static bfd_reloc_status_type
elfNN_ia64_reloc (abfd, reloc, sym, data, input_section,
output_bfd, error_message)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *reloc;
- asymbol *sym;
- PTR data;
+ asymbol *sym ATTRIBUTE_UNUSED;
+ PTR data ATTRIBUTE_UNUSED;
asection *input_section;
bfd *output_bfd;
char **error_message;
static reloc_howto_type*
elfNN_ia64_reloc_type_lookup (abfd, bfd_code)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
bfd_reloc_code_real_type bfd_code;
{
unsigned int rtype;
static void
elfNN_ia64_info_to_howto (abfd, bfd_reloc, elf_reloc)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc;
ElfNN_Internal_Rela *elf_reloc;
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *internal_relocs;
- Elf_Internal_Rela *free_relocs;
+ Elf_Internal_Rela *free_relocs = NULL;
Elf_Internal_Rela *irel, *irelend;
bfd_byte *contents;
- bfd_byte *free_contents;
+ bfd_byte *free_contents = NULL;
ElfNN_External_Sym *extsyms;
- ElfNN_External_Sym *free_extsyms;
+ ElfNN_External_Sym *free_extsyms = NULL;
struct elfNN_ia64_link_hash_table *ia64_info;
struct one_fixup *fixups = NULL;
boolean changed_contents = false;
link_info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
- free_relocs = NULL;
+
if (! link_info->keep_memory)
free_relocs = internal_relocs;
}
/* Get the section contents. */
- free_contents = NULL;
if (elf_section_data (sec)->this_hdr.contents != NULL)
contents = elf_section_data (sec)->this_hdr.contents;
else
}
/* Read this BFD's symbols. */
- free_extsyms = NULL;
if (symtab_hdr->contents != NULL)
extsyms = (ElfNN_External_Sym *) symtab_hdr->contents;
else
static boolean
elfNN_ia64_fake_sections (abfd, hdr, sec)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
ElfNN_Internal_Shdr *hdr;
asection *sec;
{
bfd *abfd;
struct bfd_link_info *info;
const Elf_Internal_Sym *sym;
- const char **namep;
- flagword *flagsp;
+ const char **namep ATTRIBUTE_UNUSED;
+ flagword *flagsp ATTRIBUTE_UNUSED;
asection **secp;
bfd_vma *valp;
{
if (sym->st_shndx == SHN_COMMON
&& !info->relocateable
- && sym->st_size <= bfd_get_gp_size (abfd))
+ && sym->st_size <= (unsigned) bfd_get_gp_size (abfd))
{
/* Common symbols less than or equal to -G nn bytes are
automatically put into .sbss. */
static boolean
elfNN_ia64_is_local_label_name (abfd, name)
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
const char *name;
{
return name[0] == '.';
static boolean
elfNN_ia64_local_hash_table_init (ht, abfd, new)
struct elfNN_ia64_local_hash_table *ht;
- bfd *abfd;
+ bfd *abfd ATTRIBUTE_UNUSED;
new_hash_entry_func new;
{
memset (ht, 0, sizeof(*ht));
struct bfd_link_info *info;
{
struct elfNN_ia64_link_hash_table *ia64_info;
- struct elf_link_hash_entry *h;
asection *s;
if (! _bfd_elf_create_dynamic_sections (abfd, info))
len += 10; /* %p slop */
addr_name = alloca (len);
- sprintf (addr_name, "%p:%lx", abfd, ELFNN_R_SYM (rel->r_info));
+ sprintf (addr_name, "%p:%lx", (void *) abfd, ELFNN_R_SYM (rel->r_info));
/* Collect the canonical entry data for this address. */
loc_h = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table,
struct bfd_link_info *info;
struct elfNN_ia64_link_hash_table *ia64_info;
{
- asection *got, *srel;
+ asection *got;
bfd *dynobj;
got = ia64_info->got_sec;
static asection *
get_fptr (abfd, info, ia64_info)
bfd *abfd;
- struct bfd_link_info *info;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
struct elfNN_ia64_link_hash_table *ia64_info;
{
asection *fptr;
static asection *
get_pltoff (abfd, info, ia64_info)
bfd *abfd;
- struct bfd_link_info *info;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
struct elfNN_ia64_link_hash_table *ia64_info;
{
asection *pltoff;
struct elfNN_ia64_dyn_sym_info *dyn_i;
int need_entry;
boolean maybe_dynamic;
- int dynrel_type;
+ int dynrel_type = R_IA64_NONE;
if (r_symndx >= symtab_hdr->sh_info)
{
static boolean
elfNN_ia64_adjust_dynamic_symbol (info, h)
- struct bfd_link_info *info;
+ struct bfd_link_info *info ATTRIBUTE_UNUSED;
struct elf_link_hash_entry *h;
{
/* ??? Undefined symbols with PLT entries should be re-defined
sec->_raw_size = strlen (ELF_DYNAMIC_INTERPRETER) + 1;
}
- /* DT_INIT and DT_FINI get function descriptors not raw code addresses.
- Force their symbols to have pltoff entries so we can use those. */
- if (ia64_info->root.dynamic_sections_created)
- {
- struct elf_link_hash_entry *h;
- struct elfNN_ia64_dyn_sym_info *dyn_i;
-
- if (info->init_function
- && (h = elf_link_hash_lookup (elf_hash_table (info),
- info->init_function, false,
- false, false))
- && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_DEF_REGULAR)) != 0)
- {
- dyn_i = get_dyn_sym_info (ia64_info, h, output_bfd, NULL, true);
- dyn_i->want_pltoff = 1;
- }
-
- if (info->fini_function
- && (h = elf_link_hash_lookup (elf_hash_table (info),
- info->fini_function, false,
- false, false))
- && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_DEF_REGULAR)) != 0)
- {
- dyn_i = get_dyn_sym_info (ia64_info, h, output_bfd, NULL, true);
- dyn_i->want_pltoff = 1;
- }
- }
-
/* Allocate the GOT entries. */
if (ia64_info->got_sec)
_bfd_set_gp_value (abfd, gp_val);
}
- /* Tricky bits. DT_INIT and DT_FINI use a pltoff entry, which is
- normally initialized in finish_dynamic_sections. Except that
- we need all non-plt pltoff entries to be initialized before
- finish_dynamic_symbols. This because the array of relocations
- used for plt entries (aka DT_JMPREL) begins after all the
- non-plt pltoff relocations. If the order gets confused, we
- munge either the array or the array base. */
- if (ia64_info->root.dynamic_sections_created)
- {
- struct elf_link_hash_entry *h;
- struct elfNN_ia64_dyn_sym_info *dyn_i;
- bfd_vma addr;
-
- if (info->init_function
- && (h = elf_link_hash_lookup (elf_hash_table (info),
- info->init_function, false,
- false, false))
- && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_DEF_REGULAR)) != 0)
- {
- dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false);
- addr = (h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset
- + h->root.u.def.value);
- (void) set_pltoff_entry (abfd, info, dyn_i, addr, false);
- }
-
- if (info->fini_function
- && (h = elf_link_hash_lookup (elf_hash_table (info),
- info->fini_function, false,
- false, false))
- && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_DEF_REGULAR)) != 0)
- {
- dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false);
- addr = (h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset
- + h->root.u.def.value);
- (void) set_pltoff_entry (abfd, info, dyn_i, addr, false);
- }
- }
-
/* If we're producing a final executable, we need to sort the contents
of the .IA_64.unwind section. Force this section to be relocated
into memory rather than written immediately to the output file. */
if ((dynamic_symbol_p || info->shared)
&& (input_section->flags & SEC_ALLOC) != 0)
{
- long dynindx;
-
BFD_ASSERT (srel != NULL);
/* If we don't need dynamic symbol lookup, install two
dyn.d_un.d_val -= (ia64_info->minplt_entries
* sizeof (ElfNN_External_Rela));
break;
-
- case DT_INIT:
- case DT_FINI:
- {
- struct elf_link_hash_entry *h;
- struct elfNN_ia64_dyn_sym_info *dyn_i;
- const char *which;
-
- if (dyn.d_tag == DT_INIT)
- which = info->init_function;
- else
- which = info->fini_function;
-
- h = elf_link_hash_lookup (elf_hash_table (info), which,
- false, false, false);
- dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false);
- dyn.d_un.d_ptr = set_pltoff_entry (abfd, info, dyn_i,
- dyn.d_un.d_ptr, 0);
- }
}
bfd_elfNN_swap_dyn_out (abfd, &dyn, dyncon);