* elf64-sparc.c: Add missing prototypes.
* elf32-cris.c: Likewise.
* elf32-i370.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-s390.c: Likewise.
+2001-08-10 Andreas Jaeger <aj@suse.de>
+
+ * elf64-sparc.c: Add missing prototypes.
+ * elf32-cris.c: Likewise.
+ * elf32-i370.c: Likewise.
+ * elf64-hppa.c: Likewise.
+ * elf64-s390.c: Likewise.
+
2001-08-10 Andreas Jaeger <aj@suse.de>
* elf64-x86-64.c (elf64_x86_64_elf_object_p): Make static.
PARAMS ((bfd *));
static boolean elf_cris_adjust_dynamic_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+static boolean cris_elf_check_relocs
+ PARAMS ((bfd *, struct bfd_link_info *, asection *,
+ const Elf_Internal_Rela *));
+
static boolean elf_cris_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
static boolean elf_cris_finish_dynamic_symbol
asection *srelgot;
BFD_ASSERT (dynobj != NULL);
-
+
srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
BFD_ASSERT (srelgot != NULL);
};
\f
static void i370_elf_howto_init PARAMS ((void));
+static reloc_howto_type *i370_elf_reloc_type_lookup
+ PARAMS ((bfd *, bfd_reloc_code_real_type));
+
static void i370_elf_info_to_howto PARAMS ((bfd *abfd, arelent *cache_ptr,
Elf32_Internal_Rela *dst));
static boolean i370_elf_set_private_flags PARAMS ((bfd *, flagword));
Elf_Internal_Rela *relocs,
Elf_Internal_Sym *local_syms,
asection **));
+static void i370_elf_post_process_headers
+ PARAMS ((bfd *, struct bfd_link_info *));
static boolean i370_elf_create_dynamic_sections PARAMS ((bfd *,
struct bfd_link_info *));
#define elf_backend_add_symbol_hook \
(boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \
const Elf_Internal_Sym *, const char **, flagword *, \
- asection **, bfd_vma *))) i370_noop
+ asection **, bfd_vma *))) i370_noop
#define elf_backend_finish_dynamic_symbol \
(boolean (*) PARAMS ((bfd *, struct bfd_link_info *, \
struct elf_link_hash_entry *, \
static boolean elf64_hppa_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
+static boolean elf64_hppa_link_output_symbol_hook
+PARAMS ((bfd *abfd, struct bfd_link_info *, const char *,
+ Elf_Internal_Sym *, asection *input_sec));
+
static boolean elf64_hppa_finish_dynamic_symbol
PARAMS ((bfd *, struct bfd_link_info *,
struct elf_link_hash_entry *, Elf_Internal_Sym *));
+static int elf64_hppa_additional_program_headers PARAMS ((bfd *));
+
+static boolean elf64_hppa_modify_segment_map PARAMS ((bfd *));
+
static boolean elf64_hppa_finish_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
#define elf_backend_object_p elf64_hppa_object_p
#define elf_backend_final_write_processing \
elf_hppa_final_write_processing
-#define elf_backend_fake_sections elf_hppa_fake_sections
+#define elf_backend_fake_sections elf_hppa_fake_sections
#define elf_backend_add_symbol_hook elf_hppa_add_symbol_hook
#define elf_backend_relocate_section elf_hppa_relocate_section
static boolean elf_s390_check_relocs
PARAMS ((bfd *, struct bfd_link_info *, asection *,
const Elf_Internal_Rela *));
+static asection *elf_s390_gc_mark_hook
+ PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
+ struct elf_link_hash_entry *, Elf_Internal_Sym *));
+static boolean elf_s390_gc_sweep_hook
+ PARAMS ((bfd *, struct bfd_link_info *, asection *,
+ const Elf_Internal_Rela *));
static boolean elf_s390_adjust_dynamic_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
static boolean elf_s390_size_dynamic_sections
Elf_Internal_Sym *));
static boolean elf_s390_finish_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
+static boolean elf_s390_object_p PARAMS ((bfd *));
#define USE_RELA 1 /* We want RELA relocations, not REL. */
static reloc_howto_type elf64_s390_vtinherit_howto =
HOWTO (R_390_GNU_VTINHERIT, 0,4,0,false,0,complain_overflow_dont, NULL, "R_390_GNU_VTINHERIT", false,0, 0, false);
static reloc_howto_type elf64_s390_vtentry_howto =
- HOWTO (R_390_GNU_VTENTRY, 0,4,0,false,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", false,0,0, false);
+ HOWTO (R_390_GNU_VTENTRY, 0,4,0,false,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", false,0,0, false);
static reloc_howto_type *
elf_s390_reloc_type_lookup (abfd, code)
case BFD_RELOC_390_GOTENT:
return &elf_howto_table[(int) R_390_GOTENT];
default:
- break;
+ break;
}
return 0;
}
default:
BFD_ASSERT (ELF64_R_TYPE(dst->r_info) < (unsigned int) R_390_max);
cache_ptr->howto = &elf_howto_table[ELF64_R_TYPE(dst->r_info)];
- }
+ }
}
static boolean
/* The size in bytes of the first entry in the procedure linkage table. */
#define PLT_FIRST_ENTRY_SIZE 32
/* The size in bytes of an entry in the procedure linkage table. */
-#define PLT_ENTRY_SIZE 32
+#define PLT_ENTRY_SIZE 32
#define GOT_ENTRY_SIZE 8
are needed to load an address in a register and execute
a branch( or just saving the address)
- Furthermore, only r 0 and 1 are free to use!!! */
+ Furthermore, only r 0 and 1 are free to use!!! */
/* The first 3 words in the GOT are then reserved.
Word 0 is the address of the dynamic table.
The GOT holds the address in the PLT to be executed.
The loader then gets:
24(15) = Pointer to the structure describing the object.
- 28(15) = Offset in symbol table
+ 28(15) = Offset in symbol table
The loader must then find the module where the function is
and insert the address in the GOT.
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
/* Some relocs require a global offset table. */
if (dynobj == NULL)
if (! bfd_elf64_link_record_dynamic_symbol (info, h))
return false;
}
-
+
sgot->_raw_size += 8;
srelgot->_raw_size += sizeof (Elf64_External_Rela);
}
}
else
{
- /* This is a global offset table entry for a local symbol. */
+ /* This is a global offset table entry for a local symbol. */
if (local_got_refcounts == NULL)
{
size_t size;
if (info->shared
&& (sec->flags & SEC_ALLOC) != 0
&& (ELF64_R_TYPE (rel->r_info) == R_390_8
- || ELF64_R_TYPE (rel->r_info) == R_390_16
+ || ELF64_R_TYPE (rel->r_info) == R_390_16
|| ELF64_R_TYPE (rel->r_info) == R_390_32
|| ELF64_R_TYPE (rel->r_info) == R_390_64
|| (h != NULL
if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return false;
break;
-
+
default:
break;
}
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset,
- (!info->shared || info->no_undefined
+ input_section, rel->r_offset,
+ (!info->shared || info->no_undefined
|| ELF_ST_VISIBILITY (h->other)))))
return false;
relocation = 0;
relocation += sgot->output_section->vma;
break;
-
+
case R_390_GOTOFF:
/* Relocation is relative to the start of the global offset
table. */
}
else if (r_type == R_390_PC16 ||
r_type == R_390_PC16DBL ||
- r_type == R_390_PC32 ||
+ r_type == R_390_PC32 ||
r_type == R_390_PC32DBL ||
r_type == R_390_PC64)
{
srela = bfd_get_section_by_name (dynobj, ".rela.plt");
BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL);
- /* Calc. index no.
+ /* Calc. index no.
Current offset - size first entry / entry size. */
plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE;
splt->contents + 8);
}
- elf_section_data (splt->output_section)->this_hdr.sh_entsize =
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize =
PLT_ENTRY_SIZE;
}
#define MINUS_ONE (~ (bfd_vma) 0)
static struct bfd_link_hash_table * sparc64_elf_bfd_link_hash_table_create
- PARAMS((bfd *));
+ PARAMS ((bfd *));
+static bfd_reloc_status_type init_insn_reloc
+ PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *,
+ bfd *, bfd_vma *, bfd_vma *));
static reloc_howto_type *sparc64_elf_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type));
static void sparc64_elf_info_to_howto
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void sparc64_elf_build_plt
- PARAMS((bfd *, unsigned char *, int));
+ PARAMS ((bfd *, unsigned char *, int));
static bfd_vma sparc64_elf_plt_entry_offset
- PARAMS((int));
+ PARAMS ((int));
static bfd_vma sparc64_elf_plt_ptr_offset
- PARAMS((int, int));
+ PARAMS ((int, int));
static boolean sparc64_elf_check_relocs
- PARAMS((bfd *, struct bfd_link_info *, asection *sec,
- const Elf_Internal_Rela *));
+ PARAMS ((bfd *, struct bfd_link_info *, asection *sec,
+ const Elf_Internal_Rela *));
static boolean sparc64_elf_adjust_dynamic_symbol
- PARAMS((struct bfd_link_info *, struct elf_link_hash_entry *));
+ PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
static boolean sparc64_elf_size_dynamic_sections
- PARAMS((bfd *, struct bfd_link_info *));
+ PARAMS ((bfd *, struct bfd_link_info *));
static int sparc64_elf_get_symbol_type
PARAMS (( Elf_Internal_Sym *, int));
static boolean sparc64_elf_add_symbol_hook
PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
- const char **, flagword *, asection **, bfd_vma *));
+ const char **, flagword *, asection **, bfd_vma *));
static void sparc64_elf_symbol_processing
PARAMS ((bfd *, asymbol *));
static boolean sparc64_elf_merge_private_bfd_data
PARAMS ((bfd *, bfd *));
+static const char *sparc64_elf_print_symbol_all
+ PARAMS ((bfd *, PTR, asymbol *));
static boolean sparc64_elf_relax_section
PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
static boolean sparc64_elf_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
+static boolean sparc64_elf_finish_dynamic_symbol
+ PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
+ Elf_Internal_Sym *));
+static boolean sparc64_elf_finish_dynamic_sections
+ PARAMS ((bfd *, struct bfd_link_info *));
static boolean sparc64_elf_object_p PARAMS ((bfd *));
static long sparc64_elf_get_reloc_upper_bound PARAMS ((bfd *, asection *));
static long sparc64_elf_get_dynamic_reloc_upper_bound PARAMS ((bfd *));
fprintf (file, "REG_%c%c%11s%c%c R", "GOLI" [reg / 8], '0' + (reg & 7), "",
((type & BSF_LOCAL)
? (type & BSF_GLOBAL) ? '!' : 'l'
- : (type & BSF_GLOBAL) ? 'g' : ' '),
- (type & BSF_WEAK) ? 'w' : ' ');
+ : (type & BSF_GLOBAL) ? 'g' : ' '),
+ (type & BSF_WEAK) ? 'w' : ' ');
if (symbol->name == NULL || symbol->name [0] == '\0')
return "#scratch";
else