include/elf/ChangeLog

* internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr,
	elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr,
	Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr,
	elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr,
	Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym,
	Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note,
	elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel,
	elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela,
	elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela,
	elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn,
	Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef,
	elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed,
	elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux,
	elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef,
	Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux,
	Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux,
	Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym,
	Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete.
	(Elf_Internal_Rel): Delete.

bfd/ChangeLog
	* elf-bfd.h: Replace occurrences of Elf32_Internal_* and
	Elf64_Internal_* with Elf_Internal_*.  Replace Elf_Internal_Rel
	with Elf_Internal_Rela.
	* elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h,
	elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c,
	elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c,
	elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
	elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
	elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
	elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c,
	elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
	elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
	elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c,
	elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto.
	* elf-hppa.h (elf_hppa_internal_shdr): Delete.  Use Elf_Internal_Shdr
	throughout instead.
	* elf.c (_bfd_elf_no_info_to_howto_rel): Delete.
	* elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *.
	Remove INLINE keyword.
	(elf_swap_reloc_in): Likewise.  Also clear r_addend.
	(elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand
	as a bfd_byte *.
	(elf_write_relocs): Consolidate REL and RELA code.
	(elf_slurp_reloc_table_from_section): Simplify REL code.
	(NAME(_bfd_elf,size_info)): Populate reloc swap entries.
	* elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define.
	* elflink.h (elf_link_read_relocs_from_section): Consolidate REL and
	RELA code.
	(elf_link_adjust_relocs): Likewise.  Don't malloc space for temp
	reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL.
	(elf_link_output_relocs): Likewise.
	(elf_reloc_link_order): Likewise.
	(elf_finish_pointer_linker_section): Likewise.
	(struct elf_link_sort_rela): Remove union.
	(elf_link_sort_cmp1): Update to suit.
	(elf_link_sort_cmp2): Here too.
	(elf_link_sort_relocs): Consolidate REL and RELA code.  Fix memory
	over-allocation for int_rels_per_ext_rel != 1 case.
	* elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls.
	* elf32-i386.c: Likewise.
	* elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out.
	* elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c,
	elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise.
	* elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out.
	* elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
	elf64-sparc.c, elf64-x86-64.c: Likewise.
	* elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out.
	* elfxx-mips.c (sort_dynamic_relocs): Likewise for
	bfd_elf32_swap_reloc_in.

	* elf32-arm.h: Update elf32_arm_info_to_howto calls.
	* elf32-mips.c: Likewise for mips_info_to_howto_rel.
	(mips_elf64_swap_reloc_in): Zero r_addend.
	(mips_elf64_be_swap_reloc_in): Likewise.
	(mips_elf64_slurp_one_reloc_table): Simplify.

	* elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries.
	* elf64-hppa.c (hppa64_elf_size_info): Likewise.
	* elf64-sparc.c (sparc64_elf_size_info): Likewise.
This commit is contained in:
Alan Modra 2002-11-28 11:55:43 +00:00
parent 1448fa3227
commit 947216bf8f
56 changed files with 1102 additions and 1383 deletions

View File

@ -1,3 +1,65 @@
2002-11-28 Alan Modra <amodra@bigpond.net.au>
* elf-bfd.h: Replace occurrences of Elf32_Internal_* and
Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel
with Elf_Internal_Rela.
* elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h,
elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c,
elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c,
elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c,
elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c,
elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c,
elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c,
elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c,
elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c,
elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto.
* elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr
throughout instead.
* elf.c (_bfd_elf_no_info_to_howto_rel): Delete.
* elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *.
Remove INLINE keyword.
(elf_swap_reloc_in): Likewise. Also clear r_addend.
(elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand
as a bfd_byte *.
(elf_write_relocs): Consolidate REL and RELA code.
(elf_slurp_reloc_table_from_section): Simplify REL code.
(NAME(_bfd_elf,size_info)): Populate reloc swap entries.
* elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define.
* elflink.h (elf_link_read_relocs_from_section): Consolidate REL and
RELA code.
(elf_link_adjust_relocs): Likewise. Don't malloc space for temp
reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL.
(elf_link_output_relocs): Likewise.
(elf_reloc_link_order): Likewise.
(elf_finish_pointer_linker_section): Likewise.
(struct elf_link_sort_rela): Remove union.
(elf_link_sort_cmp1): Update to suit.
(elf_link_sort_cmp2): Here too.
(elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory
over-allocation for int_rels_per_ext_rel != 1 case.
* elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls.
* elf32-i386.c: Likewise.
* elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out.
* elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c,
elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise.
* elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out.
* elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c,
elf64-sparc.c, elf64-x86-64.c: Likewise.
* elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out.
* elfxx-mips.c (sort_dynamic_relocs): Likewise for
bfd_elf32_swap_reloc_in.
* elf32-arm.h: Update elf32_arm_info_to_howto calls.
* elf32-mips.c: Likewise for mips_info_to_howto_rel.
(mips_elf64_swap_reloc_in): Zero r_addend.
(mips_elf64_be_swap_reloc_in): Likewise.
(mips_elf64_slurp_one_reloc_table): Simplify.
* elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries.
* elf64-hppa.c (hppa64_elf_size_info): Likewise.
* elf64-sparc.c (sparc64_elf_size_info): Likewise.
2002-11-28 Kaz Kojima <kkojima@rr.iij4u.or.jp> 2002-11-28 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* elf32-sh.c (sh_elf_relocate_section): Don't complain about * elf32-sh.c (sh_elf_relocate_section): Don't complain about

View File

@ -424,6 +424,9 @@ struct elf_size_info {
/* The number of internal relocations to allocate per external /* The number of internal relocations to allocate per external
relocation entry. */ relocation entry. */
unsigned char int_rels_per_ext_rel; unsigned char int_rels_per_ext_rel;
/* We use some fixed size arrays. This should be large enough to
handle all back-ends. */
#define MAX_INT_RELS_PER_EXT_REL 3
unsigned char arch_size, file_align; unsigned char arch_size, file_align;
unsigned char elfclass, ev_current; unsigned char elfclass, ev_current;
@ -446,30 +449,25 @@ struct elf_size_info {
void (*swap_dyn_out) void (*swap_dyn_out)
PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR));
/* This function, if defined, is called to swap in a REL /* This function is called to swap in a REL relocation. If an
relocation. If an external relocation corresponds to more than external relocation corresponds to more than one internal
one internal relocation, then all relocations are swapped in at relocation, then all relocations are swapped in at once. */
once. */
void (*swap_reloc_in) void (*swap_reloc_in)
PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rel *)); PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
/* This function, if defined, is called to swap out a REL /* This function is called to swap out a REL relocation. */
relocation. */
void (*swap_reloc_out) void (*swap_reloc_out)
PARAMS ((bfd *, const Elf_Internal_Rel *, bfd_byte *)); PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
/* This function, if defined, is called to swap in a RELA /* This function is called to swap in a RELA relocation. If an
relocation. If an external relocation corresponds to more than external relocation corresponds to more than one internal
one internal relocation, then all relocations are swapped in at relocation, then all relocations are swapped in at once. */
once. */
void (*swap_reloca_in) void (*swap_reloca_in)
PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
/* This function, if defined, is called to swap out a RELA /* This function is called to swap out a RELA relocation. */
relocation. */
void (*swap_reloca_out) void (*swap_reloca_out)
PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
}; };
#define elf_symbol_from(ABFD,S) \ #define elf_symbol_from(ABFD,S) \
@ -523,7 +521,7 @@ struct elf_backend_data
/* A function to translate an ELF REL relocation to a BFD arelent /* A function to translate an ELF REL relocation to a BFD arelent
structure. */ structure. */
void (*elf_info_to_howto_rel) void (*elf_info_to_howto_rel)
PARAMS ((bfd *, arelent *, Elf_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
/* A function to determine whether a symbol is global when /* A function to determine whether a symbol is global when
partitioning the symbol table into local and global symbols. partitioning the symbol table into local and global symbols.
@ -566,28 +564,28 @@ struct elf_backend_data
type fields for some sections, or to actually write out data for type fields for some sections, or to actually write out data for
unusual sections. */ unusual sections. */
boolean (*elf_backend_section_processing) boolean (*elf_backend_section_processing)
PARAMS ((bfd *, Elf32_Internal_Shdr *)); PARAMS ((bfd *, Elf_Internal_Shdr *));
/* A function to handle unusual section types when creating BFD /* A function to handle unusual section types when creating BFD
sections from ELF sections. */ sections from ELF sections. */
boolean (*elf_backend_section_from_shdr) boolean (*elf_backend_section_from_shdr)
PARAMS ((bfd *, Elf32_Internal_Shdr *, const char *)); PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
/* A function to convert machine dependent section header flags to /* A function to convert machine dependent section header flags to
BFD internal section header flags. */ BFD internal section header flags. */
boolean (*elf_backend_section_flags) boolean (*elf_backend_section_flags)
PARAMS ((flagword *, Elf32_Internal_Shdr *)); PARAMS ((flagword *, Elf_Internal_Shdr *));
/* A function to handle unusual program segment types when creating BFD /* A function to handle unusual program segment types when creating BFD
sections from ELF program segments. */ sections from ELF program segments. */
boolean (*elf_backend_section_from_phdr) boolean (*elf_backend_section_from_phdr)
PARAMS ((bfd *, Elf32_Internal_Phdr *, int)); PARAMS ((bfd *, Elf_Internal_Phdr *, int));
/* A function to set up the ELF section header for a BFD section in /* A function to set up the ELF section header for a BFD section in
preparation for writing it out. This is where the flags and type preparation for writing it out. This is where the flags and type
fields are set for unusual sections. */ fields are set for unusual sections. */
boolean (*elf_backend_fake_sections) boolean (*elf_backend_fake_sections)
PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
/* A function to get the ELF section index for a BFD section. If /* A function to get the ELF section index for a BFD section. If
this returns true, the section was found. If it is a normal ELF this returns true, the section was found. If it is a normal ELF
@ -1486,21 +1484,21 @@ extern elf_linker_section_pointers_t *_bfd_elf_find_pointer_linker_section
extern boolean bfd_elf32_create_pointer_linker_section extern boolean bfd_elf32_create_pointer_linker_section
PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *, PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *,
struct elf_link_hash_entry *, const Elf32_Internal_Rela *)); struct elf_link_hash_entry *, const Elf_Internal_Rela *));
extern bfd_vma bfd_elf32_finish_pointer_linker_section extern bfd_vma bfd_elf32_finish_pointer_linker_section
PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *, PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *,
struct elf_link_hash_entry *, bfd_vma, struct elf_link_hash_entry *, bfd_vma,
const Elf32_Internal_Rela *, int)); const Elf_Internal_Rela *, int));
extern boolean bfd_elf64_create_pointer_linker_section extern boolean bfd_elf64_create_pointer_linker_section
PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *, PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *,
struct elf_link_hash_entry *, const Elf64_Internal_Rela *)); struct elf_link_hash_entry *, const Elf_Internal_Rela *));
extern bfd_vma bfd_elf64_finish_pointer_linker_section extern bfd_vma bfd_elf64_finish_pointer_linker_section
PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *, PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *,
struct elf_link_hash_entry *, bfd_vma, struct elf_link_hash_entry *, bfd_vma,
const Elf64_Internal_Rela *, int)); const Elf_Internal_Rela *, int));
extern boolean _bfd_elf_make_linker_section_rela extern boolean _bfd_elf_make_linker_section_rela
PARAMS ((bfd *, elf_linker_section_t *, int)); PARAMS ((bfd *, elf_linker_section_t *, int));
@ -1526,13 +1524,13 @@ extern void bfd_elf32_swap_symbol_in
extern void bfd_elf32_swap_symbol_out extern void bfd_elf32_swap_symbol_out
PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
extern void bfd_elf32_swap_reloc_in extern void bfd_elf32_swap_reloc_in
PARAMS ((bfd *, const Elf32_External_Rel *, Elf_Internal_Rel *)); PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
extern void bfd_elf32_swap_reloc_out extern void bfd_elf32_swap_reloc_out
PARAMS ((bfd *, const Elf_Internal_Rel *, Elf32_External_Rel *)); PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
extern void bfd_elf32_swap_reloca_in extern void bfd_elf32_swap_reloca_in
PARAMS ((bfd *, const Elf32_External_Rela *, Elf_Internal_Rela *)); PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
extern void bfd_elf32_swap_reloca_out extern void bfd_elf32_swap_reloca_out
PARAMS ((bfd *, const Elf_Internal_Rela *, Elf32_External_Rela *)); PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
extern void bfd_elf32_swap_phdr_in extern void bfd_elf32_swap_phdr_in
PARAMS ((bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *)); PARAMS ((bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *));
extern void bfd_elf32_swap_phdr_out extern void bfd_elf32_swap_phdr_out
@ -1578,13 +1576,13 @@ extern void bfd_elf64_swap_symbol_in
extern void bfd_elf64_swap_symbol_out extern void bfd_elf64_swap_symbol_out
PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR));
extern void bfd_elf64_swap_reloc_in extern void bfd_elf64_swap_reloc_in
PARAMS ((bfd *, const Elf64_External_Rel *, Elf_Internal_Rel *)); PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
extern void bfd_elf64_swap_reloc_out extern void bfd_elf64_swap_reloc_out
PARAMS ((bfd *, const Elf_Internal_Rel *, Elf64_External_Rel *)); PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
extern void bfd_elf64_swap_reloca_in extern void bfd_elf64_swap_reloca_in
PARAMS ((bfd *, const Elf64_External_Rela *, Elf_Internal_Rela *)); PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
extern void bfd_elf64_swap_reloca_out extern void bfd_elf64_swap_reloca_out
PARAMS ((bfd *, const Elf_Internal_Rela *, Elf64_External_Rela *)); PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
extern void bfd_elf64_swap_phdr_in extern void bfd_elf64_swap_phdr_in
PARAMS ((bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *)); PARAMS ((bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *));
extern void bfd_elf64_swap_phdr_out extern void bfd_elf64_swap_phdr_out

View File

@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if ARCH_SIZE == 64 #if ARCH_SIZE == 64
#define ELF_R_TYPE(X) ELF64_R_TYPE(X) #define ELF_R_TYPE(X) ELF64_R_TYPE(X)
#define ELF_R_SYM(X) ELF64_R_SYM(X) #define ELF_R_SYM(X) ELF64_R_SYM(X)
#define elf_hppa_internal_shdr Elf64_Internal_Shdr
#define elf_hppa_reloc_final_type elf64_hppa_reloc_final_type #define elf_hppa_reloc_final_type elf64_hppa_reloc_final_type
#define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type #define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type
#define elf_hppa_relocate_section elf64_hppa_relocate_section #define elf_hppa_relocate_section elf64_hppa_relocate_section
@ -38,7 +37,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if ARCH_SIZE == 32 #if ARCH_SIZE == 32
#define ELF_R_TYPE(X) ELF32_R_TYPE(X) #define ELF_R_TYPE(X) ELF32_R_TYPE(X)
#define ELF_R_SYM(X) ELF32_R_SYM(X) #define ELF_R_SYM(X) ELF32_R_SYM(X)
#define elf_hppa_internal_shdr Elf32_Internal_Shdr
#define elf_hppa_reloc_final_type elf32_hppa_reloc_final_type #define elf_hppa_reloc_final_type elf32_hppa_reloc_final_type
#define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type #define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type
#define elf_hppa_relocate_section elf32_hppa_relocate_section #define elf_hppa_relocate_section elf32_hppa_relocate_section
@ -50,7 +48,7 @@ static void elf_hppa_info_to_howto
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void elf_hppa_info_to_howto_rel static void elf_hppa_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static reloc_howto_type * elf_hppa_reloc_type_lookup static reloc_howto_type * elf_hppa_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
@ -59,7 +57,7 @@ static boolean elf_hppa_is_local_label_name
PARAMS ((bfd *, const char *)); PARAMS ((bfd *, const char *));
static boolean elf_hppa_fake_sections static boolean elf_hppa_fake_sections
PARAMS ((bfd *abfd, elf_hppa_internal_shdr *, asection *)); PARAMS ((bfd *abfd, Elf_Internal_Shdr *, asection *));
static void elf_hppa_final_write_processing static void elf_hppa_final_write_processing
PARAMS ((bfd *, boolean)); PARAMS ((bfd *, boolean));
@ -937,7 +935,7 @@ static void
elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc; arelent *bfd_reloc;
Elf_Internal_Rel *elf_reloc; Elf_Internal_Rela *elf_reloc;
{ {
BFD_ASSERT (ELF_R_TYPE(elf_reloc->r_info) BFD_ASSERT (ELF_R_TYPE(elf_reloc->r_info)
< (unsigned int) R_PARISC_UNIMPLEMENTED); < (unsigned int) R_PARISC_UNIMPLEMENTED);
@ -978,7 +976,7 @@ elf_hppa_is_local_label_name (abfd, name)
static boolean static boolean
elf_hppa_fake_sections (abfd, hdr, sec) elf_hppa_fake_sections (abfd, hdr, sec)
bfd *abfd; bfd *abfd;
elf_hppa_internal_shdr *hdr; Elf_Internal_Shdr *hdr;
asection *sec; asection *sec;
{ {
register const char *name; register const char *name;

View File

@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void mn10200_info_to_howto static void mn10200_info_to_howto
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean mn10200_elf_relax_delete_bytes static boolean mn10200_elf_relax_delete_bytes
PARAMS ((bfd *, asection *, bfd_vma, int)); PARAMS ((bfd *, asection *, bfd_vma, int));
static boolean mn10200_elf_symbol_address_p static boolean mn10200_elf_symbol_address_p
@ -213,7 +213,7 @@ static void
mn10200_info_to_howto (abfd, cache_ptr, dst) mn10200_info_to_howto (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -117,7 +117,7 @@ static void elf32_mn10300_link_hash_table_free
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void mn10300_info_to_howto static void mn10300_info_to_howto
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean mn10300_elf_check_relocs static boolean mn10300_elf_check_relocs
PARAMS ((bfd *, struct bfd_link_info *, asection *, PARAMS ((bfd *, struct bfd_link_info *, asection *,
const Elf_Internal_Rela *)); const Elf_Internal_Rela *));
@ -322,7 +322,7 @@ static void
mn10300_info_to_howto (abfd, cache_ptr, dst) mn10300_info_to_howto (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -6081,17 +6081,6 @@ _bfd_elf_no_info_to_howto (abfd, cache_ptr, dst)
abort (); abort ();
} }
#if 0
void
_bfd_elf_no_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd;
arelent *cache_ptr;
Elf_Internal_Rel *dst;
{
abort ();
}
#endif
/* Try to convert a non-ELF reloc into an ELF one. */ /* Try to convert a non-ELF reloc into an ELF one. */
boolean boolean

View File

@ -29,7 +29,7 @@
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void arc_info_to_howto_rel static void arc_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean arc_elf_object_p static boolean arc_elf_object_p
PARAMS ((bfd *)); PARAMS ((bfd *));
static void arc_elf_final_write_processing static void arc_elf_final_write_processing
@ -142,7 +142,7 @@ static void
arc_info_to_howto_rel (abfd, cache_ptr, dst) arc_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -1128,7 +1128,8 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
|| (h->elf_link_hash_flags || (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0)))) & ELF_LINK_HASH_DEF_REGULAR) == 0))))
{ {
Elf_Internal_Rel outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
boolean skip, relocate; boolean skip, relocate;
if (sreloc == NULL) if (sreloc == NULL)
@ -1192,11 +1193,9 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
} }
} }
bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc = sreloc->contents;
(((Elf32_External_Rel *) loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rel);
sreloc->contents) bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
+ sreloc->reloc_count));
++sreloc->reloc_count;
/* If this reloc is against an external symbol, we do not want to /* If this reloc is against an external symbol, we do not want to
fiddle with the addend. Otherwise, we need to include the symbol fiddle with the addend. Otherwise, we need to include the symbol
@ -1657,7 +1656,8 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
if (info->shared) if (info->shared)
{ {
asection * srelgot; asection * srelgot;
Elf_Internal_Rel outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
srelgot = bfd_get_section_by_name (dynobj, ".rel.got"); srelgot = bfd_get_section_by_name (dynobj, ".rel.got");
BFD_ASSERT (srelgot != NULL); BFD_ASSERT (srelgot != NULL);
@ -1666,11 +1666,9 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
+ sgot->output_offset + sgot->output_offset
+ off); + off);
outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE); outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE);
bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc = srelgot->contents;
(((Elf32_External_Rel *) loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rel);
srelgot->contents) bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
+ srelgot->reloc_count));
++srelgot->reloc_count;
} }
local_got_offsets[r_symndx] |= 1; local_got_offsets[r_symndx] |= 1;
@ -1863,12 +1861,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
|| r_type == R_ARM_GNU_VTINHERIT) || r_type == R_ARM_GNU_VTINHERIT)
continue; continue;
#if USE_REL
elf32_arm_info_to_howto (input_bfd, & bfd_reloc,
(Elf_Internal_Rel *) rel);
#else
elf32_arm_info_to_howto (input_bfd, & bfd_reloc, rel); elf32_arm_info_to_howto (input_bfd, & bfd_reloc, rel);
#endif
howto = bfd_reloc.howto; howto = bfd_reloc.howto;
#if USE_REL #if USE_REL
@ -3321,7 +3314,8 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym)
asection * srel; asection * srel;
bfd_vma plt_index; bfd_vma plt_index;
bfd_vma got_offset; bfd_vma got_offset;
Elf_Internal_Rel rel; Elf_Internal_Rela rel;
bfd_byte *loc;
/* This symbol has an entry in the procedure linkage table. Set /* This symbol has an entry in the procedure linkage table. Set
it up. */ it up. */
@ -3371,9 +3365,8 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym)
+ sgot->output_offset + sgot->output_offset
+ got_offset); + got_offset);
rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_JUMP_SLOT); rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_JUMP_SLOT);
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc = srel->contents + plt_index * sizeof (Elf32_External_Rel);
((Elf32_External_Rel *) srel->contents bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
+ plt_index));
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{ {
@ -3394,7 +3387,8 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym)
{ {
asection * sgot; asection * sgot;
asection * srel; asection * srel;
Elf_Internal_Rel rel; Elf_Internal_Rela rel;
bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
@ -3420,16 +3414,15 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_GLOB_DAT); rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_GLOB_DAT);
} }
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc = srel->contents + srel->reloc_count++ * sizeof (Elf32_External_Rel);
((Elf32_External_Rel *) srel->contents bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
+ srel->reloc_count));
++srel->reloc_count;
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
asection * s; asection * s;
Elf_Internal_Rel rel; Elf_Internal_Rela rel;
bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */ /* This symbol needs a copy reloc. Set it up. */
BFD_ASSERT (h->dynindx != -1 BFD_ASSERT (h->dynindx != -1
@ -3444,10 +3437,8 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_section->vma + h->root.u.def.section->output_section->vma
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_COPY); rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_COPY);
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rel);
((Elf32_External_Rel *) s->contents bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
+ s->reloc_count));
++s->reloc_count;
} }
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */

View File

@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void avr_info_to_howto_rela static void avr_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static asection *elf32_avr_gc_mark_hook static asection *elf32_avr_gc_mark_hook
PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *, Elf_Internal_Sym *)); struct elf_link_hash_entry *, Elf_Internal_Sym *));
@ -386,7 +386,7 @@ static void
avr_info_to_howto_rela (abfd, cache_ptr, dst) avr_info_to_howto_rela (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -31,7 +31,7 @@ static reloc_howto_type * cris_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void cris_info_to_howto_rela static void cris_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean cris_elf_grok_prstatus static boolean cris_elf_grok_prstatus
PARAMS ((bfd *abfd, Elf_Internal_Note *note)); PARAMS ((bfd *abfd, Elf_Internal_Note *note));
@ -458,7 +458,7 @@ static void
cris_info_to_howto_rela (abfd, cache_ptr, dst) cris_info_to_howto_rela (abfd, cache_ptr, dst)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
arelent * cache_ptr; arelent * cache_ptr;
Elf32_Internal_Rela * dst; Elf_Internal_Rela * dst;
{ {
unsigned int r_type; unsigned int r_type;
@ -1079,22 +1079,21 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared) if (info->shared)
{ {
asection *srelgot; asection *s;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); s = bfd_get_section_by_name (dynobj, ".rela.got");
BFD_ASSERT (srelgot != NULL); BFD_ASSERT (s != NULL);
outrel.r_offset = (sgot->output_section->vma outrel.r_offset = (sgot->output_section->vma
+ sgot->output_offset + sgot->output_offset
+ off); + off);
outrel.r_info = ELF32_R_INFO (0, R_CRIS_RELATIVE); outrel.r_info = ELF32_R_INFO (0, R_CRIS_RELATIVE);
outrel.r_addend = relocation; outrel.r_addend = relocation;
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc = s->contents;
(((Elf32_External_Rela *) loc += s->reloc_count++ * sizeof (Elf32_External_Rela);
srelgot->contents) bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ srelgot->reloc_count));
++srelgot->reloc_count;
} }
local_got_offsets[r_symndx] |= 1; local_got_offsets[r_symndx] |= 1;
@ -1237,6 +1236,7 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
& ELF_LINK_HASH_DEF_REGULAR) == 0))) & ELF_LINK_HASH_DEF_REGULAR) == 0)))
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
boolean skip, relocate; boolean skip, relocate;
/* When generating a shared object, these relocations /* When generating a shared object, these relocations
@ -1345,11 +1345,9 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
} }
} }
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc = sreloc->contents;
(((Elf32_External_Rela *) loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
sreloc->contents) bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ sreloc->reloc_count));
++sreloc->reloc_count;
/* This reloc will be computed at runtime, so there's no /* This reloc will be computed at runtime, so there's no
need to do anything now, except for R_CRIS_32 relocations need to do anything now, except for R_CRIS_32 relocations
@ -1437,6 +1435,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_vma gotplt_offset bfd_vma gotplt_offset
= ((struct elf_cris_link_hash_entry *) h)->gotplt_offset; = ((struct elf_cris_link_hash_entry *) h)->gotplt_offset;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
boolean has_gotplt = gotplt_offset != 0; boolean has_gotplt = gotplt_offset != 0;
/* Get the index in the procedure linkage table which /* Get the index in the procedure linkage table which
@ -1517,9 +1516,8 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
+ got_offset); + got_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_CRIS_JUMP_SLOT); rela.r_info = ELF32_R_INFO (h->dynindx, R_CRIS_JUMP_SLOT);
rela.r_addend = 0; rela.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = srela->contents + gotplt_index * sizeof (Elf32_External_Rela);
((Elf32_External_Rela *) srela->contents bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ gotplt_index));
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
@ -1554,6 +1552,7 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
asection *sgot; asection *sgot;
asection *srela; asection *srela;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
bfd_byte *where; bfd_byte *where;
/* This symbol has an entry in the global offset table. Set it up. */ /* This symbol has an entry in the global offset table. Set it up. */
@ -1587,16 +1586,16 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
rela.r_addend = 0; rela.r_addend = 0;
} }
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = srela->contents;
((Elf32_External_Rela *) srela->contents loc += srela->reloc_count++ * sizeof (Elf32_External_Rela);
+ srela->reloc_count)); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
++srela->reloc_count;
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
asection *s; asection *s;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */ /* This symbol needs a copy reloc. Set it up. */
@ -1613,10 +1612,8 @@ elf_cris_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_CRIS_COPY); rela.r_info = ELF32_R_INFO (h->dynindx, R_CRIS_COPY);
rela.r_addend = 0; rela.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela);
((Elf32_External_Rela *) s->contents bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ s->reloc_count));
++s->reloc_count;
} }
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */

View File

@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void d10v_info_to_howto_rel static void d10v_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static asection * elf32_d10v_gc_mark_hook static asection * elf32_d10v_gc_mark_hook
PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *, Elf_Internal_Sym *)); struct elf_link_hash_entry *, Elf_Internal_Sym *));
@ -230,7 +230,7 @@ static void
d10v_info_to_howto_rel (abfd, cache_ptr, dst) d10v_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -28,9 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void d30v_info_to_howto_rel static void d30v_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void d30v_info_to_howto_rela static void d30v_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static bfd_reloc_status_type bfd_elf_d30v_reloc PARAMS (( static bfd_reloc_status_type bfd_elf_d30v_reloc PARAMS ((
bfd *abfd, bfd *abfd,
arelent *reloc_entry, arelent *reloc_entry,
@ -522,7 +522,7 @@ static void
d30v_info_to_howto_rel (abfd, cache_ptr, dst) d30v_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;
@ -537,7 +537,7 @@ static void
d30v_info_to_howto_rela (abfd, cache_ptr, dst) d30v_info_to_howto_rela (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -28,9 +28,9 @@ int set_dlx_skip_hi16_flag PARAMS ((int));
static boolean elf32_dlx_check_relocs static boolean elf32_dlx_check_relocs
PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *));
static void elf32_dlx_info_to_howto static void elf32_dlx_info_to_howto
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void elf32_dlx_info_to_howto_rel static void elf32_dlx_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static bfd_reloc_status_type elf32_dlx_relocate16 static bfd_reloc_status_type elf32_dlx_relocate16
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_reloc_status_type elf32_dlx_relocate26 static bfd_reloc_status_type elf32_dlx_relocate26
@ -632,7 +632,7 @@ static void
elf32_dlx_info_to_howto (abfd, cache_ptr, dst) elf32_dlx_info_to_howto (abfd, cache_ptr, dst)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
arelent * cache_ptr ATTRIBUTE_UNUSED; arelent * cache_ptr ATTRIBUTE_UNUSED;
Elf32_Internal_Rela * dst ATTRIBUTE_UNUSED; Elf_Internal_Rela * dst ATTRIBUTE_UNUSED;
{ {
abort (); abort ();
} }
@ -641,7 +641,7 @@ static void
elf32_dlx_info_to_howto_rel (abfd, cache_ptr, dst) elf32_dlx_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -31,7 +31,7 @@ static bfd_reloc_status_type fr30_elf_i32_reloc
static reloc_howto_type * fr30_reloc_type_lookup static reloc_howto_type * fr30_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void fr30_info_to_howto_rela static void fr30_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean fr30_elf_relocate_section static boolean fr30_elf_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
@ -377,7 +377,7 @@ static void
fr30_info_to_howto_rela (abfd, cache_ptr, dst) fr30_info_to_howto_rela (abfd, cache_ptr, dst)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
arelent * cache_ptr; arelent * cache_ptr;
Elf32_Internal_Rela * dst; Elf_Internal_Rela * dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -41,7 +41,7 @@ static bfd_reloc_status_type elf32_frv_relocate_gprelhi
static reloc_howto_type *frv_reloc_type_lookup static reloc_howto_type *frv_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static void frv_info_to_howto_rela static void frv_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean elf32_frv_relocate_section static boolean elf32_frv_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
static boolean elf32_frv_add_symbol_hook static boolean elf32_frv_add_symbol_hook
@ -581,7 +581,7 @@ static void
frv_info_to_howto_rela (abfd, cache_ptr, dst) frv_info_to_howto_rela (abfd, cache_ptr, dst)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
arelent * cache_ptr; arelent * cache_ptr;
Elf32_Internal_Rela * dst; Elf_Internal_Rela * dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -41,9 +41,9 @@ static reloc_howto_type dummy =
false); /* pcrel_offset */ false); /* pcrel_offset */
static void elf_generic_info_to_howto static void elf_generic_info_to_howto
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void elf_generic_info_to_howto_rel static void elf_generic_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean elf32_generic_link_add_symbols static boolean elf32_generic_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
@ -51,7 +51,7 @@ static void
elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc) elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc; arelent *bfd_reloc;
Elf32_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED; Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
{ {
bfd_reloc->howto = &dummy; bfd_reloc->howto = &dummy;
} }
@ -60,7 +60,7 @@ static void
elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc; arelent *bfd_reloc;
Elf32_Internal_Rel *elf_reloc ATTRIBUTE_UNUSED; Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
{ {
bfd_reloc->howto = &dummy; bfd_reloc->howto = &dummy;
} }

View File

@ -29,7 +29,7 @@ static reloc_howto_type *elf32_h8_reloc_type_lookup
static void elf32_h8_info_to_howto static void elf32_h8_info_to_howto
PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void elf32_h8_info_to_howto_rel static void elf32_h8_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static unsigned long elf32_h8_mach static unsigned long elf32_h8_mach
PARAMS ((flagword)); PARAMS ((flagword));
static void elf32_h8_final_write_processing static void elf32_h8_final_write_processing
@ -261,7 +261,7 @@ static void
elf32_h8_info_to_howto (abfd, bfd_reloc, elf_reloc) elf32_h8_info_to_howto (abfd, bfd_reloc, elf_reloc)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc; arelent *bfd_reloc;
Elf32_Internal_Rela *elf_reloc; Elf_Internal_Rela *elf_reloc;
{ {
unsigned int r; unsigned int r;
unsigned int i; unsigned int i;
@ -280,7 +280,7 @@ static void
elf32_h8_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) elf32_h8_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc; arelent *bfd_reloc;
Elf32_Internal_Rel *elf_reloc ATTRIBUTE_UNUSED; Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
{ {
unsigned int r; unsigned int r;

View File

@ -3774,16 +3774,16 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
In this case it is relative to the base of the In this case it is relative to the base of the
object because the symbol index is zero. */ object because the symbol index is zero. */
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
asection *srelgot = htab->srelgot; bfd_byte *loc;
Elf32_External_Rela *loc; asection *s = htab->srelgot;
outrel.r_offset = (off outrel.r_offset = (off
+ htab->sgot->output_offset + htab->sgot->output_offset
+ htab->sgot->output_section->vma); + htab->sgot->output_section->vma);
outrel.r_info = ELF32_R_INFO (0, R_PARISC_DIR32); outrel.r_info = ELF32_R_INFO (0, R_PARISC_DIR32);
outrel.r_addend = relocation; outrel.r_addend = relocation;
loc = (Elf32_External_Rela *) srelgot->contents; loc = s->contents;
loc += srelgot->reloc_count++; loc += s->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
} }
else else
@ -3864,16 +3864,16 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
/* Output a dynamic IPLT relocation for this /* Output a dynamic IPLT relocation for this
PLT entry. */ PLT entry. */
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
asection *srelplt = htab->srelplt; bfd_byte *loc;
Elf32_External_Rela *loc; asection *s = htab->srelplt;
outrel.r_offset = (off outrel.r_offset = (off
+ htab->splt->output_offset + htab->splt->output_offset
+ htab->splt->output_section->vma); + htab->splt->output_section->vma);
outrel.r_info = ELF32_R_INFO (0, R_PARISC_IPLT); outrel.r_info = ELF32_R_INFO (0, R_PARISC_IPLT);
outrel.r_addend = relocation; outrel.r_addend = relocation;
loc = (Elf32_External_Rela *) srelplt->contents; loc = s->contents;
loc += srelplt->reloc_count++; loc += s->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
} }
else else
@ -3958,7 +3958,7 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
boolean skip; boolean skip;
asection *sreloc; asection *sreloc;
Elf32_External_Rela *loc; bfd_byte *loc;
/* When generating a shared object, these relocations /* When generating a shared object, these relocations
are copied into the output file to be resolved at run are copied into the output file to be resolved at run
@ -4027,8 +4027,8 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
if (sreloc == NULL) if (sreloc == NULL)
abort (); abort ();
loc = (Elf32_External_Rela *) sreloc->contents; loc = sreloc->contents;
loc += sreloc->reloc_count++; loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
} }
break; break;
@ -4126,7 +4126,7 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
if (! ((struct elf32_hppa_link_hash_entry *) h)->pic_call) if (! ((struct elf32_hppa_link_hash_entry *) h)->pic_call)
{ {
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
Elf32_External_Rela *loc; bfd_byte *loc;
/* Create a dynamic IPLT relocation for this entry. */ /* Create a dynamic IPLT relocation for this entry. */
rel.r_offset = (h->plt.offset rel.r_offset = (h->plt.offset
@ -4145,8 +4145,8 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_addend = value; rel.r_addend = value;
} }
loc = (Elf32_External_Rela *) htab->srelplt->contents; loc = htab->srelplt->contents;
loc += htab->srelplt->reloc_count++; loc += htab->srelplt->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (htab->splt->output_section->owner, bfd_elf32_swap_reloca_out (htab->splt->output_section->owner,
&rel, loc); &rel, loc);
} }
@ -4171,7 +4171,7 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
if (h->got.offset != (bfd_vma) -1) if (h->got.offset != (bfd_vma) -1)
{ {
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
Elf32_External_Rela *loc; bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
@ -4204,8 +4204,8 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_addend = 0; rel.r_addend = 0;
} }
loc = (Elf32_External_Rela *) htab->srelgot->contents; loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++; loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
} }
@ -4213,7 +4213,7 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
{ {
asection *s; asection *s;
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
Elf32_External_Rela *loc; bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */ /* This symbol needs a copy reloc. Set it up. */
@ -4229,7 +4229,7 @@ elf32_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_section->vma); + h->root.u.def.section->output_section->vma);
rel.r_addend = 0; rel.r_addend = 0;
rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_COPY); rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_COPY);
loc = (Elf32_External_Rela *) s->contents + s->reloc_count++; loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &rel, loc); bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
} }

View File

@ -231,7 +231,7 @@ static reloc_howto_type *i370_elf_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static void i370_elf_info_to_howto PARAMS ((bfd *abfd, arelent *cache_ptr, static void i370_elf_info_to_howto PARAMS ((bfd *abfd, arelent *cache_ptr,
Elf32_Internal_Rela *dst)); Elf_Internal_Rela *dst));
static boolean i370_elf_set_private_flags PARAMS ((bfd *, flagword)); static boolean i370_elf_set_private_flags PARAMS ((bfd *, flagword));
/* Initialize the i370_elf_howto_table, so that linear accesses can be done. */ /* Initialize the i370_elf_howto_table, so that linear accesses can be done. */
@ -292,10 +292,10 @@ static boolean i370_elf_create_dynamic_sections PARAMS ((bfd *,
struct bfd_link_info *)); struct bfd_link_info *));
static boolean i370_elf_section_from_shdr PARAMS ((bfd *, static boolean i370_elf_section_from_shdr PARAMS ((bfd *,
Elf32_Internal_Shdr *, Elf_Internal_Shdr *,
const char *)); const char *));
static boolean i370_elf_fake_sections PARAMS ((bfd *, static boolean i370_elf_fake_sections PARAMS ((bfd *,
Elf32_Internal_Shdr *, Elf_Internal_Shdr *,
asection *)); asection *));
#if 0 #if 0
static elf_linker_section_t *i370_elf_create_linker_section static elf_linker_section_t *i370_elf_create_linker_section
@ -328,7 +328,7 @@ static void
i370_elf_info_to_howto (abfd, cache_ptr, dst) i370_elf_info_to_howto (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
if (!i370_elf_howto_table[ R_I370_ADDR31 ]) /* Initialize howto table */ if (!i370_elf_howto_table[ R_I370_ADDR31 ]) /* Initialize howto table */
i370_elf_howto_init (); i370_elf_howto_init ();
@ -402,7 +402,7 @@ i370_elf_merge_private_bfd_data (ibfd, obfd)
static boolean static boolean
i370_elf_section_from_shdr (abfd, hdr, name) i370_elf_section_from_shdr (abfd, hdr, name)
bfd *abfd; bfd *abfd;
Elf32_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;
const char *name; const char *name;
{ {
asection *newsect; asection *newsect;
@ -432,7 +432,7 @@ i370_elf_section_from_shdr (abfd, hdr, name)
static boolean static boolean
i370_elf_fake_sections (abfd, shdr, asect) i370_elf_fake_sections (abfd, shdr, asect)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
Elf32_Internal_Shdr *shdr; Elf_Internal_Shdr *shdr;
asection *asect; asection *asect;
{ {
if ((asect->flags & SEC_EXCLUDE) != 0) if ((asect->flags & SEC_EXCLUDE) != 0)
@ -1388,6 +1388,7 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
&& r_symndx != 0) && r_symndx != 0)
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
int skip; int skip;
#ifdef DEBUG #ifdef DEBUG
@ -1493,11 +1494,9 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
} }
} }
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc = sreloc->contents;
(((Elf32_External_Rela *) loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
sreloc->contents) bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ sreloc->reloc_count));
++sreloc->reloc_count;
/* This reloc will be computed at runtime, so there's no /* This reloc will be computed at runtime, so there's no
need to do anything now, unless this is a RELATIVE need to do anything now, unless this is a RELATIVE

View File

@ -27,9 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type *elf_i386_reloc_type_lookup static reloc_howto_type *elf_i386_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static void elf_i386_info_to_howto static void elf_i386_info_to_howto
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void elf_i386_info_to_howto_rel static void elf_i386_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean elf_i386_is_local_label_name static boolean elf_i386_is_local_label_name
PARAMS ((bfd *, const char *)); PARAMS ((bfd *, const char *));
static boolean elf_i386_grok_prstatus static boolean elf_i386_grok_prstatus
@ -70,7 +70,7 @@ static boolean allocate_dynrelocs
static boolean readonly_dynrelocs static boolean readonly_dynrelocs
PARAMS ((struct elf_link_hash_entry *, PTR)); PARAMS ((struct elf_link_hash_entry *, PTR));
static boolean elf_i386_fake_sections static boolean elf_i386_fake_sections
PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
static boolean elf_i386_size_dynamic_sections static boolean elf_i386_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
static bfd_vma dtpoff_base static bfd_vma dtpoff_base
@ -374,9 +374,9 @@ elf_i386_reloc_type_lookup (abfd, code)
static void static void
elf_i386_info_to_howto (abfd, cache_ptr, dst) elf_i386_info_to_howto (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr ATTRIBUTE_UNUSED; arelent *cache_ptr ATTRIBUTE_UNUSED;
Elf32_Internal_Rela *dst ATTRIBUTE_UNUSED; Elf_Internal_Rela *dst ATTRIBUTE_UNUSED;
{ {
abort (); abort ();
} }
@ -385,7 +385,7 @@ static void
elf_i386_info_to_howto_rel (abfd, cache_ptr, dst) elf_i386_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type = ELF32_R_TYPE (dst->r_info); unsigned int r_type = ELF32_R_TYPE (dst->r_info);
unsigned int indx; unsigned int indx;
@ -1995,7 +1995,7 @@ elf_i386_size_dynamic_sections (output_bfd, info)
static boolean static boolean
elf_i386_fake_sections (abfd, hdr, sec) elf_i386_fake_sections (abfd, hdr, sec)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
Elf32_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;
asection *sec; asection *sec;
{ {
register const char *name; register const char *name;
@ -2340,20 +2340,20 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared) if (info->shared)
{ {
asection *srelgot; asection *s;
Elf_Internal_Rel outrel; Elf_Internal_Rela outrel;
Elf32_External_Rel *loc; bfd_byte *loc;
srelgot = htab->srelgot; s = htab->srelgot;
if (srelgot == NULL) if (s == NULL)
abort (); abort ();
outrel.r_offset = (htab->sgot->output_section->vma outrel.r_offset = (htab->sgot->output_section->vma
+ htab->sgot->output_offset + htab->sgot->output_offset
+ off); + off);
outrel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); outrel.r_info = ELF32_R_INFO (0, R_386_RELATIVE);
loc = (Elf32_External_Rel *) srelgot->contents; loc = s->contents;
loc += srelgot->reloc_count++; loc += s->reloc_count++ * sizeof (Elf32_External_Rel);
bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
} }
@ -2436,10 +2436,10 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
|| h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_undefweak
|| h->root.type == bfd_link_hash_undefined))) || h->root.type == bfd_link_hash_undefined)))
{ {
Elf_Internal_Rel outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
boolean skip, relocate; boolean skip, relocate;
asection *sreloc; asection *sreloc;
Elf32_External_Rel *loc;
/* When generating a shared object, these relocations /* When generating a shared object, these relocations
are copied into the output file to be resolved at run are copied into the output file to be resolved at run
@ -2479,8 +2479,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
if (sreloc == NULL) if (sreloc == NULL)
abort (); abort ();
loc = (Elf32_External_Rel *) sreloc->contents; loc = sreloc->contents;
loc += sreloc->reloc_count++; loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rel);
bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
/* If this reloc is against an external symbol, we do /* If this reloc is against an external symbol, we do
@ -2495,9 +2495,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
case R_386_TLS_IE: case R_386_TLS_IE:
if (info->shared) if (info->shared)
{ {
Elf_Internal_Rel outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
asection *sreloc; asection *sreloc;
Elf32_External_Rel *loc;
outrel.r_offset = rel->r_offset outrel.r_offset = rel->r_offset
+ input_section->output_section->vma + input_section->output_section->vma
@ -2506,8 +2506,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
sreloc = elf_section_data (input_section)->sreloc; sreloc = elf_section_data (input_section)->sreloc;
if (sreloc == NULL) if (sreloc == NULL)
abort (); abort ();
loc = (Elf32_External_Rel *) sreloc->contents; loc = sreloc->contents;
loc += sreloc->reloc_count++; loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rel);
bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
} }
/* Fall through */ /* Fall through */
@ -2726,8 +2726,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
off &= ~1; off &= ~1;
else else
{ {
Elf_Internal_Rel outrel; Elf_Internal_Rela outrel;
Elf32_External_Rel *loc; bfd_byte *loc;
int dr_type, indx; int dr_type, indx;
if (htab->srelgot == NULL) if (htab->srelgot == NULL)
@ -2753,8 +2753,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_put_32 (output_bfd, 0, bfd_put_32 (output_bfd, 0,
htab->sgot->contents + off); htab->sgot->contents + off);
outrel.r_info = ELF32_R_INFO (indx, dr_type); outrel.r_info = ELF32_R_INFO (indx, dr_type);
loc = (Elf32_External_Rel *) htab->srelgot->contents; loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++; loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rel);
bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
if (r_type == R_386_TLS_GD) if (r_type == R_386_TLS_GD)
@ -2774,9 +2774,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
R_386_TLS_DTPOFF32); R_386_TLS_DTPOFF32);
outrel.r_offset += 4; outrel.r_offset += 4;
htab->srelgot->reloc_count++; htab->srelgot->reloc_count++;
loc++; loc += sizeof (Elf32_External_Rel);
bfd_elf32_swap_reloc_out (output_bfd, &outrel, bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
loc);
} }
} }
else if (tls_type == GOT_TLS_IE_BOTH) else if (tls_type == GOT_TLS_IE_BOTH)
@ -2787,7 +2786,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_info = ELF32_R_INFO (indx, R_386_TLS_TPOFF); outrel.r_info = ELF32_R_INFO (indx, R_386_TLS_TPOFF);
outrel.r_offset += 4; outrel.r_offset += 4;
htab->srelgot->reloc_count++; htab->srelgot->reloc_count++;
loc++; loc += sizeof (Elf32_External_Rel);
bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
} }
@ -2906,8 +2905,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
off &= ~1; off &= ~1;
else else
{ {
Elf_Internal_Rel outrel; Elf_Internal_Rela outrel;
Elf32_External_Rel *loc; bfd_byte *loc;
if (htab->srelgot == NULL) if (htab->srelgot == NULL)
abort (); abort ();
@ -2920,8 +2919,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
bfd_put_32 (output_bfd, 0, bfd_put_32 (output_bfd, 0,
htab->sgot->contents + off + 4); htab->sgot->contents + off + 4);
outrel.r_info = ELF32_R_INFO (0, R_386_TLS_DTPMOD32); outrel.r_info = ELF32_R_INFO (0, R_386_TLS_DTPMOD32);
loc = (Elf32_External_Rel *) htab->srelgot->contents; loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++; loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rel);
bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
htab->tls_ldm_got.offset |= 1; htab->tls_ldm_got.offset |= 1;
} }
@ -2941,9 +2940,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
case R_386_TLS_LE: case R_386_TLS_LE:
if (info->shared) if (info->shared)
{ {
Elf_Internal_Rel outrel; Elf_Internal_Rela outrel;
asection *sreloc; asection *sreloc;
Elf32_External_Rel *loc; bfd_byte *loc;
int indx; int indx;
outrel.r_offset = rel->r_offset outrel.r_offset = rel->r_offset
@ -2960,8 +2959,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
sreloc = elf_section_data (input_section)->sreloc; sreloc = elf_section_data (input_section)->sreloc;
if (sreloc == NULL) if (sreloc == NULL)
abort (); abort ();
loc = (Elf32_External_Rel *) sreloc->contents; loc = sreloc->contents;
loc += sreloc->reloc_count++; loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rel);
bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
if (indx) if (indx)
continue; continue;
@ -3057,8 +3056,8 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym)
{ {
bfd_vma plt_index; bfd_vma plt_index;
bfd_vma got_offset; bfd_vma got_offset;
Elf_Internal_Rel rel; Elf_Internal_Rela rel;
Elf32_External_Rel *loc; bfd_byte *loc;
/* This symbol has an entry in the procedure linkage table. Set /* This symbol has an entry in the procedure linkage table. Set
it up. */ it up. */
@ -3117,7 +3116,7 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym)
+ htab->sgotplt->output_offset + htab->sgotplt->output_offset
+ got_offset); + got_offset);
rel.r_info = ELF32_R_INFO (h->dynindx, R_386_JUMP_SLOT); rel.r_info = ELF32_R_INFO (h->dynindx, R_386_JUMP_SLOT);
loc = (Elf32_External_Rel *) htab->srelplt->contents + plt_index; loc = htab->srelplt->contents + plt_index * sizeof (Elf32_External_Rel);
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
@ -3135,8 +3134,8 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym)
&& elf_i386_hash_entry(h)->tls_type != GOT_TLS_GD && elf_i386_hash_entry(h)->tls_type != GOT_TLS_GD
&& (elf_i386_hash_entry(h)->tls_type & GOT_TLS_IE) == 0) && (elf_i386_hash_entry(h)->tls_type & GOT_TLS_IE) == 0)
{ {
Elf_Internal_Rel rel; Elf_Internal_Rela rel;
Elf32_External_Rel *loc; bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
@ -3170,15 +3169,15 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_info = ELF32_R_INFO (h->dynindx, R_386_GLOB_DAT); rel.r_info = ELF32_R_INFO (h->dynindx, R_386_GLOB_DAT);
} }
loc = (Elf32_External_Rel *) htab->srelgot->contents; loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++; loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rel);
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
Elf_Internal_Rel rel; Elf_Internal_Rela rel;
Elf32_External_Rel *loc; bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */ /* This symbol needs a copy reloc. Set it up. */
@ -3192,8 +3191,8 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_section->vma + h->root.u.def.section->output_section->vma
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rel.r_info = ELF32_R_INFO (h->dynindx, R_386_COPY); rel.r_info = ELF32_R_INFO (h->dynindx, R_386_COPY);
loc = (Elf32_External_Rel *) htab->srelbss->contents; loc = htab->srelbss->contents;
loc += htab->srelbss->reloc_count++; loc += htab->srelbss->reloc_count++ * sizeof (Elf32_External_Rel);
bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); bfd_elf32_swap_reloc_out (output_bfd, &rel, loc);
} }

View File

@ -34,7 +34,7 @@ static reloc_howto_type *elf32_i860_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void elf32_i860_info_to_howto_rela static void elf32_i860_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static bfd_reloc_status_type elf32_i860_relocate_splitn static bfd_reloc_status_type elf32_i860_relocate_splitn
PARAMS ((bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma)); PARAMS ((bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));
@ -694,7 +694,7 @@ static void
elf32_i860_info_to_howto_rela (abfd, bfd_reloc, elf_reloc) elf32_i860_info_to_howto_rela (abfd, bfd_reloc, elf_reloc)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc; arelent *bfd_reloc;
Elf64_Internal_Rela *elf_reloc; Elf_Internal_Rela *elf_reloc;
{ {
bfd_reloc->howto bfd_reloc->howto
= lookup_howto ((unsigned) ELF32_R_TYPE (elf_reloc->r_info)); = lookup_howto ((unsigned) ELF32_R_TYPE (elf_reloc->r_info));

View File

@ -28,9 +28,9 @@ static bfd_reloc_status_type elf32_i960_relocate
static reloc_howto_type *elf32_i960_reloc_type_lookup static reloc_howto_type *elf32_i960_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static void elf32_i960_info_to_howto static void elf32_i960_info_to_howto
PARAMS ((bfd *, arelent *cache_ptr, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *cache_ptr, Elf_Internal_Rela *));
static void elf32_i960_info_to_howto_rel static void elf32_i960_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
#define USE_REL 1 #define USE_REL 1
@ -77,7 +77,7 @@ static void
elf32_i960_info_to_howto (abfd, cache_ptr, dst) elf32_i960_info_to_howto (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr ATTRIBUTE_UNUSED; arelent *cache_ptr ATTRIBUTE_UNUSED;
Elf32_Internal_Rela *dst ATTRIBUTE_UNUSED; Elf_Internal_Rela *dst ATTRIBUTE_UNUSED;
{ {
abort (); abort ();
} }
@ -86,7 +86,7 @@ static void
elf32_i960_info_to_howto_rel (abfd, cache_ptr, dst) elf32_i960_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
enum elf_i960_reloc_type type; enum elf_i960_reloc_type type;

View File

@ -35,10 +35,10 @@ struct misc
/* Prototypes. */ /* Prototypes. */
static reloc_howto_type * ip2k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static reloc_howto_type * ip2k_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
static void ip2k_info_to_howto_rela PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); static void ip2k_info_to_howto_rela PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static asection * ip2k_elf_gc_mark_hook PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static asection * ip2k_elf_gc_mark_hook PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *));
static boolean ip2k_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static boolean ip2k_elf_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *));
static bfd_vma symbol_value PARAMS ((bfd *, Elf_Internal_Shdr *, Elf32_Internal_Sym *, Elf_Internal_Rela *)); static bfd_vma symbol_value PARAMS ((bfd *, Elf_Internal_Shdr *, Elf_Internal_Sym *, Elf_Internal_Rela *));
static void adjust_all_relocations PARAMS ((bfd *, asection *, bfd_vma, bfd_vma, int, int)); static void adjust_all_relocations PARAMS ((bfd *, asection *, bfd_vma, bfd_vma, int, int));
static boolean ip2k_elf_relax_delete_bytes PARAMS ((bfd *, asection *, bfd_vma, int)); static boolean ip2k_elf_relax_delete_bytes PARAMS ((bfd *, asection *, bfd_vma, int));
static boolean ip2k_elf_relax_add_bytes PARAMS ((bfd *, asection *, bfd_vma, const bfd_byte *, int, int)); static boolean ip2k_elf_relax_add_bytes PARAMS ((bfd *, asection *, bfd_vma, const bfd_byte *, int, int));
@ -256,7 +256,7 @@ static bfd_vma
symbol_value (abfd, symtab_hdr, isymbuf, irel) symbol_value (abfd, symtab_hdr, isymbuf, irel)
bfd *abfd; bfd *abfd;
Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Shdr *symtab_hdr;
Elf32_Internal_Sym *isymbuf; Elf_Internal_Sym *isymbuf;
Elf_Internal_Rela *irel; Elf_Internal_Rela *irel;
{ {
if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
@ -1164,7 +1164,7 @@ adjust_all_relocations (abfd, sec, addr, endaddr, count, noadj)
unsigned int symcount; unsigned int symcount;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr; symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
isymbuf = (Elf32_Internal_Sym *) symtab_hdr->contents; isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
shndx = _bfd_elf_section_from_bfd_section (abfd, sec); shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
@ -1265,7 +1265,7 @@ add_page_insn (abfd, sec, irel, misc)
return false; return false;
else else
{ {
Elf32_Internal_Rela * jrel = irel - 1; Elf_Internal_Rela * jrel = irel - 1;
/* Add relocation for PAGE insn added. */ /* Add relocation for PAGE insn added. */
if (ELF32_R_TYPE (jrel->r_info) != R_IP2K_NONE) if (ELF32_R_TYPE (jrel->r_info) != R_IP2K_NONE)
@ -1360,7 +1360,7 @@ static void
ip2k_info_to_howto_rela (abfd, cache_ptr, dst) ip2k_info_to_howto_rela (abfd, cache_ptr, dst)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
arelent * cache_ptr; arelent * cache_ptr;
Elf32_Internal_Rela * dst; Elf_Internal_Rela * dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -43,7 +43,7 @@ static bfd_reloc_status_type m32r_elf_sda16_reloc
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void m32r_info_to_howto_rel static void m32r_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
boolean _bfd_m32r_elf_section_from_bfd_section boolean _bfd_m32r_elf_section_from_bfd_section
PARAMS ((bfd *, asection *, int *)); PARAMS ((bfd *, asection *, int *));
void _bfd_m32r_elf_symbol_processing void _bfd_m32r_elf_symbol_processing
@ -756,7 +756,7 @@ static void
m32r_info_to_howto_rel (abfd, cache_ptr, dst) m32r_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static void m68hc11_info_to_howto_rel static void m68hc11_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static bfd_reloc_status_type m68hc11_elf_ignore_reloc static bfd_reloc_status_type m68hc11_elf_ignore_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
@ -392,7 +392,7 @@ static void
m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) m68hc11_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static void m68hc11_info_to_howto_rel static void m68hc11_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static bfd_reloc_status_type m68hc11_elf_ignore_reloc static bfd_reloc_status_type m68hc11_elf_ignore_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
@ -579,7 +579,7 @@ static void
m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) m68hc11_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type *reloc_type_lookup static reloc_howto_type *reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static void rtype_to_howto static void rtype_to_howto
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static struct bfd_hash_entry *elf_m68k_link_hash_newfunc static struct bfd_hash_entry *elf_m68k_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
static struct bfd_link_hash_table *elf_m68k_link_hash_table_create static struct bfd_link_hash_table *elf_m68k_link_hash_table_create
@ -1503,22 +1503,21 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared) if (info->shared)
{ {
asection *srelgot; asection *s;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); s = bfd_get_section_by_name (dynobj, ".rela.got");
BFD_ASSERT (srelgot != NULL); BFD_ASSERT (s != NULL);
outrel.r_offset = (sgot->output_section->vma outrel.r_offset = (sgot->output_section->vma
+ sgot->output_offset + sgot->output_offset
+ off); + off);
outrel.r_info = ELF32_R_INFO (0, R_68K_RELATIVE); outrel.r_info = ELF32_R_INFO (0, R_68K_RELATIVE);
outrel.r_addend = relocation; outrel.r_addend = relocation;
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc = s->contents;
(((Elf32_External_Rela *) loc += s->reloc_count++ * sizeof (Elf32_External_Rela);
srelgot->contents) bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ srelgot->reloc_count));
++srelgot->reloc_count;
} }
local_got_offsets[r_symndx] |= 1; local_got_offsets[r_symndx] |= 1;
@ -1609,6 +1608,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
& ELF_LINK_HASH_DEF_REGULAR) == 0))) & ELF_LINK_HASH_DEF_REGULAR) == 0)))
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
boolean skip, relocate; boolean skip, relocate;
/* When generating a shared object, these relocations /* When generating a shared object, these relocations
@ -1703,11 +1703,9 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
} }
} }
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc = sreloc->contents;
(((Elf32_External_Rela *) loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
sreloc->contents) bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ sreloc->reloc_count));
++sreloc->reloc_count;
/* This reloc will be computed at runtime, so there's no /* This reloc will be computed at runtime, so there's no
need to do anything now, except for R_68K_32 need to do anything now, except for R_68K_32
@ -1791,6 +1789,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_vma plt_index; bfd_vma plt_index;
bfd_vma got_offset; bfd_vma got_offset;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbol has an entry in the procedure linkage table. Set /* This symbol has an entry in the procedure linkage table. Set
it up. */ it up. */
@ -1863,9 +1862,8 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
+ got_offset); + got_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_68K_JMP_SLOT); rela.r_info = ELF32_R_INFO (h->dynindx, R_68K_JMP_SLOT);
rela.r_addend = 0; rela.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = srela->contents + plt_index * sizeof (Elf32_External_Rela);
((Elf32_External_Rela *) srela->contents bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ plt_index));
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{ {
@ -1880,6 +1878,7 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
asection *sgot; asection *sgot;
asection *srela; asection *srela;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
@ -1914,16 +1913,16 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
rela.r_addend = 0; rela.r_addend = 0;
} }
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = srela->contents;
((Elf32_External_Rela *) srela->contents loc += srela->reloc_count++ * sizeof (Elf32_External_Rela);
+ srela->reloc_count)); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
++srela->reloc_count;
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
asection *s; asection *s;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */ /* This symbol needs a copy reloc. Set it up. */
@ -1940,10 +1939,8 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_68K_COPY); rela.r_info = ELF32_R_INFO (h->dynindx, R_68K_COPY);
rela.r_addend = 0; rela.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela);
((Elf32_External_Rela *) s->contents bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ s->reloc_count));
++s->reloc_count;
} }
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */

View File

@ -36,7 +36,7 @@ static void mcore_elf_howto_init
static reloc_howto_type * mcore_elf_reloc_type_lookup static reloc_howto_type * mcore_elf_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static void mcore_elf_info_to_howto static void mcore_elf_info_to_howto
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean mcore_elf_set_private_flags static boolean mcore_elf_set_private_flags
PARAMS ((bfd *, flagword)); PARAMS ((bfd *, flagword));
static boolean mcore_elf_merge_private_bfd_data static boolean mcore_elf_merge_private_bfd_data
@ -275,7 +275,7 @@ static void
mcore_elf_info_to_howto (abfd, cache_ptr, dst) mcore_elf_info_to_howto (abfd, cache_ptr, dst)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
arelent * cache_ptr; arelent * cache_ptr;
Elf32_Internal_Rela * dst; Elf_Internal_Rela * dst;
{ {
if (! mcore_elf_howto_table [R_MCORE_PCRELIMM8BY4]) /* Initialize howto table if needed */ if (! mcore_elf_howto_table [R_MCORE_PCRELIMM8BY4]) /* Initialize howto table if needed */
mcore_elf_howto_init (); mcore_elf_howto_init ();

View File

@ -62,9 +62,9 @@ static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
static reloc_howto_type *mips_elf32_rtype_to_howto static reloc_howto_type *mips_elf32_rtype_to_howto
PARAMS ((unsigned int, boolean)); PARAMS ((unsigned int, boolean));
static void mips_info_to_howto_rel static void mips_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void mips_info_to_howto_rela static void mips_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean mips_elf_sym_is_global PARAMS ((bfd *, asymbol *)); static boolean mips_elf_sym_is_global PARAMS ((bfd *, asymbol *));
static boolean mips_elf32_object_p PARAMS ((bfd *)); static boolean mips_elf32_object_p PARAMS ((bfd *));
static boolean mips_elf_is_local_label_name static boolean mips_elf_is_local_label_name
@ -1464,7 +1464,7 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
} }
} }
/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */ /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */
static reloc_howto_type * static reloc_howto_type *
mips_elf32_rtype_to_howto (r_type, rela_p) mips_elf32_rtype_to_howto (r_type, rela_p)
@ -1497,13 +1497,13 @@ mips_elf32_rtype_to_howto (r_type, rela_p)
} }
} }
/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */ /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */
static void static void
mips_info_to_howto_rel (abfd, cache_ptr, dst) mips_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd; bfd *abfd;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;
@ -1520,21 +1520,18 @@ mips_info_to_howto_rel (abfd, cache_ptr, dst)
cache_ptr->addend = elf_gp (abfd); cache_ptr->addend = elf_gp (abfd);
} }
/* Given a MIPS Elf32_Internal_Rela, fill in an arelent structure. */ /* Given a MIPS Elf_Internal_Rela, fill in an arelent structure. */
static void static void
mips_info_to_howto_rela (abfd, cache_ptr, dst) mips_info_to_howto_rela (abfd, cache_ptr, dst)
bfd *abfd; bfd *abfd;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
/* Since an Elf32_Internal_Rel is an initial prefix of an mips_info_to_howto_rel (abfd, cache_ptr, dst);
Elf32_Internal_Rela, we can just use mips_info_to_howto_rel
above. */
mips_info_to_howto_rel (abfd, cache_ptr, (Elf32_Internal_Rel *) dst);
/* If we ever need to do any extra processing with dst->r_addend /* If we ever need to do any extra processing with dst->r_addend
(the field omitted in an Elf32_Internal_Rel) we can do it here. */ (the field omitted in an Elf_Internal_Rel) we can do it here. */
} }
/* Determine whether a symbol is global for the purposes of splitting /* Determine whether a symbol is global for the purposes of splitting

View File

@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type *openrisc_reloc_type_lookup static reloc_howto_type *openrisc_reloc_type_lookup
PARAMS ((bfd * , bfd_reloc_code_real_type)); PARAMS ((bfd * , bfd_reloc_code_real_type));
static void openrisc_info_to_howto_rela static void openrisc_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean openrisc_elf_relocate_section static boolean openrisc_elf_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
@ -246,7 +246,7 @@ static void
openrisc_info_to_howto_rela (abfd, cache_ptr, dst) openrisc_info_to_howto_rela (abfd, cache_ptr, dst)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
arelent * cache_ptr; arelent * cache_ptr;
Elf32_Internal_Rela * dst; Elf_Internal_Rela * dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -26,7 +26,7 @@
#include "libiberty.h" #include "libiberty.h"
static reloc_howto_type * bfd_elf32_bfd_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static reloc_howto_type * bfd_elf32_bfd_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
static void or32_info_to_howto_rel PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); static void or32_info_to_howto_rel PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean or32_elf_object_p PARAMS ((bfd *)); static boolean or32_elf_object_p PARAMS ((bfd *));
static void or32_elf_final_write_processing PARAMS ((bfd *, boolean)); static void or32_elf_final_write_processing PARAMS ((bfd *, boolean));
static bfd_reloc_status_type or32_elf_32_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type or32_elf_32_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
@ -221,7 +221,7 @@ static void
or32_info_to_howto_rel (abfd, cache_ptr, dst) or32_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type *ppc_elf_reloc_type_lookup static reloc_howto_type *ppc_elf_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void ppc_elf_info_to_howto static void ppc_elf_info_to_howto
PARAMS ((bfd *abfd, arelent *cache_ptr, Elf32_Internal_Rela *dst)); PARAMS ((bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst));
static void ppc_elf_howto_init PARAMS ((void)); static void ppc_elf_howto_init PARAMS ((void));
static int ppc_elf_sort_rela PARAMS ((const PTR, const PTR)); static int ppc_elf_sort_rela PARAMS ((const PTR, const PTR));
static boolean ppc_elf_relax_section static boolean ppc_elf_relax_section
@ -56,10 +56,10 @@ static boolean ppc_elf_create_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
static boolean ppc_elf_section_from_shdr PARAMS ((bfd *, static boolean ppc_elf_section_from_shdr PARAMS ((bfd *,
Elf32_Internal_Shdr *, Elf_Internal_Shdr *,
const char *)); const char *));
static boolean ppc_elf_fake_sections static boolean ppc_elf_fake_sections
PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
static elf_linker_section_t *ppc_elf_create_linker_section static elf_linker_section_t *ppc_elf_create_linker_section
PARAMS ((bfd *abfd, PARAMS ((bfd *abfd,
@ -1333,7 +1333,7 @@ static void
ppc_elf_info_to_howto (abfd, cache_ptr, dst) ppc_elf_info_to_howto (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
if (!ppc_elf_howto_table[R_PPC_ADDR32]) if (!ppc_elf_howto_table[R_PPC_ADDR32])
/* Initialize howto table if needed. */ /* Initialize howto table if needed. */
@ -1511,7 +1511,7 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd)
static boolean static boolean
ppc_elf_section_from_shdr (abfd, hdr, name) ppc_elf_section_from_shdr (abfd, hdr, name)
bfd *abfd; bfd *abfd;
Elf32_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;
const char *name; const char *name;
{ {
asection *newsect; asection *newsect;
@ -1537,7 +1537,7 @@ ppc_elf_section_from_shdr (abfd, hdr, name)
static boolean static boolean
ppc_elf_fake_sections (abfd, shdr, asect) ppc_elf_fake_sections (abfd, shdr, asect)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
Elf32_Internal_Shdr *shdr; Elf_Internal_Shdr *shdr;
asection *asect; asection *asect;
{ {
if ((asect->flags & SEC_EXCLUDE) != 0) if ((asect->flags & SEC_EXCLUDE) != 0)
@ -2664,6 +2664,7 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
asection *splt; asection *splt;
asection *srela; asection *srela;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
bfd_vma reloc_index; bfd_vma reloc_index;
#ifdef DEBUG #ifdef DEBUG
@ -2692,9 +2693,8 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
reloc_index = (h->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_SLOT_SIZE; reloc_index = (h->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_SLOT_SIZE;
if (reloc_index > PLT_NUM_SINGLE_ENTRIES) if (reloc_index > PLT_NUM_SINGLE_ENTRIES)
reloc_index -= (reloc_index - PLT_NUM_SINGLE_ENTRIES) / 2; reloc_index -= (reloc_index - PLT_NUM_SINGLE_ENTRIES) / 2;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = srela->contents + reloc_index * sizeof (Elf32_External_Rela);
((Elf32_External_Rela *) srela->contents bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ reloc_index));
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{ {
@ -2716,6 +2716,7 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
asection *sgot; asection *sgot;
asection *srela; asection *srela;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
@ -2748,16 +2749,16 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
} }
bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset); bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = srela->contents;
((Elf32_External_Rela *) srela->contents loc += srela->reloc_count++ * sizeof (Elf32_External_Rela);
+ srela->reloc_count)); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
++srela->reloc_count;
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
asection *s; asection *s;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbols needs a copy reloc. Set it up. */ /* This symbols needs a copy reloc. Set it up. */
@ -2780,10 +2781,8 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_COPY); rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_COPY);
rela.r_addend = 0; rela.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela);
((Elf32_External_Rela *) s->contents bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ s->reloc_count));
++s->reloc_count;
} }
#ifdef DEBUG #ifdef DEBUG
@ -3181,6 +3180,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared && r_symndx != 0) if (info->shared && r_symndx != 0)
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
int skip; int skip;
#ifdef DEBUG #ifdef DEBUG
@ -3281,11 +3281,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
} }
} }
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc = sreloc->contents;
(((Elf32_External_Rela *) loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
sreloc->contents) bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ sreloc->reloc_count));
++sreloc->reloc_count;
if (skip == -1) if (skip == -1)
continue; continue;
@ -3401,6 +3399,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
asection *srelgot; asection *srelgot;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
/* We need to generate a R_PPC_RELATIVE reloc /* We need to generate a R_PPC_RELATIVE reloc
for the dynamic linker. */ for the dynamic linker. */
@ -3412,11 +3411,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+ off); + off);
outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE); outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE);
outrel.r_addend = relocation; outrel.r_addend = relocation;
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc = srelgot->contents;
(((Elf32_External_Rela *) loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
srelgot->contents) bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ srelgot->reloc_count));
++srelgot->reloc_count;
relocation = 0; relocation = 0;
} }

View File

@ -1788,7 +1788,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
asection *srelgot; asection *srelgot;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
Elf32_External_Rela *loc; bfd_byte *loc;
srelgot = htab->srelgot; srelgot = htab->srelgot;
if (srelgot == NULL) if (srelgot == NULL)
@ -1799,8 +1799,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
+ off); + off);
outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE);
outrel.r_addend = relocation; outrel.r_addend = relocation;
loc = (Elf32_External_Rela *) srelgot->contents; loc = srelgot->contents;
loc += srelgot->reloc_count++; loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
} }
@ -1907,7 +1907,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
boolean skip, relocate; boolean skip, relocate;
asection *sreloc; asection *sreloc;
Elf32_External_Rela *loc; bfd_byte *loc;
/* When generating a shared object, these relocations /* When generating a shared object, these relocations
are copied into the output file to be resolved at run are copied into the output file to be resolved at run
@ -1954,8 +1954,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
if (sreloc == NULL) if (sreloc == NULL)
abort (); abort ();
loc = (Elf32_External_Rela *) sreloc->contents; loc = sreloc->contents;
loc += sreloc->reloc_count++; loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
/* If this reloc is against an external symbol, we do /* If this reloc is against an external symbol, we do
@ -2047,7 +2047,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_vma plt_index; bfd_vma plt_index;
bfd_vma got_offset; bfd_vma got_offset;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf32_External_Rela *loc; bfd_byte *loc;
bfd_vma relative_offset; bfd_vma relative_offset;
/* This symbol has an entry in the procedure linkage table. Set /* This symbol has an entry in the procedure linkage table. Set
@ -2167,7 +2167,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
+ got_offset); + got_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_390_JMP_SLOT); rela.r_info = ELF32_R_INFO (h->dynindx, R_390_JMP_SLOT);
rela.r_addend = 0; rela.r_addend = 0;
loc = (Elf32_External_Rela *) htab->srelplt->contents + plt_index; loc = htab->srelplt->contents + plt_index * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
@ -2184,7 +2184,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
if (h->got.offset != (bfd_vma) -1) if (h->got.offset != (bfd_vma) -1)
{ {
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf32_External_Rela *loc; bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
@ -2221,15 +2221,15 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
rela.r_addend = 0; rela.r_addend = 0;
} }
loc = (Elf32_External_Rela *) htab->srelgot->contents; loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++; loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf32_External_Rela *loc; bfd_byte *loc;
/* This symbols needs a copy reloc. Set it up. */ /* This symbols needs a copy reloc. Set it up. */
@ -2244,8 +2244,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_390_COPY); rela.r_info = ELF32_R_INFO (h->dynindx, R_390_COPY);
rela.r_addend = 0; rela.r_addend = 0;
loc = (Elf32_External_Rela *) htab->srelbss->contents; loc = htab->srelbss->contents;
loc += htab->srelbss->reloc_count++; loc += htab->srelbss->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
} }

View File

@ -4875,6 +4875,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
& ELF_LINK_HASH_DEF_REGULAR) == 0)))) & ELF_LINK_HASH_DEF_REGULAR) == 0))))
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
boolean skip, relocate; boolean skip, relocate;
/* When generating a shared object, these relocations /* When generating a shared object, these relocations
@ -4948,11 +4949,9 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
} }
} }
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc = sreloc->contents;
(((Elf32_External_Rela *) loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
sreloc->contents) bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ sreloc->reloc_count));
++sreloc->reloc_count;
/* If this reloc is against an external symbol, we do /* If this reloc is against an external symbol, we do
not want to fiddle with the addend. Otherwise, we not want to fiddle with the addend. Otherwise, we
@ -5106,6 +5105,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared) if (info->shared)
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
if (srelgot == NULL) if (srelgot == NULL)
{ {
@ -5119,11 +5119,9 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+ off); + off);
outrel.r_info = ELF32_R_INFO (0, R_SH_RELATIVE); outrel.r_info = ELF32_R_INFO (0, R_SH_RELATIVE);
outrel.r_addend = relocation; outrel.r_addend = relocation;
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc = srelgot->contents;
(((Elf32_External_Rela *) loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
srelgot->contents) bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ srelgot->reloc_count));
++srelgot->reloc_count;
} }
#ifdef INCLUDE_SHMEDIA #ifdef INCLUDE_SHMEDIA
@ -5273,6 +5271,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
unsigned short insn; unsigned short insn;
int indx; int indx;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
if (ELF32_R_TYPE (rel->r_info) == R_SH_TLS_GD_32) if (ELF32_R_TYPE (rel->r_info) == R_SH_TLS_GD_32)
{ {
@ -5378,12 +5377,10 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_addend = relocation - dtpoff_base (info); outrel.r_addend = relocation - dtpoff_base (info);
else else
outrel.r_addend = 0; outrel.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &outrel,
(((Elf32_External_Rela *)
sreloc->contents)
+ sreloc->reloc_count));
++sreloc->reloc_count;
loc = sreloc->contents;
loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
continue; continue;
} }
@ -5406,7 +5403,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else else
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
Elf32_External_Rela *loc; bfd_byte *loc;
int dr_type, indx; int dr_type, indx;
if (srelgot == NULL) if (srelgot == NULL)
@ -5426,8 +5423,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else else
outrel.r_addend = 0; outrel.r_addend = 0;
outrel.r_info = ELF32_R_INFO (indx, dr_type); outrel.r_info = ELF32_R_INFO (indx, dr_type);
loc = (Elf32_External_Rela *) srelgot->contents; loc = srelgot->contents;
loc += srelgot->reloc_count++; loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
if (r_type == R_SH_TLS_GD_32) if (r_type == R_SH_TLS_GD_32)
@ -5445,9 +5442,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_offset += 4; outrel.r_offset += 4;
outrel.r_addend = 0; outrel.r_addend = 0;
srelgot->reloc_count++; srelgot->reloc_count++;
loc++; loc += sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
loc);
} }
} }
@ -5578,7 +5574,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
else else
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
Elf32_External_Rela *loc; bfd_byte *loc;
srelgot = htab->srelgot; srelgot = htab->srelgot;
if (srelgot == NULL) if (srelgot == NULL)
@ -5588,8 +5584,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+ sgot->output_offset + off); + sgot->output_offset + off);
outrel.r_addend = 0; outrel.r_addend = 0;
outrel.r_info = ELF32_R_INFO (0, R_SH_TLS_DTPMOD32); outrel.r_info = ELF32_R_INFO (0, R_SH_TLS_DTPMOD32);
loc = (Elf32_External_Rela *) srelgot->contents; loc = srelgot->contents;
loc += srelgot->reloc_count++; loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
htab->tls_ldm_got.offset |= 1; htab->tls_ldm_got.offset |= 1;
} }
@ -5604,6 +5600,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
int indx; int indx;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
if (sreloc == NULL) if (sreloc == NULL)
{ {
@ -5634,12 +5631,10 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_addend = relocation - dtpoff_base (info); outrel.r_addend = relocation - dtpoff_base (info);
else else
outrel.r_addend = 0; outrel.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &outrel,
(((Elf32_External_Rela *)
sreloc->contents)
+ sreloc->reloc_count));
++sreloc->reloc_count;
loc = sreloc->contents;
loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
continue; continue;
} }
else else
@ -5652,6 +5647,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
int indx; int indx;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
if (sreloc == NULL) if (sreloc == NULL)
{ {
@ -5682,12 +5678,10 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_addend = relocation - dtpoff_base (info); outrel.r_addend = relocation - dtpoff_base (info);
else else
outrel.r_addend = 0; outrel.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &outrel,
(((Elf32_External_Rela *)
sreloc->contents)
+ sreloc->reloc_count));
++sreloc->reloc_count;
loc = sreloc->contents;
loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
continue; continue;
} }
} }
@ -6877,6 +6871,7 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_vma plt_index; bfd_vma plt_index;
bfd_vma got_offset; bfd_vma got_offset;
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_byte *loc;
/* This symbol has an entry in the procedure linkage table. Set /* This symbol has an entry in the procedure linkage table. Set
it up. */ it up. */
@ -6996,9 +6991,8 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
#ifdef GOT_BIAS #ifdef GOT_BIAS
rel.r_addend = GOT_BIAS; rel.r_addend = GOT_BIAS;
#endif #endif
bfd_elf32_swap_reloca_out (output_bfd, &rel, loc = srel->contents + plt_index * sizeof (Elf32_External_Rela);
((Elf32_External_Rela *) srel->contents bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+ plt_index));
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{ {
@ -7015,6 +7009,7 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
asection *sgot; asection *sgot;
asection *srel; asection *srel;
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
@ -7050,10 +7045,9 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_addend = 0; rel.r_addend = 0;
} }
bfd_elf32_swap_reloca_out (output_bfd, &rel, loc = srel->contents;
((Elf32_External_Rela *) srel->contents loc += srel->reloc_count++ * sizeof (Elf32_External_Rela);
+ srel->reloc_count)); bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
++srel->reloc_count;
} }
#ifdef INCLUDE_SHMEDIA #ifdef INCLUDE_SHMEDIA
@ -7066,6 +7060,7 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
asection *sgot; asection *sgot;
asection *srel; asection *srel;
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_byte *loc;
/* This symbol has a datalabel entry in the global offset table. /* This symbol has a datalabel entry in the global offset table.
Set it up. */ Set it up. */
@ -7102,10 +7097,9 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_addend = 0; rel.r_addend = 0;
} }
bfd_elf32_swap_reloca_out (output_bfd, &rel, loc = srel->contents;
((Elf32_External_Rela *) srel->contents loc += srel->reloc_count++ * sizeof (Elf32_External_Rela);
+ srel->reloc_count)); bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
++srel->reloc_count;
} }
} }
#endif #endif
@ -7114,6 +7108,7 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
{ {
asection *s; asection *s;
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */ /* This symbol needs a copy reloc. Set it up. */
@ -7130,10 +7125,8 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rel.r_info = ELF32_R_INFO (h->dynindx, R_SH_COPY); rel.r_info = ELF32_R_INFO (h->dynindx, R_SH_COPY);
rel.r_addend = 0; rel.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &rel, loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela);
((Elf32_External_Rela *) s->contents bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
+ s->reloc_count));
++s->reloc_count;
} }
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */

View File

@ -35,9 +35,9 @@
static reloc_howto_type *v850_elf_reloc_type_lookup static reloc_howto_type *v850_elf_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void v850_elf_info_to_howto_rel static void v850_elf_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void v850_elf_info_to_howto_rela static void v850_elf_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static bfd_reloc_status_type v850_elf_reloc static bfd_reloc_status_type v850_elf_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static boolean v850_elf_is_local_label_name static boolean v850_elf_is_local_label_name
@ -59,7 +59,7 @@ static bfd_reloc_status_type v850_elf_final_link_relocate
static boolean v850_elf_object_p static boolean v850_elf_object_p
PARAMS ((bfd *)); PARAMS ((bfd *));
static boolean v850_elf_fake_sections static boolean v850_elf_fake_sections
PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
static void v850_elf_final_write_processing static void v850_elf_final_write_processing
PARAMS ((bfd *, boolean)); PARAMS ((bfd *, boolean));
static boolean v850_elf_set_private_flags static boolean v850_elf_set_private_flags
@ -589,9 +589,9 @@ v850_elf_reloc_type_lookup (abfd, code)
static void static void
v850_elf_info_to_howto_rel (abfd, cache_ptr, dst) v850_elf_info_to_howto_rel (abfd, cache_ptr, dst)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
arelent * cache_ptr; arelent * cache_ptr;
Elf32_Internal_Rel * dst; Elf_Internal_Rela * dst;
{ {
unsigned int r_type; unsigned int r_type;
@ -603,9 +603,9 @@ v850_elf_info_to_howto_rel (abfd, cache_ptr, dst)
/* Set the howto pointer for a V850 ELF reloc (type RELA). */ /* Set the howto pointer for a V850 ELF reloc (type RELA). */
static void static void
v850_elf_info_to_howto_rela (abfd, cache_ptr, dst) v850_elf_info_to_howto_rela (abfd, cache_ptr, dst)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
arelent * cache_ptr; arelent * cache_ptr;
Elf32_Internal_Rela *dst; Elf_Internal_Rela * dst;
{ {
unsigned int r_type; unsigned int r_type;
@ -2225,9 +2225,9 @@ v850_elf_section_from_shdr (abfd, hdr, name)
static boolean static boolean
v850_elf_fake_sections (abfd, hdr, sec) v850_elf_fake_sections (abfd, hdr, sec)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
Elf32_Internal_Shdr * hdr; Elf_Internal_Shdr * hdr;
asection * sec; asection * sec;
{ {
register const char * name; register const char * name;

View File

@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type *reloc_type_lookup static reloc_howto_type *reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static void rtype_to_howto static void rtype_to_howto
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static struct bfd_hash_entry *elf_vax_link_hash_newfunc static struct bfd_hash_entry *elf_vax_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
static struct bfd_link_hash_table *elf_vax_link_hash_table_create static struct bfd_link_hash_table *elf_vax_link_hash_table_create
@ -1693,6 +1693,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
& ELF_LINK_HASH_DEF_REGULAR) == 0))) & ELF_LINK_HASH_DEF_REGULAR) == 0)))
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
boolean skip, relocate; boolean skip, relocate;
/* When generating a shared object, these relocations /* When generating a shared object, these relocations
@ -1811,11 +1812,9 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_addend, outrel.r_addend,
bfd_get_section_name (input_bfd, input_section)); bfd_get_section_name (input_bfd, input_section));
} }
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc = sreloc->contents;
(((Elf32_External_Rela *) loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
sreloc->contents) bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ sreloc->reloc_count));
++sreloc->reloc_count;
/* This reloc will be computed at runtime, so there's no /* This reloc will be computed at runtime, so there's no
need to do anything now, except for R_VAX_32 need to do anything now, except for R_VAX_32
@ -1905,6 +1904,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_vma got_offset; bfd_vma got_offset;
bfd_vma addend; bfd_vma addend;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbol has an entry in the procedure linkage table. Set /* This symbol has an entry in the procedure linkage table. Set
it up. */ it up. */
@ -1955,9 +1955,8 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
+ got_offset); + got_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_VAX_JMP_SLOT); rela.r_info = ELF32_R_INFO (h->dynindx, R_VAX_JMP_SLOT);
rela.r_addend = addend; rela.r_addend = addend;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = srela->contents + plt_index * sizeof (Elf32_External_Rela);
((Elf32_External_Rela *) srela->contents bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ plt_index));
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{ {
@ -1972,6 +1971,7 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
asection *sgot; asection *sgot;
asection *srela; asection *srela;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
@ -2002,16 +2002,16 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
(sgot->contents (sgot->contents
+ (h->got.offset & ~1))); + (h->got.offset & ~1)));
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = srela->contents;
((Elf32_External_Rela *) srela->contents loc += srela->reloc_count++ * sizeof (Elf32_External_Rela);
+ srela->reloc_count)); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
++srela->reloc_count;
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
asection *s; asection *s;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */ /* This symbol needs a copy reloc. Set it up. */
@ -2028,10 +2028,8 @@ elf_vax_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_VAX_COPY); rela.r_info = ELF32_R_INFO (h->dynindx, R_VAX_COPY);
rela.r_addend = 0; rela.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela);
((Elf32_External_Rela *) s->contents bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ s->reloc_count));
++s->reloc_count;
} }
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */

View File

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static reloc_howto_type * xstormy16_reloc_type_lookup static reloc_howto_type * xstormy16_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void xstormy16_info_to_howto_rela static void xstormy16_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static bfd_reloc_status_type xstormy16_elf_24_reloc static bfd_reloc_status_type xstormy16_elf_24_reloc
PARAMS ((bfd *abfd, arelent *reloc_entry, asymbol *symbol, PARAMS ((bfd *abfd, arelent *reloc_entry, asymbol *symbol,
PTR data, asection *input_section, bfd *output_bfd, PTR data, asection *input_section, bfd *output_bfd,
@ -296,7 +296,7 @@ static void
xstormy16_info_to_howto_rela (abfd, cache_ptr, dst) xstormy16_info_to_howto_rela (abfd, cache_ptr, dst)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
arelent * cache_ptr; arelent * cache_ptr;
Elf32_Internal_Rela * dst; Elf_Internal_Rela * dst;
{ {
unsigned int r_type = ELF32_R_TYPE (dst->r_info); unsigned int r_type = ELF32_R_TYPE (dst->r_info);

View File

@ -66,18 +66,18 @@ static bfd_reloc_status_type elf64_alpha_reloc_gpdisp
static reloc_howto_type * elf64_alpha_bfd_reloc_type_lookup static reloc_howto_type * elf64_alpha_bfd_reloc_type_lookup
PARAMS((bfd *, bfd_reloc_code_real_type)); PARAMS((bfd *, bfd_reloc_code_real_type));
static void elf64_alpha_info_to_howto static void elf64_alpha_info_to_howto
PARAMS((bfd *, arelent *, Elf64_Internal_Rela *)); PARAMS((bfd *, arelent *, Elf_Internal_Rela *));
static boolean elf64_alpha_mkobject static boolean elf64_alpha_mkobject
PARAMS((bfd *)); PARAMS((bfd *));
static boolean elf64_alpha_object_p static boolean elf64_alpha_object_p
PARAMS((bfd *)); PARAMS((bfd *));
static boolean elf64_alpha_section_from_shdr static boolean elf64_alpha_section_from_shdr
PARAMS((bfd *, Elf64_Internal_Shdr *, const char *)); PARAMS((bfd *, Elf_Internal_Shdr *, const char *));
static boolean elf64_alpha_section_flags static boolean elf64_alpha_section_flags
PARAMS((flagword *, Elf64_Internal_Shdr *)); PARAMS((flagword *, Elf_Internal_Shdr *));
static boolean elf64_alpha_fake_sections static boolean elf64_alpha_fake_sections
PARAMS((bfd *, Elf64_Internal_Shdr *, asection *)); PARAMS((bfd *, Elf_Internal_Shdr *, asection *));
static boolean elf64_alpha_create_got_section static boolean elf64_alpha_create_got_section
PARAMS((bfd *, struct bfd_link_info *)); PARAMS((bfd *, struct bfd_link_info *));
static boolean elf64_alpha_create_dynamic_sections static boolean elf64_alpha_create_dynamic_sections
@ -1165,7 +1165,7 @@ static void
elf64_alpha_info_to_howto (abfd, cache_ptr, dst) elf64_alpha_info_to_howto (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf64_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
unsigned r_type; unsigned r_type;
@ -2325,7 +2325,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again)
static boolean static boolean
elf64_alpha_section_from_shdr (abfd, hdr, name) elf64_alpha_section_from_shdr (abfd, hdr, name)
bfd *abfd; bfd *abfd;
Elf64_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;
const char *name; const char *name;
{ {
asection *newsect; asection *newsect;
@ -2365,7 +2365,7 @@ elf64_alpha_section_from_shdr (abfd, hdr, name)
static boolean static boolean
elf64_alpha_section_flags (flags, hdr) elf64_alpha_section_flags (flags, hdr)
flagword *flags; flagword *flags;
Elf64_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;
{ {
if (hdr->sh_flags & SHF_ALPHA_GPREL) if (hdr->sh_flags & SHF_ALPHA_GPREL)
*flags |= SEC_SMALL_DATA; *flags |= SEC_SMALL_DATA;
@ -2379,7 +2379,7 @@ elf64_alpha_section_flags (flags, hdr)
static boolean static boolean
elf64_alpha_fake_sections (abfd, hdr, sec) elf64_alpha_fake_sections (abfd, hdr, sec)
bfd *abfd; bfd *abfd;
Elf64_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;
asection *sec; asection *sec;
{ {
register const char *name; register const char *name;
@ -4465,6 +4465,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared && !dynamic_symbol_p) if (info->shared && !dynamic_symbol_p)
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
BFD_ASSERT(srelgot != NULL); BFD_ASSERT(srelgot != NULL);
@ -4474,10 +4475,9 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_info = ELF64_R_INFO (0, R_ALPHA_RELATIVE); outrel.r_info = ELF64_R_INFO (0, R_ALPHA_RELATIVE);
outrel.r_addend = value; outrel.r_addend = value;
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc = srelgot->contents;
((Elf64_External_Rela *) loc += srelgot->reloc_count++ * sizeof (Elf64_External_Rela);
srelgot->contents) bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
+ srelgot->reloc_count++);
BFD_ASSERT (sizeof (Elf64_External_Rela) BFD_ASSERT (sizeof (Elf64_External_Rela)
* srelgot->reloc_count * srelgot->reloc_count
<= srelgot->_cooked_size); <= srelgot->_cooked_size);
@ -4607,6 +4607,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
case R_ALPHA_TPREL64: case R_ALPHA_TPREL64:
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
/* Careful here to remember RELATIVE relocations for global /* Careful here to remember RELATIVE relocations for global
variables for symbolic shared objects. */ variables for symbolic shared objects. */
@ -4659,10 +4660,9 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
else else
memset (&outrel, 0, sizeof outrel); memset (&outrel, 0, sizeof outrel);
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc = srel->contents;
((Elf64_External_Rela *) loc += srel->reloc_count++ * sizeof (Elf64_External_Rela);
srel->contents) bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
+ srel->reloc_count++);
BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
<= srel->_cooked_size); <= srel->_cooked_size);
} }
@ -4708,6 +4708,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared && !dynamic_symbol_p) if (info->shared && !dynamic_symbol_p)
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
BFD_ASSERT(srelgot != NULL); BFD_ASSERT(srelgot != NULL);
@ -4718,10 +4719,9 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_info = ELF64_R_INFO (0, R_ALPHA_DTPMOD64); outrel.r_info = ELF64_R_INFO (0, R_ALPHA_DTPMOD64);
outrel.r_addend = 0; outrel.r_addend = 0;
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc = srelgot->contents;
((Elf64_External_Rela *) loc += srelgot->reloc_count++ * sizeof (Elf64_External_Rela);
srelgot->contents) bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
+ srelgot->reloc_count++);
BFD_ASSERT (sizeof (Elf64_External_Rela) BFD_ASSERT (sizeof (Elf64_External_Rela)
* srelgot->reloc_count * srelgot->reloc_count
<= srelgot->_cooked_size); <= srelgot->_cooked_size);
@ -4880,6 +4880,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Fill in the .plt entry for this symbol. */ /* Fill in the .plt entry for this symbol. */
asection *splt, *sgot, *srel; asection *splt, *sgot, *srel;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
bfd_vma got_addr, plt_addr; bfd_vma got_addr, plt_addr;
bfd_vma plt_index; bfd_vma plt_index;
struct alpha_elf_got_entry *gotent; struct alpha_elf_got_entry *gotent;
@ -4925,9 +4926,8 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
outrel.r_info = ELF64_R_INFO(h->dynindx, R_ALPHA_JMP_SLOT); outrel.r_info = ELF64_R_INFO(h->dynindx, R_ALPHA_JMP_SLOT);
outrel.r_addend = 0; outrel.r_addend = 0;
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc = srel->contents + plt_index * sizeof (Elf64_External_Rela);
((Elf64_External_Rela *)srel->contents bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
+ plt_index));
if (!(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) if (!(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
{ {
@ -4963,10 +4963,9 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE); outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
outrel.r_addend = plt_addr; outrel.r_addend = plt_addr;
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc = srel->contents;
((Elf64_External_Rela *) loc += srel->reloc_count++ * sizeof (Elf64_External_Rela);
srel->contents) bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
+ srel->reloc_count++);
BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
<= srel->_cooked_size); <= srel->_cooked_size);
} }
@ -4981,6 +4980,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
/* Fill in the dynamic relocations for this symbol's .got entries. */ /* Fill in the dynamic relocations for this symbol's .got entries. */
asection *srel; asection *srel;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
struct alpha_elf_got_entry *gotent; struct alpha_elf_got_entry *gotent;
srel = bfd_get_section_by_name (dynobj, ".rela.got"); srel = bfd_get_section_by_name (dynobj, ".rela.got");
@ -5024,18 +5024,18 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym)
outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); outrel.r_info = ELF64_R_INFO (h->dynindx, r_type);
outrel.r_addend = gotent->addend; outrel.r_addend = gotent->addend;
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc = srel->contents;
((Elf64_External_Rela *)srel->contents loc += srel->reloc_count++ * sizeof (Elf64_External_Rela);
+ srel->reloc_count++)); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
if (gotent->reloc_type == R_ALPHA_TLSGD) if (gotent->reloc_type == R_ALPHA_TLSGD)
{ {
outrel.r_offset += 8; outrel.r_offset += 8;
outrel.r_info = ELF64_R_INFO (h->dynindx, R_ALPHA_DTPREL64); outrel.r_info = ELF64_R_INFO (h->dynindx, R_ALPHA_DTPREL64);
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc = srel->contents;
((Elf64_External_Rela *)srel->contents loc += srel->reloc_count++ * sizeof (Elf64_External_Rela);
+ srel->reloc_count++)); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
} }
BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
@ -5504,10 +5504,10 @@ static const struct elf_size_info alpha_elf_size_info =
bfd_elf64_slurp_symbol_table, bfd_elf64_slurp_symbol_table,
bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_in,
bfd_elf64_swap_dyn_out, bfd_elf64_swap_dyn_out,
NULL, bfd_elf64_swap_reloc_in,
NULL, bfd_elf64_swap_reloc_out,
NULL, bfd_elf64_swap_reloca_in,
NULL bfd_elf64_swap_reloca_out
}; };
#define TARGET_LITTLE_SYM bfd_elf64_alpha_vec #define TARGET_LITTLE_SYM bfd_elf64_alpha_vec

View File

@ -41,9 +41,9 @@ static reloc_howto_type dummy =
false); /* pcrel_offset */ false); /* pcrel_offset */
static void elf_generic_info_to_howto static void elf_generic_info_to_howto
PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void elf_generic_info_to_howto_rel static void elf_generic_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf64_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean elf64_generic_link_add_symbols static boolean elf64_generic_link_add_symbols
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
@ -51,7 +51,7 @@ static void
elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc) elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc; arelent *bfd_reloc;
Elf64_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED; Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
{ {
bfd_reloc->howto = &dummy; bfd_reloc->howto = &dummy;
} }
@ -60,7 +60,7 @@ static void
elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc; arelent *bfd_reloc;
Elf64_Internal_Rel *elf_reloc ATTRIBUTE_UNUSED; Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED;
{ {
bfd_reloc->howto = &dummy; bfd_reloc->howto = &dummy;
} }

View File

@ -184,7 +184,7 @@ static boolean elf64_hppa_object_p
PARAMS ((bfd *)); PARAMS ((bfd *));
static boolean elf64_hppa_section_from_shdr static boolean elf64_hppa_section_from_shdr
PARAMS ((bfd *, Elf64_Internal_Shdr *, const char *)); PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
static void elf64_hppa_post_process_headers static void elf64_hppa_post_process_headers
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
@ -408,7 +408,7 @@ elf64_hppa_object_p (abfd)
static boolean static boolean
elf64_hppa_section_from_shdr (abfd, hdr, name) elf64_hppa_section_from_shdr (abfd, hdr, name)
bfd *abfd; bfd *abfd;
Elf64_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;
const char *name; const char *name;
{ {
asection *newsect; asection *newsect;
@ -1991,6 +1991,7 @@ elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
{ {
bfd_vma value; bfd_vma value;
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_byte *loc;
BFD_ASSERT (splt != NULL && spltrel != NULL) BFD_ASSERT (splt != NULL && spltrel != NULL)
@ -2029,11 +2030,9 @@ elf64_hppa_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_info = ELF64_R_INFO (h->dynindx, R_PARISC_IPLT); rel.r_info = ELF64_R_INFO (h->dynindx, R_PARISC_IPLT);
rel.r_addend = 0; rel.r_addend = 0;
bfd_elf64_swap_reloca_out (splt->output_section->owner, &rel, loc = spltrel->contents;
(((Elf64_External_Rela *) loc += spltrel->reloc_count++ * sizeof (Elf64_External_Rela);
spltrel->contents) bfd_elf64_swap_reloca_out (splt->output_section->owner, &rel, loc);
+ spltrel->reloc_count));
spltrel->reloc_count++;
} }
/* Initialize an external call stub entry if requested. */ /* Initialize an external call stub entry if requested. */
@ -2156,7 +2155,8 @@ elf64_hppa_finalize_opd (dyn_h, data)
had their address taken). */ had their address taken). */
if (info->shared && dyn_h && dyn_h->want_opd) if (info->shared && dyn_h && dyn_h->want_opd)
{ {
Elf64_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_byte *loc;
int dynindx; int dynindx;
/* We may need to do a relocation against a local symbol, in /* We may need to do a relocation against a local symbol, in
@ -2221,11 +2221,9 @@ elf64_hppa_finalize_opd (dyn_h, data)
rel.r_addend = 0; rel.r_addend = 0;
rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_EPLT); rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_EPLT);
bfd_elf64_swap_reloca_out (sopd->output_section->owner, &rel, loc = sopdrel->contents;
(((Elf64_External_Rela *) loc += sopdrel->reloc_count++ * sizeof (Elf64_External_Rela);
sopdrel->contents) bfd_elf64_swap_reloca_out (sopd->output_section->owner, &rel, loc);
+ sopdrel->reloc_count));
sopdrel->reloc_count++;
} }
return true; return true;
} }
@ -2291,7 +2289,8 @@ elf64_hppa_finalize_dlt (dyn_h, data)
if (dyn_h->want_dlt if (dyn_h->want_dlt
&& (elf64_hppa_dynamic_symbol_p (dyn_h->h, info) || info->shared)) && (elf64_hppa_dynamic_symbol_p (dyn_h->h, info) || info->shared))
{ {
Elf64_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_byte *loc;
int dynindx; int dynindx;
/* We may need to do a relocation against a local symbol, in /* We may need to do a relocation against a local symbol, in
@ -2315,11 +2314,9 @@ elf64_hppa_finalize_dlt (dyn_h, data)
rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_DIR64); rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_DIR64);
rel.r_addend = 0; rel.r_addend = 0;
bfd_elf64_swap_reloca_out (sdlt->output_section->owner, &rel, loc = sdltrel->contents;
(((Elf64_External_Rela *) loc += sdltrel->reloc_count++ * sizeof (Elf64_External_Rela);
sdltrel->contents) bfd_elf64_swap_reloca_out (sdlt->output_section->owner, &rel, loc);
+ sdltrel->reloc_count));
sdltrel->reloc_count++;
} }
return true; return true;
} }
@ -2362,7 +2359,8 @@ elf64_hppa_finalize_dynreloc (dyn_h, data)
for (rent = dyn_h->reloc_entries; rent; rent = rent->next) for (rent = dyn_h->reloc_entries; rent; rent = rent->next)
{ {
Elf64_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_byte *loc;
/* Allocate one iff we are building a shared library, the relocation /* Allocate one iff we are building a shared library, the relocation
isn't a R_PARISC_FPTR64, or we don't want an opd entry. */ isn't a R_PARISC_FPTR64, or we don't want an opd entry. */
@ -2429,12 +2427,11 @@ elf64_hppa_finalize_dynreloc (dyn_h, data)
rel.r_info = ELF64_R_INFO (dynindx, rent->type); rel.r_info = ELF64_R_INFO (dynindx, rent->type);
loc = hppa_info->other_rel_sec->contents;
loc += (hppa_info->other_rel_sec->reloc_count++
* sizeof (Elf64_External_Rela));
bfd_elf64_swap_reloca_out (hppa_info->other_rel_sec->output_section->owner, bfd_elf64_swap_reloca_out (hppa_info->other_rel_sec->output_section->owner,
&rel, &rel, loc);
(((Elf64_External_Rela *)
hppa_info->other_rel_sec->contents)
+ hppa_info->other_rel_sec->reloc_count));
hppa_info->other_rel_sec->reloc_count++;
} }
} }
@ -2704,10 +2701,10 @@ const struct elf_size_info hppa64_elf_size_info =
bfd_elf64_slurp_symbol_table, bfd_elf64_slurp_symbol_table,
bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_in,
bfd_elf64_swap_dyn_out, bfd_elf64_swap_dyn_out,
NULL, bfd_elf64_swap_reloc_in,
NULL, bfd_elf64_swap_reloc_out,
NULL, bfd_elf64_swap_reloca_in,
NULL bfd_elf64_swap_reloca_out
}; };
#define TARGET_BIG_SYM bfd_elf64_hppa_vec #define TARGET_BIG_SYM bfd_elf64_hppa_vec

View File

@ -63,20 +63,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static void mips_elf64_swap_reloc_in static void mips_elf64_swap_reloc_in
PARAMS ((bfd *, const Elf64_Mips_External_Rel *, PARAMS ((bfd *, const Elf64_Mips_External_Rel *,
Elf64_Mips_Internal_Rel *)); Elf64_Mips_Internal_Rela *));
static void mips_elf64_swap_reloca_in static void mips_elf64_swap_reloca_in
PARAMS ((bfd *, const Elf64_Mips_External_Rela *, PARAMS ((bfd *, const Elf64_Mips_External_Rela *,
Elf64_Mips_Internal_Rela *)); Elf64_Mips_Internal_Rela *));
static void mips_elf64_swap_reloc_out static void mips_elf64_swap_reloc_out
PARAMS ((bfd *, const Elf64_Mips_Internal_Rel *, PARAMS ((bfd *, const Elf64_Mips_Internal_Rela *,
Elf64_Mips_External_Rel *)); Elf64_Mips_External_Rel *));
static void mips_elf64_swap_reloca_out static void mips_elf64_swap_reloca_out
PARAMS ((bfd *, const Elf64_Mips_Internal_Rela *, PARAMS ((bfd *, const Elf64_Mips_Internal_Rela *,
Elf64_Mips_External_Rela *)); Elf64_Mips_External_Rela *));
static void mips_elf64_be_swap_reloc_in static void mips_elf64_be_swap_reloc_in
PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rel *)); PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
static void mips_elf64_be_swap_reloc_out static void mips_elf64_be_swap_reloc_out
PARAMS ((bfd *, const Elf_Internal_Rel *, bfd_byte *)); PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
static void mips_elf64_be_swap_reloca_in static void mips_elf64_be_swap_reloca_in
PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
static void mips_elf64_be_swap_reloca_out static void mips_elf64_be_swap_reloca_out
@ -86,9 +86,9 @@ static reloc_howto_type *bfd_elf64_bfd_reloc_type_lookup
static reloc_howto_type *mips_elf64_rtype_to_howto static reloc_howto_type *mips_elf64_rtype_to_howto
PARAMS ((unsigned int, boolean)); PARAMS ((unsigned int, boolean));
static void mips_elf64_info_to_howto_rel static void mips_elf64_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf64_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void mips_elf64_info_to_howto_rela static void mips_elf64_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static long mips_elf64_get_reloc_upper_bound PARAMS ((bfd *, asection *)); static long mips_elf64_get_reloc_upper_bound PARAMS ((bfd *, asection *));
static boolean mips_elf64_slurp_one_reloc_table static boolean mips_elf64_slurp_one_reloc_table
PARAMS ((bfd *, asection *, asymbol **, const Elf_Internal_Shdr *)); PARAMS ((bfd *, asection *, asymbol **, const Elf_Internal_Shdr *));
@ -1218,7 +1218,7 @@ static void
mips_elf64_swap_reloc_in (abfd, src, dst) mips_elf64_swap_reloc_in (abfd, src, dst)
bfd *abfd; bfd *abfd;
const Elf64_Mips_External_Rel *src; const Elf64_Mips_External_Rel *src;
Elf64_Mips_Internal_Rel *dst; Elf64_Mips_Internal_Rela *dst;
{ {
dst->r_offset = H_GET_64 (abfd, src->r_offset); dst->r_offset = H_GET_64 (abfd, src->r_offset);
dst->r_sym = H_GET_32 (abfd, src->r_sym); dst->r_sym = H_GET_32 (abfd, src->r_sym);
@ -1226,6 +1226,7 @@ mips_elf64_swap_reloc_in (abfd, src, dst)
dst->r_type3 = H_GET_8 (abfd, src->r_type3); dst->r_type3 = H_GET_8 (abfd, src->r_type3);
dst->r_type2 = H_GET_8 (abfd, src->r_type2); dst->r_type2 = H_GET_8 (abfd, src->r_type2);
dst->r_type = H_GET_8 (abfd, src->r_type); dst->r_type = H_GET_8 (abfd, src->r_type);
dst->r_addend = 0;
} }
/* Swap in a MIPS 64-bit Rela reloc. */ /* Swap in a MIPS 64-bit Rela reloc. */
@ -1250,7 +1251,7 @@ mips_elf64_swap_reloca_in (abfd, src, dst)
static void static void
mips_elf64_swap_reloc_out (abfd, src, dst) mips_elf64_swap_reloc_out (abfd, src, dst)
bfd *abfd; bfd *abfd;
const Elf64_Mips_Internal_Rel *src; const Elf64_Mips_Internal_Rela *src;
Elf64_Mips_External_Rel *dst; Elf64_Mips_External_Rel *dst;
{ {
H_PUT_64 (abfd, src->r_offset, dst->r_offset); H_PUT_64 (abfd, src->r_offset, dst->r_offset);
@ -1284,9 +1285,9 @@ static void
mips_elf64_be_swap_reloc_in (abfd, src, dst) mips_elf64_be_swap_reloc_in (abfd, src, dst)
bfd *abfd; bfd *abfd;
const bfd_byte *src; const bfd_byte *src;
Elf_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
Elf64_Mips_Internal_Rel mirel; Elf64_Mips_Internal_Rela mirel;
mips_elf64_swap_reloc_in (abfd, mips_elf64_swap_reloc_in (abfd,
(const Elf64_Mips_External_Rel *) src, (const Elf64_Mips_External_Rel *) src,
@ -1294,10 +1295,13 @@ mips_elf64_be_swap_reloc_in (abfd, src, dst)
dst[0].r_offset = mirel.r_offset; dst[0].r_offset = mirel.r_offset;
dst[0].r_info = ELF64_R_INFO (mirel.r_sym, mirel.r_type); dst[0].r_info = ELF64_R_INFO (mirel.r_sym, mirel.r_type);
dst[0].r_addend = 0;
dst[1].r_offset = mirel.r_offset; dst[1].r_offset = mirel.r_offset;
dst[1].r_info = ELF64_R_INFO (mirel.r_ssym, mirel.r_type2); dst[1].r_info = ELF64_R_INFO (mirel.r_ssym, mirel.r_type2);
dst[1].r_addend = 0;
dst[2].r_offset = mirel.r_offset; dst[2].r_offset = mirel.r_offset;
dst[2].r_info = ELF64_R_INFO (STN_UNDEF, mirel.r_type3); dst[2].r_info = ELF64_R_INFO (STN_UNDEF, mirel.r_type3);
dst[2].r_addend = 0;
} }
/* Swap in a MIPS 64-bit Rela reloc. */ /* Swap in a MIPS 64-bit Rela reloc. */
@ -1330,10 +1334,10 @@ mips_elf64_be_swap_reloca_in (abfd, src, dst)
static void static void
mips_elf64_be_swap_reloc_out (abfd, src, dst) mips_elf64_be_swap_reloc_out (abfd, src, dst)
bfd *abfd; bfd *abfd;
const Elf_Internal_Rel *src; const Elf_Internal_Rela *src;
bfd_byte *dst; bfd_byte *dst;
{ {
Elf64_Mips_Internal_Rel mirel; Elf64_Mips_Internal_Rela mirel;
mirel.r_offset = src[0].r_offset; mirel.r_offset = src[0].r_offset;
BFD_ASSERT(src[0].r_offset == src[1].r_offset); BFD_ASSERT(src[0].r_offset == src[1].r_offset);
@ -1947,7 +1951,7 @@ bfd_elf64_bfd_reloc_type_lookup (abfd, code)
} }
} }
/* Given a MIPS Elf64_Internal_Rel, fill in an arelent structure. */ /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */
static reloc_howto_type * static reloc_howto_type *
mips_elf64_rtype_to_howto (r_type, rela_p) mips_elf64_rtype_to_howto (r_type, rela_p)
@ -1980,7 +1984,7 @@ static void
mips_elf64_info_to_howto_rel (abfd, cache_ptr, dst) mips_elf64_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr ATTRIBUTE_UNUSED; arelent *cache_ptr ATTRIBUTE_UNUSED;
Elf64_Internal_Rel *dst ATTRIBUTE_UNUSED; Elf_Internal_Rela *dst ATTRIBUTE_UNUSED;
{ {
BFD_ASSERT (0); BFD_ASSERT (0);
} }
@ -1989,7 +1993,7 @@ static void
mips_elf64_info_to_howto_rela (abfd, cache_ptr, dst) mips_elf64_info_to_howto_rela (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr ATTRIBUTE_UNUSED; arelent *cache_ptr ATTRIBUTE_UNUSED;
Elf64_Internal_Rela *dst ATTRIBUTE_UNUSED; Elf_Internal_Rela *dst ATTRIBUTE_UNUSED;
{ {
BFD_ASSERT (0); BFD_ASSERT (0);
} }
@ -2058,20 +2062,9 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr)
(Elf64_Mips_External_Rela *) native_relocs, (Elf64_Mips_External_Rela *) native_relocs,
&rela); &rela);
else else
{ mips_elf64_swap_reloc_in (abfd,
Elf64_Mips_Internal_Rel rel; (Elf64_Mips_External_Rel *) native_relocs,
&rela);
mips_elf64_swap_reloc_in (abfd,
(Elf64_Mips_External_Rel *) native_relocs,
&rel);
rela.r_offset = rel.r_offset;
rela.r_sym = rel.r_sym;
rela.r_ssym = rel.r_ssym;
rela.r_type3 = rel.r_type3;
rela.r_type2 = rel.r_type2;
rela.r_type = rel.r_type;
rela.r_addend = 0;
}
/* Each entry represents exactly three actual relocations. */ /* Each entry represents exactly three actual relocations. */
@ -2326,7 +2319,7 @@ mips_elf64_write_rel (abfd, sec, rel_hdr, count, data)
for (idx = 0; idx < sec->reloc_count; idx++, ext_rel++) for (idx = 0; idx < sec->reloc_count; idx++, ext_rel++)
{ {
arelent *ptr; arelent *ptr;
Elf64_Mips_Internal_Rel int_rel; Elf64_Mips_Internal_Rela int_rel;
asymbol *sym; asymbol *sym;
int n; int n;
unsigned int i; unsigned int i;

View File

@ -131,7 +131,7 @@ static reloc_howto_type *bfd_elf64_bfd_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static void mmix_info_to_howto_rela static void mmix_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static int mmix_elf_sort_relocs PARAMS ((const PTR, const PTR)); static int mmix_elf_sort_relocs PARAMS ((const PTR, const PTR));
@ -1063,7 +1063,7 @@ static void
mmix_info_to_howto_rela (abfd, cache_ptr, dst) mmix_info_to_howto_rela (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf64_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -35,7 +35,7 @@ static void ppc_howto_init
static reloc_howto_type *ppc64_elf_reloc_type_lookup static reloc_howto_type *ppc64_elf_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));
static void ppc64_elf_info_to_howto static void ppc64_elf_info_to_howto
PARAMS ((bfd *abfd, arelent *cache_ptr, Elf64_Internal_Rela *dst)); PARAMS ((bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst));
static bfd_reloc_status_type ppc64_elf_ha_reloc static bfd_reloc_status_type ppc64_elf_ha_reloc
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
static bfd_reloc_status_type ppc64_elf_brtaken_reloc static bfd_reloc_status_type ppc64_elf_brtaken_reloc
@ -1351,7 +1351,7 @@ static void
ppc64_elf_info_to_howto (abfd, cache_ptr, dst) ppc64_elf_info_to_howto (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf64_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
unsigned int type; unsigned int type;
@ -4471,7 +4471,7 @@ ppc_build_one_stub (gen_entry, in_arg)
{ {
/* Create a reloc for the branch lookup table entry. */ /* Create a reloc for the branch lookup table entry. */
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf64_External_Rela *r; bfd_byte *loc;
rela.r_offset = (br_entry->offset rela.r_offset = (br_entry->offset
+ htab->sbrlt->output_offset + htab->sbrlt->output_offset
@ -4479,9 +4479,9 @@ ppc_build_one_stub (gen_entry, in_arg)
rela.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); rela.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE);
rela.r_addend = off; rela.r_addend = off;
r = (Elf64_External_Rela *) htab->srelbrlt->contents; loc = htab->srelbrlt->contents;
r += htab->srelbrlt->reloc_count++; loc += htab->srelbrlt->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (htab->srelbrlt->owner, &rela, r); bfd_elf64_swap_reloca_out (htab->srelbrlt->owner, &rela, loc);
} }
off = (br_entry->offset off = (br_entry->offset
@ -5618,7 +5618,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared) if (info->shared)
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
Elf64_External_Rela *loc; bfd_byte *loc;
/* We need to generate a R_PPC64_RELATIVE reloc /* We need to generate a R_PPC64_RELATIVE reloc
for the dynamic linker. */ for the dynamic linker. */
@ -5627,8 +5627,9 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+ off); + off);
outrel.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); outrel.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE);
outrel.r_addend = relocation; outrel.r_addend = relocation;
loc = (Elf64_External_Rela *) htab->srelgot->contents; loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++; loc += (htab->srelgot->reloc_count++
* sizeof (Elf64_External_Rela));
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
} }
@ -5763,7 +5764,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
boolean skip, relocate; boolean skip, relocate;
asection *sreloc; asection *sreloc;
Elf64_External_Rela *loc; bfd_byte *loc;
/* When generating a dynamic object, these relocations /* When generating a dynamic object, these relocations
are copied into the output file to be resolved at run are copied into the output file to be resolved at run
@ -5853,8 +5854,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (sreloc == NULL) if (sreloc == NULL)
abort (); abort ();
loc = (Elf64_External_Rela *) sreloc->contents; loc = sreloc->contents;
loc += sreloc->reloc_count++; loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
/* If this reloc is against an external symbol, it will /* If this reloc is against an external symbol, it will
@ -6065,7 +6066,7 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
&& ((struct ppc_link_hash_entry *) h)->is_func_descriptor) && ((struct ppc_link_hash_entry *) h)->is_func_descriptor)
{ {
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf64_External_Rela *loc; bfd_byte *loc;
/* This symbol has an entry in the procedure linkage table. Set /* This symbol has an entry in the procedure linkage table. Set
it up. */ it up. */
@ -6084,15 +6085,16 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_JMP_SLOT); rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_JMP_SLOT);
rela.r_addend = 0; rela.r_addend = 0;
loc = (Elf64_External_Rela *) htab->srelplt->contents; loc = htab->srelplt->contents;
loc += (h->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE; loc += ((h->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE
* sizeof (Elf64_External_Rela));
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
} }
if (h->got.offset != (bfd_vma) -1) if (h->got.offset != (bfd_vma) -1)
{ {
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf64_External_Rela *loc; bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
@ -6130,15 +6132,15 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
rela.r_addend = 0; rela.r_addend = 0;
} }
loc = (Elf64_External_Rela *) htab->srelgot->contents; loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++; loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf64_External_Rela *loc; bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */ /* This symbol needs a copy reloc. Set it up. */
@ -6153,8 +6155,8 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_COPY); rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_COPY);
rela.r_addend = 0; rela.r_addend = 0;
loc = (Elf64_External_Rela *) htab->srelbss->contents; loc = htab->srelbss->contents;
loc += htab->srelbss->reloc_count++; loc += htab->srelbss->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
} }

View File

@ -606,7 +606,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
switch (ELF64_R_TYPE (rel->r_info)) switch (ELF64_R_TYPE (rel->r_info))
{ {
case R_390_GOT12: case R_390_GOT12:
case R_390_GOT16: case R_390_GOT16:
case R_390_GOT32: case R_390_GOT32:
case R_390_GOT64: case R_390_GOT64:
case R_390_GOTENT: case R_390_GOTENT:
@ -649,19 +649,19 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
} }
break; break;
case R_390_PLT16DBL: case R_390_PLT16DBL:
case R_390_PLT32: case R_390_PLT32:
case R_390_PLT32DBL: case R_390_PLT32DBL:
case R_390_PLT64: case R_390_PLT64:
/* This symbol requires a procedure linkage table entry. We /* This symbol requires a procedure linkage table entry. We
actually build the entry in adjust_dynamic_symbol, actually build the entry in adjust_dynamic_symbol,
because this might be a case of linking PIC code which is because this might be a case of linking PIC code which is
never referenced by a dynamic object, in which case we never referenced by a dynamic object, in which case we
don't need to generate a procedure linkage table entry don't need to generate a procedure linkage table entry
after all. */ after all. */
/* If this is a local symbol, we resolve it directly without /* If this is a local symbol, we resolve it directly without
creating a procedure linkage table entry. */ creating a procedure linkage table entry. */
if (h == NULL) if (h == NULL)
continue; continue;
@ -669,12 +669,12 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
h->plt.refcount += 1; h->plt.refcount += 1;
break; break;
case R_390_8: case R_390_8:
case R_390_16: case R_390_16:
case R_390_32: case R_390_32:
case R_390_64: case R_390_64:
case R_390_PC16: case R_390_PC16:
case R_390_PC16DBL: case R_390_PC16DBL:
case R_390_PC32: case R_390_PC32:
case R_390_PC32DBL: case R_390_PC32DBL:
case R_390_PC64: case R_390_PC64:
@ -831,17 +831,17 @@ elf_s390_check_relocs (abfd, info, sec, relocs)
/* This relocation describes the C++ object vtable hierarchy. /* This relocation describes the C++ object vtable hierarchy.
Reconstruct it for later use during GC. */ Reconstruct it for later use during GC. */
case R_390_GNU_VTINHERIT: case R_390_GNU_VTINHERIT:
if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
return false; return false;
break; break;
/* This relocation describes which C++ vtable entries are actually /* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */ used. Record for later use during GC. */
case R_390_GNU_VTENTRY: case R_390_GNU_VTENTRY:
if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return false; return false;
break; break;
default: default:
break; break;
@ -1029,8 +1029,8 @@ elf_s390_adjust_dynamic_symbol (info, h)
&& h->root.type != bfd_link_hash_undefined)) && h->root.type != bfd_link_hash_undefined))
{ {
/* This case can occur if we saw a PLT32 reloc in an input /* This case can occur if we saw a PLT32 reloc in an input
file, but the symbol was never referred to by a dynamic file, but the symbol was never referred to by a dynamic
object, or if all references were garbage collected. In object, or if all references were garbage collected. In
such a case, we don't actually need to build a procedure such a case, we don't actually need to build a procedure
linkage table, and we can just do a PC32 reloc instead. */ linkage table, and we can just do a PC32 reloc instead. */
h->plt.offset = (bfd_vma) -1; h->plt.offset = (bfd_vma) -1;
@ -1540,10 +1540,10 @@ elf_s390_size_dynamic_sections (output_bfd, info)
} }
if (relocs) if (relocs)
{ {
if (!add_dynamic_entry (DT_RELA, 0) if (!add_dynamic_entry (DT_RELA, 0)
|| !add_dynamic_entry (DT_RELASZ, 0) || !add_dynamic_entry (DT_RELASZ, 0)
|| !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela)))
return false; return false;
/* If any dynamic relocs apply to a read-only section, /* If any dynamic relocs apply to a read-only section,
@ -1610,8 +1610,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
r_type = ELF64_R_TYPE (rel->r_info); r_type = ELF64_R_TYPE (rel->r_info);
if (r_type == (int) R_390_GNU_VTINHERIT if (r_type == (int) R_390_GNU_VTINHERIT
|| r_type == (int) R_390_GNU_VTENTRY) || r_type == (int) R_390_GNU_VTENTRY)
continue; continue;
if (r_type < 0 || r_type >= (int) R_390_max) if (r_type < 0 || r_type >= (int) R_390_max)
{ {
bfd_set_error (bfd_error_bad_value); bfd_set_error (bfd_error_bad_value);
@ -1666,7 +1666,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
{ {
if (! ((*info->callbacks->undefined_symbol) if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, (info, h->root.root.string, input_bfd,
input_section, rel->r_offset, input_section, rel->r_offset,
(!info->shared || info->no_undefined (!info->shared || info->no_undefined
|| ELF_ST_VISIBILITY (h->other))))) || ELF_ST_VISIBILITY (h->other)))))
return false; return false;
@ -1676,93 +1676,93 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
switch (r_type) switch (r_type)
{ {
case R_390_GOT12: case R_390_GOT12:
case R_390_GOT16: case R_390_GOT16:
case R_390_GOT32: case R_390_GOT32:
case R_390_GOT64: case R_390_GOT64:
case R_390_GOTENT: case R_390_GOTENT:
/* Relocation is to the entry for this symbol in the global /* Relocation is to the entry for this symbol in the global
offset table. */ offset table. */
if (htab->sgot == NULL) if (htab->sgot == NULL)
abort (); abort ();
if (h != NULL) if (h != NULL)
{ {
boolean dyn; boolean dyn;
off = h->got.offset; off = h->got.offset;
dyn = htab->elf.dynamic_sections_created; dyn = htab->elf.dynamic_sections_created;
if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
|| (info->shared || (info->shared
&& (info->symbolic && (info->symbolic
|| h->dynindx == -1 || h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
{ {
/* This is actually a static link, or it is a /* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined -Bsymbolic link and the symbol is defined
locally, or the symbol was forced to be local locally, or the symbol was forced to be local
because of a version file. We must initialize because of a version file. We must initialize
this entry in the global offset table. Since the this entry in the global offset table. Since the
offset must always be a multiple of 2, we use the offset must always be a multiple of 2, we use the
least significant bit to record whether we have least significant bit to record whether we have
initialized it already. initialized it already.
When doing a dynamic link, we create a .rel.got When doing a dynamic link, we create a .rel.got
relocation entry to initialize the value. This relocation entry to initialize the value. This
is done in the finish_dynamic_symbol routine. */ is done in the finish_dynamic_symbol routine. */
if ((off & 1) != 0) if ((off & 1) != 0)
off &= ~1; off &= ~1;
else else
{ {
bfd_put_64 (output_bfd, relocation, bfd_put_64 (output_bfd, relocation,
htab->sgot->contents + off); htab->sgot->contents + off);
h->got.offset |= 1; h->got.offset |= 1;
} }
} }
else else
unresolved_reloc = false; unresolved_reloc = false;
} }
else else
{ {
if (local_got_offsets == NULL) if (local_got_offsets == NULL)
abort (); abort ();
off = local_got_offsets[r_symndx]; off = local_got_offsets[r_symndx];
/* The offset must always be a multiple of 8. We use /* The offset must always be a multiple of 8. We use
the least significant bit to record whether we have the least significant bit to record whether we have
already generated the necessary reloc. */ already generated the necessary reloc. */
if ((off & 1) != 0) if ((off & 1) != 0)
off &= ~1; off &= ~1;
else else
{ {
bfd_put_64 (output_bfd, relocation, bfd_put_64 (output_bfd, relocation,
htab->sgot->contents + off); htab->sgot->contents + off);
if (info->shared) if (info->shared)
{ {
asection *srelgot; asection *s;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
Elf64_External_Rela *loc; bfd_byte *loc;
srelgot = htab->srelgot; s = htab->srelgot;
if (srelgot == NULL) if (s == NULL)
abort (); abort ();
outrel.r_offset = (htab->sgot->output_section->vma outrel.r_offset = (htab->sgot->output_section->vma
+ htab->sgot->output_offset + htab->sgot->output_offset
+ off); + off);
outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE);
outrel.r_addend = relocation; outrel.r_addend = relocation;
loc = (Elf64_External_Rela *) srelgot->contents; loc = s->contents;
loc += srelgot->reloc_count++; loc += s->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
} }
local_got_offsets[r_symndx] |= 1; local_got_offsets[r_symndx] |= 1;
} }
} }
if (off >= (bfd_vma) -2) if (off >= (bfd_vma) -2)
abort (); abort ();
@ -1778,72 +1778,72 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
if (r_type == R_390_GOTENT) if (r_type == R_390_GOTENT)
relocation += htab->sgot->output_section->vma; relocation += htab->sgot->output_section->vma;
break; break;
case R_390_GOTOFF: case R_390_GOTOFF:
/* Relocation is relative to the start of the global offset /* Relocation is relative to the start of the global offset
table. */ table. */
/* Note that sgot->output_offset is not involved in this /* Note that sgot->output_offset is not involved in this
calculation. We always want the start of .got. If we calculation. We always want the start of .got. If we
defined _GLOBAL_OFFSET_TABLE in a different way, as is defined _GLOBAL_OFFSET_TABLE in a different way, as is
permitted by the ABI, we might have to change this permitted by the ABI, we might have to change this
calculation. */ calculation. */
relocation -= htab->sgot->output_section->vma; relocation -= htab->sgot->output_section->vma;
break; break;
case R_390_GOTPC: case R_390_GOTPC:
case R_390_GOTPCDBL: case R_390_GOTPCDBL:
/* Use global offset table as symbol value. */ /* Use global offset table as symbol value. */
relocation = htab->sgot->output_section->vma; relocation = htab->sgot->output_section->vma;
unresolved_reloc = false; unresolved_reloc = false;
break; break;
case R_390_PLT16DBL: case R_390_PLT16DBL:
case R_390_PLT32: case R_390_PLT32:
case R_390_PLT32DBL: case R_390_PLT32DBL:
case R_390_PLT64: case R_390_PLT64:
/* Relocation is to the entry for this symbol in the /* Relocation is to the entry for this symbol in the
procedure linkage table. */ procedure linkage table. */
/* Resolve a PLT32 reloc against a local symbol directly, /* Resolve a PLT32 reloc against a local symbol directly,
without using the procedure linkage table. */ without using the procedure linkage table. */
if (h == NULL) if (h == NULL)
break; break;
if (h->plt.offset == (bfd_vma) -1 if (h->plt.offset == (bfd_vma) -1
|| htab->splt == NULL) || htab->splt == NULL)
{ {
/* We didn't make a PLT entry for this symbol. This /* We didn't make a PLT entry for this symbol. This
happens when statically linking PIC code, or when happens when statically linking PIC code, or when
using -Bsymbolic. */ using -Bsymbolic. */
break; break;
} }
relocation = (htab->splt->output_section->vma relocation = (htab->splt->output_section->vma
+ htab->splt->output_offset + htab->splt->output_offset
+ h->plt.offset); + h->plt.offset);
unresolved_reloc = false; unresolved_reloc = false;
break; break;
case R_390_8: case R_390_8:
case R_390_16: case R_390_16:
case R_390_32: case R_390_32:
case R_390_64: case R_390_64:
case R_390_PC16: case R_390_PC16:
case R_390_PC16DBL: case R_390_PC16DBL:
case R_390_PC32: case R_390_PC32:
case R_390_PC32DBL: case R_390_PC32DBL:
case R_390_PC64: case R_390_PC64:
/* r_symndx will be zero only for relocs against symbols /* r_symndx will be zero only for relocs against symbols
from removed linkonce sections, or sections discarded by from removed linkonce sections, or sections discarded by
a linker script. */ a linker script. */
if (r_symndx == 0 if (r_symndx == 0
|| (input_section->flags & SEC_ALLOC) == 0) || (input_section->flags & SEC_ALLOC) == 0)
break; break;
if ((info->shared if ((info->shared
&& ((r_type != R_390_PC16 && ((r_type != R_390_PC16
&& r_type != R_390_PC16DBL && r_type != R_390_PC16DBL
&& r_type != R_390_PC32 && r_type != R_390_PC32
@ -1864,18 +1864,18 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
& ELF_LINK_HASH_DEF_REGULAR) == 0) & ELF_LINK_HASH_DEF_REGULAR) == 0)
|| h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_undefweak
|| h->root.type == bfd_link_hash_undefined))) || h->root.type == bfd_link_hash_undefined)))
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
boolean skip, relocate; boolean skip, relocate;
asection *sreloc; asection *sreloc;
Elf64_External_Rela *loc; bfd_byte *loc;
/* When generating a shared object, these relocations /* When generating a shared object, these relocations
are copied into the output file to be resolved at run are copied into the output file to be resolved at run
time. */ time. */
skip = false; skip = false;
relocate = false; relocate = false;
outrel.r_offset = outrel.r_offset =
_bfd_elf_section_offset (output_bfd, info, input_section, _bfd_elf_section_offset (output_bfd, info, input_section,
@ -1885,12 +1885,12 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
else if (outrel.r_offset == (bfd_vma) -2) else if (outrel.r_offset == (bfd_vma) -2)
skip = true, relocate = true; skip = true, relocate = true;
outrel.r_offset += (input_section->output_section->vma outrel.r_offset += (input_section->output_section->vma
+ input_section->output_offset); + input_section->output_offset);
if (skip) if (skip)
memset (&outrel, 0, sizeof outrel); memset (&outrel, 0, sizeof outrel);
else if (h != NULL else if (h != NULL
&& h->dynindx != -1 && h->dynindx != -1
&& (r_type == R_390_PC16 && (r_type == R_390_PC16
|| r_type == R_390_PC16DBL || r_type == R_390_PC16DBL
@ -1901,12 +1901,12 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
|| !info->symbolic || !info->symbolic
|| (h->elf_link_hash_flags || (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0)) & ELF_LINK_HASH_DEF_REGULAR) == 0))
{ {
outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); outrel.r_info = ELF64_R_INFO (h->dynindx, r_type);
outrel.r_addend = rel->r_addend; outrel.r_addend = rel->r_addend;
} }
else else
{ {
/* This symbol is local, or marked to become local. */ /* This symbol is local, or marked to become local. */
relocate = true; relocate = true;
outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE);
@ -1917,23 +1917,23 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
if (sreloc == NULL) if (sreloc == NULL)
abort (); abort ();
loc = (Elf64_External_Rela *) sreloc->contents; loc = sreloc->contents;
loc += sreloc->reloc_count++; loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
/* If this reloc is against an external symbol, we do /* If this reloc is against an external symbol, we do
not want to fiddle with the addend. Otherwise, we not want to fiddle with the addend. Otherwise, we
need to include the symbol value so that it becomes need to include the symbol value so that it becomes
an addend for the dynamic reloc. */ an addend for the dynamic reloc. */
if (! relocate) if (! relocate)
continue; continue;
} }
break; break;
default: default:
break; break;
} }
/* Dynamic relocs are not propagated for SEC_DEBUGGING sections /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
because such sections are not SEC_ALLOC and thus ld.so will because such sections are not SEC_ALLOC and thus ld.so will
@ -2011,10 +2011,10 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_vma plt_index; bfd_vma plt_index;
bfd_vma got_offset; bfd_vma got_offset;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf64_External_Rela *loc; bfd_byte *loc;
/* This symbol has an entry in the procedure linkage table. Set /* This symbol has an entry in the procedure linkage table. Set
it up. */ it up. */
if (h->dynindx == -1 if (h->dynindx == -1
|| htab->splt == NULL || htab->splt == NULL
@ -2023,11 +2023,11 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
abort (); abort ();
/* Calc. index no. /* Calc. index no.
Current offset - size first entry / entry size. */ Current offset - size first entry / entry size. */
plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE;
/* Offset in GOT is PLT index plus GOT headers(3) times 8, /* Offset in GOT is PLT index plus GOT headers(3) times 8,
addr & GOT addr. */ addr & GOT addr. */
got_offset = (plt_index + 3) * GOT_ENTRY_SIZE; got_offset = (plt_index + 3) * GOT_ENTRY_SIZE;
/* Fill in the blueprint of a PLT. */ /* Fill in the blueprint of a PLT. */
@ -2062,7 +2062,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
htab->splt->contents + h->plt.offset + 28); htab->splt->contents + h->plt.offset + 28);
/* Fill in the entry in the global offset table. /* Fill in the entry in the global offset table.
Points to instruction after GOT offset. */ Points to instruction after GOT offset. */
bfd_put_64 (output_bfd, bfd_put_64 (output_bfd,
(htab->splt->output_section->vma (htab->splt->output_section->vma
+ htab->splt->output_offset + htab->splt->output_offset
@ -2076,7 +2076,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
+ got_offset); + got_offset);
rela.r_info = ELF64_R_INFO (h->dynindx, R_390_JMP_SLOT); rela.r_info = ELF64_R_INFO (h->dynindx, R_390_JMP_SLOT);
rela.r_addend = 0; rela.r_addend = 0;
loc = (Elf64_External_Rela *) htab->srelplt->contents + plt_index; loc = htab->srelplt->contents + plt_index * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
@ -2093,10 +2093,10 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
if (h->got.offset != (bfd_vma) -1) if (h->got.offset != (bfd_vma) -1)
{ {
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf64_External_Rela *loc; bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
if (htab->sgot == NULL || htab->srelgot == NULL) if (htab->sgot == NULL || htab->srelgot == NULL)
abort (); abort ();
@ -2115,30 +2115,30 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
|| h->dynindx == -1 || h->dynindx == -1
|| (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
{ {
BFD_ASSERT((h->got.offset & 1) != 0); BFD_ASSERT((h->got.offset & 1) != 0);
rela.r_info = ELF64_R_INFO (0, R_390_RELATIVE); rela.r_info = ELF64_R_INFO (0, R_390_RELATIVE);
rela.r_addend = (h->root.u.def.value rela.r_addend = (h->root.u.def.value
+ h->root.u.def.section->output_section->vma + h->root.u.def.section->output_section->vma
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
} }
else else
{ {
BFD_ASSERT((h->got.offset & 1) == 0); BFD_ASSERT((h->got.offset & 1) == 0);
bfd_put_64 (output_bfd, (bfd_vma) 0, htab->sgot->contents + h->got.offset); bfd_put_64 (output_bfd, (bfd_vma) 0, htab->sgot->contents + h->got.offset);
rela.r_info = ELF64_R_INFO (h->dynindx, R_390_GLOB_DAT); rela.r_info = ELF64_R_INFO (h->dynindx, R_390_GLOB_DAT);
rela.r_addend = 0; rela.r_addend = 0;
} }
loc = (Elf64_External_Rela *) htab->srelgot->contents; loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++; loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf64_External_Rela *loc; bfd_byte *loc;
/* This symbols needs a copy reloc. Set it up. */ /* This symbols needs a copy reloc. Set it up. */
@ -2153,8 +2153,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rela.r_info = ELF64_R_INFO (h->dynindx, R_390_COPY); rela.r_info = ELF64_R_INFO (h->dynindx, R_390_COPY);
rela.r_addend = 0; rela.r_addend = 0;
loc = (Elf64_External_Rela *) htab->srelbss->contents; loc = htab->srelbss->contents;
loc += htab->srelbss->reloc_count++; loc += htab->srelbss->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
} }
@ -2331,8 +2331,8 @@ const struct elf_size_info s390_elf64_size_info =
sizeof (Elf64_External_Sym), sizeof (Elf64_External_Sym),
sizeof (Elf64_External_Dyn), sizeof (Elf64_External_Dyn),
sizeof (Elf_External_Note), sizeof (Elf_External_Note),
8, /* hash-table entry size */ 8, /* hash-table entry size */
1, /* internal relocations per external relocations */ 1, /* internal relocations per external relocations */
64, /* arch_size */ 64, /* arch_size */
8, /* file_align */ 8, /* file_align */
ELFCLASS64, EV_CURRENT, ELFCLASS64, EV_CURRENT,
@ -2345,10 +2345,10 @@ const struct elf_size_info s390_elf64_size_info =
bfd_elf64_slurp_symbol_table, bfd_elf64_slurp_symbol_table,
bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_in,
bfd_elf64_swap_dyn_out, bfd_elf64_swap_dyn_out,
NULL, bfd_elf64_swap_reloc_in,
NULL, bfd_elf64_swap_reloc_out,
NULL, bfd_elf64_swap_reloca_in,
NULL bfd_elf64_swap_reloca_out
}; };
#define TARGET_BIG_SYM bfd_elf64_s390_vec #define TARGET_BIG_SYM bfd_elf64_s390_vec
@ -2388,6 +2388,6 @@ const struct elf_size_info s390_elf64_size_info =
#define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections
#define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_reloc_type_class elf_s390_reloc_type_class
#define elf_backend_object_p elf_s390_object_p #define elf_backend_object_p elf_s390_object_p
#include "elf64-target.h" #include "elf64-target.h"

View File

@ -1755,6 +1755,7 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section,
& ELF_LINK_HASH_DEF_REGULAR) == 0)))) & ELF_LINK_HASH_DEF_REGULAR) == 0))))
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
boolean skip, relocate; boolean skip, relocate;
/* When generating a shared object, these relocations /* When generating a shared object, these relocations
@ -1825,11 +1826,9 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section,
} }
} }
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc = sreloc->contents;
(((Elf64_External_Rela *) loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela);
sreloc->contents) bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
+ sreloc->reloc_count));
++sreloc->reloc_count;
/* If this reloc is against an external symbol, we do /* If this reloc is against an external symbol, we do
not want to fiddle with the addend. Otherwise, we not want to fiddle with the addend. Otherwise, we
@ -1978,22 +1977,21 @@ sh_elf64_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared) if (info->shared)
{ {
asection *srelgot; asection *s;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); s = bfd_get_section_by_name (dynobj, ".rela.got");
BFD_ASSERT (srelgot != NULL); BFD_ASSERT (s != NULL);
outrel.r_offset = (sgot->output_section->vma outrel.r_offset = (sgot->output_section->vma
+ sgot->output_offset + sgot->output_offset
+ off); + off);
outrel.r_info = ELF64_R_INFO (0, R_SH_RELATIVE64); outrel.r_info = ELF64_R_INFO (0, R_SH_RELATIVE64);
outrel.r_addend = relocation; outrel.r_addend = relocation;
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc = s->contents;
(((Elf64_External_Rela *) loc += s->reloc_count++ * sizeof (Elf64_External_Rela);
srelgot->contents) bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
+ srelgot->reloc_count));
++srelgot->reloc_count;
} }
if (rel->r_addend) if (rel->r_addend)
@ -3827,6 +3825,7 @@ sh64_elf64_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_vma plt_index; bfd_vma plt_index;
bfd_vma got_offset; bfd_vma got_offset;
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_byte *loc;
/* This symbol has an entry in the procedure linkage table. Set /* This symbol has an entry in the procedure linkage table. Set
it up. */ it up. */
@ -3915,9 +3914,8 @@ sh64_elf64_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_info = ELF64_R_INFO (h->dynindx, R_SH_JMP_SLOT64); rel.r_info = ELF64_R_INFO (h->dynindx, R_SH_JMP_SLOT64);
rel.r_addend = 0; rel.r_addend = 0;
rel.r_addend = GOT_BIAS; rel.r_addend = GOT_BIAS;
bfd_elf64_swap_reloca_out (output_bfd, &rel, loc = srel->contents + plt_index * sizeof (Elf64_External_Rela);
((Elf64_External_Rela *) srel->contents bfd_elf64_swap_reloca_out (output_bfd, &rel, loc);
+ plt_index));
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{ {
@ -3932,6 +3930,7 @@ sh64_elf64_finish_dynamic_symbol (output_bfd, info, h, sym)
asection *sgot; asection *sgot;
asection *srel; asection *srel;
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
@ -3965,16 +3964,16 @@ sh64_elf64_finish_dynamic_symbol (output_bfd, info, h, sym)
rel.r_addend = 0; rel.r_addend = 0;
} }
bfd_elf64_swap_reloca_out (output_bfd, &rel, loc = srel->contents;
((Elf64_External_Rela *) srel->contents loc += srel->reloc_count++ * sizeof (Elf64_External_Rela);
+ srel->reloc_count)); bfd_elf64_swap_reloca_out (output_bfd, &rel, loc);
++srel->reloc_count;
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
asection *s; asection *s;
Elf_Internal_Rela rel; Elf_Internal_Rela rel;
bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */ /* This symbol needs a copy reloc. Set it up. */
@ -3991,10 +3990,9 @@ sh64_elf64_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rel.r_info = ELF64_R_INFO (h->dynindx, R_SH_COPY64); rel.r_info = ELF64_R_INFO (h->dynindx, R_SH_COPY64);
rel.r_addend = 0; rel.r_addend = 0;
bfd_elf64_swap_reloca_out (output_bfd, &rel, loc = s->contents;
((Elf64_External_Rela *) s->contents loc += s->reloc_count++ * sizeof (Elf64_External_Rela);
+ s->reloc_count)); bfd_elf64_swap_reloca_out (output_bfd, &rel, loc);
++s->reloc_count;
} }
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */

View File

@ -73,7 +73,7 @@ static boolean sparc64_elf_merge_private_bfd_data
PARAMS ((bfd *, bfd *)); PARAMS ((bfd *, bfd *));
static boolean sparc64_elf_fake_sections static boolean sparc64_elf_fake_sections
PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
static const char *sparc64_elf_print_symbol_all static const char *sparc64_elf_print_symbol_all
PARAMS ((bfd *, PTR, asymbol *)); PARAMS ((bfd *, PTR, asymbol *));
@ -255,7 +255,7 @@ static void
sparc64_elf_info_to_howto (abfd, cache_ptr, dst) sparc64_elf_info_to_howto (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf64_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
BFD_ASSERT (ELF64_R_TYPE_ID (dst->r_info) < (unsigned int) R_SPARC_max_std); BFD_ASSERT (ELF64_R_TYPE_ID (dst->r_info) < (unsigned int) R_SPARC_max_std);
cache_ptr->howto = &sparc64_elf_howto_table[ELF64_R_TYPE_ID (dst->r_info)]; cache_ptr->howto = &sparc64_elf_howto_table[ELF64_R_TYPE_ID (dst->r_info)];
@ -323,7 +323,7 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic)
{ {
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_elf64_swap_reloca_in (abfd, (Elf64_External_Rela *) native_relocs, &rela); bfd_elf64_swap_reloca_in (abfd, native_relocs, &rela);
/* The address of an ELF reloc is section relative for an object /* The address of an ELF reloc is section relative for an object
file, and absolute for an executable file or shared library. file, and absolute for an executable file or shared library.
@ -626,7 +626,7 @@ sparc64_elf_write_relocs (abfd, sec, data)
dst_rela.r_info = ELF64_R_INFO (n, ptr->howto->type); dst_rela.r_info = ELF64_R_INFO (n, ptr->howto->type);
dst_rela.r_addend = ptr->addend; dst_rela.r_addend = ptr->addend;
bfd_elf64_swap_reloca_out (abfd, &dst_rela, src_rela); bfd_elf64_swap_reloca_out (abfd, &dst_rela, (bfd_byte *) src_rela);
++src_rela; ++src_rela;
} }
} }
@ -2073,6 +2073,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
case R_SPARC_UA16: case R_SPARC_UA16:
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
boolean skip, relocate; boolean skip, relocate;
if (sreloc == NULL) if (sreloc == NULL)
@ -2224,11 +2225,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
} }
} }
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc = sreloc->contents;
(((Elf64_External_Rela *) loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela);
sreloc->contents) bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
+ sreloc->reloc_count));
++sreloc->reloc_count;
/* This reloc will be computed at runtime, so there's no /* This reloc will be computed at runtime, so there's no
need to do anything now. */ need to do anything now. */
@ -2308,8 +2307,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared) if (info->shared)
{ {
asection *srelgot; asection *s;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
/* The Solaris 2.7 64-bit linker adds the contents /* The Solaris 2.7 64-bit linker adds the contents
of the location to the value of the reloc. of the location to the value of the reloc.
@ -2321,19 +2321,17 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* We need to generate a R_SPARC_RELATIVE reloc /* We need to generate a R_SPARC_RELATIVE reloc
for the dynamic linker. */ for the dynamic linker. */
srelgot = bfd_get_section_by_name(dynobj, ".rela.got"); s = bfd_get_section_by_name(dynobj, ".rela.got");
BFD_ASSERT (srelgot != NULL); BFD_ASSERT (s != NULL);
outrel.r_offset = (sgot->output_section->vma outrel.r_offset = (sgot->output_section->vma
+ sgot->output_offset + sgot->output_offset
+ off); + off);
outrel.r_info = ELF64_R_INFO (0, R_SPARC_RELATIVE); outrel.r_info = ELF64_R_INFO (0, R_SPARC_RELATIVE);
outrel.r_addend = relocation; outrel.r_addend = relocation;
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc = s->contents;
(((Elf64_External_Rela *) loc += s->reloc_count++ * sizeof (Elf64_External_Rela);
srelgot->contents) bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
+ srelgot->reloc_count));
++srelgot->reloc_count;
} }
else else
bfd_put_64 (output_bfd, relocation, sgot->contents + off); bfd_put_64 (output_bfd, relocation, sgot->contents + off);
@ -2647,6 +2645,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
asection *splt; asection *splt;
asection *srela; asection *srela;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbol has an entry in the PLT. Set it up. */ /* This symbol has an entry in the PLT. Set it up. */
@ -2678,9 +2677,9 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
Sun forgot to read their own ABI and copied elf32-sparc behaviour, Sun forgot to read their own ABI and copied elf32-sparc behaviour,
thus .plt[4] has corresponding .rela.plt[0] and so on. */ thus .plt[4] has corresponding .rela.plt[0] and so on. */
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc = srela->contents;
((Elf64_External_Rela *) srela->contents loc += (h->plt.offset - 4) * sizeof (Elf64_External_Rela);
+ (h->plt.offset - 4))); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{ {
@ -2702,6 +2701,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
asection *sgot; asection *sgot;
asection *srela; asection *srela;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbol has an entry in the GOT. Set it up. */ /* This symbol has an entry in the GOT. Set it up. */
@ -2736,16 +2736,16 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_put_64 (output_bfd, (bfd_vma) 0, bfd_put_64 (output_bfd, (bfd_vma) 0,
sgot->contents + (h->got.offset &~ (bfd_vma) 1)); sgot->contents + (h->got.offset &~ (bfd_vma) 1));
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc = srela->contents;
((Elf64_External_Rela *) srela->contents loc += srela->reloc_count++ * sizeof (Elf64_External_Rela);
+ srela->reloc_count)); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
++srela->reloc_count;
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
asection *s; asection *s;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
bfd_byte *loc;
/* This symbols needs a copy reloc. Set it up. */ /* This symbols needs a copy reloc. Set it up. */
@ -2760,10 +2760,8 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rela.r_info = ELF64_R_INFO (h->dynindx, R_SPARC_COPY); rela.r_info = ELF64_R_INFO (h->dynindx, R_SPARC_COPY);
rela.r_addend = 0; rela.r_addend = 0;
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc = s->contents + s->reloc_count++ * sizeof (Elf64_External_Rela);
((Elf64_External_Rela *) s->contents bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
+ s->reloc_count));
++s->reloc_count;
} }
/* Mark some specially defined symbols as absolute. */ /* Mark some specially defined symbols as absolute. */
@ -2993,7 +2991,7 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd)
static boolean static boolean
sparc64_elf_fake_sections (abfd, hdr, sec) sparc64_elf_fake_sections (abfd, hdr, sec)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
Elf32_Internal_Shdr *hdr ATTRIBUTE_UNUSED; Elf_Internal_Shdr *hdr ATTRIBUTE_UNUSED;
asection *sec; asection *sec;
{ {
const char *name; const char *name;
@ -3086,10 +3084,10 @@ const struct elf_size_info sparc64_elf_size_info =
bfd_elf64_slurp_symbol_table, bfd_elf64_slurp_symbol_table,
bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_in,
bfd_elf64_swap_dyn_out, bfd_elf64_swap_dyn_out,
NULL, bfd_elf64_swap_reloc_in,
NULL, bfd_elf64_swap_reloc_out,
NULL, bfd_elf64_swap_reloca_in,
NULL bfd_elf64_swap_reloca_out
}; };
#define TARGET_BIG_SYM bfd_elf64_sparc_vec #define TARGET_BIG_SYM bfd_elf64_sparc_vec

View File

@ -153,7 +153,7 @@ static const struct elf_reloc_map x86_64_reloc_map[] =
static reloc_howto_type *elf64_x86_64_reloc_type_lookup static reloc_howto_type *elf64_x86_64_reloc_type_lookup
PARAMS ((bfd *, bfd_reloc_code_real_type)); PARAMS ((bfd *, bfd_reloc_code_real_type));
static void elf64_x86_64_info_to_howto static void elf64_x86_64_info_to_howto
PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean elf64_x86_64_grok_prstatus static boolean elf64_x86_64_grok_prstatus
PARAMS ((bfd *, Elf_Internal_Note *)); PARAMS ((bfd *, Elf_Internal_Note *));
static boolean elf64_x86_64_grok_psinfo static boolean elf64_x86_64_grok_psinfo
@ -231,7 +231,7 @@ static void
elf64_x86_64_info_to_howto (abfd, cache_ptr, dst) elf64_x86_64_info_to_howto (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf64_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
unsigned r_type, i; unsigned r_type, i;
@ -2004,14 +2004,14 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
if (info->shared) if (info->shared)
{ {
asection *srelgot; asection *s;
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
Elf64_External_Rela *loc; bfd_byte *loc;
/* We need to generate a R_X86_64_RELATIVE reloc /* We need to generate a R_X86_64_RELATIVE reloc
for the dynamic linker. */ for the dynamic linker. */
srelgot = htab->srelgot; s = htab->srelgot;
if (srelgot == NULL) if (s == NULL)
abort (); abort ();
outrel.r_offset = (htab->sgot->output_section->vma outrel.r_offset = (htab->sgot->output_section->vma
@ -2019,8 +2019,8 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
+ off); + off);
outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE); outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE);
outrel.r_addend = relocation; outrel.r_addend = relocation;
loc = (Elf64_External_Rela *) srelgot->contents; loc = s->contents;
loc += srelgot->reloc_count++; loc += s->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
} }
@ -2099,9 +2099,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
|| h->root.type == bfd_link_hash_undefined))) || h->root.type == bfd_link_hash_undefined)))
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
boolean skip, relocate; boolean skip, relocate;
asection *sreloc; asection *sreloc;
Elf64_External_Rela *loc;
/* When generating a shared object, these relocations /* When generating a shared object, these relocations
are copied into the output file to be resolved at run are copied into the output file to be resolved at run
@ -2186,8 +2186,8 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
if (sreloc == NULL) if (sreloc == NULL)
abort (); abort ();
loc = (Elf64_External_Rela *) sreloc->contents; loc = sreloc->contents;
loc += sreloc->reloc_count++; loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
/* If this reloc is against an external symbol, we do /* If this reloc is against an external symbol, we do
@ -2333,7 +2333,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
else else
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
Elf64_External_Rela *loc; bfd_byte *loc;
int dr_type, indx; int dr_type, indx;
if (htab->srelgot == NULL) if (htab->srelgot == NULL)
@ -2354,8 +2354,8 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_addend = relocation - dtpoff_base (info); outrel.r_addend = relocation - dtpoff_base (info);
outrel.r_info = ELF64_R_INFO (indx, dr_type); outrel.r_info = ELF64_R_INFO (indx, dr_type);
loc = (Elf64_External_Rela *) htab->srelgot->contents; loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++; loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
if (r_type == R_X86_64_TLSGD) if (r_type == R_X86_64_TLSGD)
@ -2375,9 +2375,8 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
R_X86_64_DTPOFF64); R_X86_64_DTPOFF64);
outrel.r_offset += GOT_ENTRY_SIZE; outrel.r_offset += GOT_ENTRY_SIZE;
htab->srelgot->reloc_count++; htab->srelgot->reloc_count++;
loc++; loc += sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &outrel, bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
loc);
} }
} }
@ -2473,7 +2472,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
else else
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
Elf64_External_Rela *loc; bfd_byte *loc;
if (htab->srelgot == NULL) if (htab->srelgot == NULL)
abort (); abort ();
@ -2487,8 +2486,8 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
htab->sgot->contents + off + GOT_ENTRY_SIZE); htab->sgot->contents + off + GOT_ENTRY_SIZE);
outrel.r_info = ELF64_R_INFO (0, R_X86_64_DTPMOD64); outrel.r_info = ELF64_R_INFO (0, R_X86_64_DTPMOD64);
outrel.r_addend = 0; outrel.r_addend = 0;
loc = (Elf64_External_Rela *) htab->srelgot->contents; loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++; loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc);
htab->tls_ld_got.offset |= 1; htab->tls_ld_got.offset |= 1;
} }
@ -2589,7 +2588,7 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_vma plt_index; bfd_vma plt_index;
bfd_vma got_offset; bfd_vma got_offset;
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf64_External_Rela *loc; bfd_byte *loc;
/* This symbol has an entry in the procedure linkage table. Set /* This symbol has an entry in the procedure linkage table. Set
it up. */ it up. */
@ -2649,7 +2648,7 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym)
+ got_offset); + got_offset);
rela.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_JUMP_SLOT); rela.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_JUMP_SLOT);
rela.r_addend = 0; rela.r_addend = 0;
loc = (Elf64_External_Rela *) htab->srelplt->contents + plt_index; loc = htab->srelplt->contents + plt_index * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
@ -2668,7 +2667,7 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym)
&& elf64_x86_64_hash_entry (h)->tls_type != GOT_TLS_IE) && elf64_x86_64_hash_entry (h)->tls_type != GOT_TLS_IE)
{ {
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf64_External_Rela *loc; bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it /* This symbol has an entry in the global offset table. Set it
up. */ up. */
@ -2706,15 +2705,15 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym)
rela.r_addend = 0; rela.r_addend = 0;
} }
loc = (Elf64_External_Rela *) htab->srelgot->contents; loc = htab->srelgot->contents;
loc += htab->srelgot->reloc_count++; loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
} }
if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0)
{ {
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf64_External_Rela *loc; bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */ /* This symbol needs a copy reloc. Set it up. */
@ -2729,8 +2728,8 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym)
+ h->root.u.def.section->output_offset); + h->root.u.def.section->output_offset);
rela.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_COPY); rela.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_COPY);
rela.r_addend = 0; rela.r_addend = 0;
loc = (Elf64_External_Rela *) htab->srelbss->contents; loc = htab->srelbss->contents;
loc += htab->srelbss->reloc_count++; loc += htab->srelbss->reloc_count++ * sizeof (Elf64_External_Rela);
bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc);
} }

View File

@ -583,13 +583,13 @@ static reloc_howto_type elf32_arm_thm_pc9_howto =
true); /* pcrel_offset */ true); /* pcrel_offset */
static void elf32_arm_info_to_howto static void elf32_arm_info_to_howto
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void static void
elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
bfd * abfd ATTRIBUTE_UNUSED; bfd * abfd ATTRIBUTE_UNUSED;
arelent * bfd_reloc; arelent * bfd_reloc;
Elf32_Internal_Rel * elf_reloc; Elf_Internal_Rela * elf_reloc;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -49,7 +49,7 @@
#define ARM_ELF_OS_ABI_VERSION 0 #define ARM_ELF_OS_ABI_VERSION 0
static reloc_howto_type * find_howto PARAMS ((unsigned int)); static reloc_howto_type * find_howto PARAMS ((unsigned int));
static void elf32_arm_info_to_howto PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); static void elf32_arm_info_to_howto PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type));
static reloc_howto_type elf32_arm_howto_table[] = static reloc_howto_type elf32_arm_howto_table[] =
@ -369,7 +369,7 @@ static void
elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc; arelent *bfd_reloc;
Elf32_Internal_Rela *elf_reloc; Elf_Internal_Rela *elf_reloc;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -421,44 +421,49 @@ elf_swap_phdr_out (abfd, src, dst)
} }
/* Translate an ELF reloc from external format to internal format. */ /* Translate an ELF reloc from external format to internal format. */
INLINE void void
elf_swap_reloc_in (abfd, src, dst) elf_swap_reloc_in (abfd, s, dst)
bfd *abfd; bfd *abfd;
const Elf_External_Rel *src; const bfd_byte *s;
Elf_Internal_Rel *dst;
{
dst->r_offset = H_GET_WORD (abfd, src->r_offset);
dst->r_info = H_GET_WORD (abfd, src->r_info);
}
INLINE void
elf_swap_reloca_in (abfd, src, dst)
bfd *abfd;
const Elf_External_Rela *src;
Elf_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
const Elf_External_Rel *src = (const Elf_External_Rel *) s;
dst->r_offset = H_GET_WORD (abfd, src->r_offset);
dst->r_info = H_GET_WORD (abfd, src->r_info);
dst->r_addend = 0;
}
void
elf_swap_reloca_in (abfd, s, dst)
bfd *abfd;
const bfd_byte *s;
Elf_Internal_Rela *dst;
{
const Elf_External_Rela *src = (const Elf_External_Rela *) s;
dst->r_offset = H_GET_WORD (abfd, src->r_offset); dst->r_offset = H_GET_WORD (abfd, src->r_offset);
dst->r_info = H_GET_WORD (abfd, src->r_info); dst->r_info = H_GET_WORD (abfd, src->r_info);
dst->r_addend = H_GET_SIGNED_WORD (abfd, src->r_addend); dst->r_addend = H_GET_SIGNED_WORD (abfd, src->r_addend);
} }
/* Translate an ELF reloc from internal format to external format. */ /* Translate an ELF reloc from internal format to external format. */
INLINE void void
elf_swap_reloc_out (abfd, src, dst) elf_swap_reloc_out (abfd, src, d)
bfd *abfd; bfd *abfd;
const Elf_Internal_Rel *src; const Elf_Internal_Rela *src;
Elf_External_Rel *dst; bfd_byte *d;
{ {
Elf_External_Rel *dst = (Elf_External_Rel *) d;
H_PUT_WORD (abfd, src->r_offset, dst->r_offset); H_PUT_WORD (abfd, src->r_offset, dst->r_offset);
H_PUT_WORD (abfd, src->r_info, dst->r_info); H_PUT_WORD (abfd, src->r_info, dst->r_info);
} }
INLINE void void
elf_swap_reloca_out (abfd, src, dst) elf_swap_reloca_out (abfd, src, d)
bfd *abfd; bfd *abfd;
const Elf_Internal_Rela *src; const Elf_Internal_Rela *src;
Elf_External_Rela *dst; bfd_byte *d;
{ {
Elf_External_Rela *dst = (Elf_External_Rela *) d;
H_PUT_WORD (abfd, src->r_offset, dst->r_offset); H_PUT_WORD (abfd, src->r_offset, dst->r_offset);
H_PUT_WORD (abfd, src->r_info, dst->r_info); H_PUT_WORD (abfd, src->r_info, dst->r_info);
H_PUT_SIGNED_WORD (abfd, src->r_addend, dst->r_addend); H_PUT_SIGNED_WORD (abfd, src->r_addend, dst->r_addend);
@ -858,12 +863,13 @@ elf_write_relocs (abfd, sec, data)
{ {
boolean *failedp = (boolean *) data; boolean *failedp = (boolean *) data;
Elf_Internal_Shdr *rela_hdr; Elf_Internal_Shdr *rela_hdr;
Elf_External_Rela *outbound_relocas; bfd_vma addr_offset;
Elf_External_Rel *outbound_relocs; void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
size_t extsize;
bfd_byte *dst_rela;
unsigned int idx; unsigned int idx;
int use_rela_p; asymbol *last_sym;
asymbol *last_sym = 0; int last_sym_idx;
int last_sym_idx = 0;
/* If we have already failed, don't do anything. */ /* If we have already failed, don't do anything. */
if (*failedp) if (*failedp)
@ -891,122 +897,69 @@ elf_write_relocs (abfd, sec, data)
/* Figure out whether the relocations are RELA or REL relocations. */ /* Figure out whether the relocations are RELA or REL relocations. */
if (rela_hdr->sh_type == SHT_RELA) if (rela_hdr->sh_type == SHT_RELA)
use_rela_p = true; {
swap_out = elf_swap_reloca_out;
extsize = sizeof (Elf_External_Rela);
}
else if (rela_hdr->sh_type == SHT_REL) else if (rela_hdr->sh_type == SHT_REL)
use_rela_p = false; {
swap_out = elf_swap_reloc_out;
extsize = sizeof (Elf_External_Rel);
}
else else
/* Every relocation section should be either an SHT_RELA or an /* Every relocation section should be either an SHT_RELA or an
SHT_REL section. */ SHT_REL section. */
abort (); abort ();
/* The address of an ELF reloc is section relative for an object
file, and absolute for an executable file or shared library.
The address of a BFD reloc is always section relative. */
addr_offset = 0;
if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
addr_offset = sec->vma;
/* orelocation has the data, reloc_count has the count... */ /* orelocation has the data, reloc_count has the count... */
if (use_rela_p) last_sym = 0;
last_sym_idx = 0;
dst_rela = rela_hdr->contents;
for (idx = 0; idx < sec->reloc_count; idx++, dst_rela += extsize)
{ {
outbound_relocas = (Elf_External_Rela *) rela_hdr->contents; Elf_Internal_Rela src_rela;
arelent *ptr;
asymbol *sym;
int n;
for (idx = 0; idx < sec->reloc_count; idx++) ptr = sec->orelocation[idx];
sym = *ptr->sym_ptr_ptr;
if (sym == last_sym)
n = last_sym_idx;
else if (bfd_is_abs_section (sym->section) && sym->value == 0)
n = STN_UNDEF;
else
{ {
Elf_Internal_Rela dst_rela; last_sym = sym;
Elf_External_Rela *src_rela; n = _bfd_elf_symbol_from_bfd_symbol (abfd, &sym);
arelent *ptr; if (n < 0)
asymbol *sym;
int n;
ptr = sec->orelocation[idx];
src_rela = outbound_relocas + idx;
/* The address of an ELF reloc is section relative for an object
file, and absolute for an executable file or shared library.
The address of a BFD reloc is always section relative. */
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
dst_rela.r_offset = ptr->address;
else
dst_rela.r_offset = ptr->address + sec->vma;
sym = *ptr->sym_ptr_ptr;
if (sym == last_sym)
n = last_sym_idx;
else if (bfd_is_abs_section (sym->section) && sym->value == 0)
n = STN_UNDEF;
else
{
last_sym = sym;
n = _bfd_elf_symbol_from_bfd_symbol (abfd, &sym);
if (n < 0)
{
*failedp = true;
return;
}
last_sym_idx = n;
}
if ((*ptr->sym_ptr_ptr)->the_bfd != NULL
&& (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec
&& ! _bfd_elf_validate_reloc (abfd, ptr))
{ {
*failedp = true; *failedp = true;
return; return;
} }
last_sym_idx = n;
dst_rela.r_info = ELF_R_INFO (n, ptr->howto->type);
dst_rela.r_addend = ptr->addend;
elf_swap_reloca_out (abfd, &dst_rela, src_rela);
} }
}
else
/* REL relocations */
{
outbound_relocs = (Elf_External_Rel *) rela_hdr->contents;
for (idx = 0; idx < sec->reloc_count; idx++) if ((*ptr->sym_ptr_ptr)->the_bfd != NULL
&& (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec
&& ! _bfd_elf_validate_reloc (abfd, ptr))
{ {
Elf_Internal_Rel dst_rel; *failedp = true;
Elf_External_Rel *src_rel; return;
arelent *ptr;
int n;
asymbol *sym;
ptr = sec->orelocation[idx];
sym = *ptr->sym_ptr_ptr;
src_rel = outbound_relocs + idx;
/* The address of an ELF reloc is section relative for an object
file, and absolute for an executable file or shared library.
The address of a BFD reloc is always section relative. */
if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
dst_rel.r_offset = ptr->address;
else
dst_rel.r_offset = ptr->address + sec->vma;
if (sym == last_sym)
n = last_sym_idx;
else if (bfd_is_abs_section (sym->section) && sym->value == 0)
n = STN_UNDEF;
else
{
last_sym = sym;
n = _bfd_elf_symbol_from_bfd_symbol (abfd, &sym);
if (n < 0)
{
*failedp = true;
return;
}
last_sym_idx = n;
}
if ((*ptr->sym_ptr_ptr)->the_bfd != NULL
&& (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec
&& ! _bfd_elf_validate_reloc (abfd, ptr))
{
*failedp = true;
return;
}
dst_rel.r_info = ELF_R_INFO (n, ptr->howto->type);
elf_swap_reloc_out (abfd, &dst_rel, src_rel);
} }
src_rela.r_offset = ptr->address + addr_offset;
src_rela.r_info = ELF_R_INFO (n, ptr->howto->type);
src_rela.r_addend = ptr->addend;
(*swap_out) (abfd, &src_rela, dst_rela);
} }
} }
@ -1372,17 +1325,11 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count,
i++, relent++, native_relocs += entsize) i++, relent++, native_relocs += entsize)
{ {
Elf_Internal_Rela rela; Elf_Internal_Rela rela;
Elf_Internal_Rel rel;
if (entsize == sizeof (Elf_External_Rela)) if (entsize == sizeof (Elf_External_Rela))
elf_swap_reloca_in (abfd, (Elf_External_Rela *) native_relocs, &rela); elf_swap_reloca_in (abfd, native_relocs, &rela);
else else
{ elf_swap_reloc_in (abfd, native_relocs, &rela);
elf_swap_reloc_in (abfd, (Elf_External_Rel *) native_relocs, &rel);
rela.r_offset = rel.r_offset;
rela.r_info = rel.r_info;
rela.r_addend = 0;
}
/* The address of an ELF reloc is section relative for an object /* The address of an ELF reloc is section relative for an object
file, and absolute for an executable file or shared library. file, and absolute for an executable file or shared library.
@ -1421,7 +1368,7 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count,
if (entsize == sizeof (Elf_External_Rela)) if (entsize == sizeof (Elf_External_Rela))
(*ebd->elf_info_to_howto) (abfd, relent, &rela); (*ebd->elf_info_to_howto) (abfd, relent, &rela);
else else
(*ebd->elf_info_to_howto_rel) (abfd, relent, &rel); (*ebd->elf_info_to_howto_rel) (abfd, relent, &rela);
} }
if (allocated != NULL) if (allocated != NULL)
@ -1649,8 +1596,8 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = {
elf_slurp_symbol_table, elf_slurp_symbol_table,
elf_swap_dyn_in, elf_swap_dyn_in,
elf_swap_dyn_out, elf_swap_dyn_out,
NULL, elf_swap_reloc_in,
NULL, elf_swap_reloc_out,
NULL, elf_swap_reloca_in,
NULL elf_swap_reloca_out
}; };

View File

@ -2484,7 +2484,10 @@ elf_link_read_relocs_from_section (abfd, shdr, external_relocs,
Elf_Internal_Rela *internal_relocs; Elf_Internal_Rela *internal_relocs;
{ {
struct elf_backend_data *bed; struct elf_backend_data *bed;
bfd_size_type amt; void (*swap_in) PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
const bfd_byte *erela;
const bfd_byte *erelaend;
Elf_Internal_Rela *irela;
/* If there aren't any relocations, that's OK. */ /* If there aren't any relocations, that's OK. */
if (!shdr) if (!shdr)
@ -2502,52 +2505,20 @@ elf_link_read_relocs_from_section (abfd, shdr, external_relocs,
/* Convert the external relocations to the internal format. */ /* Convert the external relocations to the internal format. */
if (shdr->sh_entsize == sizeof (Elf_External_Rel)) if (shdr->sh_entsize == sizeof (Elf_External_Rel))
{ swap_in = bed->s->swap_reloc_in;
Elf_External_Rel *erel; else if (shdr->sh_entsize == sizeof (Elf_External_Rela))
Elf_External_Rel *erelend; swap_in = bed->s->swap_reloca_in;
Elf_Internal_Rela *irela;
Elf_Internal_Rel *irel;
erel = (Elf_External_Rel *) external_relocs;
erelend = erel + NUM_SHDR_ENTRIES (shdr);
irela = internal_relocs;
amt = bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rel);
irel = bfd_alloc (abfd, amt);
for (; erel < erelend; erel++, irela += bed->s->int_rels_per_ext_rel)
{
unsigned int i;
if (bed->s->swap_reloc_in)
(*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, irel);
else
elf_swap_reloc_in (abfd, erel, irel);
for (i = 0; i < bed->s->int_rels_per_ext_rel; ++i)
{
irela[i].r_offset = irel[i].r_offset;
irela[i].r_info = irel[i].r_info;
irela[i].r_addend = 0;
}
}
}
else else
abort ();
erela = external_relocs;
erelaend = erela + NUM_SHDR_ENTRIES (shdr) * shdr->sh_entsize;
irela = internal_relocs;
while (erela < erelaend)
{ {
Elf_External_Rela *erela; (*swap_in) (abfd, erela, irela);
Elf_External_Rela *erelaend; irela += bed->s->int_rels_per_ext_rel;
Elf_Internal_Rela *irela; erela += shdr->sh_entsize;
BFD_ASSERT (shdr->sh_entsize == sizeof (Elf_External_Rela));
erela = (Elf_External_Rela *) external_relocs;
erelaend = erela + NUM_SHDR_ENTRIES (shdr);
irela = internal_relocs;
for (; erela < erelaend; erela++, irela += bed->s->int_rels_per_ext_rel)
{
if (bed->s->swap_reloca_in)
(*bed->s->swap_reloca_in) (abfd, (bfd_byte *) erela, irela);
else
elf_swap_reloca_in (abfd, erela, irela);
}
} }
return true; return true;
@ -4588,91 +4559,51 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash)
{ {
unsigned int i; unsigned int i;
struct elf_backend_data *bed = get_elf_backend_data (abfd); struct elf_backend_data *bed = get_elf_backend_data (abfd);
Elf_Internal_Rel *irel; bfd_byte *erela;
Elf_Internal_Rela *irela; void (*swap_in) PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
bfd_size_type amt = sizeof (Elf_Internal_Rel) * bed->s->int_rels_per_ext_rel; void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
irel = (Elf_Internal_Rel *) bfd_zmalloc (amt); if (rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
if (irel == NULL)
{ {
(*_bfd_error_handler) (_("Error: out of memory")); swap_in = bed->s->swap_reloc_in;
abort (); swap_out = bed->s->swap_reloc_out;
} }
else if (rel_hdr->sh_entsize == sizeof (Elf_External_Rela))
amt = sizeof (Elf_Internal_Rela) * bed->s->int_rels_per_ext_rel;
irela = (Elf_Internal_Rela *) bfd_zmalloc (amt);
if (irela == NULL)
{ {
(*_bfd_error_handler) (_("Error: out of memory")); swap_in = bed->s->swap_reloca_in;
abort (); swap_out = bed->s->swap_reloca_out;
} }
else
abort ();
for (i = 0; i < count; i++, rel_hash++) if (bed->s->int_rels_per_ext_rel > MAX_INT_RELS_PER_EXT_REL)
abort ();
erela = rel_hdr->contents;
for (i = 0; i < count; i++, rel_hash++, erela += rel_hdr->sh_entsize)
{ {
Elf_Internal_Rela irela[MAX_INT_RELS_PER_EXT_REL];
unsigned int j;
if (*rel_hash == NULL) if (*rel_hash == NULL)
continue; continue;
BFD_ASSERT ((*rel_hash)->indx >= 0); BFD_ASSERT ((*rel_hash)->indx >= 0);
if (rel_hdr->sh_entsize == sizeof (Elf_External_Rel)) (*swap_in) (abfd, erela, irela);
{ for (j = 0; j < bed->s->int_rels_per_ext_rel; j++)
Elf_External_Rel *erel; irela[j].r_info = ELF_R_INFO ((*rel_hash)->indx,
unsigned int j; ELF_R_TYPE (irela[j].r_info));
(*swap_out) (abfd, irela, erela);
erel = (Elf_External_Rel *) rel_hdr->contents + i;
if (bed->s->swap_reloc_in)
(*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel, irel);
else
elf_swap_reloc_in (abfd, erel, irel);
for (j = 0; j < bed->s->int_rels_per_ext_rel; j++)
irel[j].r_info = ELF_R_INFO ((*rel_hash)->indx,
ELF_R_TYPE (irel[j].r_info));
if (bed->s->swap_reloc_out)
(*bed->s->swap_reloc_out) (abfd, irel, (bfd_byte *) erel);
else
elf_swap_reloc_out (abfd, irel, erel);
}
else
{
Elf_External_Rela *erela;
unsigned int j;
BFD_ASSERT (rel_hdr->sh_entsize
== sizeof (Elf_External_Rela));
erela = (Elf_External_Rela *) rel_hdr->contents + i;
if (bed->s->swap_reloca_in)
(*bed->s->swap_reloca_in) (abfd, (bfd_byte *) erela, irela);
else
elf_swap_reloca_in (abfd, erela, irela);
for (j = 0; j < bed->s->int_rels_per_ext_rel; j++)
irela[j].r_info = ELF_R_INFO ((*rel_hash)->indx,
ELF_R_TYPE (irela[j].r_info));
if (bed->s->swap_reloca_out)
(*bed->s->swap_reloca_out) (abfd, irela, (bfd_byte *) erela);
else
elf_swap_reloca_out (abfd, irela, erela);
}
} }
free (irel);
free (irela);
} }
struct elf_link_sort_rela struct elf_link_sort_rela
{ {
bfd_vma offset; bfd_vma offset;
enum elf_reloc_type_class type; enum elf_reloc_type_class type;
union /* We use this as an array of size int_rels_per_ext_rel. */
{ Elf_Internal_Rela rela[1];
/* We use these as arrays of size int_rels_per_ext_rel. */
Elf_Internal_Rel rel[1];
Elf_Internal_Rela rela[1];
} u;
}; };
static int static int
@ -4691,13 +4622,13 @@ elf_link_sort_cmp1 (A, B)
return 1; return 1;
if (relativea > relativeb) if (relativea > relativeb)
return -1; return -1;
if (ELF_R_SYM (a->u.rel->r_info) < ELF_R_SYM (b->u.rel->r_info)) if (ELF_R_SYM (a->rela->r_info) < ELF_R_SYM (b->rela->r_info))
return -1; return -1;
if (ELF_R_SYM (a->u.rel->r_info) > ELF_R_SYM (b->u.rel->r_info)) if (ELF_R_SYM (a->rela->r_info) > ELF_R_SYM (b->rela->r_info))
return 1; return 1;
if (a->u.rel->r_offset < b->u.rel->r_offset) if (a->rela->r_offset < b->rela->r_offset)
return -1; return -1;
if (a->u.rel->r_offset > b->u.rel->r_offset) if (a->rela->r_offset > b->rela->r_offset)
return 1; return 1;
return 0; return 0;
} }
@ -4721,9 +4652,9 @@ elf_link_sort_cmp2 (A, B)
return -1; return -1;
if (copya > copyb) if (copya > copyb)
return 1; return 1;
if (a->u.rel->r_offset < b->u.rel->r_offset) if (a->rela->r_offset < b->rela->r_offset)
return -1; return -1;
if (a->u.rel->r_offset > b->u.rel->r_offset) if (a->rela->r_offset > b->rela->r_offset)
return 1; return 1;
return 0; return 0;
} }
@ -4736,12 +4667,14 @@ elf_link_sort_relocs (abfd, info, psec)
{ {
bfd *dynobj = elf_hash_table (info)->dynobj; bfd *dynobj = elf_hash_table (info)->dynobj;
asection *reldyn, *o; asection *reldyn, *o;
boolean rel = false;
bfd_size_type count, size; bfd_size_type count, size;
size_t i, j, ret; size_t i, ret, sort_elt, ext_size;
struct elf_link_sort_rela *rela; bfd_byte *sort, *s_non_relative, *p;
struct elf_link_sort_rela *sq;
struct elf_backend_data *bed = get_elf_backend_data (abfd); struct elf_backend_data *bed = get_elf_backend_data (abfd);
int i2e = bed->s->int_rels_per_ext_rel; int i2e = bed->s->int_rels_per_ext_rel;
void (*swap_in) PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *));
void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
reldyn = bfd_get_section_by_name (abfd, ".rela.dyn"); reldyn = bfd_get_section_by_name (abfd, ".rela.dyn");
if (reldyn == NULL || reldyn->_raw_size == 0) if (reldyn == NULL || reldyn->_raw_size == 0)
@ -4749,11 +4682,17 @@ elf_link_sort_relocs (abfd, info, psec)
reldyn = bfd_get_section_by_name (abfd, ".rel.dyn"); reldyn = bfd_get_section_by_name (abfd, ".rel.dyn");
if (reldyn == NULL || reldyn->_raw_size == 0) if (reldyn == NULL || reldyn->_raw_size == 0)
return 0; return 0;
rel = true; ext_size = sizeof (Elf_External_Rel);
count = reldyn->_raw_size / sizeof (Elf_External_Rel); swap_in = bed->s->swap_reloc_in;
swap_out = bed->s->swap_reloc_out;
} }
else else
count = reldyn->_raw_size / sizeof (Elf_External_Rela); {
ext_size = sizeof (Elf_External_Rela);
swap_in = bed->s->swap_reloca_in;
swap_out = bed->s->swap_reloca_out;
}
count = reldyn->_raw_size / ext_size;
size = 0; size = 0;
for (o = dynobj->sections; o != NULL; o = o->next) for (o = dynobj->sections; o != NULL; o = o->next)
@ -4765,24 +4704,10 @@ elf_link_sort_relocs (abfd, info, psec)
if (size != reldyn->_raw_size) if (size != reldyn->_raw_size)
return 0; return 0;
/* We waste some memory here when N = i2e is greater than 1, since sort_elt = (sizeof (struct elf_link_sort_rela)
we allocate space for N * sizeof (*rela) where sizeof (*rela) + + (i2e - 1) * sizeof (Elf_Internal_Rela));
(N - 1) * sizeof (Elf_Internal_Rel/Rela) would do. Also, we use sort = bfd_zmalloc (sort_elt * count);
rela[k] only when k is a multiple of N, and then we index the if (sort == NULL)
array within the union, such that rela[k].u.rel[i], i < N, is the
(i+1)th internal relocation corresponding to the (k/N)th external
relocation. This is done such that the relocation swap-in and
swap-out functions can gen pointers to arrays of internal
relocations that form a single external relocation.
If C permitted arrays of structures with dynamic sizes, we could
do better, but trying to avoid wasting space at the end of the
chunk from rela[k] to rela[k+N-1] would require us to allocate a
separate array of pointers and since most ports have N == 1, this
would be more wasteful. */
rela = (struct elf_link_sort_rela *) bfd_zmalloc
(sizeof (*rela) * count * i2e);
if (rela == NULL)
{ {
(*info->callbacks->warning) (*info->callbacks->warning)
(info, _("Not enough memory to sort relocations"), 0, abfd, 0, (info, _("Not enough memory to sort relocations"), 0, abfd, 0,
@ -4795,103 +4720,62 @@ elf_link_sort_relocs (abfd, info, psec)
== (SEC_HAS_CONTENTS|SEC_LINKER_CREATED) == (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)
&& o->output_section == reldyn) && o->output_section == reldyn)
{ {
if (rel) bfd_byte *erel, *erelend;
erel = o->contents;
erelend = o->contents + o->_raw_size;
p = sort + o->output_offset / ext_size * sort_elt;
while (erel < erelend)
{ {
Elf_External_Rel *erel, *erelend; struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p;
struct elf_link_sort_rela *s; (*swap_in) (abfd, erel, s->rela);
s->type = (*bed->elf_backend_reloc_type_class) (s->rela);
erel = (Elf_External_Rel *) o->contents; p += sort_elt;
erelend = (Elf_External_Rel *) (o->contents + o->_raw_size); erel += ext_size;
s = rela + (o->output_offset / sizeof (Elf_External_Rel) * i2e);
for (; erel < erelend; erel++, s += i2e)
{
if (bed->s->swap_reloc_in)
(*bed->s->swap_reloc_in) (abfd, (bfd_byte *) erel,
s->u.rel);
else
elf_swap_reloc_in (abfd, erel, s->u.rel);
s->type = (*bed->elf_backend_reloc_type_class) (s->u.rela);
}
}
else
{
Elf_External_Rela *erela, *erelaend;
struct elf_link_sort_rela *s;
erela = (Elf_External_Rela *) o->contents;
erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size);
s = rela + (o->output_offset / sizeof (Elf_External_Rela) * i2e);
for (; erela < erelaend; erela++, s += i2e)
{
if (bed->s->swap_reloca_in)
(*bed->s->swap_reloca_in) (dynobj, (bfd_byte *) erela,
s->u.rela);
else
elf_swap_reloca_in (dynobj, erela, s->u.rela);
s->type = (*bed->elf_backend_reloc_type_class) (s->u.rela);
}
} }
} }
qsort (rela, (size_t) count, sizeof (*rela) * i2e, elf_link_sort_cmp1); qsort (sort, (size_t) count, sort_elt, elf_link_sort_cmp1);
for (ret = 0; ret < count * i2e && rela[ret].type == reloc_class_relative;
ret += i2e) for (i = 0, p = sort; i < count; i++, p += sort_elt)
;
for (i = ret, j = ret; i < count * i2e; i += i2e)
{ {
if (ELF_R_SYM (rela[i].u.rel->r_info) struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p;
!= ELF_R_SYM (rela[j].u.rel->r_info)) if (s->type != reloc_class_relative)
j = i; break;
rela[i].offset = rela[j].u.rel->r_offset;
} }
ret /= i2e; ret = i;
qsort (rela + ret, (size_t) count - ret, s_non_relative = p;
sizeof (*rela) * i2e, elf_link_sort_cmp2);
sq = (struct elf_link_sort_rela *) s_non_relative;
for (; i < count; i++, p += sort_elt)
{
struct elf_link_sort_rela *sp = (struct elf_link_sort_rela *) p;
if (ELF_R_SYM (sp->rela->r_info) != ELF_R_SYM (sq->rela->r_info))
sq = sp;
sp->offset = sq->rela->r_offset;
}
qsort (s_non_relative, (size_t) count - ret, sort_elt, elf_link_sort_cmp2);
for (o = dynobj->sections; o != NULL; o = o->next) for (o = dynobj->sections; o != NULL; o = o->next)
if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)) if ((o->flags & (SEC_HAS_CONTENTS|SEC_LINKER_CREATED))
== (SEC_HAS_CONTENTS|SEC_LINKER_CREATED) == (SEC_HAS_CONTENTS|SEC_LINKER_CREATED)
&& o->output_section == reldyn) && o->output_section == reldyn)
{ {
if (rel) bfd_byte *erel, *erelend;
{
Elf_External_Rel *erel, *erelend;
struct elf_link_sort_rela *s;
erel = (Elf_External_Rel *) o->contents; erel = o->contents;
erelend = (Elf_External_Rel *) (o->contents + o->_raw_size); erelend = o->contents + o->_raw_size;
s = rela + (o->output_offset / sizeof (Elf_External_Rel) * i2e); p = sort + o->output_offset / ext_size * sort_elt;
for (; erel < erelend; erel++, s += i2e) while (erel < erelend)
{
if (bed->s->swap_reloc_out)
(*bed->s->swap_reloc_out) (abfd, s->u.rel,
(bfd_byte *) erel);
else
elf_swap_reloc_out (abfd, s->u.rel, erel);
}
}
else
{ {
Elf_External_Rela *erela, *erelaend; struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p;
struct elf_link_sort_rela *s; (*swap_out) (abfd, s->rela, erel);
p += sort_elt;
erela = (Elf_External_Rela *) o->contents; erel += ext_size;
erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size);
s = rela + (o->output_offset / sizeof (Elf_External_Rela) * i2e);
for (; erela < erelaend; erela++, s += i2e)
{
if (bed->s->swap_reloca_out)
(*bed->s->swap_reloca_out) (dynobj, s->u.rela,
(bfd_byte *) erela);
else
elf_swap_reloca_out (dynobj, s->u.rela, erela);
}
} }
} }
free (rela);
*psec = reldyn; *psec = reldyn;
return ret; return ret;
} }
@ -6481,11 +6365,12 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr,
{ {
Elf_Internal_Rela *irela; Elf_Internal_Rela *irela;
Elf_Internal_Rela *irelaend; Elf_Internal_Rela *irelaend;
bfd_byte *erel;
Elf_Internal_Shdr *output_rel_hdr; Elf_Internal_Shdr *output_rel_hdr;
asection *output_section; asection *output_section;
unsigned int *rel_countp = NULL; unsigned int *rel_countp = NULL;
struct elf_backend_data *bed; struct elf_backend_data *bed;
bfd_size_type amt; void (*swap_out) PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *));
output_section = input_section->output_section; output_section = input_section->output_section;
output_rel_hdr = NULL; output_rel_hdr = NULL;
@ -6515,55 +6400,23 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr,
} }
bed = get_elf_backend_data (output_bfd); bed = get_elf_backend_data (output_bfd);
if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
swap_out = bed->s->swap_reloc_out;
else if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rela))
swap_out = bed->s->swap_reloca_out;
else
abort ();
erel = output_rel_hdr->contents;
erel += *rel_countp * input_rel_hdr->sh_entsize;
irela = internal_relocs; irela = internal_relocs;
irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr) irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr)
* bed->s->int_rels_per_ext_rel); * bed->s->int_rels_per_ext_rel);
while (irela < irelaend)
if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
{ {
Elf_External_Rel *erel; (*swap_out) (output_bfd, irela, erel);
Elf_Internal_Rel *irel; irela += bed->s->int_rels_per_ext_rel;
erel += input_rel_hdr->sh_entsize;
amt = bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rel);
irel = (Elf_Internal_Rel *) bfd_zmalloc (amt);
if (irel == NULL)
{
(*_bfd_error_handler) (_("Error: out of memory"));
abort ();
}
erel = ((Elf_External_Rel *) output_rel_hdr->contents + *rel_countp);
for (; irela < irelaend; irela += bed->s->int_rels_per_ext_rel, erel++)
{
unsigned int i;
for (i = 0; i < bed->s->int_rels_per_ext_rel; i++)
{
irel[i].r_offset = irela[i].r_offset;
irel[i].r_info = irela[i].r_info;
BFD_ASSERT (irela[i].r_addend == 0);
}
if (bed->s->swap_reloc_out)
(*bed->s->swap_reloc_out) (output_bfd, irel, (PTR) erel);
else
elf_swap_reloc_out (output_bfd, irel, erel);
}
free (irel);
}
else
{
Elf_External_Rela *erela;
BFD_ASSERT (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rela));
erela = ((Elf_External_Rela *) output_rel_hdr->contents + *rel_countp);
for (; irela < irelaend; irela += bed->s->int_rels_per_ext_rel, erela++)
if (bed->s->swap_reloca_out)
(*bed->s->swap_reloca_out) (output_bfd, irela, (PTR) erela);
else
elf_swap_reloca_out (output_bfd, irela, erela);
} }
/* Bump the counter, so that we know where to add the next set of /* Bump the counter, so that we know where to add the next set of
@ -7221,6 +7074,9 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order)
struct elf_link_hash_entry **rel_hash_ptr; struct elf_link_hash_entry **rel_hash_ptr;
Elf_Internal_Shdr *rel_hdr; Elf_Internal_Shdr *rel_hdr;
struct elf_backend_data *bed = get_elf_backend_data (output_bfd); struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
Elf_Internal_Rela irel[MAX_INT_RELS_PER_EXT_REL];
bfd_byte *erel;
unsigned int i;
howto = bfd_reloc_type_lookup (output_bfd, link_order->u.reloc.p->reloc); howto = bfd_reloc_type_lookup (output_bfd, link_order->u.reloc.p->reloc);
if (howto == NULL) if (howto == NULL)
@ -7336,58 +7192,28 @@ elf_reloc_link_order (output_bfd, info, output_section, link_order)
if (! info->relocateable) if (! info->relocateable)
offset += output_section->vma; offset += output_section->vma;
rel_hdr = &elf_section_data (output_section)->rel_hdr; for (i = 0; i < bed->s->int_rels_per_ext_rel; i++)
{
irel[i].r_offset = offset;
irel[i].r_info = 0;
irel[i].r_addend = 0;
}
irel[0].r_info = ELF_R_INFO (indx, howto->type);
rel_hdr = &elf_section_data (output_section)->rel_hdr;
erel = rel_hdr->contents;
if (rel_hdr->sh_type == SHT_REL) if (rel_hdr->sh_type == SHT_REL)
{ {
bfd_size_type size; erel += (elf_section_data (output_section)->rel_count
Elf_Internal_Rel *irel; * sizeof (Elf_External_Rel));
Elf_External_Rel *erel; (*bed->s->swap_reloc_out) (output_bfd, irel, erel);
unsigned int i;
size = bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rel);
irel = (Elf_Internal_Rel *) bfd_zmalloc (size);
if (irel == NULL)
return false;
for (i = 0; i < bed->s->int_rels_per_ext_rel; i++)
irel[i].r_offset = offset;
irel[0].r_info = ELF_R_INFO (indx, howto->type);
erel = ((Elf_External_Rel *) rel_hdr->contents
+ elf_section_data (output_section)->rel_count);
if (bed->s->swap_reloc_out)
(*bed->s->swap_reloc_out) (output_bfd, irel, (bfd_byte *) erel);
else
elf_swap_reloc_out (output_bfd, irel, erel);
free (irel);
} }
else else
{ {
bfd_size_type size; irel[0].r_addend = addend;
Elf_Internal_Rela *irela; erel += (elf_section_data (output_section)->rel_count
Elf_External_Rela *erela; * sizeof (Elf_External_Rela));
unsigned int i; (*bed->s->swap_reloca_out) (output_bfd, irel, erel);
size = bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela);
irela = (Elf_Internal_Rela *) bfd_zmalloc (size);
if (irela == NULL)
return false;
for (i = 0; i < bed->s->int_rels_per_ext_rel; i++)
irela[i].r_offset = offset;
irela[0].r_info = ELF_R_INFO (indx, howto->type);
irela[0].r_addend = addend;
erela = ((Elf_External_Rela *) rel_hdr->contents
+ elf_section_data (output_section)->rel_count);
if (bed->s->swap_reloca_out)
(*bed->s->swap_reloca_out) (output_bfd, irela, (bfd_byte *) erela);
else
elf_swap_reloca_out (output_bfd, irela, erela);
} }
++elf_section_data (output_section)->rel_count; ++elf_section_data (output_section)->rel_count;
@ -7604,19 +7430,10 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h,
if (info->shared) if (info->shared)
{ {
asection *srel = lsect->rel_section; asection *srel = lsect->rel_section;
Elf_Internal_Rela *outrel; Elf_Internal_Rela outrel[MAX_INT_RELS_PER_EXT_REL];
Elf_External_Rela *erel; bfd_byte *erel;
struct elf_backend_data *bed = get_elf_backend_data (output_bfd); struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
unsigned int i; unsigned int i;
bfd_size_type amt;
amt = sizeof (Elf_Internal_Rela) * bed->s->int_rels_per_ext_rel;
outrel = (Elf_Internal_Rela *) bfd_zmalloc (amt);
if (outrel == NULL)
{
(*_bfd_error_handler) (_("Error: out of memory"));
return 0;
}
/* We need to generate a relative reloc for the dynamic /* We need to generate a relative reloc for the dynamic
linker. */ linker. */
@ -7630,17 +7447,18 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h,
BFD_ASSERT (srel != NULL); BFD_ASSERT (srel != NULL);
for (i = 0; i < bed->s->int_rels_per_ext_rel; i++) for (i = 0; i < bed->s->int_rels_per_ext_rel; i++)
outrel[i].r_offset = (lsect->section->output_section->vma {
+ lsect->section->output_offset outrel[i].r_offset = (lsect->section->output_section->vma
+ linker_section_ptr->offset); + lsect->section->output_offset
+ linker_section_ptr->offset);
outrel[i].r_info = 0;
outrel[i].r_addend = 0;
}
outrel[0].r_info = ELF_R_INFO (0, relative_reloc); outrel[0].r_info = ELF_R_INFO (0, relative_reloc);
outrel[0].r_addend = 0; erel = lsect->section->contents;
erel = (Elf_External_Rela *) lsect->section->contents; erel += (elf_section_data (lsect->section)->rel_count++
erel += elf_section_data (lsect->section)->rel_count; * sizeof (Elf_External_Rela));
elf_swap_reloca_out (output_bfd, outrel, erel); elf_swap_reloca_out (output_bfd, outrel, erel);
++elf_section_data (lsect->section)->rel_count;
free (outrel);
} }
} }
} }

View File

@ -77,9 +77,9 @@ static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup
static reloc_howto_type *mips_elf_n32_rtype_to_howto static reloc_howto_type *mips_elf_n32_rtype_to_howto
PARAMS ((unsigned int, boolean)); PARAMS ((unsigned int, boolean));
static void mips_info_to_howto_rel static void mips_info_to_howto_rel
PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static void mips_info_to_howto_rela static void mips_info_to_howto_rela
PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
static boolean mips_elf_sym_is_global PARAMS ((bfd *, asymbol *)); static boolean mips_elf_sym_is_global PARAMS ((bfd *, asymbol *));
static boolean mips_elf_n32_object_p PARAMS ((bfd *)); static boolean mips_elf_n32_object_p PARAMS ((bfd *));
static boolean elf32_mips_grok_prstatus static boolean elf32_mips_grok_prstatus
@ -1896,7 +1896,7 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
} }
} }
/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */ /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */
static reloc_howto_type * static reloc_howto_type *
mips_elf_n32_rtype_to_howto (r_type, rela_p) mips_elf_n32_rtype_to_howto (r_type, rela_p)
@ -1923,13 +1923,13 @@ mips_elf_n32_rtype_to_howto (r_type, rela_p)
} }
} }
/* Given a MIPS Elf32_Internal_Rel, fill in an arelent structure. */ /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */
static void static void
mips_info_to_howto_rel (abfd, cache_ptr, dst) mips_info_to_howto_rel (abfd, cache_ptr, dst)
bfd *abfd; bfd *abfd;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rel *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;
@ -1946,13 +1946,13 @@ mips_info_to_howto_rel (abfd, cache_ptr, dst)
cache_ptr->addend = elf_gp (abfd); cache_ptr->addend = elf_gp (abfd);
} }
/* Given a MIPS Elf32_Internal_Rela, fill in an arelent structure. */ /* Given a MIPS Elf_Internal_Rela, fill in an arelent structure. */
static void static void
mips_info_to_howto_rela (abfd, cache_ptr, dst) mips_info_to_howto_rela (abfd, cache_ptr, dst)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *cache_ptr; arelent *cache_ptr;
Elf32_Internal_Rela *dst; Elf_Internal_Rela *dst;
{ {
unsigned int r_type; unsigned int r_type;

View File

@ -163,18 +163,18 @@ static reloc_howto_type * lookup_howto
static reloc_howto_type *elfNN_ia64_reloc_type_lookup static reloc_howto_type *elfNN_ia64_reloc_type_lookup
PARAMS ((bfd *abfd, bfd_reloc_code_real_type bfd_code)); PARAMS ((bfd *abfd, bfd_reloc_code_real_type bfd_code));
static void elfNN_ia64_info_to_howto static void elfNN_ia64_info_to_howto
PARAMS ((bfd *abfd, arelent *bfd_reloc, ElfNN_Internal_Rela *elf_reloc)); PARAMS ((bfd *abfd, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc));
static boolean elfNN_ia64_relax_section static boolean elfNN_ia64_relax_section
PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info, PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info,
boolean *again)); boolean *again));
static boolean is_unwind_section_name static boolean is_unwind_section_name
PARAMS ((bfd *abfd, const char *)); PARAMS ((bfd *abfd, const char *));
static boolean elfNN_ia64_section_from_shdr static boolean elfNN_ia64_section_from_shdr
PARAMS ((bfd *, ElfNN_Internal_Shdr *, const char *)); PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
static boolean elfNN_ia64_section_flags static boolean elfNN_ia64_section_flags
PARAMS ((flagword *, ElfNN_Internal_Shdr *)); PARAMS ((flagword *, Elf_Internal_Shdr *));
static boolean elfNN_ia64_fake_sections static boolean elfNN_ia64_fake_sections
PARAMS ((bfd *abfd, ElfNN_Internal_Shdr *hdr, asection *sec)); PARAMS ((bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec));
static void elfNN_ia64_final_write_processing static void elfNN_ia64_final_write_processing
PARAMS ((bfd *abfd, boolean linker)); PARAMS ((bfd *abfd, boolean linker));
static boolean elfNN_ia64_add_symbol_hook static boolean elfNN_ia64_add_symbol_hook
@ -597,7 +597,7 @@ static void
elfNN_ia64_info_to_howto (abfd, bfd_reloc, elf_reloc) elfNN_ia64_info_to_howto (abfd, bfd_reloc, elf_reloc)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
arelent *bfd_reloc; arelent *bfd_reloc;
ElfNN_Internal_Rela *elf_reloc; Elf_Internal_Rela *elf_reloc;
{ {
bfd_reloc->howto bfd_reloc->howto
= lookup_howto ((unsigned int) ELFNN_R_TYPE (elf_reloc->r_info)); = lookup_howto ((unsigned int) ELFNN_R_TYPE (elf_reloc->r_info));
@ -1017,7 +1017,7 @@ is_unwind_section_name (abfd, name)
static boolean static boolean
elfNN_ia64_section_from_shdr (abfd, hdr, name) elfNN_ia64_section_from_shdr (abfd, hdr, name)
bfd *abfd; bfd *abfd;
ElfNN_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;
const char *name; const char *name;
{ {
asection *newsect; asection *newsect;
@ -1057,7 +1057,7 @@ elfNN_ia64_section_from_shdr (abfd, hdr, name)
static boolean static boolean
elfNN_ia64_section_flags (flags, hdr) elfNN_ia64_section_flags (flags, hdr)
flagword *flags; flagword *flags;
ElfNN_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;
{ {
if (hdr->sh_flags & SHF_IA_64_SHORT) if (hdr->sh_flags & SHF_IA_64_SHORT)
*flags |= SEC_SMALL_DATA; *flags |= SEC_SMALL_DATA;
@ -1071,7 +1071,7 @@ elfNN_ia64_section_flags (flags, hdr)
static boolean static boolean
elfNN_ia64_fake_sections (abfd, hdr, sec) elfNN_ia64_fake_sections (abfd, hdr, sec)
bfd *abfd ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED;
ElfNN_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;
asection *sec; asection *sec;
{ {
register const char *name; register const char *name;
@ -3203,6 +3203,7 @@ elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type,
bfd_vma addend; bfd_vma addend;
{ {
Elf_Internal_Rela outrel; Elf_Internal_Rela outrel;
bfd_byte *loc;
BFD_ASSERT (dynindx != -1); BFD_ASSERT (dynindx != -1);
outrel.r_info = ELFNN_R_INFO (dynindx, type); outrel.r_info = ELFNN_R_INFO (dynindx, type);
@ -3219,9 +3220,9 @@ elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type,
else else
outrel.r_offset += sec->output_section->vma + sec->output_offset; outrel.r_offset += sec->output_section->vma + sec->output_offset;
bfd_elfNN_swap_reloca_out (abfd, &outrel, loc = srel->contents;
((ElfNN_External_Rela *) srel->contents loc += srel->reloc_count++ * sizeof (ElfNN_External_Rela);
+ srel->reloc_count++)); bfd_elfNN_swap_reloca_out (abfd, &outrel, loc);
BFD_ASSERT (sizeof (ElfNN_External_Rela) * srel->reloc_count BFD_ASSERT (sizeof (ElfNN_External_Rela) * srel->reloc_count
<= srel->_cooked_size); <= srel->_cooked_size);
} }
@ -4350,7 +4351,6 @@ elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym)
bfd_byte *loc; bfd_byte *loc;
asection *plt_sec; asection *plt_sec;
bfd_vma plt_addr, pltoff_addr, gp_val, index; bfd_vma plt_addr, pltoff_addr, gp_val, index;
ElfNN_External_Rela *rel;
gp_val = _bfd_get_gp_value (output_bfd); gp_val = _bfd_get_gp_value (output_bfd);
@ -4407,10 +4407,10 @@ elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym)
existing sec->reloc_count to be the base of the array of existing sec->reloc_count to be the base of the array of
PLT relocations. */ PLT relocations. */
rel = (ElfNN_External_Rela *)ia64_info->rel_pltoff_sec->contents; loc = ia64_info->rel_pltoff_sec->contents;
rel += ia64_info->rel_pltoff_sec->reloc_count; loc += ((ia64_info->rel_pltoff_sec->reloc_count + index)
* sizeof (Elf64_External_Rela));
bfd_elfNN_swap_reloca_out (output_bfd, &outrel, rel + index); bfd_elfNN_swap_reloca_out (output_bfd, &outrel, loc);
} }
/* Mark some specially defined symbols as absolute. */ /* Mark some specially defined symbols as absolute. */

View File

@ -1176,16 +1176,13 @@ sort_dynamic_relocs (arg1, arg2)
const PTR arg1; const PTR arg1;
const PTR arg2; const PTR arg2;
{ {
const Elf32_External_Rel *ext_reloc1 = (const Elf32_External_Rel *) arg1; Elf_Internal_Rela int_reloc1;
const Elf32_External_Rel *ext_reloc2 = (const Elf32_External_Rel *) arg2; Elf_Internal_Rela int_reloc2;
Elf_Internal_Rel int_reloc1; bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, arg1, &int_reloc1);
Elf_Internal_Rel int_reloc2; bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, arg2, &int_reloc2);
bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, ext_reloc1, &int_reloc1); return ELF32_R_SYM (int_reloc1.r_info) - ELF32_R_SYM (int_reloc2.r_info);
bfd_elf32_swap_reloc_in (reldyn_sorting_bfd, ext_reloc2, &int_reloc2);
return (ELF32_R_SYM (int_reloc1.r_info) - ELF32_R_SYM (int_reloc2.r_info));
} }
/* This routine is used to write out ECOFF debugging external symbol /* This routine is used to write out ECOFF debugging external symbol
@ -2861,7 +2858,7 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec,
bfd_vma *addendp; bfd_vma *addendp;
asection *input_section; asection *input_section;
{ {
Elf_Internal_Rel outrel[3]; Elf_Internal_Rela outrel[3];
boolean skip; boolean skip;
asection *sreloc; asection *sreloc;
bfd *dynobj; bfd *dynobj;
@ -2917,7 +2914,7 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec,
record. Note that R_MIPS_NONE == 0, so that this call to memset record. Note that R_MIPS_NONE == 0, so that this call to memset
is a way of setting R_TYPE to R_MIPS_NONE. */ is a way of setting R_TYPE to R_MIPS_NONE. */
if (skip) if (skip)
memset (outrel, 0, sizeof (Elf_Internal_Rel) * 3); memset (outrel, 0, sizeof (Elf_Internal_Rela) * 3);
else else
{ {
long indx; long indx;
@ -3001,10 +2998,9 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec,
+ sreloc->reloc_count * sizeof (Elf64_Mips_External_Rel))); + sreloc->reloc_count * sizeof (Elf64_Mips_External_Rel)));
} }
else else
bfd_elf32_swap_reloc_out (output_bfd, &outrel[0], bfd_elf32_swap_reloc_out
(((Elf32_External_Rel *) (output_bfd, &outrel[0],
sreloc->contents) (sreloc->contents + sreloc->reloc_count * sizeof (Elf32_External_Rel)));
+ sreloc->reloc_count));
/* Record the index of the first relocation referencing H. This /* Record the index of the first relocation referencing H. This
information is later emitted in the .msym section. */ information is later emitted in the .msym section. */
@ -3577,7 +3573,7 @@ _bfd_mips_elf_section_from_shdr (abfd, hdr, name)
boolean boolean
_bfd_mips_elf_fake_sections (abfd, hdr, sec) _bfd_mips_elf_fake_sections (abfd, hdr, sec)
bfd *abfd; bfd *abfd;
Elf32_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;
asection *sec; asection *sec;
{ {
register const char *name; register const char *name;

View File

@ -1,3 +1,25 @@
2002-11-28 Alan Modra <amodra@bigpond.net.au>
* internal.h (elf32_internal_ehdr, Elf32_Internal_Ehdr,
elf64_internal_ehdr, Elf64_Internal_Ehdr, elf32_internal_phdr,
Elf32_Internal_Phdr, elf64_internal_phdr, Elf64_Internal_Phdr,
elf32_internal_shdr, Elf32_Internal_Shdr, elf64_internal_shdr,
Elf64_Internal_Shdr, elf32_internal_sym, elf64_internal_sym,
Elf32_Internal_Sym, Elf64_Internal_Sym, Elf32_Internal_Note,
elf32_internal_note, elf32_internal_rel, Elf32_Internal_Rel,
elf64_internal_rel, Elf64_Internal_Rel, elf32_internal_rela,
elf64_internal_rela, Elf32_Internal_Rela, Elf64_Internal_Rela,
elf32_internal_dyn, elf64_internal_dyn, Elf32_Internal_Dyn,
Elf64_Internal_Dyn, elf32_internal_verdef, elf64_internal_verdef,
elf32_internal_verdaux, elf64_internal_verdaux, elf32_internal_verneed,
elf64_internal_verneed, elf32_internal_vernaux, elf64_internal_vernaux,
elf32_internal_versym, elf64_internal_versym, Elf32_Internal_Verdef,
Elf64_Internal_Verdef, Elf32_Internal_Verdaux, Elf64_Internal_Verdaux,
Elf32_Internal_Verneed, Elf64_Internal_Verneed, Elf32_Internal_Vernaux,
Elf64_Internal_Vernaux, Elf32_Internal_Versym, Elf64_Internal_Versym,
Elf32_Internal_Syminfo, Elf64_Internal_Syminfo): Delete.
(Elf_Internal_Rel): Delete.
2002-10-11 Kaz Kojima <kkojima@rr.iij4u.or.jp> 2002-10-11 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* sh.h: Add SH TLS relocs. * sh.h: Add SH TLS relocs.

View File

@ -1,5 +1,5 @@
/* ELF support for BFD. /* ELF support for BFD.
Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001 Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002
Free Software Foundation, Inc. Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support, from information published Written by Fred Fish @ Cygnus Support, from information published
@ -58,11 +58,6 @@ typedef struct elf_internal_ehdr {
unsigned int e_shstrndx; /* Section header string table index */ unsigned int e_shstrndx; /* Section header string table index */
} Elf_Internal_Ehdr; } Elf_Internal_Ehdr;
#define elf32_internal_ehdr elf_internal_ehdr
#define Elf32_Internal_Ehdr Elf_Internal_Ehdr
#define elf64_internal_ehdr elf_internal_ehdr
#define Elf64_Internal_Ehdr Elf_Internal_Ehdr
/* Program header */ /* Program header */
struct elf_internal_phdr { struct elf_internal_phdr {
@ -77,10 +72,6 @@ struct elf_internal_phdr {
}; };
typedef struct elf_internal_phdr Elf_Internal_Phdr; typedef struct elf_internal_phdr Elf_Internal_Phdr;
#define elf32_internal_phdr elf_internal_phdr
#define Elf32_Internal_Phdr Elf_Internal_Phdr
#define elf64_internal_phdr elf_internal_phdr
#define Elf64_Internal_Phdr Elf_Internal_Phdr
/* Section header */ /* Section header */
@ -101,11 +92,6 @@ typedef struct elf_internal_shdr {
unsigned char *contents; /* Section contents. */ unsigned char *contents; /* Section contents. */
} Elf_Internal_Shdr; } Elf_Internal_Shdr;
#define elf32_internal_shdr elf_internal_shdr
#define Elf32_Internal_Shdr Elf_Internal_Shdr
#define elf64_internal_shdr elf_internal_shdr
#define Elf64_Internal_Shdr Elf_Internal_Shdr
/* Symbol table entry */ /* Symbol table entry */
struct elf_internal_sym { struct elf_internal_sym {
@ -119,11 +105,6 @@ struct elf_internal_sym {
typedef struct elf_internal_sym Elf_Internal_Sym; typedef struct elf_internal_sym Elf_Internal_Sym;
#define elf32_internal_sym elf_internal_sym
#define elf64_internal_sym elf_internal_sym
#define Elf32_Internal_Sym Elf_Internal_Sym
#define Elf64_Internal_Sym Elf_Internal_Sym
/* Note segments */ /* Note segments */
typedef struct elf_internal_note { typedef struct elf_internal_note {
@ -134,33 +115,15 @@ typedef struct elf_internal_note {
char * descdata; /* Start of the desc data */ char * descdata; /* Start of the desc data */
bfd_vma descpos; /* File offset of the descdata */ bfd_vma descpos; /* File offset of the descdata */
} Elf_Internal_Note; } Elf_Internal_Note;
#define Elf32_Internal_Note Elf_Internal_Note
#define elf32_internal_note elf_internal_note
/* Relocation Entries */ /* Relocation Entries */
typedef struct elf_internal_rel {
bfd_vma r_offset; /* Location at which to apply the action */
/* This needs to support 64-bit values in elf64. */
bfd_vma r_info; /* index and type of relocation */
} Elf_Internal_Rel;
#define elf32_internal_rel elf_internal_rel
#define Elf32_Internal_Rel Elf_Internal_Rel
#define elf64_internal_rel elf_internal_rel
#define Elf64_Internal_Rel Elf_Internal_Rel
typedef struct elf_internal_rela { typedef struct elf_internal_rela {
bfd_vma r_offset; /* Location at which to apply the action */ bfd_vma r_offset; /* Location at which to apply the action */
bfd_vma r_info; /* Index and Type of relocation */ bfd_vma r_info; /* Index and Type of relocation */
bfd_vma r_addend; /* Constant addend used to compute value */ bfd_vma r_addend; /* Constant addend used to compute value */
} Elf_Internal_Rela; } Elf_Internal_Rela;
#define elf32_internal_rela elf_internal_rela
#define elf64_internal_rela elf_internal_rela
#define Elf32_Internal_Rela Elf_Internal_Rela
#define Elf64_Internal_Rela Elf_Internal_Rela
/* dynamic section structure */ /* dynamic section structure */
typedef struct elf_internal_dyn { typedef struct elf_internal_dyn {
@ -173,11 +136,6 @@ typedef struct elf_internal_dyn {
} d_un; } d_un;
} Elf_Internal_Dyn; } Elf_Internal_Dyn;
#define elf32_internal_dyn elf_internal_dyn
#define elf64_internal_dyn elf_internal_dyn
#define Elf32_Internal_Dyn Elf_Internal_Dyn
#define Elf64_Internal_Dyn Elf_Internal_Dyn
/* This structure appears in a SHT_GNU_verdef section. */ /* This structure appears in a SHT_GNU_verdef section. */
typedef struct elf_internal_verdef { typedef struct elf_internal_verdef {
@ -257,30 +215,6 @@ typedef struct
} Elf_Internal_Syminfo; } Elf_Internal_Syminfo;
#define elf32_internal_verdef elf_internal_verdef
#define elf64_internal_verdef elf_internal_verdef
#define elf32_internal_verdaux elf_internal_verdaux
#define elf64_internal_verdaux elf_internal_verdaux
#define elf32_internal_verneed elf_internal_verneed
#define elf64_internal_verneed elf_internal_verneed
#define elf32_internal_vernaux elf_internal_vernaux
#define elf64_internal_vernaux elf_internal_vernaux
#define elf32_internal_versym elf_internal_versym
#define elf64_internal_versym elf_internal_versym
#define Elf32_Internal_Verdef Elf_Internal_Verdef
#define Elf64_Internal_Verdef Elf_Internal_Verdef
#define Elf32_Internal_Verdaux Elf_Internal_Verdaux
#define Elf64_Internal_Verdaux Elf_Internal_Verdaux
#define Elf32_Internal_Verneed Elf_Internal_Verneed
#define Elf64_Internal_Verneed Elf_Internal_Verneed
#define Elf32_Internal_Vernaux Elf_Internal_Vernaux
#define Elf64_Internal_Vernaux Elf_Internal_Vernaux
#define Elf32_Internal_Versym Elf_Internal_Versym
#define Elf64_Internal_Versym Elf_Internal_Versym
#define Elf32_Internal_Syminfo Elf_Internal_Syminfo
#define Elf64_Internal_Syminfo Elf_Internal_Syminfo
/* This structure is used to describe how sections should be assigned /* This structure is used to describe how sections should be assigned
to program segments. */ to program segments. */