+2017-12-06 Alan Modra <amodra@gmail.com>
+
+ * doc/header.sed: Trim trailing space when splitting lines.
+ * aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
+ * aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
+ * arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
+ * archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
+ * bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
+ * coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
+ * coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
+ * coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
+ * coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
+ * coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
+ * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
+ * coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
+ * cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
+ * cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
+ * cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
+ * cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
+ * cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
+ * cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
+ * cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
+ * ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
+ * elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
+ * elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
+ * elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
+ * elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
+ * elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
+ * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
+ * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
+ * elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
+ * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
+ * elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
+ * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
+ * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
+ * elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
+ * elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
+ * elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
+ * elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
+ * elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
+ * elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
+ * elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
+ * elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
+ * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
+ * elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
+ * elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
+ * elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
+ * elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
+ * elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
+ * elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
+ * host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
+ * i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
+ * i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
+ * libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
+ * libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
+ * m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
+ * mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
+ * mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
+ * netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
+ * nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
+ * opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
+ * pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
+ * pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
+ * peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
+ * riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
+ * sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
+ * syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
+ * vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
+ * vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
+ * xsym.c, * xsym.h: Whitespace fixes.
+ * bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
+
2017-12-06 Alan Modra <amodra@gmail.com>
* elf32-lm32.c (lm32_elf_check_relocs): Skip non-ALLOC sections.
/* BFD back-end for AIX on PS/2 core files.
This was based on trad-core.c, which was written by John Gilmore of
- Cygnus Support.
+ Cygnus Support.
Copyright (C) 1988-2017 Free Software Foundation, Inc.
Written by Minh Tran-Le <TRANLE@INTELLICORP.COM>.
Converted to back end form by Ian Lance Taylor <ian@cygnus.com>.
#define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
#define aout_32_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
#define aout_32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
-#define aout_32_close_and_cleanup aout_32_bfd_free_cached_info
-#define aout_32_set_arch_mach aout_adobe_set_arch_mach
-#define aout_32_set_section_contents aout_adobe_set_section_contents
-#define aout_32_sizeof_headers aout_adobe_sizeof_headers
+#define aout_32_close_and_cleanup aout_32_bfd_free_cached_info
+#define aout_32_set_arch_mach aout_adobe_set_arch_mach
+#define aout_32_set_section_contents aout_adobe_set_section_contents
+#define aout_32_sizeof_headers aout_adobe_sizeof_headers
#define aout_32_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define aout_32_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-#define aout_32_bfd_relax_section bfd_generic_relax_section
-#define aout_32_bfd_gc_sections bfd_generic_gc_sections
+#define aout_32_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define aout_32_bfd_relax_section bfd_generic_relax_section
+#define aout_32_bfd_gc_sections bfd_generic_gc_sections
#define aout_32_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define aout_32_bfd_merge_sections bfd_generic_merge_sections
-#define aout_32_bfd_is_group_section bfd_generic_is_group_section
-#define aout_32_bfd_discard_group bfd_generic_discard_group
-#define aout_32_section_already_linked _bfd_generic_section_already_linked
-#define aout_32_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define aout_32_bfd_define_start_stop bfd_generic_define_start_stop
-#define aout_32_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define aout_32_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define aout_32_bfd_link_just_syms _bfd_generic_link_just_syms
+#define aout_32_bfd_merge_sections bfd_generic_merge_sections
+#define aout_32_bfd_is_group_section bfd_generic_is_group_section
+#define aout_32_bfd_discard_group bfd_generic_discard_group
+#define aout_32_section_already_linked _bfd_generic_section_already_linked
+#define aout_32_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define aout_32_bfd_define_start_stop bfd_generic_define_start_stop
+#define aout_32_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define aout_32_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define aout_32_bfd_link_just_syms _bfd_generic_link_just_syms
#define aout_32_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
-#define aout_32_bfd_final_link _bfd_generic_final_link
-#define aout_32_bfd_link_split_section _bfd_generic_link_split_section
-#define aout_32_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define aout_32_bfd_final_link _bfd_generic_final_link
+#define aout_32_bfd_link_split_section _bfd_generic_link_split_section
+#define aout_32_bfd_link_check_relocs _bfd_generic_link_check_relocs
#define aout_32_set_reloc _bfd_generic_set_reloc
const bfd_target aout_adobe_vec =
#define MY(OP) CONCAT2 (arm_aout_,OP)
#define N_BADMAG(x) ((((x)->a_info & ~007200) != ZMAGIC) && \
- (((x)->a_info & ~006000) != OMAGIC) && \
- ((x)->a_info != NMAGIC))
+ (((x)->a_info & ~006000) != OMAGIC) && \
+ ((x)->a_info != NMAGIC))
#define N_MAGIC(x) ((x)->a_info & ~07200)
#define MY_bfd_reloc_type_lookup arm_aout_bfd_reloc_type_lookup
| rel->r_index[2]);
*r_extern = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
r_pcrel_done = (0 != (rel->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
- r_neg = (0 != (rel->r_type[0] & RELOC_ARM_BITS_NEG_BIG));
+ r_neg = (0 != (rel->r_type[0] & RELOC_ARM_BITS_NEG_BIG));
r_length = ((rel->r_type[0] & RELOC_STD_BITS_LENGTH_BIG)
>> RELOC_STD_BITS_LENGTH_SH_BIG);
}
| rel->r_index[0]);
*r_extern = (0 != (rel->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
r_pcrel_done = (0 != (rel->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
- r_neg = (0 != (rel->r_type[0] & RELOC_ARM_BITS_NEG_LITTLE));
+ r_neg = (0 != (rel->r_type[0] & RELOC_ARM_BITS_NEG_LITTLE));
r_length = ((rel->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE)
>> RELOC_STD_BITS_LENGTH_SH_LITTLE);
}
if (howto->type == 3 || howto->type == 7)
r_length = 3;
- r_pcrel = howto->type & 4; /* PC Relative done? */
+ r_pcrel = howto->type & 4; /* PC Relative done? */
r_neg = howto->type & 8; /* Negative relocation. */
if (bfd_header_big_endian (abfd))
switch (bfd_arch_bits_per_address (abfd))
{
case 32:
- code = BFD_RELOC_32;
- break;
+ code = BFD_RELOC_32;
+ break;
default:
return NULL;
}
const bfd_target arm_aout_le_vec =
{
- "a.out-arm-little", /* Name. */
+ "a.out-arm-little", /* Name. */
bfd_target_aout_flavour,
- BFD_ENDIAN_LITTLE, /* Target byte order (little). */
- BFD_ENDIAN_LITTLE, /* Target headers byte order (little). */
- (HAS_RELOC | EXEC_P | /* Object flags. */
+ BFD_ENDIAN_LITTLE, /* Target byte order (little). */
+ BFD_ENDIAN_LITTLE, /* Target headers byte order (little). */
+ (HAS_RELOC | EXEC_P | /* Object flags. */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
MY_symbol_leading_char,
- AR_PAD_CHAR, /* AR_pad_char. */
- 15, /* AR_max_namelen. */
+ AR_PAD_CHAR, /* AR_pad_char. */
+ 15, /* AR_max_namelen. */
0, /* match priority. */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
const bfd_target arm_aout_be_vec =
{
- "a.out-arm-big", /* Name. */
+ "a.out-arm-big", /* Name. */
bfd_target_aout_flavour,
- BFD_ENDIAN_BIG, /* Target byte order (big). */
- BFD_ENDIAN_BIG, /* Target headers byte order (big). */
- (HAS_RELOC | EXEC_P | /* Object flags. */
+ BFD_ENDIAN_BIG, /* Target byte order (big). */
+ BFD_ENDIAN_BIG, /* Target headers byte order (big). */
+ (HAS_RELOC | EXEC_P | /* Object flags. */
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
functions. Beware; some of the information there is outdated. */
#define N_HEADER_IN_TEXT(x) 0
-#define N_TXTOFF(x) 32
+#define N_TXTOFF(x) 32
#define ENTRY_CAN_BE_ZERO
#define TEXT_START_ADDR 0
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: Bad relocation record imported: %d"), abfd, r_index);
+ (_("%B: Bad relocation record imported: %d"), abfd, r_index);
bfd_set_error (bfd_error_wrong_format);
reloc_howto_type * MYNS (bfd_reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
reloc_howto_type * MYNS (bfd_reloc_name_lookup) (bfd *, const char *);
-bfd_boolean MYNS (write_object_contents) (bfd *);
+bfd_boolean MYNS (write_object_contents) (bfd *);
/* Avoid multiple definitions from aoutx if supporting
standard a.out format(s) as well as this one. */
sym1: .long foo # 2's complement not pc relative
self: movd @self, r0 # pc relative displacement
- movd foo, r0 # non pc relative displacement
+ movd foo, r0 # non pc relative displacement
self: movd self, r0 # pc relative immediate
- movd foo, r0 # non pc relative immediate
+ movd foo, r0 # non pc relative immediate
In addition, for historical reasons the encoding of the relocation types
in the a.out format relocation entries is such that even the relocation
#define CTOR_TABLE_RELOC_HOWTO(BFD) (MY (howto_table) + 14)
-#define RELOC_STD_BITS_NS32K_TYPE_BIG 0x06
-#define RELOC_STD_BITS_NS32K_TYPE_LITTLE 0x60
-#define RELOC_STD_BITS_NS32K_TYPE_SH_BIG 1
-#define RELOC_STD_BITS_NS32K_TYPE_SH_LITTLE 5
+#define RELOC_STD_BITS_NS32K_TYPE_BIG 0x06
+#define RELOC_STD_BITS_NS32K_TYPE_LITTLE 0x60
+#define RELOC_STD_BITS_NS32K_TYPE_SH_BIG 1
+#define RELOC_STD_BITS_NS32K_TYPE_SH_LITTLE 5
static reloc_howto_type *
MY (reloc_howto) (bfd *abfd ATTRIBUTE_UNUSED,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Headers. */
#endif
- {_bfd_dummy_target, MY_object_p, /* bfd_check_format. */
+ {_bfd_dummy_target, MY_object_p, /* bfd_check_format. */
bfd_generic_archive_p, MY_core_file_p},
{bfd_false, MY_mkobject, /* bfd_set_format. */
_bfd_generic_mkarchive, bfd_false},
- {bfd_false, MY_write_object_contents, /* bfd_write_contents. */
+ {bfd_false, MY_write_object_contents, /* bfd_write_contents. */
_bfd_write_archive_contents, bfd_false},
BFD_JUMP_TABLE_GENERIC (MY),
#define TARGET_IS_BIG_ENDIAN_P
#define N_HEADER_IN_TEXT(x) 1
-#define TEXT_START_ADDR 1024
-#define TARGET_PAGE_SIZE 128
-#define SEGMENT_SIZE TARGET_PAGE_SIZE
-#define DEFAULT_ARCH bfd_arch_tic30
+#define TEXT_START_ADDR 1024
+#define TARGET_PAGE_SIZE 128
+#define SEGMENT_SIZE TARGET_PAGE_SIZE
+#define DEFAULT_ARCH bfd_arch_tic30
#define ARCH_SIZE 32
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
#define MY_reloc_howto(BFD, REL, IN, EX, PC) tic30_aout_reloc_howto (BFD, REL, & IN, & EX, & PC)
-#define MY_final_link_relocate tic30_aout_final_link_relocate
-#define MY_object_p tic30_aout_object_p
-#define MY_mkobject NAME (aout,mkobject)
+#define MY_final_link_relocate tic30_aout_final_link_relocate
+#define MY_object_p tic30_aout_object_p
+#define MY_mkobject NAME (aout,mkobject)
#define MY_write_object_contents tic30_aout_write_object_contents
-#define MY_set_sizes tic30_aout_set_sizes
+#define MY_set_sizes tic30_aout_set_sizes
#ifndef MY_exec_hdr_flags
#define MY_exec_hdr_flags 1
(bfd_get_8 (BFD, ADDR + 2) )
#define bfd_putb_24(BFD,DATA,ADDR) \
- bfd_put_8 (BFD, (bfd_byte) ((DATA >> 16) & 0xFF), ADDR ); \
+ bfd_put_8 (BFD, (bfd_byte) ((DATA >> 16) & 0xFF), ADDR ); \
bfd_put_8 (BFD, (bfd_byte) ((DATA >> 8) & 0xFF), ADDR + 1); \
- bfd_put_8 (BFD, (bfd_byte) ( DATA & 0xFF), ADDR + 2)
+ bfd_put_8 (BFD, (bfd_byte) ( DATA & 0xFF), ADDR + 2)
/* Set parameters about this a.out file that are machine-dependent.
This routine is called from some_aout_object_p just before it returns. */
#define MY_truncate_arname bfd_bsd_truncate_arname
#endif
#ifndef MY_update_armap_timestamp
-#define MY_update_armap_timestamp _bfd_archive_bsd_update_armap_timestamp
+#define MY_update_armap_timestamp _bfd_archive_bsd_update_armap_timestamp
#endif
/* No core file defined here -- configure in trad-core.c separately. */
#ifndef MY_core_file_failing_command
-#define MY_core_file_failing_command _bfd_nocore_core_file_failing_command
+#define MY_core_file_failing_command _bfd_nocore_core_file_failing_command
#endif
#ifndef MY_core_file_failing_signal
#define MY_core_file_failing_signal _bfd_nocore_core_file_failing_signal
_bfd_nocore_core_file_matches_executable_p
#endif
#ifndef MY_core_file_pid
-#define MY_core_file_pid _bfd_nocore_core_file_pid
+#define MY_core_file_pid _bfd_nocore_core_file_pid
#endif
#ifndef MY_core_file_p
#define MY_core_file_p _bfd_dummy_target
MY_finish_dynamic_link
};
\f
-#define MY_core_file_failing_command sunos4_core_file_failing_command
+#define MY_core_file_failing_command sunos4_core_file_failing_command
#define MY_core_file_failing_signal sunos4_core_file_failing_signal
#define MY_core_file_matches_executable_p sunos4_core_file_matches_executable_p
reloc_howto_type howto_table_ext[] =
{
- /* Type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */
- HOWTO (RELOC_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "8", FALSE, 0, 0x000000ff, FALSE),
- HOWTO (RELOC_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "16", FALSE, 0, 0x0000ffff, FALSE),
- HOWTO (RELOC_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "32", FALSE, 0, 0xffffffff, FALSE),
- HOWTO (RELOC_DISP8, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0, "DISP8", FALSE, 0, 0x000000ff, FALSE),
- HOWTO (RELOC_DISP16, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "DISP16", FALSE, 0, 0x0000ffff, FALSE),
- HOWTO (RELOC_DISP32, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "DISP32", FALSE, 0, 0xffffffff, FALSE),
- HOWTO (RELOC_WDISP30, 2, 2, 30, TRUE, 0, complain_overflow_signed, 0, "WDISP30", FALSE, 0, 0x3fffffff, FALSE),
- HOWTO (RELOC_WDISP22, 2, 2, 22, TRUE, 0, complain_overflow_signed, 0, "WDISP22", FALSE, 0, 0x003fffff, FALSE),
- HOWTO (RELOC_HI22, 10, 2, 22, FALSE, 0, complain_overflow_bitfield, 0, "HI22", FALSE, 0, 0x003fffff, FALSE),
- HOWTO (RELOC_22, 0, 2, 22, FALSE, 0, complain_overflow_bitfield, 0, "22", FALSE, 0, 0x003fffff, FALSE),
- HOWTO (RELOC_13, 0, 2, 13, FALSE, 0, complain_overflow_bitfield, 0, "13", FALSE, 0, 0x00001fff, FALSE),
- HOWTO (RELOC_LO10, 0, 2, 10, FALSE, 0, complain_overflow_dont, 0, "LO10", FALSE, 0, 0x000003ff, FALSE),
- HOWTO (RELOC_SFA_BASE,0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "SFA_BASE", FALSE, 0, 0xffffffff, FALSE),
- HOWTO (RELOC_SFA_OFF13,0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "SFA_OFF13", FALSE, 0, 0xffffffff, FALSE),
- HOWTO (RELOC_BASE10, 0, 2, 10, FALSE, 0, complain_overflow_dont, 0, "BASE10", FALSE, 0, 0x000003ff, FALSE),
- HOWTO (RELOC_BASE13, 0, 2, 13, FALSE, 0, complain_overflow_signed, 0, "BASE13", FALSE, 0, 0x00001fff, FALSE),
- HOWTO (RELOC_BASE22, 10, 2, 22, FALSE, 0, complain_overflow_bitfield, 0, "BASE22", FALSE, 0, 0x003fffff, FALSE),
- HOWTO (RELOC_PC10, 0, 2, 10, TRUE, 0, complain_overflow_dont, 0, "PC10", FALSE, 0, 0x000003ff, TRUE),
- HOWTO (RELOC_PC22, 10, 2, 22, TRUE, 0, complain_overflow_signed, 0, "PC22", FALSE, 0, 0x003fffff, TRUE),
- HOWTO (RELOC_JMP_TBL, 2, 2, 30, TRUE, 0, complain_overflow_signed, 0, "JMP_TBL", FALSE, 0, 0x3fffffff, FALSE),
+ /* Type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */
+ HOWTO (RELOC_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "8", FALSE, 0, 0x000000ff, FALSE),
+ HOWTO (RELOC_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "16", FALSE, 0, 0x0000ffff, FALSE),
+ HOWTO (RELOC_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "32", FALSE, 0, 0xffffffff, FALSE),
+ HOWTO (RELOC_DISP8, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0, "DISP8", FALSE, 0, 0x000000ff, FALSE),
+ HOWTO (RELOC_DISP16, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "DISP16", FALSE, 0, 0x0000ffff, FALSE),
+ HOWTO (RELOC_DISP32, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "DISP32", FALSE, 0, 0xffffffff, FALSE),
+ HOWTO (RELOC_WDISP30, 2, 2, 30, TRUE, 0, complain_overflow_signed, 0, "WDISP30", FALSE, 0, 0x3fffffff, FALSE),
+ HOWTO (RELOC_WDISP22, 2, 2, 22, TRUE, 0, complain_overflow_signed, 0, "WDISP22", FALSE, 0, 0x003fffff, FALSE),
+ HOWTO (RELOC_HI22, 10, 2, 22, FALSE, 0, complain_overflow_bitfield, 0, "HI22", FALSE, 0, 0x003fffff, FALSE),
+ HOWTO (RELOC_22, 0, 2, 22, FALSE, 0, complain_overflow_bitfield, 0, "22", FALSE, 0, 0x003fffff, FALSE),
+ HOWTO (RELOC_13, 0, 2, 13, FALSE, 0, complain_overflow_bitfield, 0, "13", FALSE, 0, 0x00001fff, FALSE),
+ HOWTO (RELOC_LO10, 0, 2, 10, FALSE, 0, complain_overflow_dont, 0, "LO10", FALSE, 0, 0x000003ff, FALSE),
+ HOWTO (RELOC_SFA_BASE,0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "SFA_BASE", FALSE, 0, 0xffffffff, FALSE),
+ HOWTO (RELOC_SFA_OFF13,0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "SFA_OFF13", FALSE, 0, 0xffffffff, FALSE),
+ HOWTO (RELOC_BASE10, 0, 2, 10, FALSE, 0, complain_overflow_dont, 0, "BASE10", FALSE, 0, 0x000003ff, FALSE),
+ HOWTO (RELOC_BASE13, 0, 2, 13, FALSE, 0, complain_overflow_signed, 0, "BASE13", FALSE, 0, 0x00001fff, FALSE),
+ HOWTO (RELOC_BASE22, 10, 2, 22, FALSE, 0, complain_overflow_bitfield, 0, "BASE22", FALSE, 0, 0x003fffff, FALSE),
+ HOWTO (RELOC_PC10, 0, 2, 10, TRUE, 0, complain_overflow_dont, 0, "PC10", FALSE, 0, 0x000003ff, TRUE),
+ HOWTO (RELOC_PC22, 10, 2, 22, TRUE, 0, complain_overflow_signed, 0, "PC22", FALSE, 0, 0x003fffff, TRUE),
+ HOWTO (RELOC_JMP_TBL, 2, 2, 30, TRUE, 0, complain_overflow_signed, 0, "JMP_TBL", FALSE, 0, 0x3fffffff, FALSE),
HOWTO (RELOC_SEGOFF16,0, 2, 0, FALSE, 0, complain_overflow_bitfield, 0, "SEGOFF16", FALSE, 0, 0x00000000, FALSE),
HOWTO (RELOC_GLOB_DAT,0, 2, 0, FALSE, 0, complain_overflow_bitfield, 0, "GLOB_DAT", FALSE, 0, 0x00000000, FALSE),
HOWTO (RELOC_JMP_SLOT,0, 2, 0, FALSE, 0, complain_overflow_bitfield, 0, "JMP_SLOT", FALSE, 0, 0x00000000, FALSE),
HOWTO (RELOC_RELATIVE,0, 2, 0, FALSE, 0, complain_overflow_bitfield, 0, "RELATIVE", FALSE, 0, 0x00000000, FALSE),
- HOWTO (0, 0, 3, 0, FALSE, 0, complain_overflow_dont, 0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
- HOWTO (0, 0, 3, 0, FALSE, 0, complain_overflow_dont, 0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
+ HOWTO (0, 0, 3, 0, FALSE, 0, complain_overflow_dont, 0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
+ HOWTO (0, 0, 3, 0, FALSE, 0, complain_overflow_dont, 0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
#define RELOC_SPARC_REV32 RELOC_WDISP19
- HOWTO (RELOC_SPARC_REV32, 0, 2, 32, FALSE, 0, complain_overflow_dont, 0,"R_SPARC_REV32",FALSE, 0, 0xffffffff, FALSE),
+ HOWTO (RELOC_SPARC_REV32, 0, 2, 32, FALSE, 0, complain_overflow_dont, 0,"R_SPARC_REV32",FALSE, 0, 0xffffffff, FALSE),
};
/* Convert standard reloc records to "arelent" format (incl byte swap). */
reloc_howto_type howto_table_std[] =
{
- /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */
-HOWTO ( 0, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,0,"8", TRUE, 0x000000ff,0x000000ff, FALSE),
-HOWTO ( 1, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
-HOWTO ( 2, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"32", TRUE, 0xffffffff,0xffffffff, FALSE),
-HOWTO ( 3, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,0,"64", TRUE, 0xdeaddead,0xdeaddead, FALSE),
-HOWTO ( 4, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0,"DISP8", TRUE, 0x000000ff,0x000000ff, FALSE),
-HOWTO ( 5, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0,"DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
-HOWTO ( 6, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0,"DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
-HOWTO ( 7, 0, 4, 64, TRUE, 0, complain_overflow_signed, 0,"DISP64", TRUE, 0xfeedface,0xfeedface, FALSE),
-HOWTO ( 8, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"GOT_REL", FALSE, 0,0x00000000, FALSE),
-HOWTO ( 9, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"BASE16", FALSE,0xffffffff,0xffffffff, FALSE),
-HOWTO (10, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"BASE32", FALSE,0xffffffff,0xffffffff, FALSE),
+ /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */
+HOWTO ( 0, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,0,"8", TRUE, 0x000000ff,0x000000ff, FALSE),
+HOWTO ( 1, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+HOWTO ( 2, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"32", TRUE, 0xffffffff,0xffffffff, FALSE),
+HOWTO ( 3, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,0,"64", TRUE, 0xdeaddead,0xdeaddead, FALSE),
+HOWTO ( 4, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0,"DISP8", TRUE, 0x000000ff,0x000000ff, FALSE),
+HOWTO ( 5, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0,"DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+HOWTO ( 6, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0,"DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
+HOWTO ( 7, 0, 4, 64, TRUE, 0, complain_overflow_signed, 0,"DISP64", TRUE, 0xfeedface,0xfeedface, FALSE),
+HOWTO ( 8, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"GOT_REL", FALSE, 0,0x00000000, FALSE),
+HOWTO ( 9, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"BASE16", FALSE,0xffffffff,0xffffffff, FALSE),
+HOWTO (10, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"BASE32", FALSE,0xffffffff,0xffffffff, FALSE),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
- HOWTO (16, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"JMP_TABLE", FALSE, 0,0x00000000, FALSE),
+ HOWTO (16, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"JMP_TABLE", FALSE, 0,0x00000000, FALSE),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
- HOWTO (32, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"RELATIVE", FALSE, 0,0x00000000, FALSE),
+ HOWTO (32, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"RELATIVE", FALSE, 0,0x00000000, FALSE),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
EMPTY_HOWTO (-1),
- HOWTO (40, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"BASEREL", FALSE, 0,0x00000000, FALSE),
+ HOWTO (40, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"BASEREL", FALSE, 0,0x00000000, FALSE),
};
#define TABLE_SIZE(TABLE) (sizeof (TABLE) / sizeof (TABLE[0]))
SYNOPSIS
void aout_@var{size}_swap_exec_header_in,
- (bfd *abfd,
- struct external_exec *bytes,
- struct internal_exec *execp);
+ (bfd *abfd,
+ struct external_exec *bytes,
+ struct internal_exec *execp);
DESCRIPTION
Swap the information in an executable header @var{raw_bytes} taken
SYNOPSIS
const bfd_target *aout_@var{size}_some_aout_object_p
(bfd *abfd,
- struct internal_exec *execp,
+ struct internal_exec *execp,
const bfd_target *(*callback_to_real_object_p) (bfd *));
DESCRIPTION
struct stat stat_buf;
/* The original heuristic doesn't work in some important cases.
- The a.out file has no information about the text start
- address. For files (like kernels) linked to non-standard
- addresses (ld -Ttext nnn) the entry point may not be between
- the default text start (obj_textsec(abfd)->vma) and
- (obj_textsec(abfd)->vma) + text size. This is not just a mach
- issue. Many kernels are loaded at non standard addresses. */
+ The a.out file has no information about the text start
+ address. For files (like kernels) linked to non-standard
+ addresses (ld -Ttext nnn) the entry point may not be between
+ the default text start (obj_textsec(abfd)->vma) and
+ (obj_textsec(abfd)->vma) + text size. This is not just a mach
+ issue. Many kernels are loaded at non standard addresses. */
if (abfd->iostream != NULL
&& (abfd->flags & BFD_IN_MEMORY) == 0
&& (fstat (fileno ((FILE *) (abfd->iostream)), &stat_buf) == 0)
enum machine_type aout_@var{size}_machine_type
(enum bfd_architecture arch,
unsigned long machine,
- bfd_boolean *unknown);
+ bfd_boolean *unknown);
DESCRIPTION
Keep track of machine architecture and machine type for
|| machine == bfd_mach_sparc_v8plus
|| machine == bfd_mach_sparc_v8plusa
|| machine == bfd_mach_sparc_v8plusb
- || machine == bfd_mach_sparc_v8plusc
- || machine == bfd_mach_sparc_v8plusd
- || machine == bfd_mach_sparc_v8pluse
- || machine == bfd_mach_sparc_v8plusv
- || machine == bfd_mach_sparc_v8plusm
- || machine == bfd_mach_sparc_v8plusm8
+ || machine == bfd_mach_sparc_v8plusc
+ || machine == bfd_mach_sparc_v8plusd
+ || machine == bfd_mach_sparc_v8pluse
+ || machine == bfd_mach_sparc_v8plusv
+ || machine == bfd_mach_sparc_v8plusm
+ || machine == bfd_mach_sparc_v8plusm8
|| machine == bfd_mach_sparc_v9
|| machine == bfd_mach_sparc_v9a
|| machine == bfd_mach_sparc_v9b
- || machine == bfd_mach_sparc_v9c
- || machine == bfd_mach_sparc_v9d
- || machine == bfd_mach_sparc_v9e
- || machine == bfd_mach_sparc_v9v
+ || machine == bfd_mach_sparc_v9c
+ || machine == bfd_mach_sparc_v9d
+ || machine == bfd_mach_sparc_v9e
+ || machine == bfd_mach_sparc_v9v
|| machine == bfd_mach_sparc_v9m
- || machine == bfd_mach_sparc_v9m8)
+ || machine == bfd_mach_sparc_v9m8)
arch_flags = M_SPARC;
else if (machine == bfd_mach_sparc_sparclet)
arch_flags = M_SPARCLET;
case bfd_arch_ns32k:
switch (machine)
{
- case 0: arch_flags = M_NS32532; break;
+ case 0: arch_flags = M_NS32532; break;
case 32032: arch_flags = M_NS32032; break;
case 32532: arch_flags = M_NS32532; break;
default: arch_flags = M_UNKNOWN; break;
else
{
/* The VMA of the .bss section is set by the VMA of the
- .data section plus the size of the .data section. We may
- need to add padding bytes to make this true. */
+ .data section plus the size of the .data section. We may
+ need to add padding bytes to make this true. */
pad = obj_bsssec (abfd)->vma - vma;
if (pad > 0)
{
else
{
/* The .text section is being loaded at an unusual address. We
- may need to pad it such that the .data section starts at a page
- boundary. */
+ may need to pad it such that the .data section starts at a page
+ boundary. */
if (ztih)
text_pad = ((obj_textsec (abfd)->filepos - obj_textsec (abfd)->vma)
& (adata (abfd).page_size - 1));
str;
}),
obj_textsec (abfd)->vma, obj_textsec (abfd)->size,
- obj_textsec (abfd)->alignment_power,
+ obj_textsec (abfd)->alignment_power,
obj_datasec (abfd)->vma, obj_datasec (abfd)->size,
- obj_datasec (abfd)->alignment_power,
+ obj_datasec (abfd)->alignment_power,
obj_bsssec (abfd)->vma, obj_bsssec (abfd)->size,
- obj_bsssec (abfd)->alignment_power);
+ obj_bsssec (abfd)->alignment_power);
#endif
#endif
#ifdef BFD_AOUT_DEBUG
fprintf (stderr, " text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x>\n",
obj_textsec (abfd)->vma, obj_textsec (abfd)->size,
- obj_textsec (abfd)->filepos,
+ obj_textsec (abfd)->filepos,
obj_datasec (abfd)->vma, obj_datasec (abfd)->size,
- obj_datasec (abfd)->filepos,
+ obj_datasec (abfd)->filepos,
obj_bsssec (abfd)->vma, obj_bsssec (abfd)->size);
#endif
aout_@var{size}_new_section_hook
SYNOPSIS
- bfd_boolean aout_@var{size}_new_section_hook,
+ bfd_boolean aout_@var{size}_new_section_hook,
(bfd *abfd,
asection *newsect);
/* xgettext:c-format */
(_("%B: can not represent section `%A' in a.out object file format"),
abfd, section);
- bfd_set_error (bfd_error_nonrepresentable_section);
- return FALSE;
+ bfd_set_error (bfd_error_nonrepresentable_section);
+ return FALSE;
}
}
case N_SETB: case N_SETB | N_EXT:
{
/* This code is no longer needed. It used to be used to make
- the linker handle set symbols, but they are now handled in
- the add_symbols routine instead. */
+ the linker handle set symbols, but they are now handled in
+ the add_symbols routine instead. */
switch (cache_ptr->type & N_TYPE)
{
case N_SETA:
/* xgettext:c-format */
(_("%B: can not represent section `%A' in a.out object file format"),
abfd, sec);
- bfd_set_error (bfd_error_nonrepresentable_section);
- return FALSE;
+ bfd_set_error (bfd_error_nonrepresentable_section);
+ return FALSE;
}
}
if (r_extern && r_index > symcount)
{
/* We could arrange to return an error, but it might be useful
- to see the file even if it is bad. */
+ to see the file even if it is bad. */
r_extern = 0;
r_index = N_ABS;
}
if (r_extern && r_index > symcount)
{
/* We could arrange to return an error, but it might be useful
- to see the file even if it is bad. */
+ to see the file even if it is bad. */
r_extern = 0;
r_index = N_ABS;
}
subclass. */
if (ret == NULL)
ret = (struct aout_link_hash_entry *) bfd_hash_allocate (table,
- sizeof (* ret));
+ sizeof (* ret));
if (ret == NULL)
return NULL;
in. This is true regardless of whether the current
definition of the symbol is undefined or common.
- If the current definition is common, we have a case in
+ If the current definition is common, we have a case in
which we have already seen an object file including:
- int a;
+ int a;
and this object file from the archive includes:
- int a = 5;
+ int a = 5;
In such a case, whether to include this object is target
- dependant for backward compatibility.
+ dependant for backward compatibility.
FIXME: The SunOS 4.1.3 linker will pull in the archive
element if the symbol is defined in the .data section,
subclass. */
if (ret == NULL)
ret = (struct aout_link_includes_entry *)
- bfd_hash_allocate (table, sizeof (* ret));
+ bfd_hash_allocate (table, sizeof (* ret));
if (ret == NULL)
return NULL;
return TRUE;
case bfd_link_hash_new:
/* This can happen for set symbols when sets are not being
- built. */
+ built. */
return TRUE;
case bfd_link_hash_undefined:
type = N_UNDF | N_EXT;
if (h != NULL)
{
/* We decided to strip this symbol, but it
- turns out that we can't. Note that we
- lose the other and desc information here.
- I don't think that will ever matter for a
- global symbol. */
+ turns out that we can't. Note that we
+ lose the other and desc information here.
+ I don't think that will ever matter for a
+ global symbol. */
if (h->indx < 0)
{
h->indx = -2;
}
/* Now warn if a global symbol is undefined. We could not
- do this earlier, because check_dynamic_reloc might want
- to skip this reloc. */
+ do this earlier, because check_dynamic_reloc might want
+ to skip this reloc. */
if (hundef && ! bfd_link_pic (flaginfo->info) && ! r_baserel)
{
const char *name;
if (h != NULL)
{
/* We decided to strip this symbol, but it
- turns out that we can't. Note that we
- lose the other and desc information here.
- I don't think that will ever matter for a
- global symbol. */
+ turns out that we can't. Note that we
+ lose the other and desc information here.
+ I don't think that will ever matter for a
+ global symbol. */
if (h->indx < 0)
{
h->indx = -2;
int type;
/* For base relative relocs, r_index is always an index
- into the symbol table, even if r_extern is 0. */
+ into the symbol table, even if r_extern is 0. */
sym = syms + r_index;
type = H_GET_8 (input_bfd, sym->e_type);
if ((type & N_TYPE) == N_TEXT
}
/* Now warn if a global symbol is undefined. We could not
- do this earlier, because check_dynamic_reloc might want
- to skip this reloc. */
+ do this earlier, because check_dynamic_reloc might want
+ to skip this reloc. */
if (hundef
&& ! bfd_link_pic (flaginfo->info)
&& r_type != (unsigned int) RELOC_BASE10
bfd_boolean copy;
/* We set *symbol_map to 0 above for all symbols. If it has
- already been set to -1 for this symbol, it means that we are
- discarding it because it appears in a duplicate header file.
- See the N_BINCL code below. */
+ already been set to -1 for this symbol, it means that we are
+ discarding it because it appears in a duplicate header file.
+ See the N_BINCL code below. */
if (*symbol_map == -1)
continue;
/* Initialize *symbol_map to -1, which means that the symbol was
- not copied into the output file. We will change it later if
- we do copy the symbol over. */
+ not copied into the output file. We will change it later if
+ we do copy the symbol over. */
*symbol_map = -1;
type = H_GET_8 (input_bfd, sym->e_type);
h = *sym_hash;
/* Use the name from the hash table, in case the symbol was
- wrapped. */
+ wrapped. */
if (h != NULL
&& h->root.type != bfd_link_hash_warning)
name = h->root.root.string;
}
/* If we have already included a header file with the
- same value, then replace this one with an N_EXCL
- symbol. */
+ same value, then replace this one with an N_EXCL
+ symbol. */
copy = (bfd_boolean) (! flaginfo->info->keep_memory);
incl_entry = aout_link_includes_lookup (&flaginfo->includes,
name, TRUE, copy);
if (t == NULL)
{
/* This is the first time we have seen this header
- file with this set of stabs strings. */
+ file with this set of stabs strings. */
t = (struct aout_link_includes_totals *)
- bfd_hash_allocate (&flaginfo->includes.root,
+ bfd_hash_allocate (&flaginfo->includes.root,
sizeof *t);
if (t == NULL)
return FALSE;
int *incl_map;
/* This is a duplicate header file. We must change
- it to be an N_EXCL entry, and mark all the
- included symbols to prevent outputting them. */
+ it to be an N_EXCL entry, and mark all the
+ included symbols to prevent outputting them. */
type = (int) N_EXCL;
nest = 0;
{
case GOT_NORMAL:
{
- bfd_vma offset
+ bfd_vma offset
= ADD_SYMBOL_REF_SEC_AND_RELOC (got, bfd_link_pic (info)
|| h != NULL, h);
- new_got_entry_to_list (list, type, offset, TLS_GOT_NONE);
+ new_got_entry_to_list (list, type, offset, TLS_GOT_NONE);
}
break;
static bfd_vma
-relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p,
- enum tls_type_e type,
- struct bfd_link_info * info,
- bfd * output_bfd,
- unsigned long r_symndx,
- Elf_Internal_Sym * local_syms,
- asection ** local_sections,
- struct elf_link_hash_entry * h,
+relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p,
+ enum tls_type_e type,
+ struct bfd_link_info * info,
+ bfd * output_bfd,
+ unsigned long r_symndx,
+ Elf_Internal_Sym * local_syms,
+ asection ** local_sections,
+ struct elf_link_hash_entry * h,
struct arc_relocation_data * reloc_data)
{
struct elf_link_hash_table *htab = elf_hash_table (info);
enum tls_got_entries e = list->existing_entries;
BFD_ASSERT (list->type != GOT_TLS_GD
- || list->existing_entries == TLS_GOT_MOD_AND_OFF);
+ || list->existing_entries == TLS_GOT_MOD_AND_OFF);
bfd_vma dynindx = (h == NULL || h->dynindx == -1) ? 0 : h->dynindx;
if (e == TLS_GOT_MOD_AND_OFF || e == TLS_GOT_MOD)
{
ADD_RELA (output_bfd, got, got_offset, dynindx,
- R_ARC_TLS_DTPMOD, 0);
+ R_ARC_TLS_DTPMOD, 0);
ARC_DEBUG ("arc_info: TLS_DYNRELOC: type = %d, \
GOT_OFFSET = %#lx, GOT_VMA = %#lx, INDEX = %ld, ADDEND = 0x0\n",
list->type,
create_got_dynrelocs_for_got_info (struct got_entry **list_p,
bfd *output_bfd,
struct bfd_link_info * info,
- struct elf_link_hash_entry *h)
+ struct elf_link_hash_entry *h)
{
if (list_p == NULL)
return;
/* Non Arc V2 Related PLT entries. */
-PLT_TYPE_START (ELF_ARC_PIC)
+PLT_TYPE_START (ELF_ARC_PIC)
PLT_ENTRY (0x2730,0x7f8b,0x0000,0x0000) /* ld %r11, [pcl,0] : 0 to be replaced by _DYNAMIC@GOTPC+4 */
PLT_ENTRY (0x2730,0x7f8a,0x0000,0x0000) /* ld %r10, [pcl,0] : 0 to be replaced by -DYNAMIC@GOTPC+8 */
PLT_ENTRY (0x2020,0x0280) /* j [%r10] */
ELEM_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 0)
-PLT_TYPE_END (ELF_ARC_PIC)
+PLT_TYPE_END (ELF_ARC_PIC)
-PLT_TYPE_START (ELF_ARC_ABS)
+PLT_TYPE_START (ELF_ARC_ABS)
PLT_ENTRY (0x1600,0x700b,0x0000,0x0000) /* ld %r11, [0] */
PLT_ENTRY (0x1600,0x700a,0x0000,0x0000) /* ld %r10, [0] */
PLT_ENTRY (0x2020,0x0280) /* j [%r10] */
ELEM_RELOC (4, 32, 0xFFFFFFFF, SGOT | RELATIVE_INSN_32 | MIDDLE_ENDIAN, 0)
-PLT_TYPE_END (ELF_ARC_ABS)
+PLT_TYPE_END (ELF_ARC_ABS)
MIDDLE_ENDIAN = (1 << 11)
};
-#define IS_RELATIVE(S) ((S & (RELATIVE | RELATIVE_INSN_24 | RELATIVE_INSN_32)) != 0)
-#define IS_INSN_32(S) ((S & RELATIVE_INSN_32) != 0)
-#define IS_INSN_24(S) ((S & RELATIVE_INSN_24) != 0)
+#define IS_RELATIVE(S) ((S & (RELATIVE | RELATIVE_INSN_24 | RELATIVE_INSN_32)) != 0)
+#define IS_INSN_32(S) ((S & RELATIVE_INSN_32) != 0)
+#define IS_INSN_24(S) ((S & RELATIVE_INSN_24) != 0)
#define IS_MIDDLE_ENDIAN(S) ((S & MIDDLE_ENDIAN) != 0)
-#define SYM_ONLY(S) (S & 0xFF)
+#define SYM_ONLY(S) (S & 0xFF)
struct plt_reloc
{
#define PLT_TYPE_END(NAME) \
{0, 0, 0, LAST_RELOC, 0} \
};
-#define PLT_ENTRY(...)
+#define PLT_ENTRY(...)
#define PLT_ELEM(...)
#define ENTRY_RELOC(...) { __VA_ARGS__ },
#define ELEM_RELOC(...)
#define PLT_TYPE_END(NAME) \
{0, 0, 0, LAST_RELOC, 0} \
};
-#define PLT_ENTRY(...)
+#define PLT_ENTRY(...)
#define PLT_ELEM(...)
#define ENTRY_RELOC(...)
#define ELEM_RELOC(...) { __VA_ARGS__ },
Relative path Reference path Result
------------- -------------- ------
- bar.o lib.a bar.o
- foo/bar.o lib.a foo/bar.o
- bar.o foo/lib.a ../bar.o
- foo/bar.o baz/lib.a ../foo/bar.o
- bar.o ../lib.a <parent of current dir>/bar.o
- ; ../bar.o ../lib.a bar.o
- ; ../bar.o lib.a ../bar.o
- foo/bar.o ../lib.a <parent of current dir>/foo/bar.o
- bar.o ../../lib.a <grandparent>/<parent>/bar.o
- bar.o foo/baz/lib.a ../../bar.o
+ bar.o lib.a bar.o
+ foo/bar.o lib.a foo/bar.o
+ bar.o foo/lib.a ../bar.o
+ foo/bar.o baz/lib.a ../foo/bar.o
+ bar.o ../lib.a <parent of current dir>/bar.o
+ ; ../bar.o ../lib.a bar.o
+ ; ../bar.o lib.a ../bar.o
+ foo/bar.o ../lib.a <parent of current dir>/foo/bar.o
+ bar.o ../../lib.a <grandparent>/<parent>/bar.o
+ bar.o foo/baz/lib.a ../../bar.o
Note - the semicolons above are there to prevent the BFD chew
utility from interpreting those lines as prototypes to put into
return -1;
#define foo(arelt, stelt, size) \
buf->stelt = strtol (hdr->arelt, &aloser, size); \
- if (aloser == hdr->arelt) \
+ if (aloser == hdr->arelt) \
return -1;
/* Some platforms support special notations for large IDs. */
if (!_bfd_ar_sizepad (hdr.ar_size, sizeof (hdr.ar_size), mapsize))
return FALSE;
_bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%ld",
- time (NULL));
+ time (NULL));
/* This, at least, is what Intel coff sets the values to.: */
_bfd_ar_spacepad (hdr.ar_uid, sizeof (hdr.ar_uid), "%ld", 0);
_bfd_ar_spacepad (hdr.ar_gid, sizeof (hdr.ar_gid), "%ld", 0);
.{
. bfd_arch_unknown, {* File arch not known. *}
. bfd_arch_obscure, {* Arch known, not one of these. *}
-. bfd_arch_m68k, {* Motorola 68xxx *}
-.#define bfd_mach_m68000 1
-.#define bfd_mach_m68008 2
-.#define bfd_mach_m68010 3
-.#define bfd_mach_m68020 4
-.#define bfd_mach_m68030 5
-.#define bfd_mach_m68040 6
-.#define bfd_mach_m68060 7
-.#define bfd_mach_cpu32 8
-.#define bfd_mach_fido 9
-.#define bfd_mach_mcf_isa_a_nodiv 10
-.#define bfd_mach_mcf_isa_a 11
-.#define bfd_mach_mcf_isa_a_mac 12
-.#define bfd_mach_mcf_isa_a_emac 13
-.#define bfd_mach_mcf_isa_aplus 14
-.#define bfd_mach_mcf_isa_aplus_mac 15
-.#define bfd_mach_mcf_isa_aplus_emac 16
-.#define bfd_mach_mcf_isa_b_nousp 17
-.#define bfd_mach_mcf_isa_b_nousp_mac 18
-.#define bfd_mach_mcf_isa_b_nousp_emac 19
-.#define bfd_mach_mcf_isa_b 20
-.#define bfd_mach_mcf_isa_b_mac 21
-.#define bfd_mach_mcf_isa_b_emac 22
-.#define bfd_mach_mcf_isa_b_float 23
-.#define bfd_mach_mcf_isa_b_float_mac 24
-.#define bfd_mach_mcf_isa_b_float_emac 25
-.#define bfd_mach_mcf_isa_c 26
-.#define bfd_mach_mcf_isa_c_mac 27
-.#define bfd_mach_mcf_isa_c_emac 28
-.#define bfd_mach_mcf_isa_c_nodiv 29
-.#define bfd_mach_mcf_isa_c_nodiv_mac 30
-.#define bfd_mach_mcf_isa_c_nodiv_emac 31
-. bfd_arch_vax, {* DEC Vax *}
-. bfd_arch_i960, {* Intel 960 *}
+. bfd_arch_m68k, {* Motorola 68xxx. *}
+.#define bfd_mach_m68000 1
+.#define bfd_mach_m68008 2
+.#define bfd_mach_m68010 3
+.#define bfd_mach_m68020 4
+.#define bfd_mach_m68030 5
+.#define bfd_mach_m68040 6
+.#define bfd_mach_m68060 7
+.#define bfd_mach_cpu32 8
+.#define bfd_mach_fido 9
+.#define bfd_mach_mcf_isa_a_nodiv 10
+.#define bfd_mach_mcf_isa_a 11
+.#define bfd_mach_mcf_isa_a_mac 12
+.#define bfd_mach_mcf_isa_a_emac 13
+.#define bfd_mach_mcf_isa_aplus 14
+.#define bfd_mach_mcf_isa_aplus_mac 15
+.#define bfd_mach_mcf_isa_aplus_emac 16
+.#define bfd_mach_mcf_isa_b_nousp 17
+.#define bfd_mach_mcf_isa_b_nousp_mac 18
+.#define bfd_mach_mcf_isa_b_nousp_emac 19
+.#define bfd_mach_mcf_isa_b 20
+.#define bfd_mach_mcf_isa_b_mac 21
+.#define bfd_mach_mcf_isa_b_emac 22
+.#define bfd_mach_mcf_isa_b_float 23
+.#define bfd_mach_mcf_isa_b_float_mac 24
+.#define bfd_mach_mcf_isa_b_float_emac 25
+.#define bfd_mach_mcf_isa_c 26
+.#define bfd_mach_mcf_isa_c_mac 27
+.#define bfd_mach_mcf_isa_c_emac 28
+.#define bfd_mach_mcf_isa_c_nodiv 29
+.#define bfd_mach_mcf_isa_c_nodiv_mac 30
+.#define bfd_mach_mcf_isa_c_nodiv_emac 31
+. bfd_arch_vax, {* DEC Vax. *}
+. bfd_arch_i960, {* Intel 960. *}
. {* The order of the following is important.
-. lower number indicates a machine type that
-. only accepts a subset of the instructions
-. available to machines with higher numbers.
-. The exception is the "ca", which is
-. incompatible with all other machines except
-. "core". *}
+. lower number indicates a machine type that
+. only accepts a subset of the instructions
+. available to machines with higher numbers.
+. The exception is the "ca", which is
+. incompatible with all other machines except
+. "core". *}
.
-.#define bfd_mach_i960_core 1
-.#define bfd_mach_i960_ka_sa 2
-.#define bfd_mach_i960_kb_sb 3
-.#define bfd_mach_i960_mc 4
-.#define bfd_mach_i960_xa 5
-.#define bfd_mach_i960_ca 6
-.#define bfd_mach_i960_jx 7
-.#define bfd_mach_i960_hx 8
+.#define bfd_mach_i960_core 1
+.#define bfd_mach_i960_ka_sa 2
+.#define bfd_mach_i960_kb_sb 3
+.#define bfd_mach_i960_mc 4
+.#define bfd_mach_i960_xa 5
+.#define bfd_mach_i960_ca 6
+.#define bfd_mach_i960_jx 7
+.#define bfd_mach_i960_hx 8
.
-. bfd_arch_or1k, {* OpenRISC 1000 *}
-.#define bfd_mach_or1k 1
-.#define bfd_mach_or1knd 2
+. bfd_arch_or1k, {* OpenRISC 1000. *}
+.#define bfd_mach_or1k 1
+.#define bfd_mach_or1knd 2
.
-. bfd_arch_sparc, {* SPARC *}
+. bfd_arch_sparc, {* SPARC. *}
.#define bfd_mach_sparc 1
.{* The difference between v8plus and v9 is that v9 is a true 64 bit env. *}
.#define bfd_mach_sparc_sparclet 2
. && (mach) != bfd_mach_sparc_v8plusv \
. && (mach) != bfd_mach_sparc_v8plusm \
. && (mach) != bfd_mach_sparc_v8plusm8)
-. bfd_arch_spu, {* PowerPC SPU *}
+. bfd_arch_spu, {* PowerPC SPU. *}
.#define bfd_mach_spu 256
-. bfd_arch_mips, {* MIPS Rxxxx *}
+. bfd_arch_mips, {* MIPS Rxxxx. *}
.#define bfd_mach_mips3000 3000
.#define bfd_mach_mips3900 3900
.#define bfd_mach_mips4000 4000
.#define bfd_mach_mips14000 14000
.#define bfd_mach_mips16000 16000
.#define bfd_mach_mips16 16
-.#define bfd_mach_mips5 5
-.#define bfd_mach_mips_loongson_2e 3001
-.#define bfd_mach_mips_loongson_2f 3002
-.#define bfd_mach_mips_loongson_3a 3003
-.#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *}
+.#define bfd_mach_mips5 5
+.#define bfd_mach_mips_loongson_2e 3001
+.#define bfd_mach_mips_loongson_2f 3002
+.#define bfd_mach_mips_loongson_3a 3003
+.#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01. *}
.#define bfd_mach_mips_octeon 6501
.#define bfd_mach_mips_octeonp 6601
.#define bfd_mach_mips_octeon2 6502
-.#define bfd_mach_mips_octeon3 6503
-.#define bfd_mach_mips_xlr 887682 {* decimal 'XLR' *}
-.#define bfd_mach_mips_interaptiv_mr2 736550 {* decimal 'IA2' *}
-.#define bfd_mach_mipsisa32 32
-.#define bfd_mach_mipsisa32r2 33
-.#define bfd_mach_mipsisa32r3 34
-.#define bfd_mach_mipsisa32r5 36
-.#define bfd_mach_mipsisa32r6 37
-.#define bfd_mach_mipsisa64 64
-.#define bfd_mach_mipsisa64r2 65
-.#define bfd_mach_mipsisa64r3 66
-.#define bfd_mach_mipsisa64r5 68
-.#define bfd_mach_mipsisa64r6 69
-.#define bfd_mach_mips_micromips 96
-. bfd_arch_i386, {* Intel 386 *}
+.#define bfd_mach_mips_octeon3 6503
+.#define bfd_mach_mips_xlr 887682 {* decimal 'XLR'. *}
+.#define bfd_mach_mips_interaptiv_mr2 736550 {* decimal 'IA2'. *}
+.#define bfd_mach_mipsisa32 32
+.#define bfd_mach_mipsisa32r2 33
+.#define bfd_mach_mipsisa32r3 34
+.#define bfd_mach_mipsisa32r5 36
+.#define bfd_mach_mipsisa32r6 37
+.#define bfd_mach_mipsisa64 64
+.#define bfd_mach_mipsisa64r2 65
+.#define bfd_mach_mipsisa64r3 66
+.#define bfd_mach_mipsisa64r5 68
+.#define bfd_mach_mipsisa64r6 69
+.#define bfd_mach_mips_micromips 96
+. bfd_arch_i386, {* Intel 386. *}
.#define bfd_mach_i386_intel_syntax (1 << 0)
.#define bfd_mach_i386_i8086 (1 << 1)
.#define bfd_mach_i386_i386 (1 << 2)
.#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
.#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
.#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
-. bfd_arch_l1om, {* Intel L1OM *}
+. bfd_arch_l1om, {* Intel L1OM. *}
.#define bfd_mach_l1om (1 << 5)
.#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
-. bfd_arch_k1om, {* Intel K1OM *}
+. bfd_arch_k1om, {* Intel K1OM. *}
.#define bfd_mach_k1om (1 << 6)
.#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
.#define bfd_mach_i386_nacl (1 << 7)
.#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
.#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
.#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
-. bfd_arch_iamcu, {* Intel MCU *}
+. bfd_arch_iamcu, {* Intel MCU. *}
.#define bfd_mach_iamcu (1 << 8)
.#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
.#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
-. bfd_arch_we32k, {* AT&T WE32xxx *}
-. bfd_arch_tahoe, {* CCI/Harris Tahoe *}
-. bfd_arch_i860, {* Intel 860 *}
-. bfd_arch_i370, {* IBM 360/370 Mainframes *}
-. bfd_arch_romp, {* IBM ROMP PC/RT *}
-. bfd_arch_convex, {* Convex *}
-. bfd_arch_m88k, {* Motorola 88xxx *}
-. bfd_arch_m98k, {* Motorola 98xxx *}
-. bfd_arch_pyramid, {* Pyramid Technology *}
-. bfd_arch_h8300, {* Renesas H8/300 (formerly Hitachi H8/300) *}
-.#define bfd_mach_h8300 1
-.#define bfd_mach_h8300h 2
-.#define bfd_mach_h8300s 3
-.#define bfd_mach_h8300hn 4
-.#define bfd_mach_h8300sn 5
-.#define bfd_mach_h8300sx 6
-.#define bfd_mach_h8300sxn 7
-. bfd_arch_pdp11, {* DEC PDP-11 *}
+. bfd_arch_we32k, {* AT&T WE32xxx. *}
+. bfd_arch_tahoe, {* CCI/Harris Tahoe. *}
+. bfd_arch_i860, {* Intel 860. *}
+. bfd_arch_i370, {* IBM 360/370 Mainframes. *}
+. bfd_arch_romp, {* IBM ROMP PC/RT. *}
+. bfd_arch_convex, {* Convex. *}
+. bfd_arch_m88k, {* Motorola 88xxx. *}
+. bfd_arch_m98k, {* Motorola 98xxx. *}
+. bfd_arch_pyramid, {* Pyramid Technology. *}
+. bfd_arch_h8300, {* Renesas H8/300 (formerly Hitachi H8/300). *}
+.#define bfd_mach_h8300 1
+.#define bfd_mach_h8300h 2
+.#define bfd_mach_h8300s 3
+.#define bfd_mach_h8300hn 4
+.#define bfd_mach_h8300sn 5
+.#define bfd_mach_h8300sx 6
+.#define bfd_mach_h8300sxn 7
+. bfd_arch_pdp11, {* DEC PDP-11. *}
. bfd_arch_plugin,
-. bfd_arch_powerpc, {* PowerPC *}
+. bfd_arch_powerpc, {* PowerPC. *}
.#define bfd_mach_ppc 32
.#define bfd_mach_ppc64 64
.#define bfd_mach_ppc_403 403
.#define bfd_mach_ppc_rs64ii 642
.#define bfd_mach_ppc_rs64iii 643
.#define bfd_mach_ppc_7400 7400
-.#define bfd_mach_ppc_e500 500
-.#define bfd_mach_ppc_e500mc 5001
-.#define bfd_mach_ppc_e500mc64 5005
-.#define bfd_mach_ppc_e5500 5006
-.#define bfd_mach_ppc_e6500 5007
-.#define bfd_mach_ppc_titan 83
-.#define bfd_mach_ppc_vle 84
-. bfd_arch_rs6000, {* IBM RS/6000 *}
+.#define bfd_mach_ppc_e500 500
+.#define bfd_mach_ppc_e500mc 5001
+.#define bfd_mach_ppc_e500mc64 5005
+.#define bfd_mach_ppc_e5500 5006
+.#define bfd_mach_ppc_e6500 5007
+.#define bfd_mach_ppc_titan 83
+.#define bfd_mach_ppc_vle 84
+. bfd_arch_rs6000, {* IBM RS/6000. *}
.#define bfd_mach_rs6k 6000
.#define bfd_mach_rs6k_rs1 6001
.#define bfd_mach_rs6k_rsc 6003
.#define bfd_mach_rs6k_rs2 6002
-. bfd_arch_hppa, {* HP PA RISC *}
+. bfd_arch_hppa, {* HP PA RISC. *}
.#define bfd_mach_hppa10 10
.#define bfd_mach_hppa11 11
.#define bfd_mach_hppa20 20
.#define bfd_mach_hppa20w 25
-. bfd_arch_d10v, {* Mitsubishi D10V *}
+. bfd_arch_d10v, {* Mitsubishi D10V. *}
.#define bfd_mach_d10v 1
.#define bfd_mach_d10v_ts2 2
.#define bfd_mach_d10v_ts3 3
-. bfd_arch_d30v, {* Mitsubishi D30V *}
-. bfd_arch_dlx, {* DLX *}
-. bfd_arch_m68hc11, {* Motorola 68HC11 *}
-. bfd_arch_m68hc12, {* Motorola 68HC12 *}
+. bfd_arch_d30v, {* Mitsubishi D30V. *}
+. bfd_arch_dlx, {* DLX. *}
+. bfd_arch_m68hc11, {* Motorola 68HC11. *}
+. bfd_arch_m68hc12, {* Motorola 68HC12. *}
.#define bfd_mach_m6812_default 0
-.#define bfd_mach_m6812 1
-.#define bfd_mach_m6812s 2
-. bfd_arch_m9s12x, {* Freescale S12X *}
-. bfd_arch_m9s12xg, {* Freescale XGATE *}
-. bfd_arch_z8k, {* Zilog Z8000 *}
+.#define bfd_mach_m6812 1
+.#define bfd_mach_m6812s 2
+. bfd_arch_m9s12x, {* Freescale S12X. *}
+. bfd_arch_m9s12xg, {* Freescale XGATE. *}
+. bfd_arch_z8k, {* Zilog Z8000. *}
.#define bfd_mach_z8001 1
.#define bfd_mach_z8002 2
-. bfd_arch_h8500, {* Renesas H8/500 (formerly Hitachi H8/500) *}
-. bfd_arch_sh, {* Renesas / SuperH SH (formerly Hitachi SH) *}
-.#define bfd_mach_sh 1
-.#define bfd_mach_sh2 0x20
-.#define bfd_mach_sh_dsp 0x2d
-.#define bfd_mach_sh2a 0x2a
-.#define bfd_mach_sh2a_nofpu 0x2b
+. bfd_arch_h8500, {* Renesas H8/500 (formerly Hitachi H8/500). *}
+. bfd_arch_sh, {* Renesas / SuperH SH (formerly Hitachi SH). *}
+.#define bfd_mach_sh 1
+.#define bfd_mach_sh2 0x20
+.#define bfd_mach_sh_dsp 0x2d
+.#define bfd_mach_sh2a 0x2a
+.#define bfd_mach_sh2a_nofpu 0x2b
.#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
-.#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
-.#define bfd_mach_sh2a_or_sh4 0x2a3
-.#define bfd_mach_sh2a_or_sh3e 0x2a4
-.#define bfd_mach_sh2e 0x2e
-.#define bfd_mach_sh3 0x30
-.#define bfd_mach_sh3_nommu 0x31
-.#define bfd_mach_sh3_dsp 0x3d
-.#define bfd_mach_sh3e 0x3e
-.#define bfd_mach_sh4 0x40
-.#define bfd_mach_sh4_nofpu 0x41
-.#define bfd_mach_sh4_nommu_nofpu 0x42
-.#define bfd_mach_sh4a 0x4a
-.#define bfd_mach_sh4a_nofpu 0x4b
-.#define bfd_mach_sh4al_dsp 0x4d
-.#define bfd_mach_sh5 0x50
-. bfd_arch_alpha, {* Dec Alpha *}
-.#define bfd_mach_alpha_ev4 0x10
-.#define bfd_mach_alpha_ev5 0x20
-.#define bfd_mach_alpha_ev6 0x30
+.#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
+.#define bfd_mach_sh2a_or_sh4 0x2a3
+.#define bfd_mach_sh2a_or_sh3e 0x2a4
+.#define bfd_mach_sh2e 0x2e
+.#define bfd_mach_sh3 0x30
+.#define bfd_mach_sh3_nommu 0x31
+.#define bfd_mach_sh3_dsp 0x3d
+.#define bfd_mach_sh3e 0x3e
+.#define bfd_mach_sh4 0x40
+.#define bfd_mach_sh4_nofpu 0x41
+.#define bfd_mach_sh4_nommu_nofpu 0x42
+.#define bfd_mach_sh4a 0x4a
+.#define bfd_mach_sh4a_nofpu 0x4b
+.#define bfd_mach_sh4al_dsp 0x4d
+.#define bfd_mach_sh5 0x50
+. bfd_arch_alpha, {* Dec Alpha. *}
+.#define bfd_mach_alpha_ev4 0x10
+.#define bfd_mach_alpha_ev5 0x20
+.#define bfd_mach_alpha_ev6 0x30
. bfd_arch_arm, {* Advanced Risc Machines ARM. *}
.#define bfd_mach_arm_unknown 0
.#define bfd_mach_arm_2 1
.#define bfd_mach_arm_2a 2
.#define bfd_mach_arm_3 3
-.#define bfd_mach_arm_3M 4
-.#define bfd_mach_arm_4 5
-.#define bfd_mach_arm_4T 6
-.#define bfd_mach_arm_5 7
+.#define bfd_mach_arm_3M 4
+.#define bfd_mach_arm_4 5
+.#define bfd_mach_arm_4T 6
+.#define bfd_mach_arm_5 7
.#define bfd_mach_arm_5T 8
.#define bfd_mach_arm_5TE 9
.#define bfd_mach_arm_XScale 10
.#define bfd_mach_arm_ep9312 11
.#define bfd_mach_arm_iWMMXt 12
.#define bfd_mach_arm_iWMMXt2 13
-. bfd_arch_nds32, {* Andes NDS32 *}
-.#define bfd_mach_n1 1
-.#define bfd_mach_n1h 2
-.#define bfd_mach_n1h_v2 3
-.#define bfd_mach_n1h_v3 4
-.#define bfd_mach_n1h_v3m 5
-. bfd_arch_ns32k, {* National Semiconductors ns32000 *}
-. bfd_arch_w65, {* WDC 65816 *}
-. bfd_arch_tic30, {* Texas Instruments TMS320C30 *}
-. bfd_arch_tic4x, {* Texas Instruments TMS320C3X/4X *}
-.#define bfd_mach_tic3x 30
-.#define bfd_mach_tic4x 40
-. bfd_arch_tic54x, {* Texas Instruments TMS320C54X *}
-. bfd_arch_tic6x, {* Texas Instruments TMS320C6X *}
-. bfd_arch_tic80, {* TI TMS320c80 (MVP) *}
-. bfd_arch_v850, {* NEC V850 *}
-. bfd_arch_v850_rh850,{* NEC V850 (using RH850 ABI) *}
-.#define bfd_mach_v850 1
-.#define bfd_mach_v850e 'E'
-.#define bfd_mach_v850e1 '1'
-.#define bfd_mach_v850e2 0x4532
-.#define bfd_mach_v850e2v3 0x45325633
-.#define bfd_mach_v850e3v5 0x45335635 {* ('E'|'3'|'V'|'5') *}
-. bfd_arch_arc, {* ARC Cores *}
-.#define bfd_mach_arc_a4 0
-.#define bfd_mach_arc_a5 1
-.#define bfd_mach_arc_arc600 2
-.#define bfd_mach_arc_arc601 4
-.#define bfd_mach_arc_arc700 3
-.#define bfd_mach_arc_arcv2 5
-. bfd_arch_m32c, {* Renesas M16C/M32C. *}
-.#define bfd_mach_m16c 0x75
-.#define bfd_mach_m32c 0x78
-. bfd_arch_m32r, {* Renesas M32R (formerly Mitsubishi M32R/D) *}
+. bfd_arch_nds32, {* Andes NDS32. *}
+.#define bfd_mach_n1 1
+.#define bfd_mach_n1h 2
+.#define bfd_mach_n1h_v2 3
+.#define bfd_mach_n1h_v3 4
+.#define bfd_mach_n1h_v3m 5
+. bfd_arch_ns32k, {* National Semiconductors ns32000. *}
+. bfd_arch_w65, {* WDC 65816. *}
+. bfd_arch_tic30, {* Texas Instruments TMS320C30. *}
+. bfd_arch_tic4x, {* Texas Instruments TMS320C3X/4X. *}
+.#define bfd_mach_tic3x 30
+.#define bfd_mach_tic4x 40
+. bfd_arch_tic54x, {* Texas Instruments TMS320C54X. *}
+. bfd_arch_tic6x, {* Texas Instruments TMS320C6X. *}
+. bfd_arch_tic80, {* TI TMS320c80 (MVP). *}
+. bfd_arch_v850, {* NEC V850. *}
+. bfd_arch_v850_rh850,{* NEC V850 (using RH850 ABI). *}
+.#define bfd_mach_v850 1
+.#define bfd_mach_v850e 'E'
+.#define bfd_mach_v850e1 '1'
+.#define bfd_mach_v850e2 0x4532
+.#define bfd_mach_v850e2v3 0x45325633
+.#define bfd_mach_v850e3v5 0x45335635 {* ('E'|'3'|'V'|'5'). *}
+. bfd_arch_arc, {* ARC Cores. *}
+.#define bfd_mach_arc_a4 0
+.#define bfd_mach_arc_a5 1
+.#define bfd_mach_arc_arc600 2
+.#define bfd_mach_arc_arc601 4
+.#define bfd_mach_arc_arc700 3
+.#define bfd_mach_arc_arcv2 5
+. bfd_arch_m32c, {* Renesas M16C/M32C. *}
+.#define bfd_mach_m16c 0x75
+.#define bfd_mach_m32c 0x78
+. bfd_arch_m32r, {* Renesas M32R (formerly Mitsubishi M32R/D). *}
.#define bfd_mach_m32r 1 {* For backwards compatibility. *}
.#define bfd_mach_m32rx 'x'
.#define bfd_mach_m32r2 '2'
-. bfd_arch_mn10200, {* Matsushita MN10200 *}
-. bfd_arch_mn10300, {* Matsushita MN10300 *}
-.#define bfd_mach_mn10300 300
+. bfd_arch_mn10200, {* Matsushita MN10200. *}
+. bfd_arch_mn10300, {* Matsushita MN10300. *}
+.#define bfd_mach_mn10300 300
.#define bfd_mach_am33 330
.#define bfd_mach_am33_2 332
. bfd_arch_fr30,
.#define bfd_mach_fr300 300
.#define bfd_mach_fr400 400
.#define bfd_mach_fr450 450
-.#define bfd_mach_frvtomcat 499 {* fr500 prototype *}
+.#define bfd_mach_frvtomcat 499 {* fr500 prototype. *}
.#define bfd_mach_fr500 500
.#define bfd_mach_fr550 550
-. bfd_arch_moxie, {* The moxie processor *}
+. bfd_arch_moxie, {* The moxie processor. *}
.#define bfd_mach_moxie 1
-. bfd_arch_ft32, {* The ft32 processor *}
+. bfd_arch_ft32, {* The ft32 processor. *}
.#define bfd_mach_ft32 1
.#define bfd_mach_ft32b 2
. bfd_arch_mcore,
.#define bfd_mach_mep_c5 0x6335
. bfd_arch_metag,
.#define bfd_mach_metag 1
-. bfd_arch_ia64, {* HP/Intel ia64 *}
+. bfd_arch_ia64, {* HP/Intel ia64. *}
.#define bfd_mach_ia64_elf64 64
.#define bfd_mach_ia64_elf32 32
. bfd_arch_ip2k, {* Ubicom IP2K microcontrollers. *}
.#define bfd_mach_ip2022 1
.#define bfd_mach_ip2022ext 2
. bfd_arch_iq2000, {* Vitesse IQ2000. *}
-.#define bfd_mach_iq2000 1
-.#define bfd_mach_iq10 2
-. bfd_arch_epiphany, {* Adapteva EPIPHANY *}
+.#define bfd_mach_iq2000 1
+.#define bfd_mach_iq10 2
+. bfd_arch_epiphany, {* Adapteva EPIPHANY. *}
.#define bfd_mach_epiphany16 1
.#define bfd_mach_epiphany32 2
. bfd_arch_mt,
-.#define bfd_mach_ms1 1
-.#define bfd_mach_mrisc2 2
-.#define bfd_mach_ms2 3
+.#define bfd_mach_ms1 1
+.#define bfd_mach_mrisc2 2
+.#define bfd_mach_ms2 3
. bfd_arch_pj,
. bfd_arch_avr, {* Atmel AVR microcontrollers. *}
.#define bfd_mach_avr1 1
.#define bfd_mach_avr5 5
.#define bfd_mach_avr51 51
.#define bfd_mach_avr6 6
-.#define bfd_mach_avrtiny 100
-.#define bfd_mach_avrxmega1 101
-.#define bfd_mach_avrxmega2 102
-.#define bfd_mach_avrxmega3 103
-.#define bfd_mach_avrxmega4 104
-.#define bfd_mach_avrxmega5 105
-.#define bfd_mach_avrxmega6 106
-.#define bfd_mach_avrxmega7 107
-. bfd_arch_bfin, {* ADI Blackfin *}
-.#define bfd_mach_bfin 1
-. bfd_arch_cr16, {* National Semiconductor CompactRISC (ie CR16). *}
+.#define bfd_mach_avrtiny 100
+.#define bfd_mach_avrxmega1 101
+.#define bfd_mach_avrxmega2 102
+.#define bfd_mach_avrxmega3 103
+.#define bfd_mach_avrxmega4 104
+.#define bfd_mach_avrxmega5 105
+.#define bfd_mach_avrxmega6 106
+.#define bfd_mach_avrxmega7 107
+. bfd_arch_bfin, {* ADI Blackfin. *}
+.#define bfd_mach_bfin 1
+. bfd_arch_cr16, {* National Semiconductor CompactRISC (ie CR16). *}
.#define bfd_mach_cr16 1
-. bfd_arch_cr16c, {* National Semiconductor CompactRISC. *}
+. bfd_arch_cr16c, {* National Semiconductor CompactRISC. *}
.#define bfd_mach_cr16c 1
. bfd_arch_crx, {* National Semiconductor CRX. *}
.#define bfd_mach_crx 1
-. bfd_arch_cris, {* Axis CRIS *}
+. bfd_arch_cris, {* Axis CRIS. *}
.#define bfd_mach_cris_v0_v10 255
.#define bfd_mach_cris_v32 32
.#define bfd_mach_cris_v10_v32 1032
.#define bfd_mach_riscv32 132
.#define bfd_mach_riscv64 164
. bfd_arch_rl78,
-.#define bfd_mach_rl78 0x75
-. bfd_arch_rx, {* Renesas RX. *}
-.#define bfd_mach_rx 0x75
-. bfd_arch_s390, {* IBM s390 *}
-.#define bfd_mach_s390_31 31
-.#define bfd_mach_s390_64 64
-. bfd_arch_score, {* Sunplus score *}
-.#define bfd_mach_score3 3
-.#define bfd_mach_score7 7
+.#define bfd_mach_rl78 0x75
+. bfd_arch_rx, {* Renesas RX. *}
+.#define bfd_mach_rx 0x75
+. bfd_arch_s390, {* IBM s390. *}
+.#define bfd_mach_s390_31 31
+.#define bfd_mach_s390_64 64
+. bfd_arch_score, {* Sunplus score. *}
+.#define bfd_mach_score3 3
+.#define bfd_mach_score7 7
. bfd_arch_mmix, {* Donald Knuth's educational processor. *}
. bfd_arch_xstormy16,
.#define bfd_mach_xstormy16 1
. bfd_arch_msp430, {* Texas Instruments MSP430 architecture. *}
-.#define bfd_mach_msp11 11
-.#define bfd_mach_msp110 110
-.#define bfd_mach_msp12 12
-.#define bfd_mach_msp13 13
-.#define bfd_mach_msp14 14
-.#define bfd_mach_msp15 15
-.#define bfd_mach_msp16 16
-.#define bfd_mach_msp20 20
-.#define bfd_mach_msp21 21
-.#define bfd_mach_msp22 22
-.#define bfd_mach_msp23 23
-.#define bfd_mach_msp24 24
-.#define bfd_mach_msp26 26
-.#define bfd_mach_msp31 31
-.#define bfd_mach_msp32 32
-.#define bfd_mach_msp33 33
-.#define bfd_mach_msp41 41
-.#define bfd_mach_msp42 42
-.#define bfd_mach_msp43 43
-.#define bfd_mach_msp44 44
-.#define bfd_mach_msp430x 45
-.#define bfd_mach_msp46 46
-.#define bfd_mach_msp47 47
-.#define bfd_mach_msp54 54
-. bfd_arch_xc16x, {* Infineon's XC16X Series. *}
-.#define bfd_mach_xc16x 1
-.#define bfd_mach_xc16xl 2
-.#define bfd_mach_xc16xs 3
-. bfd_arch_xgate, {* Freescale XGATE *}
-.#define bfd_mach_xgate 1
+.#define bfd_mach_msp11 11
+.#define bfd_mach_msp110 110
+.#define bfd_mach_msp12 12
+.#define bfd_mach_msp13 13
+.#define bfd_mach_msp14 14
+.#define bfd_mach_msp15 15
+.#define bfd_mach_msp16 16
+.#define bfd_mach_msp20 20
+.#define bfd_mach_msp21 21
+.#define bfd_mach_msp22 22
+.#define bfd_mach_msp23 23
+.#define bfd_mach_msp24 24
+.#define bfd_mach_msp26 26
+.#define bfd_mach_msp31 31
+.#define bfd_mach_msp32 32
+.#define bfd_mach_msp33 33
+.#define bfd_mach_msp41 41
+.#define bfd_mach_msp42 42
+.#define bfd_mach_msp43 43
+.#define bfd_mach_msp44 44
+.#define bfd_mach_msp430x 45
+.#define bfd_mach_msp46 46
+.#define bfd_mach_msp47 47
+.#define bfd_mach_msp54 54
+. bfd_arch_xc16x, {* Infineon's XC16X Series. *}
+.#define bfd_mach_xc16x 1
+.#define bfd_mach_xc16xl 2
+.#define bfd_mach_xc16xs 3
+. bfd_arch_xgate, {* Freescale XGATE. *}
+.#define bfd_mach_xgate 1
. bfd_arch_xtensa, {* Tensilica's Xtensa cores. *}
.#define bfd_mach_xtensa 1
. bfd_arch_z80,
-.#define bfd_mach_z80strict 1 {* No undocumented opcodes. *}
-.#define bfd_mach_z80 3 {* With ixl, ixh, iyl, and iyh. *}
-.#define bfd_mach_z80full 7 {* All undocumented instructions. *}
-.#define bfd_mach_r800 11 {* R800: successor with multiplication. *}
-. bfd_arch_lm32, {* Lattice Mico32 *}
-.#define bfd_mach_lm32 1
-. bfd_arch_microblaze,{* Xilinx MicroBlaze. *}
-. bfd_arch_tilepro, {* Tilera TILEPro *}
-. bfd_arch_tilegx, {* Tilera TILE-Gx *}
-.#define bfd_mach_tilepro 1
-.#define bfd_mach_tilegx 1
-.#define bfd_mach_tilegx32 2
-. bfd_arch_aarch64, {* AArch64 *}
+.#define bfd_mach_z80strict 1 {* No undocumented opcodes. *}
+.#define bfd_mach_z80 3 {* With ixl, ixh, iyl, and iyh. *}
+.#define bfd_mach_z80full 7 {* All undocumented instructions. *}
+.#define bfd_mach_r800 11 {* R800: successor with multiplication. *}
+. bfd_arch_lm32, {* Lattice Mico32. *}
+.#define bfd_mach_lm32 1
+. bfd_arch_microblaze,{* Xilinx MicroBlaze. *}
+. bfd_arch_tilepro, {* Tilera TILEPro. *}
+. bfd_arch_tilegx, {* Tilera TILE-Gx. *}
+.#define bfd_mach_tilepro 1
+.#define bfd_mach_tilegx 1
+.#define bfd_mach_tilegx32 2
+. bfd_arch_aarch64, {* AArch64. *}
.#define bfd_mach_aarch64 0
.#define bfd_mach_aarch64_ilp32 32
-. bfd_arch_nios2, {* Nios II *}
+. bfd_arch_nios2, {* Nios II. *}
.#define bfd_mach_nios2 0
.#define bfd_mach_nios2r1 1
.#define bfd_mach_nios2r2 2
-. bfd_arch_visium, {* Visium *}
+. bfd_arch_visium, {* Visium. *}
.#define bfd_mach_visium 1
-. bfd_arch_wasm32, {* WebAssembly *}
-.#define bfd_mach_wasm32 1
-. bfd_arch_pru, {* PRU *}
-.#define bfd_mach_pru 0
+. bfd_arch_wasm32, {* WebAssembly. *}
+.#define bfd_mach_wasm32 1
+. bfd_arch_pru, {* PRU. *}
+.#define bfd_mach_pru 0
. bfd_arch_last
. };
*/
. The default arch should be the first entry for an arch so that
. all the entries for that arch can be accessed via <<next>>. *}
. bfd_boolean the_default;
-. const struct bfd_arch_info * (*compatible)
-. (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
+. const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
+. const struct bfd_arch_info *);
.
. bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
.
DESCRIPTION
Return the number of octets (8-bit quantities) per target byte
- (minimum addressable unit). In most cases, this will be one, but some
- DSP targets have 16, 32, or even 48 bits per byte.
+ (minimum addressable unit). In most cases, this will be one, but some
+ DSP targets have 16, 32, or even 48 bits per byte.
*/
unsigned int
DESCRIPTION
See bfd_octets_per_byte.
- This routine is provided for those cases where a bfd * is not
- available
+ This routine is provided for those cases where a bfd * is not
+ available
*/
unsigned int
#define SEGMENT_SIZE TARGET_PAGE_SIZE
#define DEFAULT_ARCH bfd_arch_arm
-#define DEFAULT_MID M_ARM6_NETBSD
+#define DEFAULT_MID M_ARM6_NETBSD
/*#define MACHTYPE_OK(mtype) ((mtype) == M_ARM6_NETBSD)*/
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
the tokens. */
-#define MY(OP) CONCAT2 (arm_aout_nbsd_, OP)
+#define MY(OP) CONCAT2 (arm_aout_nbsd_, OP)
/* This needs to start with a.out so GDB knows it is an a.out variant. */
-#define TARGETNAME "a.out-arm-netbsd"
+#define TARGETNAME "a.out-arm-netbsd"
#include "netbsd.h"
#endif
/* Declaring a type wide enough to hold a host long and a host pointer. */
-#define BFD_HOSTPTR_T @BFD_HOSTPTR_T@
+#define BFD_HOSTPTR_T @BFD_HOSTPTR_T@
typedef BFD_HOSTPTR_T bfd_hostptr_t;
/* Forward declaration. */
/* Used in generating armaps (archive tables of contents).
Perhaps just a forward definition would do? */
-struct orl /* Output ranlib. */
+struct orl /* Output ranlib. */
{
char **name; /* Symbol name. */
union
union
{
struct bfd_symbol *sym; /* Function name. */
- bfd_vma offset; /* Offset into section. */
+ bfd_vma offset; /* Offset into section. */
} u;
}
alent;
{
symvalue value;
char type;
- const char *name; /* Symbol name. */
- unsigned char stab_type; /* Stab type. */
- char stab_other; /* Stab other. */
- short stab_desc; /* Stab desc. */
- const char *stab_name; /* String for stab type. */
+ const char *name; /* Symbol name. */
+ unsigned char stab_type; /* Stab type. */
+ char stab_other; /* Stab other. */
+ short stab_desc; /* Stab desc. */
+ const char *stab_name; /* String for stab type. */
} symbol_info;
/* Get the name of a stabs type code. */
only if the argument is NULL. */
struct bfd_hash_entry *(*newfunc)
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
- /* An objalloc for this hash table. This is a struct objalloc *,
+ /* An objalloc for this hash table. This is a struct objalloc *,
but we use void * to avoid requiring the inclusion of objalloc.h. */
void *memory;
/* The number of slots in the hash table. */
(_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
- (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
+ (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
#else
#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
/* ELF ARM mapping symbol support. */
#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
-#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
+#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
extern bfd_boolean bfd_is_arm_special_symbol_name
-/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
- generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
- "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
- "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
+/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
+ generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",
+ "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",
+ "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",
"linker.c", "simple.c" and "compress.c".
Run "make headers" in your build bfd/ to regenerate. */
#endif
/* Declaring a type wide enough to hold a host long and a host pointer. */
-#define BFD_HOSTPTR_T @BFD_HOSTPTR_T@
+#define BFD_HOSTPTR_T @BFD_HOSTPTR_T@
typedef BFD_HOSTPTR_T bfd_hostptr_t;
/* Forward declaration. */
/* Used in generating armaps (archive tables of contents).
Perhaps just a forward definition would do? */
-struct orl /* Output ranlib. */
+struct orl /* Output ranlib. */
{
char **name; /* Symbol name. */
union
union
{
struct bfd_symbol *sym; /* Function name. */
- bfd_vma offset; /* Offset into section. */
+ bfd_vma offset; /* Offset into section. */
} u;
}
alent;
{
symvalue value;
char type;
- const char *name; /* Symbol name. */
- unsigned char stab_type; /* Stab type. */
- char stab_other; /* Stab other. */
- short stab_desc; /* Stab desc. */
- const char *stab_name; /* String for stab type. */
+ const char *name; /* Symbol name. */
+ unsigned char stab_type; /* Stab type. */
+ char stab_other; /* Stab other. */
+ short stab_desc; /* Stab desc. */
+ const char *stab_name; /* String for stab type. */
} symbol_info;
/* Get the name of a stabs type code. */
only if the argument is NULL. */
struct bfd_hash_entry *(*newfunc)
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
- /* An objalloc for this hash table. This is a struct objalloc *,
+ /* An objalloc for this hash table. This is a struct objalloc *,
but we use void * to avoid requiring the inclusion of objalloc.h. */
void *memory;
/* The number of slots in the hash table. */
(_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \
bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \
- (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
+ (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \
bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
#else
#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \
/* ELF ARM mapping symbol support. */
#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
-#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
+#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
extern bfd_boolean bfd_is_arm_special_symbol_name
#define bfd_put(bits, abfd, val, ptr) \
((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
- : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
- : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
- : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
+ : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
+ : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
+ : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
: (abort (), (void) 0))
synthesized from other information. */
flagword flags;
-#define SEC_NO_FLAGS 0x000
+#define SEC_NO_FLAGS 0x0
/* Tells the OS to allocate space for this section when loading.
This is clear for a section containing debug information only. */
-#define SEC_ALLOC 0x001
+#define SEC_ALLOC 0x1
/* Tells the OS to load the section from the file when loading.
This is clear for a .bss section. */
-#define SEC_LOAD 0x002
+#define SEC_LOAD 0x2
/* The section contains data still to be relocated, so there is
some relocation information too. */
-#define SEC_RELOC 0x004
+#define SEC_RELOC 0x4
/* A signal to the OS that the section contains read only data. */
-#define SEC_READONLY 0x008
+#define SEC_READONLY 0x8
/* The section contains code only. */
-#define SEC_CODE 0x010
+#define SEC_CODE 0x10
/* The section contains data only. */
-#define SEC_DATA 0x020
+#define SEC_DATA 0x20
/* The section will reside in ROM. */
-#define SEC_ROM 0x040
+#define SEC_ROM 0x40
/* The section contains constructor information. This section
type is used by the linker to create lists of constructors and
sections called <<__CTOR_LIST__>> and relocate the data
contained within - exactly the operations it would peform on
standard data. */
-#define SEC_CONSTRUCTOR 0x080
+#define SEC_CONSTRUCTOR 0x80
/* The section has contents - a data section could be
<<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
<<SEC_HAS_CONTENTS>> */
-#define SEC_HAS_CONTENTS 0x100
+#define SEC_HAS_CONTENTS 0x100
/* An instruction to the linker to not output the section
even if it has information which would normally be written. */
-#define SEC_NEVER_LOAD 0x200
+#define SEC_NEVER_LOAD 0x200
/* The section contains thread local data. */
-#define SEC_THREAD_LOCAL 0x400
+#define SEC_THREAD_LOCAL 0x400
/* The section has GOT references. This flag is only for the
linker, and is currently only used by the elf32-hppa back end.
in this section, which indicate to the linker that the section
contains PIC code, and must be handled specially when doing a
static link. */
-#define SEC_HAS_GOT_REF 0x800
+#define SEC_HAS_GOT_REF 0x800
/* The section contains common symbols (symbols may be defined
multiple times, the value of a symbol is the amount of
space it requires, and the largest symbol value is the one
used). Most targets have exactly one of these (which we
translate to bfd_com_section_ptr), but ECOFF has two. */
-#define SEC_IS_COMMON 0x1000
+#define SEC_IS_COMMON 0x1000
/* The section contains only debugging information. For
example, this is set for ELF .debug and .stab sections.
strip tests this flag to see if a section can be
discarded. */
-#define SEC_DEBUGGING 0x2000
+#define SEC_DEBUGGING 0x2000
/* The contents of this section are held in memory pointed to
by the contents field. This is checked by bfd_get_section_contents,
and the data is retrieved from memory if appropriate. */
-#define SEC_IN_MEMORY 0x4000
+#define SEC_IN_MEMORY 0x4000
/* The contents of this section are to be excluded by the
linker for executable and shared objects unless those
objects are to be further relocated. */
-#define SEC_EXCLUDE 0x8000
+#define SEC_EXCLUDE 0x8000
/* The contents of this section are to be sorted based on the sum of
the symbol and addend values specified by the associated relocation
entries. Entries without associated relocation entries will be
appended to the end of the section in an unspecified order. */
-#define SEC_SORT_ENTRIES 0x10000
+#define SEC_SORT_ENTRIES 0x10000
/* When linking, duplicate sections of the same name should be
discarded, rather than being combined into a single section as
is usually done. This is similar to how common symbols are
handled. See SEC_LINK_DUPLICATES below. */
-#define SEC_LINK_ONCE 0x20000
+#define SEC_LINK_ONCE 0x20000
/* If SEC_LINK_ONCE is set, this bitfield describes how the linker
should handle duplicate sections. */
-#define SEC_LINK_DUPLICATES 0xc0000
+#define SEC_LINK_DUPLICATES 0xc0000
/* This value for SEC_LINK_DUPLICATES means that duplicate
sections with the same name should simply be discarded. */
-#define SEC_LINK_DUPLICATES_DISCARD 0x0
+#define SEC_LINK_DUPLICATES_DISCARD 0x0
/* This value for SEC_LINK_DUPLICATES means that the linker
should warn if there are any duplicate sections, although
it should still only link one copy. */
-#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
+#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
/* This value for SEC_LINK_DUPLICATES means that the linker
should warn if any duplicate sections are a different size. */
relocation or other arcane processing. It is skipped when
going through the first-pass output, trusting that someone
else up the line will take care of it later. */
-#define SEC_LINKER_CREATED 0x100000
+#define SEC_LINKER_CREATED 0x100000
/* This section should not be subject to garbage collection.
Also set to inform the linker that this section should not be
listed in the link map as discarded. */
-#define SEC_KEEP 0x200000
+#define SEC_KEEP 0x200000
/* This section contains "short" data, and should be placed
"near" the GP. */
-#define SEC_SMALL_DATA 0x400000
+#define SEC_SMALL_DATA 0x400000
/* Attempt to merge identical entities in the section.
Entity size is given in the entsize field. */
-#define SEC_MERGE 0x800000
+#define SEC_MERGE 0x800000
/* If given with SEC_MERGE, entities to merge are zero terminated
strings where entsize specifies character size instead of fixed
size entries. */
-#define SEC_STRINGS 0x1000000
+#define SEC_STRINGS 0x1000000
/* This section contains data about section groups. */
-#define SEC_GROUP 0x2000000
+#define SEC_GROUP 0x2000000
/* The section is a COFF shared library section. This flag is
only for the linker. If this type of section appears in
might be cleaner to have some more general mechanism to
allow the back end to control what the linker does with
sections. */
-#define SEC_COFF_SHARED_LIBRARY 0x4000000
+#define SEC_COFF_SHARED_LIBRARY 0x4000000
/* This input section should be copied to output in reverse order
as an array of pointers. This is for ELF linker internal use
only. */
-#define SEC_ELF_REVERSE_COPY 0x4000000
+#define SEC_ELF_REVERSE_COPY 0x4000000
/* This section contains data which may be shared with other
executables or shared objects. This is for COFF only. */
-#define SEC_COFF_SHARED 0x8000000
+#define SEC_COFF_SHARED 0x8000000
/* This section should be compressed. This is for ELF linker
internal use only. */
-#define SEC_ELF_COMPRESS 0x8000000
+#define SEC_ELF_COMPRESS 0x8000000
/* When a section with this flag is being linked, then if the size of
the input section is less than a page, it should not cross a page
boundary. If the size of the input section is one page or more,
it should be aligned on a page boundary. This is for TI
TMS320C54X only. */
-#define SEC_TIC54X_BLOCK 0x10000000
+#define SEC_TIC54X_BLOCK 0x10000000
/* This section should be renamed. This is for ELF linker
internal use only. */
-#define SEC_ELF_RENAME 0x10000000
+#define SEC_ELF_RENAME 0x10000000
/* Conditionally link this section; do not link if there are no
references found to any symbol in the section. This is for TI
TMS320C54X only. */
-#define SEC_TIC54X_CLINK 0x20000000
+#define SEC_TIC54X_CLINK 0x20000000
/* This section contains vliw code. This is for Toshiba MeP only. */
-#define SEC_MEP_VLIW 0x20000000
+#define SEC_MEP_VLIW 0x20000000
/* Indicate that section has the no read flag set. This happens
when memory read flag isn't set. */
-#define SEC_COFF_NOREAD 0x40000000
+#define SEC_COFF_NOREAD 0x40000000
/* Indicate that section has the purecode flag set. */
-#define SEC_ELF_PURECODE 0x80000000
+#define SEC_ELF_PURECODE 0x80000000
/* End of section flags. */
would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
compilers will complain about comma expressions that have no effect. */
static inline bfd_boolean
-bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
+bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
+ void * val)
{
ptr->userdata = val;
return TRUE;
}
static inline bfd_boolean
-bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
+bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
+ unsigned int val)
{
ptr->alignment_power = val;
return TRUE;
(bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
- BFD_SEND (obfd, _bfd_copy_private_section_data, \
- (ibfd, isection, obfd, osection))
+ BFD_SEND (obfd, _bfd_copy_private_section_data, \
+ (ibfd, isection, obfd, osection))
bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
{
bfd_arch_unknown, /* File arch not known. */
bfd_arch_obscure, /* Arch known, not one of these. */
- bfd_arch_m68k, /* Motorola 68xxx */
-#define bfd_mach_m68000 1
-#define bfd_mach_m68008 2
-#define bfd_mach_m68010 3
-#define bfd_mach_m68020 4
-#define bfd_mach_m68030 5
-#define bfd_mach_m68040 6
-#define bfd_mach_m68060 7
-#define bfd_mach_cpu32 8
-#define bfd_mach_fido 9
-#define bfd_mach_mcf_isa_a_nodiv 10
-#define bfd_mach_mcf_isa_a 11
-#define bfd_mach_mcf_isa_a_mac 12
-#define bfd_mach_mcf_isa_a_emac 13
-#define bfd_mach_mcf_isa_aplus 14
-#define bfd_mach_mcf_isa_aplus_mac 15
-#define bfd_mach_mcf_isa_aplus_emac 16
-#define bfd_mach_mcf_isa_b_nousp 17
-#define bfd_mach_mcf_isa_b_nousp_mac 18
-#define bfd_mach_mcf_isa_b_nousp_emac 19
-#define bfd_mach_mcf_isa_b 20
-#define bfd_mach_mcf_isa_b_mac 21
-#define bfd_mach_mcf_isa_b_emac 22
-#define bfd_mach_mcf_isa_b_float 23
-#define bfd_mach_mcf_isa_b_float_mac 24
-#define bfd_mach_mcf_isa_b_float_emac 25
-#define bfd_mach_mcf_isa_c 26
-#define bfd_mach_mcf_isa_c_mac 27
-#define bfd_mach_mcf_isa_c_emac 28
-#define bfd_mach_mcf_isa_c_nodiv 29
-#define bfd_mach_mcf_isa_c_nodiv_mac 30
-#define bfd_mach_mcf_isa_c_nodiv_emac 31
- bfd_arch_vax, /* DEC Vax */
- bfd_arch_i960, /* Intel 960 */
+ bfd_arch_m68k, /* Motorola 68xxx. */
+#define bfd_mach_m68000 1
+#define bfd_mach_m68008 2
+#define bfd_mach_m68010 3
+#define bfd_mach_m68020 4
+#define bfd_mach_m68030 5
+#define bfd_mach_m68040 6
+#define bfd_mach_m68060 7
+#define bfd_mach_cpu32 8
+#define bfd_mach_fido 9
+#define bfd_mach_mcf_isa_a_nodiv 10
+#define bfd_mach_mcf_isa_a 11
+#define bfd_mach_mcf_isa_a_mac 12
+#define bfd_mach_mcf_isa_a_emac 13
+#define bfd_mach_mcf_isa_aplus 14
+#define bfd_mach_mcf_isa_aplus_mac 15
+#define bfd_mach_mcf_isa_aplus_emac 16
+#define bfd_mach_mcf_isa_b_nousp 17
+#define bfd_mach_mcf_isa_b_nousp_mac 18
+#define bfd_mach_mcf_isa_b_nousp_emac 19
+#define bfd_mach_mcf_isa_b 20
+#define bfd_mach_mcf_isa_b_mac 21
+#define bfd_mach_mcf_isa_b_emac 22
+#define bfd_mach_mcf_isa_b_float 23
+#define bfd_mach_mcf_isa_b_float_mac 24
+#define bfd_mach_mcf_isa_b_float_emac 25
+#define bfd_mach_mcf_isa_c 26
+#define bfd_mach_mcf_isa_c_mac 27
+#define bfd_mach_mcf_isa_c_emac 28
+#define bfd_mach_mcf_isa_c_nodiv 29
+#define bfd_mach_mcf_isa_c_nodiv_mac 30
+#define bfd_mach_mcf_isa_c_nodiv_emac 31
+ bfd_arch_vax, /* DEC Vax. */
+ bfd_arch_i960, /* Intel 960. */
/* The order of the following is important.
lower number indicates a machine type that
only accepts a subset of the instructions
incompatible with all other machines except
"core". */
-#define bfd_mach_i960_core 1
-#define bfd_mach_i960_ka_sa 2
-#define bfd_mach_i960_kb_sb 3
-#define bfd_mach_i960_mc 4
-#define bfd_mach_i960_xa 5
-#define bfd_mach_i960_ca 6
-#define bfd_mach_i960_jx 7
-#define bfd_mach_i960_hx 8
+#define bfd_mach_i960_core 1
+#define bfd_mach_i960_ka_sa 2
+#define bfd_mach_i960_kb_sb 3
+#define bfd_mach_i960_mc 4
+#define bfd_mach_i960_xa 5
+#define bfd_mach_i960_ca 6
+#define bfd_mach_i960_jx 7
+#define bfd_mach_i960_hx 8
- bfd_arch_or1k, /* OpenRISC 1000 */
-#define bfd_mach_or1k 1
-#define bfd_mach_or1knd 2
+ bfd_arch_or1k, /* OpenRISC 1000. */
+#define bfd_mach_or1k 1
+#define bfd_mach_or1knd 2
- bfd_arch_sparc, /* SPARC */
+ bfd_arch_sparc, /* SPARC. */
#define bfd_mach_sparc 1
/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
#define bfd_mach_sparc_sparclet 2
&& (mach) != bfd_mach_sparc_v8plusv \
&& (mach) != bfd_mach_sparc_v8plusm \
&& (mach) != bfd_mach_sparc_v8plusm8)
- bfd_arch_spu, /* PowerPC SPU */
+ bfd_arch_spu, /* PowerPC SPU. */
#define bfd_mach_spu 256
- bfd_arch_mips, /* MIPS Rxxxx */
+ bfd_arch_mips, /* MIPS Rxxxx. */
#define bfd_mach_mips3000 3000
#define bfd_mach_mips3900 3900
#define bfd_mach_mips4000 4000
#define bfd_mach_mips_loongson_2e 3001
#define bfd_mach_mips_loongson_2f 3002
#define bfd_mach_mips_loongson_3a 3003
-#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */
+#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */
#define bfd_mach_mips_octeon 6501
#define bfd_mach_mips_octeonp 6601
#define bfd_mach_mips_octeon2 6502
#define bfd_mach_mips_octeon3 6503
-#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */
-#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2' */
+#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */
+#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */
#define bfd_mach_mipsisa32 32
#define bfd_mach_mipsisa32r2 33
#define bfd_mach_mipsisa32r3 34
#define bfd_mach_mipsisa64r5 68
#define bfd_mach_mipsisa64r6 69
#define bfd_mach_mips_micromips 96
- bfd_arch_i386, /* Intel 386 */
+ bfd_arch_i386, /* Intel 386. */
#define bfd_mach_i386_intel_syntax (1 << 0)
#define bfd_mach_i386_i8086 (1 << 1)
#define bfd_mach_i386_i386 (1 << 2)
#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax)
#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax)
#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax)
- bfd_arch_l1om, /* Intel L1OM */
+ bfd_arch_l1om, /* Intel L1OM. */
#define bfd_mach_l1om (1 << 5)
#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax)
- bfd_arch_k1om, /* Intel K1OM */
+ bfd_arch_k1om, /* Intel K1OM. */
#define bfd_mach_k1om (1 << 6)
#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax)
#define bfd_mach_i386_nacl (1 << 7)
#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl)
#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl)
#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl)
- bfd_arch_iamcu, /* Intel MCU */
+ bfd_arch_iamcu, /* Intel MCU. */
#define bfd_mach_iamcu (1 << 8)
#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu)
#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax)
- bfd_arch_we32k, /* AT&T WE32xxx */
- bfd_arch_tahoe, /* CCI/Harris Tahoe */
- bfd_arch_i860, /* Intel 860 */
- bfd_arch_i370, /* IBM 360/370 Mainframes */
- bfd_arch_romp, /* IBM ROMP PC/RT */
- bfd_arch_convex, /* Convex */
- bfd_arch_m88k, /* Motorola 88xxx */
- bfd_arch_m98k, /* Motorola 98xxx */
- bfd_arch_pyramid, /* Pyramid Technology */
- bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */
-#define bfd_mach_h8300 1
-#define bfd_mach_h8300h 2
-#define bfd_mach_h8300s 3
-#define bfd_mach_h8300hn 4
-#define bfd_mach_h8300sn 5
-#define bfd_mach_h8300sx 6
-#define bfd_mach_h8300sxn 7
- bfd_arch_pdp11, /* DEC PDP-11 */
+ bfd_arch_we32k, /* AT&T WE32xxx. */
+ bfd_arch_tahoe, /* CCI/Harris Tahoe. */
+ bfd_arch_i860, /* Intel 860. */
+ bfd_arch_i370, /* IBM 360/370 Mainframes. */
+ bfd_arch_romp, /* IBM ROMP PC/RT. */
+ bfd_arch_convex, /* Convex. */
+ bfd_arch_m88k, /* Motorola 88xxx. */
+ bfd_arch_m98k, /* Motorola 98xxx. */
+ bfd_arch_pyramid, /* Pyramid Technology. */
+ bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */
+#define bfd_mach_h8300 1
+#define bfd_mach_h8300h 2
+#define bfd_mach_h8300s 3
+#define bfd_mach_h8300hn 4
+#define bfd_mach_h8300sn 5
+#define bfd_mach_h8300sx 6
+#define bfd_mach_h8300sxn 7
+ bfd_arch_pdp11, /* DEC PDP-11. */
bfd_arch_plugin,
- bfd_arch_powerpc, /* PowerPC */
+ bfd_arch_powerpc, /* PowerPC. */
#define bfd_mach_ppc 32
#define bfd_mach_ppc64 64
#define bfd_mach_ppc_403 403
#define bfd_mach_ppc_e6500 5007
#define bfd_mach_ppc_titan 83
#define bfd_mach_ppc_vle 84
- bfd_arch_rs6000, /* IBM RS/6000 */
+ bfd_arch_rs6000, /* IBM RS/6000. */
#define bfd_mach_rs6k 6000
#define bfd_mach_rs6k_rs1 6001
#define bfd_mach_rs6k_rsc 6003
#define bfd_mach_rs6k_rs2 6002
- bfd_arch_hppa, /* HP PA RISC */
+ bfd_arch_hppa, /* HP PA RISC. */
#define bfd_mach_hppa10 10
#define bfd_mach_hppa11 11
#define bfd_mach_hppa20 20
#define bfd_mach_hppa20w 25
- bfd_arch_d10v, /* Mitsubishi D10V */
+ bfd_arch_d10v, /* Mitsubishi D10V. */
#define bfd_mach_d10v 1
#define bfd_mach_d10v_ts2 2
#define bfd_mach_d10v_ts3 3
- bfd_arch_d30v, /* Mitsubishi D30V */
- bfd_arch_dlx, /* DLX */
- bfd_arch_m68hc11, /* Motorola 68HC11 */
- bfd_arch_m68hc12, /* Motorola 68HC12 */
+ bfd_arch_d30v, /* Mitsubishi D30V. */
+ bfd_arch_dlx, /* DLX. */
+ bfd_arch_m68hc11, /* Motorola 68HC11. */
+ bfd_arch_m68hc12, /* Motorola 68HC12. */
#define bfd_mach_m6812_default 0
#define bfd_mach_m6812 1
#define bfd_mach_m6812s 2
- bfd_arch_m9s12x, /* Freescale S12X */
- bfd_arch_m9s12xg, /* Freescale XGATE */
- bfd_arch_z8k, /* Zilog Z8000 */
+ bfd_arch_m9s12x, /* Freescale S12X. */
+ bfd_arch_m9s12xg, /* Freescale XGATE. */
+ bfd_arch_z8k, /* Zilog Z8000. */
#define bfd_mach_z8001 1
#define bfd_mach_z8002 2
- bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */
- bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */
-#define bfd_mach_sh 1
-#define bfd_mach_sh2 0x20
-#define bfd_mach_sh_dsp 0x2d
-#define bfd_mach_sh2a 0x2a
-#define bfd_mach_sh2a_nofpu 0x2b
+ bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500). */
+ bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */
+#define bfd_mach_sh 1
+#define bfd_mach_sh2 0x20
+#define bfd_mach_sh_dsp 0x2d
+#define bfd_mach_sh2a 0x2a
+#define bfd_mach_sh2a_nofpu 0x2b
#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
-#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
-#define bfd_mach_sh2a_or_sh4 0x2a3
-#define bfd_mach_sh2a_or_sh3e 0x2a4
-#define bfd_mach_sh2e 0x2e
-#define bfd_mach_sh3 0x30
-#define bfd_mach_sh3_nommu 0x31
-#define bfd_mach_sh3_dsp 0x3d
-#define bfd_mach_sh3e 0x3e
-#define bfd_mach_sh4 0x40
-#define bfd_mach_sh4_nofpu 0x41
-#define bfd_mach_sh4_nommu_nofpu 0x42
-#define bfd_mach_sh4a 0x4a
-#define bfd_mach_sh4a_nofpu 0x4b
-#define bfd_mach_sh4al_dsp 0x4d
-#define bfd_mach_sh5 0x50
- bfd_arch_alpha, /* Dec Alpha */
-#define bfd_mach_alpha_ev4 0x10
-#define bfd_mach_alpha_ev5 0x20
-#define bfd_mach_alpha_ev6 0x30
+#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
+#define bfd_mach_sh2a_or_sh4 0x2a3
+#define bfd_mach_sh2a_or_sh3e 0x2a4
+#define bfd_mach_sh2e 0x2e
+#define bfd_mach_sh3 0x30
+#define bfd_mach_sh3_nommu 0x31
+#define bfd_mach_sh3_dsp 0x3d
+#define bfd_mach_sh3e 0x3e
+#define bfd_mach_sh4 0x40
+#define bfd_mach_sh4_nofpu 0x41
+#define bfd_mach_sh4_nommu_nofpu 0x42
+#define bfd_mach_sh4a 0x4a
+#define bfd_mach_sh4a_nofpu 0x4b
+#define bfd_mach_sh4al_dsp 0x4d
+#define bfd_mach_sh5 0x50
+ bfd_arch_alpha, /* Dec Alpha. */
+#define bfd_mach_alpha_ev4 0x10
+#define bfd_mach_alpha_ev5 0x20
+#define bfd_mach_alpha_ev6 0x30
bfd_arch_arm, /* Advanced Risc Machines ARM. */
#define bfd_mach_arm_unknown 0
#define bfd_mach_arm_2 1
#define bfd_mach_arm_ep9312 11
#define bfd_mach_arm_iWMMXt 12
#define bfd_mach_arm_iWMMXt2 13
- bfd_arch_nds32, /* Andes NDS32 */
+ bfd_arch_nds32, /* Andes NDS32. */
#define bfd_mach_n1 1
#define bfd_mach_n1h 2
#define bfd_mach_n1h_v2 3
#define bfd_mach_n1h_v3 4
#define bfd_mach_n1h_v3m 5
- bfd_arch_ns32k, /* National Semiconductors ns32000 */
- bfd_arch_w65, /* WDC 65816 */
- bfd_arch_tic30, /* Texas Instruments TMS320C30 */
- bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */
+ bfd_arch_ns32k, /* National Semiconductors ns32000. */
+ bfd_arch_w65, /* WDC 65816. */
+ bfd_arch_tic30, /* Texas Instruments TMS320C30. */
+ bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */
#define bfd_mach_tic3x 30
#define bfd_mach_tic4x 40
- bfd_arch_tic54x, /* Texas Instruments TMS320C54X */
- bfd_arch_tic6x, /* Texas Instruments TMS320C6X */
- bfd_arch_tic80, /* TI TMS320c80 (MVP) */
- bfd_arch_v850, /* NEC V850 */
- bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI) */
+ bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */
+ bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */
+ bfd_arch_tic80, /* TI TMS320c80 (MVP). */
+ bfd_arch_v850, /* NEC V850. */
+ bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */
#define bfd_mach_v850 1
#define bfd_mach_v850e 'E'
#define bfd_mach_v850e1 '1'
#define bfd_mach_v850e2 0x4532
#define bfd_mach_v850e2v3 0x45325633
-#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5') */
- bfd_arch_arc, /* ARC Cores */
+#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */
+ bfd_arch_arc, /* ARC Cores. */
#define bfd_mach_arc_a4 0
#define bfd_mach_arc_a5 1
#define bfd_mach_arc_arc600 2
#define bfd_mach_arc_arc601 4
#define bfd_mach_arc_arc700 3
#define bfd_mach_arc_arcv2 5
- bfd_arch_m32c, /* Renesas M16C/M32C. */
-#define bfd_mach_m16c 0x75
-#define bfd_mach_m32c 0x78
- bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */
+ bfd_arch_m32c, /* Renesas M16C/M32C. */
+#define bfd_mach_m16c 0x75
+#define bfd_mach_m32c 0x78
+ bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */
#define bfd_mach_m32r 1 /* For backwards compatibility. */
#define bfd_mach_m32rx 'x'
#define bfd_mach_m32r2 '2'
- bfd_arch_mn10200, /* Matsushita MN10200 */
- bfd_arch_mn10300, /* Matsushita MN10300 */
-#define bfd_mach_mn10300 300
+ bfd_arch_mn10200, /* Matsushita MN10200. */
+ bfd_arch_mn10300, /* Matsushita MN10300. */
+#define bfd_mach_mn10300 300
#define bfd_mach_am33 330
#define bfd_mach_am33_2 332
bfd_arch_fr30,
#define bfd_mach_fr300 300
#define bfd_mach_fr400 400
#define bfd_mach_fr450 450
-#define bfd_mach_frvtomcat 499 /* fr500 prototype */
+#define bfd_mach_frvtomcat 499 /* fr500 prototype. */
#define bfd_mach_fr500 500
#define bfd_mach_fr550 550
- bfd_arch_moxie, /* The moxie processor */
+ bfd_arch_moxie, /* The moxie processor. */
#define bfd_mach_moxie 1
- bfd_arch_ft32, /* The ft32 processor */
+ bfd_arch_ft32, /* The ft32 processor. */
#define bfd_mach_ft32 1
#define bfd_mach_ft32b 2
bfd_arch_mcore,
#define bfd_mach_mep_c5 0x6335
bfd_arch_metag,
#define bfd_mach_metag 1
- bfd_arch_ia64, /* HP/Intel ia64 */
+ bfd_arch_ia64, /* HP/Intel ia64. */
#define bfd_mach_ia64_elf64 64
#define bfd_mach_ia64_elf32 32
bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */
bfd_arch_iq2000, /* Vitesse IQ2000. */
#define bfd_mach_iq2000 1
#define bfd_mach_iq10 2
- bfd_arch_epiphany, /* Adapteva EPIPHANY */
+ bfd_arch_epiphany, /* Adapteva EPIPHANY. */
#define bfd_mach_epiphany16 1
#define bfd_mach_epiphany32 2
bfd_arch_mt,
#define bfd_mach_avr5 5
#define bfd_mach_avr51 51
#define bfd_mach_avr6 6
-#define bfd_mach_avrtiny 100
-#define bfd_mach_avrxmega1 101
-#define bfd_mach_avrxmega2 102
-#define bfd_mach_avrxmega3 103
-#define bfd_mach_avrxmega4 104
-#define bfd_mach_avrxmega5 105
-#define bfd_mach_avrxmega6 106
-#define bfd_mach_avrxmega7 107
- bfd_arch_bfin, /* ADI Blackfin */
+#define bfd_mach_avrtiny 100
+#define bfd_mach_avrxmega1 101
+#define bfd_mach_avrxmega2 102
+#define bfd_mach_avrxmega3 103
+#define bfd_mach_avrxmega4 104
+#define bfd_mach_avrxmega5 105
+#define bfd_mach_avrxmega6 106
+#define bfd_mach_avrxmega7 107
+ bfd_arch_bfin, /* ADI Blackfin. */
#define bfd_mach_bfin 1
- bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
+ bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */
#define bfd_mach_cr16 1
- bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
+ bfd_arch_cr16c, /* National Semiconductor CompactRISC. */
#define bfd_mach_cr16c 1
bfd_arch_crx, /* National Semiconductor CRX. */
#define bfd_mach_crx 1
- bfd_arch_cris, /* Axis CRIS */
+ bfd_arch_cris, /* Axis CRIS. */
#define bfd_mach_cris_v0_v10 255
#define bfd_mach_cris_v32 32
#define bfd_mach_cris_v10_v32 1032
#define bfd_mach_riscv32 132
#define bfd_mach_riscv64 164
bfd_arch_rl78,
-#define bfd_mach_rl78 0x75
+#define bfd_mach_rl78 0x75
bfd_arch_rx, /* Renesas RX. */
#define bfd_mach_rx 0x75
- bfd_arch_s390, /* IBM s390 */
+ bfd_arch_s390, /* IBM s390. */
#define bfd_mach_s390_31 31
#define bfd_mach_s390_64 64
- bfd_arch_score, /* Sunplus score */
-#define bfd_mach_score3 3
-#define bfd_mach_score7 7
+ bfd_arch_score, /* Sunplus score. */
+#define bfd_mach_score3 3
+#define bfd_mach_score7 7
bfd_arch_mmix, /* Donald Knuth's educational processor. */
bfd_arch_xstormy16,
#define bfd_mach_xstormy16 1
bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */
-#define bfd_mach_msp11 11
-#define bfd_mach_msp110 110
-#define bfd_mach_msp12 12
-#define bfd_mach_msp13 13
-#define bfd_mach_msp14 14
-#define bfd_mach_msp15 15
-#define bfd_mach_msp16 16
-#define bfd_mach_msp20 20
-#define bfd_mach_msp21 21
-#define bfd_mach_msp22 22
-#define bfd_mach_msp23 23
-#define bfd_mach_msp24 24
-#define bfd_mach_msp26 26
-#define bfd_mach_msp31 31
-#define bfd_mach_msp32 32
-#define bfd_mach_msp33 33
-#define bfd_mach_msp41 41
-#define bfd_mach_msp42 42
-#define bfd_mach_msp43 43
-#define bfd_mach_msp44 44
-#define bfd_mach_msp430x 45
-#define bfd_mach_msp46 46
-#define bfd_mach_msp47 47
-#define bfd_mach_msp54 54
- bfd_arch_xc16x, /* Infineon's XC16X Series. */
+#define bfd_mach_msp11 11
+#define bfd_mach_msp110 110
+#define bfd_mach_msp12 12
+#define bfd_mach_msp13 13
+#define bfd_mach_msp14 14
+#define bfd_mach_msp15 15
+#define bfd_mach_msp16 16
+#define bfd_mach_msp20 20
+#define bfd_mach_msp21 21
+#define bfd_mach_msp22 22
+#define bfd_mach_msp23 23
+#define bfd_mach_msp24 24
+#define bfd_mach_msp26 26
+#define bfd_mach_msp31 31
+#define bfd_mach_msp32 32
+#define bfd_mach_msp33 33
+#define bfd_mach_msp41 41
+#define bfd_mach_msp42 42
+#define bfd_mach_msp43 43
+#define bfd_mach_msp44 44
+#define bfd_mach_msp430x 45
+#define bfd_mach_msp46 46
+#define bfd_mach_msp47 47
+#define bfd_mach_msp54 54
+ bfd_arch_xc16x, /* Infineon's XC16X Series. */
#define bfd_mach_xc16x 1
#define bfd_mach_xc16xl 2
#define bfd_mach_xc16xs 3
- bfd_arch_xgate, /* Freescale XGATE */
+ bfd_arch_xgate, /* Freescale XGATE. */
#define bfd_mach_xgate 1
bfd_arch_xtensa, /* Tensilica's Xtensa cores. */
#define bfd_mach_xtensa 1
bfd_arch_z80,
-#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
-#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
-#define bfd_mach_z80full 7 /* All undocumented instructions. */
-#define bfd_mach_r800 11 /* R800: successor with multiplication. */
- bfd_arch_lm32, /* Lattice Mico32 */
-#define bfd_mach_lm32 1
- bfd_arch_microblaze,/* Xilinx MicroBlaze. */
- bfd_arch_tilepro, /* Tilera TILEPro */
- bfd_arch_tilegx, /* Tilera TILE-Gx */
-#define bfd_mach_tilepro 1
-#define bfd_mach_tilegx 1
-#define bfd_mach_tilegx32 2
- bfd_arch_aarch64, /* AArch64 */
+#define bfd_mach_z80strict 1 /* No undocumented opcodes. */
+#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */
+#define bfd_mach_z80full 7 /* All undocumented instructions. */
+#define bfd_mach_r800 11 /* R800: successor with multiplication. */
+ bfd_arch_lm32, /* Lattice Mico32. */
+#define bfd_mach_lm32 1
+ bfd_arch_microblaze,/* Xilinx MicroBlaze. */
+ bfd_arch_tilepro, /* Tilera TILEPro. */
+ bfd_arch_tilegx, /* Tilera TILE-Gx. */
+#define bfd_mach_tilepro 1
+#define bfd_mach_tilegx 1
+#define bfd_mach_tilegx32 2
+ bfd_arch_aarch64, /* AArch64. */
#define bfd_mach_aarch64 0
#define bfd_mach_aarch64_ilp32 32
- bfd_arch_nios2, /* Nios II */
+ bfd_arch_nios2, /* Nios II. */
#define bfd_mach_nios2 0
#define bfd_mach_nios2r1 1
#define bfd_mach_nios2r2 2
- bfd_arch_visium, /* Visium */
+ bfd_arch_visium, /* Visium. */
#define bfd_mach_visium 1
- bfd_arch_wasm32, /* WebAssembly */
+ bfd_arch_wasm32, /* WebAssembly. */
#define bfd_mach_wasm32 1
- bfd_arch_pru, /* PRU */
-#define bfd_mach_pru 0
+ bfd_arch_pru, /* PRU. */
+#define bfd_mach_pru 0
bfd_arch_last
};
The default arch should be the first entry for an arch so that
all the entries for that arch can be accessed via <<next>>. */
bfd_boolean the_default;
- const struct bfd_arch_info * (*compatible)
- (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
+ const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *,
+ const struct bfd_arch_info *);
bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
NULL, FALSE, 0, 0, FALSE)
-#define HOWTO_PREPARE(relocation, symbol) \
- { \
- if (symbol != NULL) \
- { \
- if (bfd_is_com_section (symbol->section)) \
- { \
- relocation = 0; \
- } \
- else \
- { \
- relocation = symbol->value; \
- } \
- } \
+#define HOWTO_PREPARE(relocation, symbol) \
+ { \
+ if (symbol != NULL) \
+ { \
+ if (bfd_is_com_section (symbol->section)) \
+ { \
+ relocation = 0; \
+ } \
+ else \
+ { \
+ relocation = symbol->value; \
+ } \
+ } \
}
unsigned int bfd_get_reloc_size (reloc_howto_type *);
symvalue value;
/* Attributes of a symbol. */
-#define BSF_NO_FLAGS 0x00
+#define BSF_NO_FLAGS 0
/* The symbol has local scope; <<static>> in <<C>>. The value
is the offset into the section of the data. */
-#define BSF_LOCAL (1 << 0)
+#define BSF_LOCAL (1 << 0)
/* The symbol has global scope; initialized data in <<C>>. The
value is the offset into the section of the data. */
-#define BSF_GLOBAL (1 << 1)
+#define BSF_GLOBAL (1 << 1)
/* The symbol has global scope and is exported. The value is
the offset into the section of the data. */
-#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
+#define BSF_EXPORT BSF_GLOBAL /* No real difference. */
/* A normal C symbol would be one of:
<<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. */
/* The symbol is a debugging record. The value has an arbitrary
meaning, unless BSF_DEBUGGING_RELOC is also set. */
-#define BSF_DEBUGGING (1 << 2)
+#define BSF_DEBUGGING (1 << 2)
/* The symbol denotes a function entry point. Used in ELF,
perhaps others someday. */
-#define BSF_FUNCTION (1 << 3)
+#define BSF_FUNCTION (1 << 3)
/* Used by the linker. */
-#define BSF_KEEP (1 << 5)
+#define BSF_KEEP (1 << 5)
/* An ELF common symbol. */
-#define BSF_ELF_COMMON (1 << 6)
+#define BSF_ELF_COMMON (1 << 6)
/* A weak global symbol, overridable without warnings by
a regular global symbol of the same name. */
-#define BSF_WEAK (1 << 7)
+#define BSF_WEAK (1 << 7)
/* This symbol was created to point to a section, e.g. ELF's
STT_SECTION symbols. */
-#define BSF_SECTION_SYM (1 << 8)
+#define BSF_SECTION_SYM (1 << 8)
/* The symbol used to be a common symbol, but now it is
allocated. */
-#define BSF_OLD_COMMON (1 << 9)
+#define BSF_OLD_COMMON (1 << 9)
/* In some files the type of a symbol sometimes alters its
location in an output file - ie in coff a <<ISFCN>> symbol
which is also <<C_EXT>> symbol appears where it was
declared and not at the end of a section. This bit is set
by the target BFD part to convey this information. */
-#define BSF_NOT_AT_END (1 << 10)
+#define BSF_NOT_AT_END (1 << 10)
/* Signal that the symbol is the label of constructor section. */
-#define BSF_CONSTRUCTOR (1 << 11)
+#define BSF_CONSTRUCTOR (1 << 11)
/* Signal that the symbol is a warning symbol. The name is a
warning. The name of the next symbol is the one to warn about;
if a reference is made to a symbol with the same name as the next
symbol, a warning is issued by the linker. */
-#define BSF_WARNING (1 << 12)
+#define BSF_WARNING (1 << 12)
/* Signal that the symbol is indirect. This symbol is an indirect
pointer to the symbol with the same name as the next symbol. */
-#define BSF_INDIRECT (1 << 13)
+#define BSF_INDIRECT (1 << 13)
/* BSF_FILE marks symbols that contain a file name. This is used
for ELF STT_FILE symbols. */
-#define BSF_FILE (1 << 14)
+#define BSF_FILE (1 << 14)
/* Symbol is from dynamic linking information. */
-#define BSF_DYNAMIC (1 << 15)
+#define BSF_DYNAMIC (1 << 15)
/* The symbol denotes a data object. Used in ELF, and perhaps
others someday. */
-#define BSF_OBJECT (1 << 16)
+#define BSF_OBJECT (1 << 16)
/* This symbol is a debugging symbol. The value is the offset
into the section of the data. BSF_DEBUGGING should be set
as well. */
-#define BSF_DEBUGGING_RELOC (1 << 17)
+#define BSF_DEBUGGING_RELOC (1 << 17)
/* This symbol is thread local. Used in ELF. */
-#define BSF_THREAD_LOCAL (1 << 18)
+#define BSF_THREAD_LOCAL (1 << 18)
/* This symbol represents a complex relocation expression,
with the expression tree serialized in the symbol name. */
-#define BSF_RELC (1 << 19)
+#define BSF_RELC (1 << 19)
/* This symbol represents a signed complex relocation expression,
with the expression tree serialized in the symbol name. */
-#define BSF_SRELC (1 << 20)
+#define BSF_SRELC (1 << 20)
/* This symbol was created by bfd_get_synthetic_symtab. */
-#define BSF_SYNTHETIC (1 << 21)
+#define BSF_SYNTHETIC (1 << 21)
/* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
The dynamic linker will compute the value of this symbol by
/* This symbol is a globally unique data object. The dynamic linker
will make sure that in the entire process there is just one symbol
with this name and type in use. BSF_OBJECT must also be set. */
-#define BSF_GNU_UNIQUE (1 << 23)
+#define BSF_GNU_UNIQUE (1 << 23)
flagword flags;
asymbol;
#define bfd_get_symtab_upper_bound(abfd) \
- BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
+ BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
#define bfd_is_local_label_name(abfd, name) \
- BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
+ BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
#define bfd_is_target_special_symbol(abfd, sym) \
- BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
+ BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
#define bfd_canonicalize_symtab(abfd, location) \
- BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
+ BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
bfd_boolean bfd_set_symtab
(bfd *abfd, asymbol **location, unsigned int count);
void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
#define bfd_make_empty_symbol(abfd) \
- BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
+ BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
asymbol *_bfd_generic_make_empty_symbol (bfd *);
#define bfd_make_debug_symbol(abfd,ptr,size) \
- BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
+ BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
int bfd_decode_symclass (asymbol *symbol);
(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
- BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
- (ibfd, isymbol, obfd, osymbol))
+ BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
+ (ibfd, isymbol, obfd, osymbol))
/* Extracted from bfd.c. */
the object_flags values have mostly just been copied from backend
to another, and are not necessarily correct). */
-#define BFD_NO_FLAGS 0x00
+#define BFD_NO_FLAGS 0x0
/* BFD contains relocation entries. */
-#define HAS_RELOC 0x01
+#define HAS_RELOC 0x1
/* BFD is directly executable. */
-#define EXEC_P 0x02
+#define EXEC_P 0x2
/* BFD has line number information (basically used for F_LNNO in a
COFF header). */
-#define HAS_LINENO 0x04
+#define HAS_LINENO 0x4
/* BFD has debugging information. */
-#define HAS_DEBUG 0x08
+#define HAS_DEBUG 0x08
/* BFD has symbols. */
-#define HAS_SYMS 0x10
+#define HAS_SYMS 0x10
/* BFD has local symbols (basically used for F_LSYMS in a COFF
header). */
-#define HAS_LOCALS 0x20
+#define HAS_LOCALS 0x20
/* BFD is a dynamic object. */
-#define DYNAMIC 0x40
+#define DYNAMIC 0x40
/* Text section is write protected (if D_PAGED is not set, this is
like an a.out NMAGIC file) (the linker sets this by default, but
clears it for -r or -N). */
-#define WP_TEXT 0x80
+#define WP_TEXT 0x80
/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
linker sets this by default, but clears it for -r or -n or -N). */
-#define D_PAGED 0x100
+#define D_PAGED 0x100
/* BFD is relaxable (this means that bfd_relax_section may be able to
do something) (sometimes bfd_relax_section can do something even if
this is not set). */
-#define BFD_IS_RELAXABLE 0x200
+#define BFD_IS_RELAXABLE 0x200
/* This may be set before writing out a BFD to request using a
traditional format. For example, this is used to request that when
writing out an a.out object the symbols not be hashed to eliminate
duplicates. */
-#define BFD_TRADITIONAL_FORMAT 0x400
+#define BFD_TRADITIONAL_FORMAT 0x400
/* This flag indicates that the BFD contents are actually cached
in memory. If this is set, iostream points to a bfd_in_memory
struct. */
-#define BFD_IN_MEMORY 0x800
+#define BFD_IN_MEMORY 0x800
/* This BFD has been created by the linker and doesn't correspond
to any input file. */
-#define BFD_LINKER_CREATED 0x1000
+#define BFD_LINKER_CREATED 0x1000
/* This may be set before writing out a BFD to request that it
be written using values for UIDs, GIDs, timestamps, etc. that
#define BFD_DETERMINISTIC_OUTPUT 0x2000
/* Compress sections in this BFD. */
-#define BFD_COMPRESS 0x4000
+#define BFD_COMPRESS 0x4000
/* Decompress sections in this BFD. */
-#define BFD_DECOMPRESS 0x8000
+#define BFD_DECOMPRESS 0x8000
/* BFD is a dummy, for plugins. */
-#define BFD_PLUGIN 0x10000
+#define BFD_PLUGIN 0x10000
/* Compress sections in this BFD with SHF_COMPRESSED from gABI. */
-#define BFD_COMPRESS_GABI 0x20000
+#define BFD_COMPRESS_GABI 0x20000
/* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
BFD. */
-#define BFD_CONVERT_ELF_COMMON 0x40000
+#define BFD_CONVERT_ELF_COMMON 0x40000
/* Use the ELF STT_COMMON type in this BFD. */
-#define BFD_USE_ELF_STT_COMMON 0x80000
+#define BFD_USE_ELF_STT_COMMON 0x80000
/* Flags bits to be saved in bfd_preserve_save. */
#define BFD_FLAGS_SAVED \
(bfd *abfd, asection *sec, arelent **rel, unsigned int count);
#define bfd_set_reloc(abfd, asect, location, count) \
- BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
+ BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
int bfd_get_arch_size (bfd *abfd);
bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
#define bfd_copy_private_header_data(ibfd, obfd) \
- BFD_SEND (obfd, _bfd_copy_private_header_data, \
- (ibfd, obfd))
+ BFD_SEND (obfd, _bfd_copy_private_header_data, \
+ (ibfd, obfd))
bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
#define bfd_copy_private_bfd_data(ibfd, obfd) \
- BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
- (ibfd, obfd))
+ BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
+ (ibfd, obfd))
bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
#define bfd_set_private_flags(abfd, flags) \
- BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
+ BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
#define bfd_sizeof_headers(abfd, info) \
BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
(abfd, syms, sec, off, file, func, line, NULL))
#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
- line, disc) \
+ line, disc) \
BFD_SEND (abfd, _bfd_find_nearest_line, \
(abfd, syms, sec, off, file, func, line, disc))
within the target vector structure, one for each format to check. */
/* Check the format of a file being read. Return a <<bfd_target *>> or zero. */
- const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
+ const struct bfd_target *
+ (*_bfd_check_format[bfd_type_end]) (bfd *);
/* Set the format of a file being written. */
bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
/* Called when a new section is created. */
bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
/* Read the contents of a section. */
- bfd_boolean (*_bfd_get_section_contents)
- (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
- bfd_boolean (*_bfd_get_section_contents_in_window)
- (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
+ bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
+ bfd_size_type);
+ bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
+ bfd_window *, file_ptr,
+ bfd_size_type);
/* Entry points to copy private data. */
#define BFD_JUMP_TABLE_COPY(NAME) \
/* Called to initialize BFD private section data from one object file
to another. */
#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
- BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info))
- bfd_boolean (*_bfd_init_private_section_data)
- (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *);
+ BFD_SEND (obfd, _bfd_init_private_section_data, \
+ (ibfd, isec, obfd, osec, link_info))
+ bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
+ sec_ptr,
+ struct bfd_link_info *);
/* Called to copy BFD private section data from one object file
to another. */
- bfd_boolean (*_bfd_copy_private_section_data)
- (bfd *, sec_ptr, bfd *, sec_ptr);
+ bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
+ sec_ptr);
/* Called to copy BFD private symbol data from one symbol
to another. */
- bfd_boolean (*_bfd_copy_private_symbol_data)
- (bfd *, asymbol *, bfd *, asymbol *);
+ bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
+ asymbol *);
/* Called to copy BFD private header data from one object file
to another. */
- bfd_boolean (*_bfd_copy_private_header_data)
- (bfd *, bfd *);
+ bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
/* Called to set private backend flags. */
bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
bfd_boolean (*_bfd_slurp_armap) (bfd *);
bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
- bfd_boolean (*_bfd_construct_extended_name_table)
- (bfd *, char **, bfd_size_type *, const char **);
+ bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
+ bfd_size_type *,
+ const char **);
void (*_bfd_truncate_arname) (bfd *, const char *, char *);
- bfd_boolean (*write_armap)
- (bfd *, unsigned int, struct orl *, unsigned int, int);
+ bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
+ unsigned int, int);
void * (*_bfd_read_ar_hdr_fn) (bfd *);
bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
bfd * (*openr_next_archived_file) (bfd *, bfd *);
-#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
+#define bfd_get_elt_at_index(b,i) \
+ BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
NAME##_minisymbol_to_symbol
long (*_bfd_get_symtab_upper_bound) (bfd *);
- long (*_bfd_canonicalize_symtab)
- (bfd *, struct bfd_symbol **);
+ long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
struct bfd_symbol *
(*_bfd_make_empty_symbol) (bfd *);
- void (*_bfd_print_symbol)
- (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
-#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
- void (*_bfd_get_symbol_info)
- (bfd *, struct bfd_symbol *, symbol_info *);
-#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
- const char *(*_bfd_get_symbol_version_string)
- (bfd *, struct bfd_symbol *, bfd_boolean *);
-#define bfd_get_symbol_version_string(b,s,h) BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
+ void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
+ bfd_print_symbol_type);
+#define bfd_print_symbol(b,p,s,e) \
+ BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
+ void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
+ symbol_info *);
+#define bfd_get_symbol_info(b,p,e) \
+ BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
+ const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
+ bfd_boolean *);
+#define bfd_get_symbol_version_string(b,s,h) \
+ BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
- bfd_boolean (*_bfd_find_nearest_line)
- (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma,
- const char **, const char **, unsigned int *, unsigned int *);
- bfd_boolean (*_bfd_find_line)
- (bfd *, struct bfd_symbol **, struct bfd_symbol *,
- const char **, unsigned int *);
+ bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
+ struct bfd_section *, bfd_vma,
+ const char **, const char **,
+ unsigned int *, unsigned int *);
+ bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
+ struct bfd_symbol *, const char **,
+ unsigned int *);
bfd_boolean (*_bfd_find_inliner_info)
(bfd *, const char **, const char **, unsigned int *);
/* Back-door to allow format-aware applications to create debug symbols
while using BFD for everything else. Currently used by the assembler
when creating COFF files. */
- asymbol * (*_bfd_make_debug_symbol)
- (bfd *, void *, unsigned long size);
+ asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
#define bfd_read_minisymbols(b, d, m, s) \
- BFD_SEND (b, _read_minisymbols, (b, d, m, s))
- long (*_read_minisymbols)
- (bfd *, bfd_boolean, void **, unsigned int *);
+ BFD_SEND (b, _read_minisymbols, (b, d, m, s))
+ long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
+ unsigned int *);
#define bfd_minisymbol_to_symbol(b, d, m, f) \
- BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
- asymbol * (*_minisymbol_to_symbol)
- (bfd *, bfd_boolean, const void *, asymbol *);
+ BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
+ asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
+ asymbol *);
/* Routines for relocs. */
#define BFD_JUMP_TABLE_RELOCS(NAME) \
NAME##_bfd_reloc_name_lookup
long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
- long (*_bfd_canonicalize_reloc)
- (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
- void (*_bfd_set_reloc)
- (bfd *, sec_ptr, arelent **, unsigned int);
+ long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
+ struct bfd_symbol **);
+ void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
/* See documentation on reloc types. */
reloc_howto_type *
(*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
reloc_howto_type *
(*reloc_name_lookup) (bfd *, const char *);
-
/* Routines used when writing an object file. */
#define BFD_JUMP_TABLE_WRITE(NAME) \
NAME##_set_arch_mach, \
NAME##_set_section_contents
- bfd_boolean (*_bfd_set_arch_mach)
- (bfd *, enum bfd_architecture, unsigned long);
- bfd_boolean (*_bfd_set_section_contents)
- (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
+ bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
+ unsigned long);
+ bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
+ file_ptr, bfd_size_type);
/* Routines used by the linker. */
#define BFD_JUMP_TABLE_LINK(NAME) \
NAME##_bfd_define_start_stop
int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
- bfd_byte * (*_bfd_get_relocated_section_contents)
- (bfd *, struct bfd_link_info *, struct bfd_link_order *,
- bfd_byte *, bfd_boolean, struct bfd_symbol **);
+ bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
+ struct bfd_link_info *,
+ struct bfd_link_order *,
+ bfd_byte *, bfd_boolean,
+ struct bfd_symbol **);
- bfd_boolean (*_bfd_relax_section)
- (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
+ bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
+ struct bfd_link_info *, bfd_boolean *);
/* Create a hash table for the linker. Different backends store
different information in this table. */
/* Copy the symbol type and other attributes for a linker script
assignment of one symbol to another. */
#define bfd_copy_link_hash_symbol_type(b, t, f) \
- BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
- void (*_bfd_copy_link_hash_symbol_type)
- (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
+ BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
+ void (*_bfd_copy_link_hash_symbol_type) (bfd *,
+ struct bfd_link_hash_entry *,
+ struct bfd_link_hash_entry *);
/* Do a link based on the link_order structures attached to each
section of the BFD. */
/* Sets the bitmask of allowed and disallowed section flags. */
bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
- struct flag_info *,
- asection *);
+ struct flag_info *, asection *);
/* Attempt to merge SEC_MERGE sections. */
bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
struct bfd_link_hash_entry *);
/* Define a __start, __stop, .startof. or .sizeof. symbol. */
- struct bfd_link_hash_entry *(*_bfd_define_start_stop) (struct bfd_link_info *,
- const char *,
- asection *);
+ struct bfd_link_hash_entry *
+ (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
+ asection *);
/* Routines to handle dynamic symbols and relocs. */
#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
/* Get the amount of memory required to hold the dynamic symbols. */
long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
/* Read in the dynamic symbols. */
- long (*_bfd_canonicalize_dynamic_symtab)
- (bfd *, struct bfd_symbol **);
+ long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
/* Create synthetized symbols. */
- long (*_bfd_get_synthetic_symtab)
- (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
- struct bfd_symbol **);
+ long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
+ long, struct bfd_symbol **,
+ struct bfd_symbol **);
/* Get the amount of memory required to hold the dynamic relocs. */
long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
/* Read in the dynamic relocs. */
- long (*_bfd_canonicalize_dynamic_reloc)
- (bfd *, arelent **, struct bfd_symbol **);
+ long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
+ struct bfd_symbol **);
/* Opposite endian version of this target. */
- const struct bfd_target * alternative_target;
+ const struct bfd_target *alternative_target;
/* Data for use by back-end routines, which isn't
generic enough to belong in this structure. */
(bfd *ibfd, struct bfd_link_info *info);
#define bfd_merge_private_bfd_data(ibfd, info) \
- BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
- (ibfd, info))
+ BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
+ (ibfd, info))
/* Extracted from simple.c. */
bfd_byte *bfd_simple_get_relocated_section_contents
(bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
. the object_flags values have mostly just been copied from backend
. to another, and are not necessarily correct). *}
.
-.#define BFD_NO_FLAGS 0x00
+.#define BFD_NO_FLAGS 0x0
.
. {* BFD contains relocation entries. *}
-.#define HAS_RELOC 0x01
+.#define HAS_RELOC 0x1
.
. {* BFD is directly executable. *}
-.#define EXEC_P 0x02
+.#define EXEC_P 0x2
.
. {* BFD has line number information (basically used for F_LNNO in a
. COFF header). *}
-.#define HAS_LINENO 0x04
+.#define HAS_LINENO 0x4
.
. {* BFD has debugging information. *}
-.#define HAS_DEBUG 0x08
+.#define HAS_DEBUG 0x08
.
. {* BFD has symbols. *}
-.#define HAS_SYMS 0x10
+.#define HAS_SYMS 0x10
.
. {* BFD has local symbols (basically used for F_LSYMS in a COFF
. header). *}
-.#define HAS_LOCALS 0x20
+.#define HAS_LOCALS 0x20
.
. {* BFD is a dynamic object. *}
-.#define DYNAMIC 0x40
+.#define DYNAMIC 0x40
.
. {* Text section is write protected (if D_PAGED is not set, this is
. like an a.out NMAGIC file) (the linker sets this by default, but
. clears it for -r or -N). *}
-.#define WP_TEXT 0x80
+.#define WP_TEXT 0x80
.
. {* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
. linker sets this by default, but clears it for -r or -n or -N). *}
-.#define D_PAGED 0x100
+.#define D_PAGED 0x100
.
. {* BFD is relaxable (this means that bfd_relax_section may be able to
. do something) (sometimes bfd_relax_section can do something even if
. this is not set). *}
-.#define BFD_IS_RELAXABLE 0x200
+.#define BFD_IS_RELAXABLE 0x200
.
. {* This may be set before writing out a BFD to request using a
. traditional format. For example, this is used to request that when
. writing out an a.out object the symbols not be hashed to eliminate
. duplicates. *}
-.#define BFD_TRADITIONAL_FORMAT 0x400
+.#define BFD_TRADITIONAL_FORMAT 0x400
.
. {* This flag indicates that the BFD contents are actually cached
. in memory. If this is set, iostream points to a bfd_in_memory
. struct. *}
-.#define BFD_IN_MEMORY 0x800
+.#define BFD_IN_MEMORY 0x800
.
. {* This BFD has been created by the linker and doesn't correspond
. to any input file. *}
-.#define BFD_LINKER_CREATED 0x1000
+.#define BFD_LINKER_CREATED 0x1000
.
. {* This may be set before writing out a BFD to request that it
. be written using values for UIDs, GIDs, timestamps, etc. that
.#define BFD_DETERMINISTIC_OUTPUT 0x2000
.
. {* Compress sections in this BFD. *}
-.#define BFD_COMPRESS 0x4000
+.#define BFD_COMPRESS 0x4000
.
. {* Decompress sections in this BFD. *}
-.#define BFD_DECOMPRESS 0x8000
+.#define BFD_DECOMPRESS 0x8000
.
. {* BFD is a dummy, for plugins. *}
-.#define BFD_PLUGIN 0x10000
+.#define BFD_PLUGIN 0x10000
.
. {* Compress sections in this BFD with SHF_COMPRESSED from gABI. *}
-.#define BFD_COMPRESS_GABI 0x20000
+.#define BFD_COMPRESS_GABI 0x20000
.
. {* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this
. BFD. *}
-.#define BFD_CONVERT_ELF_COMMON 0x40000
+.#define BFD_CONVERT_ELF_COMMON 0x40000
.
. {* Use the ELF STT_COMMON type in this BFD. *}
-.#define BFD_USE_ELF_STT_COMMON 0x80000
+.#define BFD_USE_ELF_STT_COMMON 0x80000
.
. {* Flags bits to be saved in bfd_preserve_save. *}
.#define BFD_FLAGS_SAVED \
. struct bfd *archive_next; {* The next BFD in the archive. *}
. struct bfd *archive_head; {* The first BFD in the archive. *}
. struct bfd *nested_archives; {* List of nested archive in a flattened
-. thin archive. *}
+. thin archive. *}
.
. union {
. {* For input BFDs, a chain of BFDs involved in a link. *}
individual documentation for precise semantics). On an error,
they call <<bfd_set_error>> to set an error condition that callers
can check by calling <<bfd_get_error>>.
- If that returns <<bfd_error_system_call>>, then check
+ If that returns <<bfd_error_system_call>>, then check
<<errno>>.
The easiest way to report a BFD error to the user is to
CODE_FRAGMENT
.
.typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg,
-. const char *bfd_version,
-. const char *bfd_file,
-. int bfd_line);
+. const char *bfd_version,
+. const char *bfd_file,
+. int bfd_line);
.
*/
The argument @var{abfd} is ignored.
.#define bfd_set_reloc(abfd, asect, location, count) \
-. BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
+. BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count))
*/
/*
bfd_get_arch_size
SYNOPSIS
- int bfd_get_arch_size (bfd *abfd);
+ int bfd_get_arch_size (bfd *abfd);
DESCRIPTION
Returns the normalized architecture address size, in bits, as
bfd_get_sign_extend_vma
SYNOPSIS
- int bfd_get_sign_extend_vma (bfd *abfd);
+ int bfd_get_sign_extend_vma (bfd *abfd);
DESCRIPTION
Indicates if the target architecture "naturally" sign extends
bfd_set_start_address
SYNOPSIS
- bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
+ bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
DESCRIPTION
Make @var{vma} the entry point of output BFD @var{abfd}.
Not enough memory exists to create private data for @var{obfd}.
.#define bfd_copy_private_header_data(ibfd, obfd) \
-. BFD_SEND (obfd, _bfd_copy_private_header_data, \
-. (ibfd, obfd))
+. BFD_SEND (obfd, _bfd_copy_private_header_data, \
+. (ibfd, obfd))
*/
Not enough memory exists to create private data for @var{obfd}.
.#define bfd_copy_private_bfd_data(ibfd, obfd) \
-. BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
-. (ibfd, obfd))
+. BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
+. (ibfd, obfd))
*/
Not enough memory exists to create private data for @var{obfd}.
.#define bfd_set_private_flags(abfd, flags) \
-. BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
+. BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
*/
The following functions exist but have not yet been documented.
.#define bfd_sizeof_headers(abfd, info) \
-. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
+. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
.
.#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
-. BFD_SEND (abfd, _bfd_find_nearest_line, \
-. (abfd, syms, sec, off, file, func, line, NULL))
+. BFD_SEND (abfd, _bfd_find_nearest_line, \
+. (abfd, syms, sec, off, file, func, line, NULL))
.
.#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \
-. line, disc) \
-. BFD_SEND (abfd, _bfd_find_nearest_line, \
-. (abfd, syms, sec, off, file, func, line, disc))
+. line, disc) \
+. BFD_SEND (abfd, _bfd_find_nearest_line, \
+. (abfd, syms, sec, off, file, func, line, disc))
.
.#define bfd_find_line(abfd, syms, sym, file, line) \
-. BFD_SEND (abfd, _bfd_find_line, \
-. (abfd, syms, sym, file, line))
+. BFD_SEND (abfd, _bfd_find_line, \
+. (abfd, syms, sym, file, line))
.
.#define bfd_find_inliner_info(abfd, file, func, line) \
-. BFD_SEND (abfd, _bfd_find_inliner_info, \
-. (abfd, file, func, line))
+. BFD_SEND (abfd, _bfd_find_inliner_info, \
+. (abfd, file, func, line))
.
.#define bfd_debug_info_start(abfd) \
-. BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
+. BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
.
.#define bfd_debug_info_end(abfd) \
-. BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
+. BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
.
.#define bfd_debug_info_accumulate(abfd, section) \
-. BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
+. BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
.
.#define bfd_stat_arch_elt(abfd, stat) \
-. BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
+. BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
.
.#define bfd_update_armap_timestamp(abfd) \
-. BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
+. BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
.
.#define bfd_set_arch_mach(abfd, arch, mach)\
-. BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
+. BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
.
.#define bfd_relax_section(abfd, section, link_info, again) \
-. BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
+. BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
.
.#define bfd_gc_sections(abfd, link_info) \
. BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
. BFD_SEND (abfd, _bfd_final_link, (abfd, info))
.
.#define bfd_free_cached_info(abfd) \
-. BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
+. BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
.
.#define bfd_get_dynamic_symtab_upper_bound(abfd) \
. BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
bfd_emul_get_maxpagesize
SYNOPSIS
- bfd_vma bfd_emul_get_maxpagesize (const char *);
+ bfd_vma bfd_emul_get_maxpagesize (const char *);
DESCRIPTION
Returns the maximum page size, in bytes, as determined by
bfd_emul_set_maxpagesize
SYNOPSIS
- void bfd_emul_set_maxpagesize (const char *, bfd_vma);
+ void bfd_emul_set_maxpagesize (const char *, bfd_vma);
DESCRIPTION
For ELF, set the maximum page size for the emulation. It is
bfd_emul_get_commonpagesize
SYNOPSIS
- bfd_vma bfd_emul_get_commonpagesize (const char *);
+ bfd_vma bfd_emul_get_commonpagesize (const char *);
DESCRIPTION
Returns the common page size, in bytes, as determined by
bfd_emul_set_commonpagesize
SYNOPSIS
- void bfd_emul_set_commonpagesize (const char *, bfd_vma);
+ void bfd_emul_set_commonpagesize (const char *, bfd_vma);
DESCRIPTION
For ELF, set the common page size for the emulation. It is
. or -1 (setting <<bfd_error>>) if an error occurs. *}
. file_ptr (*bread) (struct bfd *abfd, void *ptr, file_ptr nbytes);
. file_ptr (*bwrite) (struct bfd *abfd, const void *ptr,
-. file_ptr nbytes);
+. file_ptr nbytes);
. {* Return the current IOSTREAM file offset, or -1 (setting <<bfd_error>>
. if an error occurs. *}
. file_ptr (*btell) (struct bfd *abfd);
. {* For the following, on successful completion a value of 0 is returned.
-. Otherwise, a value of -1 is returned (and <<bfd_error>> is set). *}
+. Otherwise, a value of -1 is returned (and <<bfd_error>> is set). *}
. int (*bseek) (struct bfd *abfd, file_ptr offset, int whence);
. int (*bclose) (struct bfd *abfd);
. int (*bflush) (struct bfd *abfd);
. MAP_LEN the size mapped (a page multiple). Use unmap with MAP_ADDR and
. MAP_LEN to unmap. *}
. void *(*bmmap) (struct bfd *abfd, void *addr, bfd_size_type len,
-. int prot, int flags, file_ptr offset,
-. void **map_addr, bfd_size_type *map_len);
+. int prot, int flags, file_ptr offset,
+. void **map_addr, bfd_size_type *map_len);
.};
.extern const struct bfd_iovec _bfd_memory_iovec;
bfd_size_type maxbytes = arelt_size (abfd);
if (abfd->where + size > maxbytes)
- {
- if (abfd->where >= maxbytes)
- return 0;
- size = maxbytes - abfd->where;
- }
+ {
+ if (abfd->where >= maxbytes)
+ return 0;
+ size = maxbytes - abfd->where;
+ }
}
if (abfd->iovec)
while (parent_bfd->my_archive != NULL
&& !bfd_is_thin_archive (parent_bfd->my_archive))
- {
- file_position += parent_bfd->origin;
- parent_bfd = parent_bfd->my_archive;
- }
+ {
+ file_position += parent_bfd->origin;
+ parent_bfd = parent_bfd->my_archive;
+ }
}
if (abfd->iovec)
bfd_tell (abfd);
/* An EINVAL error probably means that the file offset was
- absurd. */
+ absurd. */
if (hold_errno == EINVAL)
bfd_set_error (bfd_error_file_truncated);
else
SYNOPSIS
void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
- int prot, int flags, file_ptr offset,
- void **map_addr, bfd_size_type *map_len);
+ int prot, int flags, file_ptr offset,
+ void **map_addr, bfd_size_type *map_len);
DESCRIPTION
Return mmap()ed region of the file, if possible and implemented.
- LEN and OFFSET do not need to be page aligned. The page aligned
- address and length are written to MAP_ADDR and MAP_LEN.
+ LEN and OFFSET do not need to be page aligned. The page aligned
+ address and length are written to MAP_ADDR and MAP_LEN.
*/
void *
bfd_mmap (bfd *abfd, void *addr, bfd_size_type len,
int prot, int flags, file_ptr offset,
- void **map_addr, bfd_size_type *map_len)
+ void **map_addr, bfd_size_type *map_len)
{
void *ret = (void *)-1;
return ret;
return abfd->iovec->bmmap (abfd, addr, len, prot, flags, offset,
- map_addr, map_len);
+ map_addr, map_len);
}
/* Memory file I/O operations. */
if (abfd->where + get > bim->size)
{
if (bim->size < (bfd_size_type) abfd->where)
- get = 0;
+ get = 0;
else
- get = bim->size - abfd->where;
+ get = bim->size - abfd->where;
bfd_set_error (bfd_error_file_truncated);
}
memcpy (ptr, bim->buffer + abfd->where, (size_t) get);
/* Round up to cut down on memory fragmentation */
newsize = (bim->size + 127) & ~(bfd_size_type) 127;
if (newsize > oldsize)
- {
- bim->buffer = (bfd_byte *) bfd_realloc_or_free (bim->buffer, newsize);
- if (bim->buffer == NULL)
- {
- bim->size = 0;
- return 0;
- }
- if (newsize > bim->size)
- memset (bim->buffer + bim->size, 0, newsize - bim->size);
- }
+ {
+ bim->buffer = (bfd_byte *) bfd_realloc_or_free (bim->buffer, newsize);
+ if (bim->buffer == NULL)
+ {
+ bim->size = 0;
+ return 0;
+ }
+ if (newsize > bim->size)
+ memset (bim->buffer + bim->size, 0, newsize - bim->size);
+ }
}
memcpy (bim->buffer + abfd->where, ptr, (size_t) size);
return size;
if ((bfd_size_type)nwhere > bim->size)
{
if (abfd->direction == write_direction
- || abfd->direction == both_direction)
- {
- bfd_size_type newsize, oldsize;
-
- oldsize = (bim->size + 127) & ~(bfd_size_type) 127;
- bim->size = nwhere;
- /* Round up to cut down on memory fragmentation */
- newsize = (bim->size + 127) & ~(bfd_size_type) 127;
- if (newsize > oldsize)
- {
- bim->buffer = (bfd_byte *) bfd_realloc_or_free (bim->buffer, newsize);
- if (bim->buffer == NULL)
- {
- errno = EINVAL;
- bim->size = 0;
- return -1;
- }
- memset (bim->buffer + oldsize, 0, newsize - oldsize);
- }
- }
+ || abfd->direction == both_direction)
+ {
+ bfd_size_type newsize, oldsize;
+
+ oldsize = (bim->size + 127) & ~(bfd_size_type) 127;
+ bim->size = nwhere;
+ /* Round up to cut down on memory fragmentation */
+ newsize = (bim->size + 127) & ~(bfd_size_type) 127;
+ if (newsize > oldsize)
+ {
+ bim->buffer = (bfd_byte *) bfd_realloc_or_free (bim->buffer, newsize);
+ if (bim->buffer == NULL)
+ {
+ errno = EINVAL;
+ bim->size = 0;
+ return -1;
+ }
+ memset (bim->buffer + oldsize, 0, newsize - oldsize);
+ }
+ }
else
- {
- abfd->where = bim->size;
- errno = EINVAL;
- bfd_set_error (bfd_error_file_truncated);
- return -1;
- }
+ {
+ abfd->where = bim->size;
+ errno = EINVAL;
+ bfd_set_error (bfd_error_file_truncated);
+ return -1;
+ }
}
return 0;
}
static void *
memory_bmmap (bfd *abfd ATTRIBUTE_UNUSED, void *addr ATTRIBUTE_UNUSED,
- bfd_size_type len ATTRIBUTE_UNUSED, int prot ATTRIBUTE_UNUSED,
- int flags ATTRIBUTE_UNUSED, file_ptr offset ATTRIBUTE_UNUSED,
- void **map_addr ATTRIBUTE_UNUSED,
- bfd_size_type *map_len ATTRIBUTE_UNUSED)
+ bfd_size_type len ATTRIBUTE_UNUSED, int prot ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, file_ptr offset ATTRIBUTE_UNUSED,
+ void **map_addr ATTRIBUTE_UNUSED,
+ bfd_size_type *map_len ATTRIBUTE_UNUSED)
{
return (void *)-1;
}
bfd_symbol_info (symbol, ret);
}
-#define binary_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define binary_get_lineno _bfd_nosymbols_get_lineno
-#define binary_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define binary_find_line _bfd_nosymbols_find_line
-#define binary_find_inliner_info _bfd_nosymbols_find_inliner_info
-#define binary_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define binary_read_minisymbols _bfd_generic_read_minisymbols
-#define binary_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define binary_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define binary_get_lineno _bfd_nosymbols_get_lineno
+#define binary_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define binary_find_line _bfd_nosymbols_find_line
+#define binary_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define binary_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define binary_read_minisymbols _bfd_generic_read_minisymbols
+#define binary_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
#define binary_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
/* Set the architecture of a binary file. */
asection *s;
/* The lowest section LMA sets the virtual address of the start
- of the file. We use this to set the file position of all the
- sections. */
+ of the file. We use this to set the file position of all the
+ sections. */
found_low = FALSE;
low = 0;
for (s = abfd->sections; s != NULL; s = s->next)
}
#define binary_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define binary_bfd_relax_section bfd_generic_relax_section
-#define binary_bfd_gc_sections bfd_generic_gc_sections
-#define binary_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define binary_bfd_merge_sections bfd_generic_merge_sections
-#define binary_bfd_is_group_section bfd_generic_is_group_section
-#define binary_bfd_discard_group bfd_generic_discard_group
-#define binary_section_already_linked _bfd_generic_section_already_linked
-#define binary_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define binary_bfd_define_start_stop bfd_generic_define_start_stop
-#define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define binary_bfd_link_just_syms _bfd_generic_link_just_syms
-#define binary_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
-#define binary_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define binary_bfd_final_link _bfd_generic_final_link
-#define binary_bfd_link_split_section _bfd_generic_link_split_section
-#define binary_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-#define binary_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define binary_bfd_relax_section bfd_generic_relax_section
+#define binary_bfd_gc_sections bfd_generic_gc_sections
+#define binary_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define binary_bfd_merge_sections bfd_generic_merge_sections
+#define binary_bfd_is_group_section bfd_generic_is_group_section
+#define binary_bfd_discard_group bfd_generic_discard_group
+#define binary_section_already_linked _bfd_generic_section_already_linked
+#define binary_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define binary_bfd_define_start_stop bfd_generic_define_start_stop
+#define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define binary_bfd_link_just_syms _bfd_generic_link_just_syms
+#define binary_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
+#define binary_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define binary_bfd_final_link _bfd_generic_final_link
+#define binary_bfd_link_split_section _bfd_generic_link_split_section
+#define binary_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define binary_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target binary_vec =
{
/* Some reloc hackery. */
#define CALLS 0x66003800 /* Template for 'calls' instruction */
-#define BAL 0x0b000000 /* Template for 'bal' instruction */
+#define BAL 0x0b000000 /* Template for 'bal' instruction */
#define BAL_MASK 0x00ffffff
#define BALX 0x85f00000 /* Template for 'balx' instruction */
#define BALX_MASK 0x0007ffff
else if ((symbol->symbol.flags & BSF_SECTION_SYM) != 0)
{
/* A callj against a symbol in the same section is a fully
- resolved relative call. We don't need to do anything here.
- If the symbol is not in the same section, I'm not sure what
- to do; fortunately, this case will probably never arise. */
+ resolved relative call. We don't need to do anything here.
+ If the symbol is not in the same section, I'm not sure what
+ to do; fortunately, this case will probably never arise. */
BFD_ASSERT (! shrinking);
BFD_ASSERT (symbol->symbol.section == input_section);
}
/* Build the transfer vectors for Big and Little-Endian B.OUT files. */
-#define aout_32_find_line _bfd_nosymbols_find_line
+#define aout_32_find_line _bfd_nosymbols_find_line
#define aout_32_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define aout_32_close_and_cleanup aout_32_bfd_free_cached_info
+#define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define aout_32_close_and_cleanup aout_32_bfd_free_cached_info
#define b_out_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define b_out_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define b_out_bfd_link_just_syms _bfd_generic_link_just_syms
+#define b_out_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define b_out_bfd_link_just_syms _bfd_generic_link_just_syms
#define b_out_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
-#define b_out_bfd_final_link _bfd_generic_final_link
-#define b_out_bfd_link_split_section _bfd_generic_link_split_section
-#define b_out_bfd_gc_sections bfd_generic_gc_sections
-#define b_out_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define b_out_bfd_merge_sections bfd_generic_merge_sections
-#define b_out_bfd_is_group_section bfd_generic_is_group_section
-#define b_out_bfd_discard_group bfd_generic_discard_group
-#define b_out_section_already_linked _bfd_generic_section_already_linked
-#define b_out_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define b_out_bfd_define_start_stop bfd_generic_define_start_stop
+#define b_out_bfd_final_link _bfd_generic_final_link
+#define b_out_bfd_link_split_section _bfd_generic_link_split_section
+#define b_out_bfd_gc_sections bfd_generic_gc_sections
+#define b_out_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define b_out_bfd_merge_sections bfd_generic_merge_sections
+#define b_out_bfd_is_group_section bfd_generic_is_group_section
+#define b_out_bfd_discard_group bfd_generic_discard_group
+#define b_out_section_already_linked _bfd_generic_section_already_linked
+#define b_out_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define b_out_bfd_define_start_stop bfd_generic_define_start_stop
#define aout_32_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-#define b_out_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define b_out_bfd_link_check_relocs _bfd_generic_link_check_relocs
#define b_out_set_reloc _bfd_generic_set_reloc
extern const bfd_target bout_le_vec;
/* PR ld/19260: 32-bit Solaris has very inelegant handling of the 255
file descriptor limit. The problem is that setrlimit(2) can raise
RLIMIT_NOFILE to a value that is not supported by libc, resulting
- in "Too many open files" errors. This can happen here even though
+ in "Too many open files" errors. This can happen here even though
max_open_files is set to rlim.rlim_cur / 8. For example, if
a parent process has set rlim.rlim_cur to 65536, then max_open_files
will be computed as 8192.
This check essentially reverts to the behavior from binutils 2.23.1
- for 32-bit Solaris only. (It is hoped that the 32-bit libc
+ for 32-bit Solaris only. (It is hoped that the 32-bit libc
limitation will be removed soon). 64-bit Solaris libc does not have
this limitation. */
max = 16;
#ifdef _SC_OPEN_MAX
max = sysconf (_SC_OPEN_MAX) / 8;
#else
- max = 10;
+ max = 10;
#endif
#endif /* not 32-bit Solaris */
file_ptr chunk_nread;
if (chunk_size > max_chunk_size)
- chunk_size = max_chunk_size;
+ chunk_size = max_chunk_size;
chunk_nread = cache_bread_1 (abfd, (char *) buf + nread, chunk_size);
/* Update the nread count.
- We just have to be careful of the case when cache_bread_1 returns
- a negative count: If this is our first read, then set nread to
- that negative count in order to return that negative value to the
- caller. Otherwise, don't add it to our total count, or we would
- end up returning a smaller number of bytes read than we actually
- did. */
+ We just have to be careful of the case when cache_bread_1 returns
+ a negative count: If this is our first read, then set nread to
+ that negative count in order to return that negative value to the
+ caller. Otherwise, don't add it to our total count, or we would
+ end up returning a smaller number of bytes read than we actually
+ did. */
if (nread == 0 || chunk_nread > 0)
- nread += chunk_nread;
+ nread += chunk_nread;
if (chunk_nread < chunk_size)
- break;
+ break;
}
return nread;
int prot ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED,
file_ptr offset ATTRIBUTE_UNUSED,
- void **map_addr ATTRIBUTE_UNUSED,
- bfd_size_type *map_len ATTRIBUTE_UNUSED)
+ void **map_addr ATTRIBUTE_UNUSED,
+ bfd_size_type *map_len ATTRIBUTE_UNUSED)
{
void *ret = (void *) -1;
return ret;
if (pagesize_m1 == 0)
- pagesize_m1 = getpagesize () - 1;
+ pagesize_m1 = getpagesize () - 1;
/* Handle archive members. */
if (abfd->my_archive != NULL
&& !bfd_is_thin_archive (abfd->my_archive))
- offset += abfd->origin;
+ offset += abfd->origin;
/* Align. */
pg_offset = offset & ~pagesize_m1;
if (ret == (void *) -1)
bfd_set_error (bfd_error_system_call);
else
- {
- *map_addr = ret;
- *map_len = pg_len;
- ret = (char *) ret + (offset & pagesize_m1);
- }
+ {
+ *map_addr = ret;
+ *map_len = pg_len;
+ ret = (char *) ret + (offset & pagesize_m1);
+ }
}
#endif
switch (bfd_get_32 (abfd, crashinfo.cpu_vector))
{
- /* bus error */
+ /* bus error */
case 2 : abfd->tdata.cisco_core_data->sig = SIGBUS; break;
- /* address error */
+ /* address error */
case 3 : abfd->tdata.cisco_core_data->sig = SIGBUS; break;
/* illegal instruction */
case 4 : abfd->tdata.cisco_core_data->sig = SIGILL; break;
- /* zero divide */
+ /* zero divide */
case 5 : abfd->tdata.cisco_core_data->sig = SIGFPE; break;
- /* chk instruction */
+ /* chk instruction */
case 6 : abfd->tdata.cisco_core_data->sig = SIGFPE; break;
- /* trapv instruction */
+ /* trapv instruction */
case 7 : abfd->tdata.cisco_core_data->sig = SIGFPE; break;
/* privilege violation */
case 8 : abfd->tdata.cisco_core_data->sig = SIGSEGV; break;
- /* trace trap */
+ /* trace trap */
case 9 : abfd->tdata.cisco_core_data->sig = SIGTRAP; break;
/* line 1010 emulator */
case 10: abfd->tdata.cisco_core_data->sig = SIGILL; break;
this cannot be triggered by software. Call it a SIGBUS. */
case 13: abfd->tdata.cisco_core_data->sig = SIGBUS; break;
- /* interrupt */
+ /* interrupt */
case 31: abfd->tdata.cisco_core_data->sig = SIGINT; break;
- /* breakpoint */
+ /* breakpoint */
case 33: abfd->tdata.cisco_core_data->sig = SIGTRAP; break;
- /* floating point err */
+ /* floating point err */
case 48: abfd->tdata.cisco_core_data->sig = SIGFPE; break;
- /* floating point err */
+ /* floating point err */
case 49: abfd->tdata.cisco_core_data->sig = SIGFPE; break;
- /* zero divide */
+ /* zero divide */
case 50: abfd->tdata.cisco_core_data->sig = SIGFPE; break;
- /* underflow */
+ /* underflow */
case 51: abfd->tdata.cisco_core_data->sig = SIGFPE; break;
- /* operand error */
+ /* operand error */
case 52: abfd->tdata.cisco_core_data->sig = SIGFPE; break;
- /* overflow */
+ /* overflow */
case 53: abfd->tdata.cisco_core_data->sig = SIGFPE; break;
- /* NAN */
+ /* NAN */
case 54: abfd->tdata.cisco_core_data->sig = SIGFPE; break;
default:
#ifndef SIGEMT
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
- 0, /* symbol prefix */
+ 0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
0, /* match_priority */
case ALPHA_R_SREL32:
case ALPHA_R_SREL64:
/* This relocs appear to be fully resolved when they are against
- internal symbols. Against external symbols, BRADDR at least
- appears to be resolved against the next instruction. */
+ internal symbols. Against external symbols, BRADDR at least
+ appears to be resolved against the next instruction. */
if (! intern->r_extern)
rptr->addend = 0;
else
bfd_byte ab[8];
/* This is a compressed file. We must set the size correctly.
- The size is the eight bytes after the dummy file header. */
+ The size is the eight bytes after the dummy file header. */
if (bfd_seek (abfd, (file_ptr) FILHSZ, SEEK_CUR) != 0
|| bfd_bread (ab, (bfd_size_type) 8, abfd) != 8
|| bfd_seek (abfd, (file_ptr) (- (FILHSZ + 8)), SEEK_CUR) != 0)
bfd_size_type size;
/* We can't use arelt_size here, because that uses parsed_size,
- which is the uncompressed size. We need the compressed size. */
+ which is the uncompressed size. We need the compressed size. */
t = (struct areltdata *) last_file->arelt_data;
h = (struct ar_hdr *) t->arch_header;
size = strtol (h->ar_size, (char **) NULL, 10);
#else
reloc_howto_type apollocoff_howto_table[] =
{
- HOWTO (R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "8", TRUE, 0x000000ff,0x000000ff, FALSE),
- HOWTO (R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
- HOWTO (R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "32", TRUE, 0xffffffff,0xffffffff, FALSE),
- HOWTO (R_PCRBYTE, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0, "DISP8", TRUE, 0x000000ff,0x000000ff, FALSE),
- HOWTO (R_PCRWORD, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
- HOWTO (R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
- HOWTO (R_RELLONG_NEG, 0, -2, 32, FALSE, 0, complain_overflow_bitfield, 0, "-32", TRUE, 0xffffffff,0xffffffff, FALSE),
+ HOWTO (R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "8", TRUE, 0x000000ff,0x000000ff, FALSE),
+ HOWTO (R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+ HOWTO (R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "32", TRUE, 0xffffffff,0xffffffff, FALSE),
+ HOWTO (R_PCRBYTE, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0, "DISP8", TRUE, 0x000000ff,0x000000ff, FALSE),
+ HOWTO (R_PCRWORD, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+ HOWTO (R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
+ HOWTO (R_RELLONG_NEG, 0, -2, 32, FALSE, 0, complain_overflow_bitfield, 0, "-32", TRUE, 0xffffffff,0xffffffff, FALSE),
};
#endif /* not ONLY_DECLARE_RELOCS */
#else
-#define ARM_8 0
-#define ARM_16 1
-#define ARM_32 2
-#define ARM_26 3
+#define ARM_8 0
+#define ARM_16 1
+#define ARM_32 2
+#define ARM_26 3
#define ARM_DISP8 4
#define ARM_DISP16 5
#define ARM_DISP32 6
-#define ARM_26D 7
+#define ARM_26D 7
/* 8 is unused. */
#define ARM_NEG16 9
#define ARM_NEG32 10
complain_overflow_dont,
aoutarm_fix_pcrel_26_done,
"ARM_26D",
- TRUE, /* partial_inplace. */
+ TRUE, /* partial_inplace. */
0x00ffffff,
0x0,
PCRELOFFSET),
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_32",
- TRUE, /* partial_inplace. */
+ TRUE, /* partial_inplace. */
0xffffffff,
0xffffffff,
PCRELOFFSET),
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_RVA32",
- TRUE, /* partial_inplace. */
+ TRUE, /* partial_inplace. */
0xffffffff,
0xffffffff,
PCRELOFFSET),
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_SECTION",
- TRUE, /* partial_inplace. */
+ TRUE, /* partial_inplace. */
0x0000ffff,
0x0000ffff,
PCRELOFFSET),
complain_overflow_bitfield,
coff_arm_reloc,
"ARM_SECREL",
- TRUE, /* partial_inplace. */
+ TRUE, /* partial_inplace. */
0xffffffff,
0xffffffff,
PCRELOFFSET),
char **error_message)
{
return coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message,
+ input_section, output_bfd, error_message,
b23);
}
char **error_message)
{
return coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message,
+ input_section, output_bfd, error_message,
b9);
}
#endif /* not ARM_WINCE */
char **error_message)
{
return coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message,
+ input_section, output_bfd, error_message,
b12);
}
switch (bfd_arch_bits_per_address (abfd))
{
case 32:
- code = BFD_RELOC_32;
- break;
+ code = BFD_RELOC_32;
+ break;
default:
return NULL;
}
switch (code)
{
#ifdef ARM_WINCE
- ASTD (BFD_RELOC_32, ARM_32);
- ASTD (BFD_RELOC_RVA, ARM_RVA32);
- ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26);
+ ASTD (BFD_RELOC_32, ARM_32);
+ ASTD (BFD_RELOC_RVA, ARM_RVA32);
+ ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26);
ASTD (BFD_RELOC_THUMB_PCREL_BRANCH12, ARM_THUMB12);
- ASTD (BFD_RELOC_32_SECREL, ARM_SECREL);
+ ASTD (BFD_RELOC_32_SECREL, ARM_SECREL);
#else
- ASTD (BFD_RELOC_8, ARM_8);
- ASTD (BFD_RELOC_16, ARM_16);
- ASTD (BFD_RELOC_32, ARM_32);
- ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26);
- ASTD (BFD_RELOC_ARM_PCREL_BLX, ARM_26);
- ASTD (BFD_RELOC_8_PCREL, ARM_DISP8);
- ASTD (BFD_RELOC_16_PCREL, ARM_DISP16);
- ASTD (BFD_RELOC_32_PCREL, ARM_DISP32);
- ASTD (BFD_RELOC_RVA, ARM_RVA32);
+ ASTD (BFD_RELOC_8, ARM_8);
+ ASTD (BFD_RELOC_16, ARM_16);
+ ASTD (BFD_RELOC_32, ARM_32);
+ ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26);
+ ASTD (BFD_RELOC_ARM_PCREL_BLX, ARM_26);
+ ASTD (BFD_RELOC_8_PCREL, ARM_DISP8);
+ ASTD (BFD_RELOC_16_PCREL, ARM_DISP16);
+ ASTD (BFD_RELOC_32_PCREL, ARM_DISP32);
+ ASTD (BFD_RELOC_RVA, ARM_RVA32);
ASTD (BFD_RELOC_THUMB_PCREL_BRANCH9, ARM_THUMB9);
ASTD (BFD_RELOC_THUMB_PCREL_BRANCH12, ARM_THUMB12);
ASTD (BFD_RELOC_THUMB_PCREL_BRANCH23, ARM_THUMB23);
- ASTD (BFD_RELOC_THUMB_PCREL_BLX, ARM_THUMB23);
+ ASTD (BFD_RELOC_THUMB_PCREL_BLX, ARM_THUMB23);
#endif
default: return NULL;
}
}
#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER 2
-#define COFF_PAGE_SIZE 0x1000
+#define COFF_PAGE_SIZE 0x1000
/* Turn a howto into a reloc nunmber. */
#define SELECT_RELOC(x,howto) { x.r_type = howto->type; }
-#define BADMAG(x) ARMBADMAG(x)
-#define ARM 1 /* Customize coffcode.h. */
+#define BADMAG(x) ARMBADMAG(x)
+#define ARM 1 /* Customize coffcode.h. */
#ifndef ARM_WINCE
/* Make sure that the 'r_offset' field is copied properly
bfd * bfd_of_glue_owner;
/* Support interworking with old, non-interworking aware ARM code. */
- int support_old_code;
+ int support_old_code;
};
/* Get the ARM coff linker hash table from a link_info structure. */
BFD_ASSERT ((rel_off & 1) != 1);
- rel_off >>= 1; /* Half word aligned address. */
- low_bits = rel_off & 0x000007FF; /* The bottom 11 bits. */
+ rel_off >>= 1; /* Half word aligned address. */
+ low_bits = rel_off & 0x000007FF; /* The bottom 11 bits. */
high_bits = (rel_off >> 11) & 0x000007FF; /* The top 11 bits. */
if ((br_insn & LOW_HI_ORDER) == LOW_HI_ORDER)
ldr r12, __func_addr
bx r12
__func_addr:
- .word func @ behave as if you saw a ARM_32 reloc
+ .word func @ behave as if you saw a ARM_32 reloc
*/
#define ARM2THUMB_GLUE_SIZE 12
nop ldr r6, __func_addr
.arm mov lr, pc
__func_change_to_arm: bx r6
- b func .arm
+ b func .arm
__func_back_to_thumb:
- ldmia r13! {r6, lr}
- bx lr
- __func_addr:
- .word func
+ ldmia r13! {r6, lr}
+ bx lr
+ __func_addr:
+ .word func
*/
#define THUMB2ARM_GLUE_SIZE (globals->support_old_code ? 20 : 8)
for (; rel < relend; rel++)
{
- int done = 0;
- long symndx;
+ int done = 0;
+ long symndx;
struct coff_link_hash_entry * h;
- struct internal_syment * sym;
- bfd_vma addend;
- bfd_vma val;
- reloc_howto_type * howto;
- bfd_reloc_status_type rstat;
- bfd_vma h_val;
+ struct internal_syment * sym;
+ bfd_vma addend;
+ bfd_vma val;
+ reloc_howto_type * howto;
+ bfd_reloc_status_type rstat;
+ bfd_vma h_val;
symndx = rel->r_symndx;
}
/* COFF treats common symbols in one of two ways. Either the
- size of the symbol is included in the section contents, or it
- is not. We assume that the size is not included, and force
- the rtype_to_howto function to adjust the addend as needed. */
+ size of the symbol is included in the section contents, or it
+ is not. We assume that the size is not included, and force
+ the rtype_to_howto function to adjust the addend as needed. */
if (sym != NULL && sym->n_scnum != 0)
addend = - sym->n_value;
return FALSE;
/* The relocation_section function will skip pcrel_offset relocs
- when doing a relocatable link. However, we want to convert
- ARM_26 to ARM_26D relocs if possible. We return a fake howto in
- this case without pcrel_offset set, and adjust the addend to
- compensate. 'partial_inplace' is also set, since we want 'done'
- relocations to be reflected in section's data. */
+ when doing a relocatable link. However, we want to convert
+ ARM_26 to ARM_26D relocs if possible. We return a fake howto in
+ this case without pcrel_offset set, and adjust the addend to
+ compensate. 'partial_inplace' is also set, since we want 'done'
+ relocations to be reflected in section's data. */
if (rel->r_type == ARM_26
- && h != NULL
- && bfd_link_relocatable (info)
- && (h->root.type == bfd_link_hash_defined
+ && h != NULL
+ && bfd_link_relocatable (info)
+ && (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
- && (h->root.u.def.section->output_section
+ && (h->root.u.def.section->output_section
== input_section->output_section))
- {
- static reloc_howto_type fake_arm26_reloc =
+ {
+ static reloc_howto_type fake_arm26_reloc =
HOWTO (ARM_26,
- 2,
- 2,
- 24,
- TRUE,
- 0,
- complain_overflow_signed,
- aoutarm_fix_pcrel_26 ,
- "ARM_26",
- TRUE,
- 0x00ffffff,
- 0x00ffffff,
- FALSE);
-
- addend -= rel->r_vaddr - input_section->vma;
+ 2,
+ 2,
+ 24,
+ TRUE,
+ 0,
+ complain_overflow_signed,
+ aoutarm_fix_pcrel_26 ,
+ "ARM_26",
+ TRUE,
+ 0x00ffffff,
+ 0x00ffffff,
+ FALSE);
+
+ addend -= rel->r_vaddr - input_section->vma;
#ifdef ARM_WINCE
- /* FIXME: I don't know why, but the hack is necessary for correct
- generation of bl's instruction offset. */
- addend -= 8;
+ /* FIXME: I don't know why, but the hack is necessary for correct
+ generation of bl's instruction offset. */
+ addend -= 8;
#endif
- howto = & fake_arm26_reloc;
- }
+ howto = & fake_arm26_reloc;
+ }
#ifdef ARM_WINCE
/* MS ARM-CE makes the reloc relative to the opcode's pc, not
#endif
/* If we are doing a relocatable link, then we can just ignore
- a PC relative reloc that is pcrel_offset. It will already
- have the correct value. If this is not a relocatable link,
- then we should ignore the symbol value. */
+ a PC relative reloc that is pcrel_offset. It will already
+ have the correct value. If this is not a relocatable link,
+ then we should ignore the symbol value. */
if (howto->pc_relative && howto->pcrel_offset)
- {
- if (bfd_link_relocatable (info))
- continue;
+ {
+ if (bfd_link_relocatable (info))
+ continue;
/* FIXME - it is not clear which targets need this next test
and which do not. It is known that it is needed for the
VxWorks and EPOC-PE targets, but it is also known that it
the beginning of the symbol's section, so we must not cancel
out the symbol's value, otherwise we'll be adding it in
twice. */
- if (sym != NULL && sym->n_scnum != 0)
- addend += sym->n_value;
+ if (sym != NULL && sym->n_scnum != 0)
+ addend += sym->n_value;
#endif
- }
+ }
val = 0;
else
{
sec = sections[symndx];
- val = (sec->output_section->vma
+ val = (sec->output_section->vma
+ sec->output_offset
+ sym->n_value
- sec->vma);
}
else
{
- /* We don't output the stubs if we are generating a
- relocatable output file, since we may as well leave the
- stub generation to the final linker pass. If we fail to
+ /* We don't output the stubs if we are generating a
+ relocatable output file, since we may as well leave the
+ stub generation to the final linker pass. If we fail to
verify that the name is defined, we'll try to build stubs
for an undefined name... */
- if (! bfd_link_relocatable (info)
+ if (! bfd_link_relocatable (info)
&& ( h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak))
- {
+ {
asection * h_sec = h->root.u.def.section;
const char * name = h->root.root.string;
+ h_sec->output_section->vma
+ h_sec->output_offset);
- if (howto->type == ARM_26)
- {
- if ( h->symbol_class == C_THUMBSTATFUNC
+ if (howto->type == ARM_26)
+ {
+ if ( h->symbol_class == C_THUMBSTATFUNC
|| h->symbol_class == C_THUMBEXTFUNC)
{
/* Arm code calling a Thumb function. */
- unsigned long int tmp;
- bfd_vma my_offset;
- asection * s;
- long int ret_offset;
- struct coff_link_hash_entry * myh;
+ unsigned long int tmp;
+ bfd_vma my_offset;
+ asection * s;
+ long int ret_offset;
+ struct coff_link_hash_entry * myh;
struct coff_arm_link_hash_table * globals;
myh = find_arm_glue (info, name, input_bfd);
bfd_put_32 (output_bfd, h_val | a2t3_func_addr_insn,
s->contents + my_offset + 8);
- if (info->base_file
+ if (info->base_file
&& !arm_emit_base_file_entry (info, output_bfd,
s, my_offset + 8))
return FALSE;
contents + rel->r_vaddr - input_section->vma);
done = 1;
}
- }
+ }
#ifndef ARM_WINCE
/* Note: We used to check for ARM_THUMB9 and ARM_THUMB12. */
- else if (howto->type == ARM_THUMB23)
- {
- if ( h->symbol_class == C_EXT
+ else if (howto->type == ARM_THUMB23)
+ {
+ if ( h->symbol_class == C_EXT
|| h->symbol_class == C_STAT
|| h->symbol_class == C_LABEL)
{
/* Thumb code calling an ARM function. */
- asection * s = 0;
- bfd_vma my_offset;
- unsigned long int tmp;
- long int ret_offset;
- struct coff_link_hash_entry * myh;
- struct coff_arm_link_hash_table * globals;
+ asection * s = 0;
+ bfd_vma my_offset;
+ unsigned long int tmp;
+ long int ret_offset;
+ struct coff_link_hash_entry * myh;
+ struct coff_arm_link_hash_table * globals;
myh = find_thumb_glue (info, name, input_bfd);
if (myh == NULL)
bfd_put_32 (output_bfd, h_val,
s->contents + my_offset + 16);
- if (info->base_file
+ if (info->base_file
&& !arm_emit_base_file_entry (info,
output_bfd, s,
my_offset + 16))
contents + rel->r_vaddr - input_section->vma);
done = 1;
- }
- }
+ }
+ }
#endif
- }
+ }
- /* If the relocation type and destination symbol does not
- fall into one of the above categories, then we can just
- perform a direct link. */
+ /* If the relocation type and destination symbol does not
+ fall into one of the above categories, then we can just
+ perform a direct link. */
if (done)
rstat = bfd_reloc_ok;
/* Only perform this fix during the final link, not a relocatable link. */
else if (! bfd_link_relocatable (info)
&& howto->type == ARM_THUMB23)
- {
- /* This is pretty much a copy of what the default
- _bfd_final_link_relocate and _bfd_relocate_contents
- routines do to perform a relocation, with special
- processing for the split addressing of the Thumb BL
- instruction. Again, it would probably be simpler adding a
- ThumbBRANCH23 specific macro expansion into the default
- code. */
+ {
+ /* This is pretty much a copy of what the default
+ _bfd_final_link_relocate and _bfd_relocate_contents
+ routines do to perform a relocation, with special
+ processing for the split addressing of the Thumb BL
+ instruction. Again, it would probably be simpler adding a
+ ThumbBRANCH23 specific macro expansion into the default
+ code. */
- bfd_vma address = rel->r_vaddr - input_section->vma;
+ bfd_vma address = rel->r_vaddr - input_section->vma;
if (address > high_address)
rstat = bfd_reloc_outofrange;
- else
- {
- bfd_vma relocation = val + addend;
+ else
+ {
+ bfd_vma relocation = val + addend;
int size = bfd_get_reloc_size (howto);
bfd_boolean overflow = FALSE;
bfd_byte *location = contents + address;
BFD_ASSERT (size == 4);
- /* howto->pc_relative should be TRUE for type 14 BRANCH23. */
- relocation -= (input_section->output_section->vma
- + input_section->output_offset);
+ /* howto->pc_relative should be TRUE for type 14 BRANCH23. */
+ relocation -= (input_section->output_section->vma
+ + input_section->output_offset);
- /* howto->pcrel_offset should be TRUE for type 14 BRANCH23. */
- relocation -= address;
+ /* howto->pcrel_offset should be TRUE for type 14 BRANCH23. */
+ relocation -= address;
/* No need to negate the relocation with BRANCH23. */
/* howto->complain_on_overflow == complain_overflow_signed for BRANCH23. */
which specifies that bit 1 of the target address will come from bit
1 of the base address. */
if (bfd_big_endian (input_bfd))
- {
+ {
if ((x & 0x1800) == 0x0800 && (relocation & 0x02))
relocation += 2;
relocation = (((relocation & 0xffe) >> 1) | ((relocation << 4) & 0x07ff0000));
}
else
- {
+ {
if ((x & 0x18000000) == 0x08000000 && (relocation & 0x02))
relocation += 2;
relocation = (((relocation & 0xffe) << 15) | ((relocation >> 12) & 0x7ff));
bfd_put_32 (input_bfd, x, location);
rstat = overflow ? bfd_reloc_overflow : bfd_reloc_ok;
- }
- }
+ }
+ }
#endif
else
- if (bfd_link_relocatable (info) && ! howto->partial_inplace)
- rstat = bfd_reloc_ok;
- else
+ if (bfd_link_relocatable (info) && ! howto->partial_inplace)
+ rstat = bfd_reloc_ok;
+ else
rstat = _bfd_final_link_relocate (howto, input_bfd, input_section,
contents,
rel->r_vaddr - input_section->vma,
if (patchit)
{
bfd_byte * location = contents + rel->r_vaddr - input_section->vma;
- bfd_vma x = bfd_get_32 (input_bfd, location);
+ bfd_vma x = bfd_get_32 (input_bfd, location);
bfd_put_32 (input_bfd, x | 1, location);
}
bfd_boolean
bfd_arm_allocate_interworking_sections (struct bfd_link_info * info)
{
- asection * s;
- bfd_byte * foo;
+ asection * s;
+ bfd_byte * foo;
struct coff_arm_link_hash_table * globals;
globals = coff_arm_hash_table (info);
}
static void
-record_arm_to_thumb_glue (struct bfd_link_info * info,
+record_arm_to_thumb_glue (struct bfd_link_info * info,
struct coff_link_hash_entry * h)
{
- const char * name = h->root.root.string;
- register asection * s;
- char * tmp_name;
- struct coff_link_hash_entry * myh;
- struct bfd_link_hash_entry * bh;
+ const char * name = h->root.root.string;
+ register asection * s;
+ char * tmp_name;
+ struct coff_link_hash_entry * myh;
+ struct bfd_link_hash_entry * bh;
struct coff_arm_link_hash_table * globals;
bfd_vma val;
bfd_size_type amt;
#ifndef ARM_WINCE
static void
-record_thumb_to_arm_glue (struct bfd_link_info * info,
+record_thumb_to_arm_glue (struct bfd_link_info * info,
struct coff_link_hash_entry * h)
{
- const char * name = h->root.root.string;
- asection * s;
- char * tmp_name;
- struct coff_link_hash_entry * myh;
- struct bfd_link_hash_entry * bh;
+ const char * name = h->root.root.string;
+ asection * s;
+ char * tmp_name;
+ struct coff_link_hash_entry * myh;
+ struct bfd_link_hash_entry * bh;
struct coff_arm_link_hash_table * globals;
bfd_vma val;
bfd_size_type amt;
{armcoff/pe}.em */
bfd_boolean
-bfd_arm_get_bfd_for_interworking (bfd * abfd,
+bfd_arm_get_bfd_for_interworking (bfd * abfd,
struct bfd_link_info * info)
{
struct coff_arm_link_hash_table * globals;
- flagword flags;
- asection * sec;
+ flagword flags;
+ asection * sec;
/* If we are only performing a partial link do not bother
getting a bfd to hold the glue. */
}
bfd_boolean
-bfd_arm_process_before_allocation (bfd * abfd,
+bfd_arm_process_before_allocation (bfd * abfd,
struct bfd_link_info * info,
- int support_old_code)
+ int support_old_code)
{
asection * sec;
struct coff_arm_link_hash_table * globals;
for (rel = i; rel < i + sec->reloc_count; ++rel)
{
- unsigned short r_type = rel->r_type;
- long symndx;
- struct coff_link_hash_entry * h;
+ unsigned short r_type = rel->r_type;
+ long symndx;
+ struct coff_link_hash_entry * h;
symndx = rel->r_symndx;
#endif /* ! defined (COFF_IMAGE_WITH_PE) */
-#define coff_bfd_reloc_type_lookup coff_arm_reloc_type_lookup
-#define coff_bfd_reloc_name_lookup coff_arm_reloc_name_lookup
-#define coff_relocate_section coff_arm_relocate_section
-#define coff_bfd_is_local_label_name coff_arm_is_local_label_name
+#define coff_bfd_reloc_type_lookup coff_arm_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup coff_arm_reloc_name_lookup
+#define coff_relocate_section coff_arm_relocate_section
+#define coff_bfd_is_local_label_name coff_arm_is_local_label_name
#define coff_adjust_symndx coff_arm_adjust_symndx
-#define coff_link_output_has_begun coff_arm_link_output_has_begun
+#define coff_link_output_has_begun coff_arm_link_output_has_begun
#define coff_final_link_postscript coff_arm_final_link_postscript
#define coff_bfd_merge_private_bfd_data coff_arm_merge_private_bfd_data
#define coff_bfd_print_private_bfd_data coff_arm_print_private_bfd_data
-#define coff_bfd_set_private_flags _bfd_coff_arm_set_private_flags
-#define coff_bfd_copy_private_bfd_data coff_arm_copy_private_bfd_data
+#define coff_bfd_set_private_flags _bfd_coff_arm_set_private_flags
+#define coff_bfd_copy_private_bfd_data coff_arm_copy_private_bfd_data
#define coff_bfd_link_hash_table_create coff_arm_link_hash_table_create
/* When doing a relocatable link, we want to convert ARM_26 relocs
/* xgettext: c-format */
_bfd_error_handler (_("\
error: %B is compiled as position independent code, whereas target %B is absolute position"),
- ibfd, obfd);
+ ibfd, obfd);
else
/* xgettext: c-format */
_bfd_error_handler (_("\
error: %B is compiled as absolute position code, whereas target %B is position independent"),
- ibfd, obfd);
+ ibfd, obfd);
bfd_set_error (bfd_error_wrong_format);
return FALSE;
if (APCS_SET (abfd)
&& ( (APCS_26_FLAG (abfd) != flag)
|| (APCS_FLOAT_FLAG (abfd) != (flags & F_APCS_FLOAT))
- || (PIC_FLAG (abfd) != (flags & F_PIC))
+ || (PIC_FLAG (abfd) != (flags & F_PIC))
))
return FALSE;
labels of the form Lxxx to be stripped. */
static bfd_boolean
-coff_arm_is_local_label_name (bfd * abfd ATTRIBUTE_UNUSED,
+coff_arm_is_local_label_name (bfd * abfd ATTRIBUTE_UNUSED,
const char * name)
{
#ifdef USER_LABEL_PREFIX
value = bfd_h8300_pad_address (abfd, value);
/* If the address is a sign-extended 16-bit value then we can
- relax this instruction. */
+ relax this instruction. */
if (value <= 0x7fff || value >= 0xffff8000u)
{
/* Change the reloc type. */
coff_symbol_type *coffsym = (coff_symbol_type *) NULL; \
if (ptr && bfd_asymbol_bfd (ptr) != abfd) \
coffsym = (obj_symbols (abfd) \
- + (cache_ptr->sym_ptr_ptr - symbols)); \
+ + (cache_ptr->sym_ptr_ptr - symbols)); \
else if (ptr) \
coffsym = coff_symbol_from (ptr); \
if (coffsym != (coff_symbol_type *) NULL \
*addendp -= 4;
/* If the symbol is defined, then the generic code is going to
- add back the symbol value in order to cancel out an
- adjustment it made to the addend. However, we set the addend
- to 0 at the start of this function. We need to adjust here,
- to avoid the adjustment the generic code will make. FIXME:
- This is getting a bit hackish. */
+ add back the symbol value in order to cancel out an
+ adjustment it made to the addend. However, we set the addend
+ to 0 at the start of this function. We need to adjust here,
+ to avoid the adjustment the generic code will make. FIXME:
+ This is getting a bit hackish. */
if (sym != NULL && sym->n_scnum != 0)
*addendp -= sym->n_value;
}
EMPTY_HOWTO (3),
EMPTY_HOWTO (4),
EMPTY_HOWTO (5),
- HOWTO (R_DIR32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (R_DIR32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- coff_i860_reloc, /* special_function */
- "dir32", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ coff_i860_reloc, /* special_function */
+ "dir32", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
/* {7}, */
- HOWTO (R_IMAGEBASE, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (R_IMAGEBASE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- coff_i860_reloc, /* special_function */
- "rva32", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ coff_i860_reloc, /* special_function */
+ "rva32", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
EMPTY_HOWTO (010),
EMPTY_HOWTO (011),
EMPTY_HOWTO (012),
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
EMPTY_HOWTO (0x1d),
HOWTO (COFF860_R_HIGH, /* type */
16, /* rightshift */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (COFF860_R_LOW0, /* type */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_LOW0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (COFF860_R_LOW1, /* type */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_LOW1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xfffe, /* src_mask */
0xfffe, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (COFF860_R_LOW2, /* type */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_LOW2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xfffc, /* src_mask */
0xfffc, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (COFF860_R_LOW3, /* type */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_LOW3, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xfff8, /* src_mask */
0xfff8, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (COFF860_R_LOW4, /* type */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_LOW4, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xfff0, /* src_mask */
0xfff0, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (COFF860_R_SPLIT0, /* type */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_SPLIT0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0x1f07ff, /* src_mask */
0x1f07ff, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (COFF860_R_SPLIT1, /* type */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_SPLIT1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0x1f07fe, /* src_mask */
0x1f07fe, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (COFF860_R_SPLIT2, /* type */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_SPLIT2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0x1f07fc, /* src_mask */
0x1f07fc, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (COFF860_R_HIGHADJ, /* type */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_HIGHADJ, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (COFF860_R_BRADDR, /* type */
+ FALSE), /* pcrel_offset */
+ HOWTO (COFF860_R_BRADDR, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
26, /* bitsize */
FALSE, /* partial_inplace */
0x3ffffff, /* src_mask */
0x3ffffff, /* dst_mask */
- TRUE) /* pcrel_offset */
+ TRUE) /* pcrel_offset */
};
/* Turn a howto into a reloc number. */
else
{
/* For every other relocation, do exactly what coff_slurp_reloc_table
- would do (which this code is taken directly from). */
+ would do (which this code is taken directly from). */
asymbol *ptr = NULL;
cache_ptr->address = dst->r_vaddr;
{
case C_LEAFSTAT:
case C_LEAFEXT:
- /* This is a call to a leaf procedure, replace instruction with a bal
+ /* This is a call to a leaf procedure, replace instruction with a bal
to the correct location. */
{
union internal_auxent *aux = &((cs->native+2)->u.auxent);
sym and auxents untouched, so the delta between the two
is the offset of the bal entry point. */
word = ((word + olf) & BAL_MASK) | BAL;
- bfd_put_32 (abfd, (bfd_vma) word,
+ bfd_put_32 (abfd, (bfd_vma) word,
(bfd_byte *) data + reloc_entry->address);
- }
+ }
result = bfd_reloc_ok;
break;
case C_SCALL:
if (bfd_is_com_section (bfd_get_section (symbol)))
{
/* I don't really know what the right action is for a common
- symbol. */
+ symbol. */
return bfd_reloc_continue;
}
else
{
sec = sections[symndx];
- val = (sec->output_section->vma
+ val = (sec->output_section->vma
+ sec->output_offset
+ sym->n_value
- sec->vma);
{
case C_NULL:
/* This symbol is apparently not from a COFF input file.
- We warn, and then assume that it is not a leaf
- function. */
+ We warn, and then assume that it is not a leaf
+ function. */
(*info->callbacks->reloc_dangerous)
(info,
_("uncertain calling convention for non-COFF symbol"),
case C_LEAFSTAT:
case C_LEAFEXT:
/* This is a call to a leaf procedure; use the bal
- instruction. */
+ instruction. */
{
long olf;
unsigned long word;
#endif
reloc_howto_type m68kcoff_howto_table[] =
{
- HOWTO (R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "8", TRUE, 0x000000ff,0x000000ff, FALSE),
- HOWTO (R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
- HOWTO (R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "32", TRUE, 0xffffffff,0xffffffff, FALSE),
- HOWTO (R_PCRBYTE, 0, 0, 8, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP8", TRUE, 0x000000ff,0x000000ff, FALSE),
- HOWTO (R_PCRWORD, 0, 1, 16, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
- HOWTO (R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
- HOWTO (R_RELLONG_NEG, 0, -2, 32, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "-32", TRUE, 0xffffffff,0xffffffff, FALSE),
+ HOWTO (R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "8", TRUE, 0x000000ff,0x000000ff, FALSE),
+ HOWTO (R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+ HOWTO (R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "32", TRUE, 0xffffffff,0xffffffff, FALSE),
+ HOWTO (R_PCRBYTE, 0, 0, 8, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP8", TRUE, 0x000000ff,0x000000ff, FALSE),
+ HOWTO (R_PCRWORD, 0, 1, 16, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+ HOWTO (R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, RELOC_SPECIAL_FN, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
+ HOWTO (R_RELLONG_NEG, 0, -2, 32, FALSE, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "-32", TRUE, 0xffffffff,0xffffffff, FALSE),
};
#endif /* not ONLY_DECLARE_RELOCS */
case R_PCRWORD: internal->howto = m68kcoff_howto_table + 4; break;
case R_PCRLONG: internal->howto = m68kcoff_howto_table + 5; break;
case R_RELLONG_NEG: internal->howto = m68kcoff_howto_table + 6; break;
- default: internal->howto = NULL; break;
+ default: internal->howto = NULL; break;
}
}
STAT_REL reloc_howto_type *
m68k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- const char *r_name)
+ const char *r_name)
{
unsigned int i;
coff_symbol_type *coffsym = (coff_symbol_type *) NULL; \
if (ptr && bfd_asymbol_bfd (ptr) != abfd) \
coffsym = (obj_symbols (abfd) \
- + (cache_ptr->sym_ptr_ptr - symbols)); \
+ + (cache_ptr->sym_ptr_ptr - symbols)); \
else if (ptr) \
coffsym = coff_symbol_from (ptr); \
if (coffsym != (coff_symbol_type *) NULL \
* bfd_octets_per_byte (abfd)))
return bfd_reloc_outofrange;
- x = bfd_get_16 (abfd, (bfd_byte *) data + addr);
+ x = bfd_get_16 (abfd, (bfd_byte *) data + addr);
/* Work out which section the relocation is targeted at and the
initial relocation command value. */
{
/* Unused: */
HOWTO (IMAGE_REL_MCORE_ABSOLUTE,/* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_dont, /* dont complain_on_overflow */
- NULL, /* special_function */
- "ABSOLUTE", /* name */
- FALSE, /* partial_inplace */
- 0x00, /* src_mask */
- 0x00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ NULL, /* special_function */
+ "ABSOLUTE", /* name */
+ FALSE, /* partial_inplace */
+ 0x00, /* src_mask */
+ 0x00, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (IMAGE_REL_MCORE_ADDR32,/* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- NULL, /* special_function */
- "ADDR32", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ NULL, /* special_function */
+ "ADDR32", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 8 bits + 2 zero bits; jmpi/jsri/lrw instructions.
Should not appear in object files. */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
mcore_coff_unsupported_reloc, /* special_function */
- "IMM8BY4", /* name */
+ "IMM8BY4", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
TRUE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- NULL, /* special_function */
- "IMM11BY2", /* name */
+ NULL, /* special_function */
+ "IMM11BY2", /* name */
FALSE, /* partial_inplace */
0x0, /* src_mask */
0x7ff, /* dst_mask */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
mcore_coff_unsupported_reloc, /* special_function */
- "IMM4BY2", /* name */
+ "IMM4BY2", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
TRUE, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- NULL, /* special_function */
- "PCREL_32", /* name */
+ NULL, /* special_function */
+ "PCREL_32", /* name */
FALSE, /* partial_inplace */
0x0, /* src_mask */
0xffffffff, /* dst_mask */
TRUE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- NULL, /* special_function */
- "JSR_IMM11BY2", /* name */
+ NULL, /* special_function */
+ "JSR_IMM11BY2", /* name */
FALSE, /* partial_inplace */
0x0, /* src_mask */
0x7ff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (IMAGE_REL_MCORE_RVA, /* type */
+ HOWTO (IMAGE_REL_MCORE_RVA, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- NULL, /* special_function */
- "MCORE_RVA", /* name */
+ NULL, /* special_function */
+ "MCORE_RVA", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
/* The original coff_link_hash_table structure. MUST be first field. */
struct coff_link_hash_table root;
- bfd * bfd_of_toc_owner;
- long int global_toc_size;
- long int import_table_size;
- long int first_thunk_address;
- long int thunk_size;
+ bfd * bfd_of_toc_owner;
+ long int global_toc_size;
+ long int import_table_size;
+ long int first_thunk_address;
+ long int thunk_size;
}
mcore_hash_table;
bfd_vma reloc_offset)
{
bfd_vma addr = reloc_offset
- - input_section->vma
- + input_section->output_offset
- + input_section->output_section->vma;
+ - input_section->vma
+ + input_section->output_offset
+ + input_section->output_section->vma;
if (coff_data (output_bfd)->pe)
addr -= pe_data (output_bfd)->pe_opthdr.ImageBase;
{
switch (code)
{
- HOW2MAP (BFD_RELOC_32, IMAGE_REL_MCORE_ADDR32);
- HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM8BY4, IMAGE_REL_MCORE_PCREL_IMM8BY4);
- HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM11BY2, IMAGE_REL_MCORE_PCREL_IMM11BY2);
- HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM4BY2, IMAGE_REL_MCORE_PCREL_IMM4BY2);
- HOW2MAP (BFD_RELOC_32_PCREL, IMAGE_REL_MCORE_PCREL_32);
+ HOW2MAP (BFD_RELOC_32, IMAGE_REL_MCORE_ADDR32);
+ HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM8BY4, IMAGE_REL_MCORE_PCREL_IMM8BY4);
+ HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM11BY2, IMAGE_REL_MCORE_PCREL_IMM11BY2);
+ HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM4BY2, IMAGE_REL_MCORE_PCREL_IMM4BY2);
+ HOW2MAP (BFD_RELOC_32_PCREL, IMAGE_REL_MCORE_PCREL_32);
HOW2MAP (BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2);
- HOW2MAP (BFD_RELOC_RVA, IMAGE_REL_MCORE_RVA);
+ HOW2MAP (BFD_RELOC_RVA, IMAGE_REL_MCORE_RVA);
default:
return NULL;
}
* addendp = sec->vma - 2; /* XXX guess - is this right ? */
/* If the symbol is defined, then the generic code is going to
- add back the symbol value in order to cancel out an
- adjustment it made to the addend. However, we set the addend
- to 0 at the start of this function. We need to adjust here,
- to avoid the adjustment the generic code will make. FIXME:
- This is getting a bit hackish. */
+ add back the symbol value in order to cancel out an
+ adjustment it made to the addend. However, we set the addend
+ to 0 at the start of this function. We need to adjust here,
+ to avoid the adjustment the generic code will make. FIXME:
+ This is getting a bit hackish. */
if (sym != NULL && sym->n_scnum != 0)
* addendp -= sym->n_value;
}
/* xgettext: c-format */
(_("%B: compiled for a %s system and target is %s.\n"),
input_bfd,
- bfd_big_endian (input_bfd) ? _("big endian") : _("little endian"),
- bfd_big_endian (output_bfd) ? _("big endian") : _("little endian"));
+ bfd_big_endian (input_bfd) ? _("big endian") : _("little endian"),
+ bfd_big_endian (output_bfd) ? _("big endian") : _("little endian"));
bfd_set_error (bfd_error_wrong_format);
return FALSE;
for (; rel < relend; rel++)
{
- long symndx;
- struct internal_syment * sym;
- bfd_vma val;
- bfd_vma addend;
- bfd_reloc_status_type rstat;
- bfd_byte * loc;
- unsigned short r_type = rel->r_type;
- reloc_howto_type * howto = NULL;
+ long symndx;
+ struct internal_syment * sym;
+ bfd_vma val;
+ bfd_vma addend;
+ bfd_reloc_status_type rstat;
+ bfd_byte * loc;
+ unsigned short r_type = rel->r_type;
+ reloc_howto_type * howto = NULL;
struct coff_link_hash_entry * h;
- const char * my_name;
+ const char * my_name;
symndx = rel->r_symndx;
loc = contents + rel->r_vaddr - input_section->vma;
#define coff_bfd_reloc_type_lookup mcore_coff_reloc_type_lookup
#define coff_bfd_reloc_name_lookup mcore_coff_reloc_name_lookup
-#define coff_relocate_section coff_mcore_relocate_section
-#define coff_rtype_to_howto coff_mcore_rtype_to_howto
+#define coff_relocate_section coff_mcore_relocate_section
+#define coff_rtype_to_howto coff_mcore_rtype_to_howto
#define SELECT_RELOC(internal, howto) {internal.r_type = howto->type;}
/* Make sure that the 'r_offset' field is copied properly
so that identical binaries will compare the same. */
-#define SWAP_IN_RELOC_OFFSET H_GET_32
-#define SWAP_OUT_RELOC_OFFSET H_PUT_32
+#define SWAP_IN_RELOC_OFFSET H_GET_32
+#define SWAP_OUT_RELOC_OFFSET H_PUT_32
-#define COFF_PAGE_SIZE 0x1000
+#define COFF_PAGE_SIZE 0x1000
#include "coffcode.h"
\f
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
mips_generic_reloc, /* special_function */
reloc_entry->address
* bfd_octets_per_byte (abfd)))
return bfd_reloc_outofrange;
-
+
/* Do the REFHI relocation. Note that we actually don't
need to know anything about the REFLO itself, except
where to find the low 16 bits of the addend needed by the
struct external_reloc *lo_ext_rel;
/* As a GNU extension, permit an arbitrary number of REFHI
- relocs before the REFLO reloc. This permits gcc to emit
+ relocs before the REFLO reloc. This permits gcc to emit
the HI and LO relocs itself. */
for (lo_ext_rel = ext_rel + 1;
lo_ext_rel < ext_rel_end;
/* As we wonder around the relocs, we'll keep the assigned toc_offset
here. */
- bfd_vma toc_offset; /* Our addition, as required. */
+ bfd_vma toc_offset; /* Our addition, as required. */
int symbol_is_glue;
unsigned long int glue_insn;
ppc_coff_link_hash_table_init (struct ppc_coff_link_hash_table *table,
bfd *abfd,
struct bfd_hash_entry *(*newfunc)
- (struct bfd_hash_entry *,
+ (struct bfd_hash_entry *,
struct bfd_hash_table *,
const char *),
unsigned int entsize)
/* These should definitely go in a header file somewhere... */
/* NOP */
-#define IMAGE_REL_PPC_ABSOLUTE 0x0000
+#define IMAGE_REL_PPC_ABSOLUTE 0x0000
/* 64-bit address */
-#define IMAGE_REL_PPC_ADDR64 0x0001
+#define IMAGE_REL_PPC_ADDR64 0x0001
/* 32-bit address */
-#define IMAGE_REL_PPC_ADDR32 0x0002
+#define IMAGE_REL_PPC_ADDR32 0x0002
/* 26-bit address, shifted left 2 (branch absolute) */
-#define IMAGE_REL_PPC_ADDR24 0x0003
+#define IMAGE_REL_PPC_ADDR24 0x0003
/* 16-bit address */
-#define IMAGE_REL_PPC_ADDR16 0x0004
+#define IMAGE_REL_PPC_ADDR16 0x0004
/* 16-bit address, shifted left 2 (load doubleword) */
-#define IMAGE_REL_PPC_ADDR14 0x0005
+#define IMAGE_REL_PPC_ADDR14 0x0005
/* 26-bit PC-relative offset, shifted left 2 (branch relative) */
-#define IMAGE_REL_PPC_REL24 0x0006
+#define IMAGE_REL_PPC_REL24 0x0006
/* 16-bit PC-relative offset, shifted left 2 (br cond relative) */
-#define IMAGE_REL_PPC_REL14 0x0007
+#define IMAGE_REL_PPC_REL14 0x0007
/* 16-bit offset from TOC base */
-#define IMAGE_REL_PPC_TOCREL16 0x0008
+#define IMAGE_REL_PPC_TOCREL16 0x0008
/* 16-bit offset from TOC base, shifted left 2 (load doubleword) */
-#define IMAGE_REL_PPC_TOCREL14 0x0009
+#define IMAGE_REL_PPC_TOCREL14 0x0009
/* 32-bit addr w/o image base */
-#define IMAGE_REL_PPC_ADDR32NB 0x000A
+#define IMAGE_REL_PPC_ADDR32NB 0x000A
/* va of containing section (as in an image sectionhdr) */
-#define IMAGE_REL_PPC_SECREL 0x000B
+#define IMAGE_REL_PPC_SECREL 0x000B
/* sectionheader number */
-#define IMAGE_REL_PPC_SECTION 0x000C
+#define IMAGE_REL_PPC_SECTION 0x000C
/* substitute TOC restore instruction iff symbol is glue code */
-#define IMAGE_REL_PPC_IFGLUE 0x000D
+#define IMAGE_REL_PPC_IFGLUE 0x000D
/* symbol is glue code; virtual address is TOC restore instruction */
-#define IMAGE_REL_PPC_IMGLUE 0x000E
+#define IMAGE_REL_PPC_IMGLUE 0x000E
/* va of containing section (limited to 16 bits) */
-#define IMAGE_REL_PPC_SECREL16 0x000F
+#define IMAGE_REL_PPC_SECREL16 0x000F
/* Stuff to handle immediate data when the number of bits in the
data is greater than the number of bits in the immediate field
We need to do (usually) 32 bit arithmetic on 16 bit chunks. */
-#define IMAGE_REL_PPC_REFHI 0x0010
-#define IMAGE_REL_PPC_REFLO 0x0011
-#define IMAGE_REL_PPC_PAIR 0x0012
+#define IMAGE_REL_PPC_REFHI 0x0010
+#define IMAGE_REL_PPC_REFLO 0x0011
+#define IMAGE_REL_PPC_PAIR 0x0012
/* This is essentially the same as tocrel16, with TOCDEFN assumed. */
-#define IMAGE_REL_PPC_TOCREL16_DEFN 0x0013
+#define IMAGE_REL_PPC_TOCREL16_DEFN 0x0013
/* Flag bits in IMAGE_RELOCATION.TYPE. */
/* Subtract reloc value rather than adding it. */
-#define IMAGE_REL_PPC_NEG 0x0100
+#define IMAGE_REL_PPC_NEG 0x0100
/* Fix branch prediction bit to predict branch taken. */
-#define IMAGE_REL_PPC_BRTAKEN 0x0200
+#define IMAGE_REL_PPC_BRTAKEN 0x0200
/* Fix branch prediction bit to predict branch not taken. */
-#define IMAGE_REL_PPC_BRNTAKEN 0x0400
+#define IMAGE_REL_PPC_BRNTAKEN 0x0400
/* TOC slot defined in file (or, data in toc). */
-#define IMAGE_REL_PPC_TOCDEFN 0x0800
+#define IMAGE_REL_PPC_TOCDEFN 0x0800
/* Masks to isolate above values in IMAGE_RELOCATION.Type. */
-#define IMAGE_REL_PPC_TYPEMASK 0x00FF
-#define IMAGE_REL_PPC_FLAGMASK 0x0F00
+#define IMAGE_REL_PPC_TYPEMASK 0x00FF
+#define IMAGE_REL_PPC_FLAGMASK 0x0F00
-#define EXTRACT_TYPE(x) ((x) & IMAGE_REL_PPC_TYPEMASK)
+#define EXTRACT_TYPE(x) ((x) & IMAGE_REL_PPC_TYPEMASK)
#define EXTRACT_FLAGS(x) ((x) & IMAGE_REL_PPC_FLAGMASK)
-#define EXTRACT_JUNK(x) \
- ((x) & ~(IMAGE_REL_PPC_TYPEMASK | IMAGE_REL_PPC_FLAGMASK))
+#define EXTRACT_JUNK(x) \
+ ((x) & ~(IMAGE_REL_PPC_TYPEMASK | IMAGE_REL_PPC_FLAGMASK))
\f
/* Static helper functions to make relocation work. */
/* (Work In Progress) */
From the document "" we find the following listed as used relocs:
- ABSOLUTE : The noop
+ ABSOLUTE : The noop
ADDR[64|32|16] : fields that hold addresses in data fields or the
- 16 bit displacement field on a load/store.
+ 16 bit displacement field on a load/store.
ADDR[24|14] : fields that hold addresses in branch and cond
- branches. These represent [26|16] bit addresses.
- The low order 2 bits are preserved.
- REL[24|14] : branches relative to the Instruction Address
- register. These represent [26|16] bit addresses,
- as before. The instruction field will be zero, and
- the address of the SYM will be inserted at link time.
- TOCREL16 : 16 bit displacement field referring to a slot in
- toc.
- TOCREL14 : 16 bit displacement field, similar to REL14 or ADDR14.
- ADDR32NB : 32 bit address relative to the virtual origin.
- (On the alpha, this is always a linker generated thunk)
- (i.e. 32bit addr relative to the image base)
- SECREL : The value is relative to the start of the section
- containing the symbol.
- SECTION : access to the header containing the item. Supports the
- codeview debugger.
+ branches. These represent [26|16] bit addresses.
+ The low order 2 bits are preserved.
+ REL[24|14] : branches relative to the Instruction Address
+ register. These represent [26|16] bit addresses,
+ as before. The instruction field will be zero, and
+ the address of the SYM will be inserted at link time.
+ TOCREL16 : 16 bit displacement field referring to a slot in
+ toc.
+ TOCREL14 : 16 bit displacement field, similar to REL14 or ADDR14.
+ ADDR32NB : 32 bit address relative to the virtual origin.
+ (On the alpha, this is always a linker generated thunk)
+ (i.e. 32bit addr relative to the image base)
+ SECREL : The value is relative to the start of the section
+ containing the symbol.
+ SECTION : access to the header containing the item. Supports the
+ codeview debugger.
In particular, note that the document does not indicate that the
relocations listed in the header file are used. */
/* IMAGE_REL_PPC_ABSOLUTE 0x0000 NOP */
/* Unused: */
HOWTO (IMAGE_REL_PPC_ABSOLUTE, /* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_dont, /* dont complain_on_overflow */
- 0, /* special_function */
- "ABSOLUTE", /* name */
- FALSE, /* partial_inplace */
- 0x00, /* src_mask */
- 0x00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* special_function */
+ "ABSOLUTE", /* name */
+ FALSE, /* partial_inplace */
+ 0x00, /* src_mask */
+ 0x00, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR64 0x0001 64-bit address */
/* Unused: */
- HOWTO(IMAGE_REL_PPC_ADDR64, /* type */
- 0, /* rightshift */
- 3, /* size (0 = byte, 1 = short, 2 = long) */
- 64, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- 0, /* special_function */
- "ADDR64", /* name */
- TRUE, /* partial_inplace */
- MINUS_ONE, /* src_mask */
- MINUS_ONE, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO(IMAGE_REL_PPC_ADDR64, /* type */
+ 0, /* rightshift */
+ 3, /* size (0 = byte, 1 = short, 2 = long) */
+ 64, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ 0, /* special_function */
+ "ADDR64", /* name */
+ TRUE, /* partial_inplace */
+ MINUS_ONE, /* src_mask */
+ MINUS_ONE, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR32 0x0002 32-bit address */
/* Used: */
HOWTO (IMAGE_REL_PPC_ADDR32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- 0, /* special_function */
- "ADDR32", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* special_function */
+ "ADDR32", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR24 0x0003 26-bit address, shifted left 2 (branch absolute) */
/* the LI field is in bit 6 through bit 29 is 24 bits, + 2 for the shift */
/* Of course, That's the IBM approved bit numbering, which is not what */
/* anyone else uses.... The li field is in bit 2 thru 25 */
/* Used: */
- HOWTO (IMAGE_REL_PPC_ADDR24, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 26, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (IMAGE_REL_PPC_ADDR24, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- 0, /* special_function */
- "ADDR24", /* name */
- TRUE, /* partial_inplace */
- 0x07fffffc, /* src_mask */
- 0x07fffffc, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* special_function */
+ "ADDR24", /* name */
+ TRUE, /* partial_inplace */
+ 0x07fffffc, /* src_mask */
+ 0x07fffffc, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR16 0x0004 16-bit address */
/* Used: */
- HOWTO (IMAGE_REL_PPC_ADDR16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (IMAGE_REL_PPC_ADDR16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- 0, /* special_function */
- "ADDR16", /* name */
- TRUE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* special_function */
+ "ADDR16", /* name */
+ TRUE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR14 0x0005 */
/* 16-bit address, shifted left 2 (load doubleword) */
/* FIXME: the mask is likely wrong, and the bit position may be as well */
/* Unused: */
- HOWTO (IMAGE_REL_PPC_ADDR14, /* type */
- 1, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (IMAGE_REL_PPC_ADDR14, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- 0, /* special_function */
- "ADDR16", /* name */
- TRUE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* special_function */
+ "ADDR16", /* name */
+ TRUE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_REL24 0x0006 */
/* 26-bit PC-relative offset, shifted left 2 (branch relative) */
/* Used: */
- HOWTO (IMAGE_REL_PPC_REL24, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 26, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (IMAGE_REL_PPC_REL24, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- 0, /* special_function */
- "REL24", /* name */
- TRUE, /* partial_inplace */
- 0x3fffffc, /* src_mask */
- 0x3fffffc, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* special_function */
+ "REL24", /* name */
+ TRUE, /* partial_inplace */
+ 0x3fffffc, /* src_mask */
+ 0x3fffffc, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_REL14 0x0007 */
/* 16-bit PC-relative offset, shifted left 2 (br cond relative) */
/* FIXME: the mask is likely wrong, and the bit position may be as well */
/* FIXME: how does it know how far to shift? */
/* Unused: */
- HOWTO (IMAGE_REL_PPC_ADDR14, /* type */
- 1, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (IMAGE_REL_PPC_ADDR14, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- 0, /* special_function */
- "ADDR16", /* name */
- TRUE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ 0, /* special_function */
+ "ADDR16", /* name */
+ TRUE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
/* IMAGE_REL_PPC_TOCREL16 0x0008 */
/* 16-bit offset from TOC base */
/* Used: */
HOWTO (IMAGE_REL_PPC_TOCREL16,/* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- ppc_toc16_reloc, /* special_function */
- "TOCREL16", /* name */
- FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ ppc_toc16_reloc, /* special_function */
+ "TOCREL16", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_TOCREL14 0x0009 */
/* 16-bit offset from TOC base, shifted left 2 (load doubleword) */
/* Unused: */
HOWTO (IMAGE_REL_PPC_TOCREL14,/* type */
- 1, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- 0, /* special_function */
- "TOCREL14", /* name */
- FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* special_function */
+ "TOCREL14", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_ADDR32NB 0x000A */
/* 32-bit addr w/ image base */
/* Unused: */
HOWTO (IMAGE_REL_PPC_ADDR32NB,/* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- 0, /* special_function */
- "ADDR32NB", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* special_function */
+ "ADDR32NB", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_SECREL 0x000B */
/* va of containing section (as in an image sectionhdr) */
/* Unused: */
HOWTO (IMAGE_REL_PPC_SECREL,/* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- ppc_secrel_reloc, /* special_function */
- "SECREL", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ ppc_secrel_reloc, /* special_function */
+ "SECREL", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
/* IMAGE_REL_PPC_SECTION 0x000C */
/* sectionheader number */
/* Unused: */
HOWTO (IMAGE_REL_PPC_SECTION,/* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- ppc_section_reloc, /* special_function */
- "SECTION", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ ppc_section_reloc, /* special_function */
+ "SECTION", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
/* IMAGE_REL_PPC_IFGLUE 0x000D */
/* substitute TOC restore instruction iff symbol is glue code */
/* Used: */
HOWTO (IMAGE_REL_PPC_IFGLUE,/* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- 0, /* special_function */
- "IFGLUE", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* special_function */
+ "IFGLUE", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_IMGLUE 0x000E */
/* symbol is glue code; virtual address is TOC restore instruction */
/* Unused: */
HOWTO (IMAGE_REL_PPC_IMGLUE,/* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- ppc_imglue_reloc, /* special_function */
- "IMGLUE", /* name */
- FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ ppc_imglue_reloc, /* special_function */
+ "IMGLUE", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_SECREL16 0x000F */
/* va of containing section (limited to 16 bits) */
/* Unused: */
HOWTO (IMAGE_REL_PPC_SECREL16,/* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- 0, /* special_function */
- "SECREL16", /* name */
- TRUE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
-
- /* IMAGE_REL_PPC_REFHI 0x0010 */
+ 0, /* special_function */
+ "SECREL16", /* name */
+ TRUE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ /* IMAGE_REL_PPC_REFHI 0x0010 */
/* Unused: */
- HOWTO (IMAGE_REL_PPC_REFHI, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (IMAGE_REL_PPC_REFHI, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
ppc_refhi_reloc, /* special_function */
- "REFHI", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ "REFHI", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
- /* IMAGE_REL_PPC_REFLO 0x0011 */
+ /* IMAGE_REL_PPC_REFLO 0x0011 */
/* Unused: */
- HOWTO (IMAGE_REL_PPC_REFLO, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (IMAGE_REL_PPC_REFLO, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
ppc_refhi_reloc, /* special_function */
- "REFLO", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ "REFLO", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
- /* IMAGE_REL_PPC_PAIR 0x0012 */
+ /* IMAGE_REL_PPC_PAIR 0x0012 */
/* Unused: */
- HOWTO (IMAGE_REL_PPC_PAIR, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (IMAGE_REL_PPC_PAIR, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- ppc_pair_reloc, /* special_function */
- "PAIR", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ ppc_pair_reloc, /* special_function */
+ "PAIR", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* IMAGE_REL_PPC_TOCREL16_DEFN 0x0013 */
/* 16-bit offset from TOC base, without causing a definition */
/* Used: */
HOWTO ( (IMAGE_REL_PPC_TOCREL16 | IMAGE_REL_PPC_TOCDEFN), /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- 0, /* special_function */
- "TOCREL16, TOCDEFN", /* name */
- FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* special_function */
+ "TOCREL16, TOCDEFN", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
\f
/* Some really cheezy macros that can be turned on to test stderr :-) */
#ifdef DEBUG_RELOC
-#define UN_IMPL(x) \
-{ \
- static int i; \
- if (i == 0) \
- { \
- i = 1; \
+#define UN_IMPL(x) \
+{ \
+ static int i; \
+ if (i == 0) \
+ { \
+ i = 1; \
fprintf (stderr,_("Unimplemented Relocation -- %s\n"),x); \
- } \
+ } \
}
-#define DUMP_RELOC(n,r) \
-{ \
+#define DUMP_RELOC(n,r) \
+{ \
fprintf (stderr,"%s sym %d, addr %d, addend %d\n", \
- n, (*(r->sym_ptr_ptr))->name, \
- r->address, r->addend); \
+ n, (*(r->sym_ptr_ptr))->name, \
+ r->address, r->addend); \
}
/* Given a reloc name, n, and a pointer to an internal_reloc,
#define n_zeroes _n._n_n._n_zeroes
#define n_offset _n._n_n._n_offset */
-#define DUMP_RELOC2(n,r) \
-{ \
- fprintf (stderr,"%s sym %d, r_vaddr %d %s\n", \
+#define DUMP_RELOC2(n,r) \
+{ \
+ fprintf (stderr,"%s sym %d, r_vaddr %d %s\n", \
n, r->r_symndx, r->r_vaddr, \
(((r->r_type) & IMAGE_REL_PPC_TOCDEFN) == 0) \
- ?" ":" TOCDEFN" ); \
+ ?" ":" TOCDEFN" ); \
}
#else
(sizeof (ppc_coff_howto_table) / sizeof (ppc_coff_howto_table[0]) - 1)
/* FIXME: There is a possibility that when we read in a reloc from a file,
- that there are some bits encoded in the upper portion of the
+ that there are some bits encoded in the upper portion of the
type field. Not yet implemented. */
static void
/* We can encode one of three things in the type field, aside from the
type:
1. IMAGE_REL_PPC_NEG - indicates the value field is a subtraction
- value, rather than an addition value
+ value, rather than an addition value
2. IMAGE_REL_PPC_BRTAKEN, IMAGE_REL_PPC_BRNTAKEN - indicates that
- the branch is expected to be taken or not.
+ the branch is expected to be taken or not.
3. IMAGE_REL_PPC_TOCDEFN - toc slot definition in the file
For now, we just strip this stuff to find the type, and ignore it other
than that. */
/* We can encode one of three things in the type field, aside from the
type:
1. IMAGE_REL_PPC_NEG - indicates the value field is a subtraction
- value, rather than an addition value
+ value, rather than an addition value
2. IMAGE_REL_PPC_BRTAKEN, IMAGE_REL_PPC_BRNTAKEN - indicates that
- the branch is expected to be taken or not.
+ the branch is expected to be taken or not.
3. IMAGE_REL_PPC_TOCDEFN - toc slot definition in the file
For now, we just strip this stuff to find the type, and ignore it other
than that. */
{
HOW2MAP(BFD_RELOC_32_GOTOFF, IMAGE_REL_PPC_IMGLUE);
HOW2MAP(BFD_RELOC_16_GOT_PCREL, IMAGE_REL_PPC_IFGLUE);
- HOW2MAP(BFD_RELOC_16, IMAGE_REL_PPC_ADDR16);
+ HOW2MAP(BFD_RELOC_16, IMAGE_REL_PPC_ADDR16);
HOW2MAP(BFD_RELOC_PPC_B26, IMAGE_REL_PPC_REL24);
HOW2MAP(BFD_RELOC_PPC_BA26, IMAGE_REL_PPC_ADDR24);
HOW2MAP(BFD_RELOC_PPC_TOC16, IMAGE_REL_PPC_TOCREL16);
HOW2MAP(BFD_RELOC_16_GOTOFF, IMAGE_REL_PPC_TOCREL16_DEFN);
- HOW2MAP(BFD_RELOC_32, IMAGE_REL_PPC_ADDR32);
- HOW2MAP(BFD_RELOC_RVA, IMAGE_REL_PPC_ADDR32NB);
+ HOW2MAP(BFD_RELOC_32, IMAGE_REL_PPC_ADDR32);
+ HOW2MAP(BFD_RELOC_RVA, IMAGE_REL_PPC_ADDR32NB);
default:
return NULL;
}
#define coff_bfd_reloc_type_lookup ppc_coff_reloc_type_lookup
#define coff_bfd_reloc_name_lookup ppc_coff_reloc_name_lookup
-#define coff_rtype_to_howto coff_ppc_rtype_to_howto
-#define coff_relocate_section coff_ppc_relocate_section
-#define coff_bfd_final_link ppc_bfd_coff_final_link
+#define coff_rtype_to_howto coff_ppc_rtype_to_howto
+#define coff_relocate_section coff_ppc_relocate_section
+#define coff_bfd_final_link ppc_bfd_coff_final_link
#ifndef COFF_IMAGE_WITH_PE
#endif
#define SELECT_RELOC(internal, howto) {internal.r_type=howto->type;}
-#define COFF_PAGE_SIZE 0x1000
+#define COFF_PAGE_SIZE 0x1000
/* FIXME: This controls some code that used to be in peicode.h and is
now in peigen.c. It will not control the code in peigen.c. If
unsigned int i;
/* We use section_count + 1, rather than section_count, because
- the target_index fields are 1 based. */
+ the target_index fields are 1 based. */
amt = abfd->section_count + 1;
amt *= sizeof (struct coff_link_section_info);
flaginfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt);
if (o->reloc_count != 0)
{
/* We don't know the indices of global symbols until we have
- written out all the local symbols. For each section in
- the output file, we keep an array of pointers to hash
- table entries. Each entry in the array corresponds to a
- reloc. When we find a reloc against a global symbol, we
- set the corresponding entry in this array so that we can
- fix up the symbol index after we have written out all the
- local symbols.
+ written out all the local symbols. For each section in
+ the output file, we keep an array of pointers to hash
+ table entries. Each entry in the array corresponds to a
+ reloc. When we find a reloc against a global symbol, we
+ set the corresponding entry in this array so that we can
+ fix up the symbol index after we have written out all the
+ local symbols.
Because of this problem, we also keep the relocs in
memory until the end of the link. This wastes memory,
bfd_getl32, bfd_getl_signed_32, bfd_putl32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
- {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
+ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p },
{bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
bfd_false},
bfd_getb32, bfd_getb_signed_32, bfd_putb32,
bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
- {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
+ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */
bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p },
{bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */
bfd_false},
bfd_boolean
_bfd_xcoff_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
- const char *name ATTRIBUTE_UNUSED)
+ const char *name ATTRIBUTE_UNUSED)
{
return FALSE;
}
void
_bfd_xcoff_swap_aux_in (bfd *abfd, void * ext1, int type, int in_class,
- int indx, int numaux, void * in1)
+ int indx, int numaux, void * in1)
{
AUXENT * ext = (AUXENT *)ext1;
union internal_auxent *in = (union internal_auxent *)in1;
unsigned int
_bfd_xcoff_swap_aux_out (bfd *abfd, void * inp, int type, int in_class,
- int indx ATTRIBUTE_UNUSED,
- int numaux ATTRIBUTE_UNUSED,
- void * extp)
+ int indx ATTRIBUTE_UNUSED,
+ int numaux ATTRIBUTE_UNUSED,
+ void * extp)
{
union internal_auxent *in = (union internal_auxent *)inp;
AUXENT *ext = (AUXENT *)extp;
{
H_PUT_32 (abfd, 0, ext->x_file.x_n.x_n.x_zeroes);
H_PUT_32 (abfd, in->x_file.x_n.x_offset,
- ext->x_file.x_n.x_n.x_offset);
+ ext->x_file.x_n.x_n.x_offset);
}
else
{
reloc_howto_type *
_bfd_xcoff_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
switch (code)
{
bfd_boolean
bfd_xcoff_ar_archive_set_magic (bfd *abfd ATTRIBUTE_UNUSED,
- char *magic ATTRIBUTE_UNUSED)
+ char *magic ATTRIBUTE_UNUSED)
{
/* Not supported yet. */
return FALSE;
do \
{ \
(VAR) = sizeof (VAR) > sizeof (long) \
- ? _bfd_strntoll (FIELD, 10, sizeof FIELD) \
+ ? _bfd_strntoll (FIELD, 10, sizeof FIELD) \
: _bfd_strntol (FIELD, 10, sizeof FIELD); \
} \
while (0)
static bfd_boolean
xcoff_write_armap_old (bfd *abfd, unsigned int elength ATTRIBUTE_UNUSED,
- struct orl *map, unsigned int orl_count, int stridx)
+ struct orl *map, unsigned int orl_count, int stridx)
{
struct archive_iterator iterator;
struct xcoff_ar_hdr hdr;
static bfd_boolean
xcoff_write_armap_big (bfd *abfd, unsigned int elength ATTRIBUTE_UNUSED,
- struct orl *map, unsigned int orl_count, int stridx)
+ struct orl *map, unsigned int orl_count, int stridx)
{
struct archive_iterator iterator;
struct xcoff_ar_file_hdr_big *fhdr;
bfd_boolean
_bfd_xcoff_write_armap (bfd *abfd, unsigned int elength ATTRIBUTE_UNUSED,
- struct orl *map, unsigned int orl_count, int stridx)
+ struct orl *map, unsigned int orl_count, int stridx)
{
if (! xcoff_big_format_p (abfd))
return xcoff_write_armap_old (abfd, elength, map, orl_count, stridx);
bfd_boolean
xcoff_reloc_type_noop (bfd *input_bfd ATTRIBUTE_UNUSED,
- asection *input_section ATTRIBUTE_UNUSED,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- struct internal_reloc *rel ATTRIBUTE_UNUSED,
- struct internal_syment *sym ATTRIBUTE_UNUSED,
- struct reloc_howto_struct *howto ATTRIBUTE_UNUSED,
- bfd_vma val ATTRIBUTE_UNUSED,
- bfd_vma addend ATTRIBUTE_UNUSED,
- bfd_vma *relocation ATTRIBUTE_UNUSED,
- bfd_byte *contents ATTRIBUTE_UNUSED)
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct internal_reloc *rel ATTRIBUTE_UNUSED,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ struct reloc_howto_struct *howto ATTRIBUTE_UNUSED,
+ bfd_vma val ATTRIBUTE_UNUSED,
+ bfd_vma addend ATTRIBUTE_UNUSED,
+ bfd_vma *relocation ATTRIBUTE_UNUSED,
+ bfd_byte *contents ATTRIBUTE_UNUSED)
{
return TRUE;
}
bfd_boolean
xcoff_reloc_type_fail (bfd *input_bfd,
- asection *input_section ATTRIBUTE_UNUSED,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- struct internal_reloc *rel,
- struct internal_syment *sym ATTRIBUTE_UNUSED,
- struct reloc_howto_struct *howto ATTRIBUTE_UNUSED,
- bfd_vma val ATTRIBUTE_UNUSED,
- bfd_vma addend ATTRIBUTE_UNUSED,
- bfd_vma *relocation ATTRIBUTE_UNUSED,
- bfd_byte *contents ATTRIBUTE_UNUSED)
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct internal_reloc *rel,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ struct reloc_howto_struct *howto ATTRIBUTE_UNUSED,
+ bfd_vma val ATTRIBUTE_UNUSED,
+ bfd_vma addend ATTRIBUTE_UNUSED,
+ bfd_vma *relocation ATTRIBUTE_UNUSED,
+ bfd_byte *contents ATTRIBUTE_UNUSED)
{
_bfd_error_handler
/* xgettext: c-format */
bfd_boolean
xcoff_reloc_type_pos (bfd *input_bfd ATTRIBUTE_UNUSED,
- asection *input_section ATTRIBUTE_UNUSED,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- struct internal_reloc *rel ATTRIBUTE_UNUSED,
- struct internal_syment *sym ATTRIBUTE_UNUSED,
- struct reloc_howto_struct *howto ATTRIBUTE_UNUSED,
- bfd_vma val,
- bfd_vma addend,
- bfd_vma *relocation,
- bfd_byte *contents ATTRIBUTE_UNUSED)
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct internal_reloc *rel ATTRIBUTE_UNUSED,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ struct reloc_howto_struct *howto ATTRIBUTE_UNUSED,
+ bfd_vma val,
+ bfd_vma addend,
+ bfd_vma *relocation,
+ bfd_byte *contents ATTRIBUTE_UNUSED)
{
*relocation = val + addend;
return TRUE;
bfd_boolean
xcoff_reloc_type_neg (bfd *input_bfd ATTRIBUTE_UNUSED,
- asection *input_section ATTRIBUTE_UNUSED,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- struct internal_reloc *rel ATTRIBUTE_UNUSED,
- struct internal_syment *sym ATTRIBUTE_UNUSED,
- struct reloc_howto_struct *howto ATTRIBUTE_UNUSED,
- bfd_vma val,
- bfd_vma addend,
- bfd_vma *relocation,
- bfd_byte *contents ATTRIBUTE_UNUSED)
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct internal_reloc *rel ATTRIBUTE_UNUSED,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ struct reloc_howto_struct *howto ATTRIBUTE_UNUSED,
+ bfd_vma val,
+ bfd_vma addend,
+ bfd_vma *relocation,
+ bfd_byte *contents ATTRIBUTE_UNUSED)
{
*relocation = addend - val;
return TRUE;
bfd_boolean
xcoff_reloc_type_rel (bfd *input_bfd ATTRIBUTE_UNUSED,
- asection *input_section,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- struct internal_reloc *rel ATTRIBUTE_UNUSED,
- struct internal_syment *sym ATTRIBUTE_UNUSED,
- struct reloc_howto_struct *howto,
- bfd_vma val,
- bfd_vma addend,
- bfd_vma *relocation,
- bfd_byte *contents ATTRIBUTE_UNUSED)
+ asection *input_section,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct internal_reloc *rel ATTRIBUTE_UNUSED,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ struct reloc_howto_struct *howto,
+ bfd_vma val,
+ bfd_vma addend,
+ bfd_vma *relocation,
+ bfd_byte *contents ATTRIBUTE_UNUSED)
{
howto->pc_relative = TRUE;
bfd_boolean
xcoff_reloc_type_toc (bfd *input_bfd,
- asection *input_section ATTRIBUTE_UNUSED,
- bfd *output_bfd,
- struct internal_reloc *rel,
- struct internal_syment *sym,
- struct reloc_howto_struct *howto ATTRIBUTE_UNUSED,
- bfd_vma val,
- bfd_vma addend ATTRIBUTE_UNUSED,
- bfd_vma *relocation,
- bfd_byte *contents ATTRIBUTE_UNUSED)
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd,
+ struct internal_reloc *rel,
+ struct internal_syment *sym,
+ struct reloc_howto_struct *howto ATTRIBUTE_UNUSED,
+ bfd_vma val,
+ bfd_vma addend ATTRIBUTE_UNUSED,
+ bfd_vma *relocation,
+ bfd_byte *contents ATTRIBUTE_UNUSED)
{
struct xcoff_link_hash_entry *h;
bfd_boolean
xcoff_reloc_type_ba (bfd *input_bfd ATTRIBUTE_UNUSED,
- asection *input_section ATTRIBUTE_UNUSED,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- struct internal_reloc *rel ATTRIBUTE_UNUSED,
- struct internal_syment *sym ATTRIBUTE_UNUSED,
- struct reloc_howto_struct *howto,
- bfd_vma val,
- bfd_vma addend,
- bfd_vma *relocation,
- bfd_byte *contents ATTRIBUTE_UNUSED)
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct internal_reloc *rel ATTRIBUTE_UNUSED,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ struct reloc_howto_struct *howto,
+ bfd_vma val,
+ bfd_vma addend,
+ bfd_vma *relocation,
+ bfd_byte *contents ATTRIBUTE_UNUSED)
{
howto->src_mask &= ~3;
howto->dst_mask = howto->src_mask;
static bfd_boolean
xcoff_reloc_type_br (bfd *input_bfd,
- asection *input_section,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- struct internal_reloc *rel,
- struct internal_syment *sym ATTRIBUTE_UNUSED,
- struct reloc_howto_struct *howto,
- bfd_vma val,
- bfd_vma addend,
- bfd_vma *relocation,
- bfd_byte *contents)
+ asection *input_section,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct internal_reloc *rel,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ struct reloc_howto_struct *howto,
+ bfd_vma val,
+ bfd_vma addend,
+ bfd_vma *relocation,
+ bfd_byte *contents)
{
struct xcoff_link_hash_entry *h;
bfd_vma section_offset;
bfd_boolean
xcoff_reloc_type_crel (bfd *input_bfd ATTRIBUTE_UNUSED,
- asection *input_section,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- struct internal_reloc *rel ATTRIBUTE_UNUSED,
- struct internal_syment *sym ATTRIBUTE_UNUSED,
- struct reloc_howto_struct *howto,
- bfd_vma val ATTRIBUTE_UNUSED,
- bfd_vma addend,
- bfd_vma *relocation,
- bfd_byte *contents ATTRIBUTE_UNUSED)
+ asection *input_section,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct internal_reloc *rel ATTRIBUTE_UNUSED,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ struct reloc_howto_struct *howto,
+ bfd_vma val ATTRIBUTE_UNUSED,
+ bfd_vma addend,
+ bfd_vma *relocation,
+ bfd_byte *contents ATTRIBUTE_UNUSED)
{
howto->pc_relative = TRUE;
howto->src_mask &= ~3;
static bfd_boolean
xcoff_complain_overflow_dont_func (bfd *input_bfd ATTRIBUTE_UNUSED,
- bfd_vma val ATTRIBUTE_UNUSED,
- bfd_vma relocation ATTRIBUTE_UNUSED,
- struct reloc_howto_struct *
- howto ATTRIBUTE_UNUSED)
+ bfd_vma val ATTRIBUTE_UNUSED,
+ bfd_vma relocation ATTRIBUTE_UNUSED,
+ struct reloc_howto_struct *
+ howto ATTRIBUTE_UNUSED)
{
return FALSE;
}
static bfd_boolean
xcoff_complain_overflow_bitfield_func (bfd *input_bfd,
- bfd_vma val,
- bfd_vma relocation,
- struct reloc_howto_struct *howto)
+ bfd_vma val,
+ bfd_vma relocation,
+ struct reloc_howto_struct *howto)
{
bfd_vma fieldmask, signmask, ss;
bfd_vma a, b, sum;
static bfd_boolean
xcoff_complain_overflow_signed_func (bfd *input_bfd,
- bfd_vma val,
- bfd_vma relocation,
- struct reloc_howto_struct *howto)
+ bfd_vma val,
+ bfd_vma relocation,
+ struct reloc_howto_struct *howto)
{
bfd_vma addrmask, fieldmask, signmask, ss;
bfd_vma a, b, sum;
static bfd_boolean
xcoff_complain_overflow_unsigned_func (bfd *input_bfd,
- bfd_vma val,
- bfd_vma relocation,
- struct reloc_howto_struct *howto)
+ bfd_vma val,
+ bfd_vma relocation,
+ struct reloc_howto_struct *howto)
{
bfd_vma addrmask, fieldmask;
bfd_vma a, b, sum;
bfd_boolean
xcoff_ppc_relocate_section (bfd *output_bfd,
- struct bfd_link_info *info,
- bfd *input_bfd,
- asection *input_section,
- bfd_byte *contents,
- struct internal_reloc *relocs,
- struct internal_syment *syms,
- asection **sections)
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ struct internal_reloc *relocs,
+ struct internal_syment *syms,
+ asection **sections)
{
struct internal_reloc *rel;
struct internal_reloc *relend;
static bfd_boolean
_bfd_xcoff_put_ldsymbol_name (bfd *abfd ATTRIBUTE_UNUSED,
- struct xcoff_loader_info *ldinfo,
- struct internal_ldsym *ldsym,
- const char *name)
+ struct xcoff_loader_info *ldinfo,
+ struct internal_ldsym *ldsym,
+ const char *name)
{
size_t len;
len = strlen (name);
static asection *
xcoff_create_csect_from_smclas (bfd *abfd,
- union internal_auxent *aux,
- const char *symbol_name)
+ union internal_auxent *aux,
+ const char *symbol_name)
{
asection *return_value = NULL;
static bfd_vma
xcoff_loader_symbol_offset (bfd *abfd,
- struct internal_ldhdr *ldhdr ATTRIBUTE_UNUSED)
+ struct internal_ldhdr *ldhdr ATTRIBUTE_UNUSED)
{
return bfd_xcoff_ldhdrsz (abfd);
}
static bfd_boolean
xcoff_generate_rtinit (bfd *abfd, const char *init, const char *fini,
- bfd_boolean rtld)
+ bfd_boolean rtld)
{
bfd_byte filehdr_ext[FILHSZ];
bfd_byte scnhdr_ext[SCNHSZ];
EMPTY_HOWTO (15),
#ifdef COFF_WITH_PE
- HOWTO (R_SH_IMAGEBASE, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (R_SH_IMAGEBASE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
- sh_reloc, /* special_function */
- "rva32", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ sh_reloc, /* special_function */
+ "rva32", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
#else
EMPTY_HOWTO (16), /* R_SH_IMM8 */
#endif
*addendp -= 4;
/* If the symbol is defined, then the generic code is going to
- add back the symbol value in order to cancel out an
- adjustment it made to the addend. However, we set the addend
- to 0 at the start of this function. We need to adjust here,
- to avoid the adjustment the generic code will make. FIXME:
- This is getting a bit hackish. */
+ add back the symbol value in order to cancel out an
+ adjustment it made to the addend. However, we set the addend
+ to 0 at the start of this function. We need to adjust here,
+ to avoid the adjustment the generic code will make. FIXME:
+ This is getting a bit hackish. */
if (sym != NULL && sym->n_scnum != 0)
*addendp -= sym->n_value;
}
}
/* The r_offset field of the R_SH_USES reloc will point us to
- the register load. The 4 is because the r_offset field is
- computed as though it were a jump offset, which are based
- from 4 bytes after the jump instruction. */
+ the register load. The 4 is because the r_offset field is
+ computed as though it were a jump offset, which are based
+ from 4 bytes after the jump instruction. */
laddr = irel->r_vaddr - sec->vma + 4;
/* Careful to sign extend the 32-bit offset. */
laddr += ((irel->r_offset & 0xffffffff) ^ 0x80000000) - 0x80000000;
}
/* Get the address from which the register is being loaded. The
- displacement in the mov.l instruction is quadrupled. It is a
- displacement from four bytes after the movl instruction, but,
- before adding in the PC address, two least significant bits
- of the PC are cleared. We assume that the section is aligned
- on a four byte boundary. */
+ displacement in the mov.l instruction is quadrupled. It is a
+ displacement from four bytes after the movl instruction, but,
+ before adding in the PC address, two least significant bits
+ of the PC are cleared. We assume that the section is aligned
+ on a four byte boundary. */
paddr = insn & 0xff;
paddr *= 4;
paddr += (laddr + 4) &~ (bfd_vma) 3;
}
/* Get the reloc for the address from which the register is
- being loaded. This reloc will tell us which function is
- actually being called. */
+ being loaded. This reloc will tell us which function is
+ actually being called. */
paddr += sec->vma;
for (irelfn = internal_relocs; irelfn < irelend; irelfn++)
if (irelfn->r_vaddr == paddr
&& h->root.type != bfd_link_hash_defweak)
{
/* This appears to be a reference to an undefined
- symbol. Just ignore it--it will be caught by the
- regular reloc processing. */
+ symbol. Just ignore it--it will be caught by the
+ regular reloc processing. */
continue;
}
/* Replace the jsr with a bsr. */
/* Change the R_SH_USES reloc into an R_SH_PCDISP reloc, and
- replace the jsr with a bsr. */
+ replace the jsr with a bsr. */
irel->r_type = R_SH_PCDISP;
irel->r_symndx = irelfn->r_symndx;
if (sym.n_sclass != C_EXT)
{
/* If this needs to be changed because of future relaxing,
- it will be handled here like other internal PCDISP
- relocs. */
+ it will be handled here like other internal PCDISP
+ relocs. */
bfd_put_16 (abfd,
(bfd_vma) 0xb000 | ((foff >> 1) & 0xfff),
contents + irel->r_vaddr - sec->vma);
else
{
/* We can't fully resolve this yet, because the external
- symbol value may be changed by future relaxing. We let
- the final link phase handle it. */
+ symbol value may be changed by future relaxing. We let
+ the final link phase handle it. */
bfd_put_16 (abfd, (bfd_vma) 0xb000,
contents + irel->r_vaddr - sec->vma);
}
/* See if there is another R_SH_USES reloc referring to the same
- register load. */
+ register load. */
for (irelscan = internal_relocs; irelscan < irelend; irelscan++)
if (irelscan->r_type == R_SH_USES
&& laddr == irelscan->r_vaddr - sec->vma + 4 + irelscan->r_offset)
}
/* Look for a R_SH_COUNT reloc on the location where the
- function address is stored. Do this before deleting any
- bytes, to avoid confusion about the address. */
+ function address is stored. Do this before deleting any
+ bytes, to avoid confusion about the address. */
for (irelcount = internal_relocs; irelcount < irelend; irelcount++)
if (irelcount->r_vaddr == paddr
&& irelcount->r_type == R_SH_COUNT)
goto error_return;
/* That will change things, so, just in case it permits some
- other function call to come within range, we should relax
- again. Note that this is not required, and it may be slow. */
+ other function call to come within range, we should relax
+ again. Note that this is not required, and it may be slow. */
*again = TRUE;
/* Now check whether we got a COUNT reloc. */
}
/* The number of uses is stored in the r_offset field. We've
- just deleted one. */
+ just deleted one. */
if (irelcount->r_offset == 0)
{
/* xgettext: c-format */
--irelcount->r_offset;
/* If there are no more uses, we can delete the address. Reload
- the address from irelfn, in case it was changed by the
- previous call to sh_relax_delete_bytes. */
+ the address from irelfn, in case it was changed by the
+ previous call to sh_relax_delete_bytes. */
if (irelcount->r_offset == 0)
{
if (! sh_relax_delete_bytes (abfd, sec,
irel->r_type = R_SH_UNUSED;
/* If this is a PC relative reloc, see if the range it covers
- includes the bytes we have deleted. */
+ includes the bytes we have deleted. */
switch (irel->r_type)
{
default:
case R_SH_IMAGEBASE:
#endif
/* If this reloc is against a symbol defined in this
- section, and the symbol will not be adjusted below, we
- must check the addend to see it will put the value in
- range to be adjusted, and hence must be changed. */
+ section, and the symbol will not be adjusted below, we
+ must check the addend to see it will put the value in
+ range to be adjusted, and hence must be changed. */
bfd_coff_swap_sym_in (abfd,
((bfd_byte *) obj_coff_external_syms (abfd)
+ (irel->r_symndx
continue;
/* We always cache the relocs. Perhaps, if info->keep_memory is
- FALSE, we should free them, if we are permitted to, when we
- leave sh_coff_relax_section. */
+ FALSE, we should free them, if we are permitted to, when we
+ leave sh_coff_relax_section. */
internal_relocs = (_bfd_coff_read_internal_relocs
(abfd, o, TRUE, (bfd_byte *) NULL, FALSE,
(struct internal_reloc *) NULL));
if (!bfd_malloc_and_get_section (abfd, o, &ocontents))
return FALSE;
/* We always cache the section contents.
- Perhaps, if info->keep_memory is FALSE, we
- should free them, if we are permitted to,
- when we leave sh_coff_relax_section. */
+ Perhaps, if info->keep_memory is FALSE, we
+ should free them, if we are permitted to,
+ when we leave sh_coff_relax_section. */
coff_section_data (abfd, o)->contents = ocontents;
}
}
opend = op + min->count;
/* Since the opcodes tables are sorted, we could use a binary
- search here if the count were above some cutoff value. */
+ search here if the count were above some cutoff value. */
for (; op < opend; op++)
if (op->opcode == l)
return op;
int type, add;
/* There are a few special types of relocs that we don't want to
- adjust. These relocs do not apply to the instruction itself,
- but are only associated with the address. */
+ adjust. These relocs do not apply to the instruction itself,
+ but are only associated with the address. */
type = irel->r_type;
if (type == R_SH_ALIGN
|| type == R_SH_CODE
continue;
/* If an R_SH_USES reloc points to one of the addresses being
- swapped, we must adjust it. It would be incorrect to do this
- for a jump, though, since we want to execute both
- instructions after the jump. (We have avoided swapping
- around a label, so the jump will not wind up executing an
- instruction it shouldn't). */
+ swapped, we must adjust it. It would be incorrect to do this
+ for a jump, though, since we want to execute both
+ instructions after the jump. (We have avoided swapping
+ around a label, so the jump will not wind up executing an
+ instruction it shouldn't). */
if (type == R_SH_USES)
{
bfd_vma off;
case R_SH_PCRELIMM8BY4:
/* This reloc ignores the least significant 3 bits of
- the program counter before adding in the offset.
- This means that if ADDR is at an even address, the
- swap will not affect the offset. If ADDR is an at an
- odd address, then the instruction will be crossing a
- four byte boundary, and must be adjusted. */
+ the program counter before adding in the offset.
+ This means that if ADDR is at an even address, the
+ swap will not affect the offset. If ADDR is an at an
+ odd address, then the instruction will be crossing a
+ four byte boundary, and must be adjusted. */
if ((addr & 3) != 0)
{
insn = bfd_get_16 (abfd, loc);
bfd_reloc_status_type rstat;
/* Almost all relocs have to do with relaxing. If any work must
- be done for them, it has been done in sh_relax_section. */
+ be done for them, it has been done in sh_relax_section. */
if (rel->r_type != R_SH_IMM32
#ifdef COFF_WITH_PE
&& rel->r_type != R_SH_IMM32CE
else
{
sec = sections[symndx];
- val = (sec->output_section->vma
+ val = (sec->output_section->vma
+ sec->output_offset
+ sym->n_value
- sec->vma);
name = obj_coff_strings (input_bfd) + sym->_n._n_n._n_offset;
else
{
- strncpy (buf, sym->_n._n_name, SYMNMLEN);
+ strncpy (buf, sym->_n._n_name, SYMNMLEN);
buf[SYMNMLEN] = '\0';
name = buf;
}
goto stub_end;
}
/* Compute the size of the stub (it is every thing up
- to the beginning of the coff image). */
+ to the beginning of the coff image). */
coff_start = (long) _H (2) * 512L;
if (_H (1))
coff_start += (long) _H (1) - 512L;
/* Currently there is only a fixed stub size of 2048 bytes
- supported. */
+ supported. */
if (coff_start != 2048)
{
close (f);
if (output_bfd != (bfd *) NULL)
{
/* This is a partial relocation, and we want to apply the
- relocation to the reloc entry rather than the raw data.
- Modify the reloc inplace to reflect what we now know. */
+ relocation to the reloc entry rather than the raw data.
+ Modify the reloc inplace to reflect what we now know. */
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
}
if (reloc->r_symndx != -1)
{
if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd))
- {
+ {
_bfd_error_handler
/* xgettext: c-format */
(_("%B: warning: illegal symbol index %ld in relocs"),
abfd, reloc->r_symndx);
- relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
- ptr = NULL;
- }
+ relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+ ptr = NULL;
+ }
else
- {
- relent->sym_ptr_ptr = (symbols
- + obj_convert (abfd)[reloc->r_symndx]);
- ptr = *(relent->sym_ptr_ptr);
- }
+ {
+ relent->sym_ptr_ptr = (symbols
+ + obj_convert (abfd)[reloc->r_symndx]);
+ ptr = *(relent->sym_ptr_ptr);
+ }
}
else
{
if (output_bfd != (bfd *) NULL)
{
/* This is a partial relocation, and we want to apply the
- relocation to the reloc entry rather than the raw data.
- Modify the reloc inplace to reflect what we now know. */
+ relocation to the reloc entry rather than the raw data.
+ Modify the reloc inplace to reflect what we now know. */
reloc_entry->address += input_section->output_offset;
return bfd_reloc_ok;
}
bfd_size_type bytes_to_do)
{
return coff_set_section_contents (abfd, section, location,
- offset, bytes_to_do);
+ offset, bytes_to_do);
}
static void
if (reloc->r_symndx != -1)
{
if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd))
- {
- _bfd_error_handler
+ {
+ _bfd_error_handler
/* xgettext: c-format */
- (_("%B: warning: illegal symbol index %ld in relocs"),
- abfd, reloc->r_symndx);
- relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
- ptr = NULL;
- }
+ (_("%B: warning: illegal symbol index %ld in relocs"),
+ abfd, reloc->r_symndx);
+ relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
+ ptr = NULL;
+ }
else
- {
- relent->sym_ptr_ptr = (symbols
- + obj_convert (abfd)[reloc->r_symndx]);
- ptr = *(relent->sym_ptr_ptr);
- }
+ {
+ relent->sym_ptr_ptr = (symbols
+ + obj_convert (abfd)[reloc->r_symndx]);
+ ptr = *(relent->sym_ptr_ptr);
+ }
}
else
{
}
/* COFF treats common symbols in one of two ways. Either the
- size of the symbol is included in the section contents, or it
- is not. We assume that the size is not included, and force
- the rtype_to_howto function to adjust the addend as needed. */
+ size of the symbol is included in the section contents, or it
+ is not. We assume that the size is not included, and force
+ the rtype_to_howto function to adjust the addend as needed. */
if (sym != NULL && sym->n_scnum != 0)
addend = - sym->n_value;
else
{
sec = sections[symndx];
- val = (sec->output_section->vma
+ val = (sec->output_section->vma
+ sec->output_offset
+ sym->n_value);
if (! obj_pe (output_bfd))
addr = rel->r_vaddr - input_section->vma;
/* FIXME: This code assumes little endian, but the PP can
- apparently be bi-endian. I don't know if the bi-endianness
- applies to the instruction set or just to the data. */
+ apparently be bi-endian. I don't know if the bi-endianness
+ applies to the instruction set or just to the data. */
switch (howto->type)
{
default:
EMPTY_HOWTO (3),
EMPTY_HOWTO (4),
EMPTY_HOWTO (5),
- HOWTO(R_DIR32, 0, 2, 32, FALSE, 0,complain_overflow_bitfield, 0, "dir32", TRUE, 0xffffffff,0xffffffff, FALSE),
+ HOWTO(R_DIR32, 0, 2, 32, FALSE, 0,complain_overflow_bitfield, 0, "dir32", TRUE, 0xffffffff,0xffffffff, FALSE),
EMPTY_HOWTO (7),
EMPTY_HOWTO (010),
EMPTY_HOWTO (011),
EMPTY_HOWTO (014),
EMPTY_HOWTO (015),
EMPTY_HOWTO (016),
- HOWTO(R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "8", TRUE, 0x000000ff,0x000000ff, FALSE),
- HOWTO(R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
- HOWTO(R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "32", TRUE, 0xffffffff,0xffffffff, FALSE),
- HOWTO(R_PCRBYTE, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0, "DISP8", TRUE, 0x000000ff,0x000000ff, FALSE),
- HOWTO(R_PCRWORD, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
- HOWTO(R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
+ HOWTO(R_RELBYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "8", TRUE, 0x000000ff,0x000000ff, FALSE),
+ HOWTO(R_RELWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+ HOWTO(R_RELLONG, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "32", TRUE, 0xffffffff,0xffffffff, FALSE),
+ HOWTO(R_PCRBYTE, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0, "DISP8", TRUE, 0x000000ff,0x000000ff, FALSE),
+ HOWTO(R_PCRWORD, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+ HOWTO(R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
};
#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0]))
{
reloc_howto_type *howto = reloc_entry->howto;
unsigned char *addr = (unsigned char *) data + reloc_entry->address;
-
+
if (! bfd_reloc_offset_in_range (howto, abfd, input_section,
reloc_entry->address
* bfd_octets_per_byte (abfd)))
EMPTY_HOWTO (13),
#ifndef DONT_EXTEND_AMD64
HOWTO (R_AMD64_PCRQUAD,
- 0, /* rightshift */
- 4, /* size (0 = byte, 1 = short, 2 = long) */
- 64, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- coff_amd64_reloc, /* special_function */
- "R_X86_64_PC64", /* name */
- TRUE, /* partial_inplace */
- 0xffffffffffffffffll, /* src_mask */
- 0xffffffffffffffffll, /* dst_mask */
- PCRELOFFSET), /* pcrel_offset */
+ 0, /* rightshift */
+ 4, /* size (0 = byte, 1 = short, 2 = long) */
+ 64, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ coff_amd64_reloc, /* special_function */
+ "R_X86_64_PC64", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffffffffffffll, /* src_mask */
+ 0xffffffffffffffffll, /* dst_mask */
+ PCRELOFFSET), /* pcrel_offset */
#else
EMPTY_HOWTO (14),
#endif
#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) \
{ \
coff_symbol_type *coffsym = NULL; \
- \
+ \
if (ptr && bfd_asymbol_bfd (ptr) != abfd) \
coffsym = (obj_symbols (abfd) \
- + (cache_ptr->sym_ptr_ptr - symbols)); \
+ + (cache_ptr->sym_ptr_ptr - symbols)); \
else if (ptr) \
coffsym = coff_symbol_from (ptr); \
- \
+ \
if (coffsym != NULL \
&& coffsym->native->u.syment.n_scnum == 0) \
cache_ptr->addend = - coffsym->native->u.syment.n_value; \
*addendp -= 4;
/* If the symbol is defined, then the generic code is going to
- add back the symbol value in order to cancel out an
- adjustment it made to the addend. However, we set the addend
- to 0 at the start of this function. We need to adjust here,
- to avoid the adjustment the generic code will make. FIXME:
- This is getting a bit hackish. */
+ add back the symbol value in order to cancel out an
+ adjustment it made to the addend. However, we set the addend
+ to 0 at the start of this function. We need to adjust here,
+ to avoid the adjustment the generic code will make. FIXME:
+ This is getting a bit hackish. */
if (sym != NULL && sym->n_scnum != 0)
*addendp -= sym->n_value;
}
static void
reloc_processing (arelent *relent,
- struct internal_reloc *reloc,
- asymbol **symbols,
- bfd *abfd,
- asection *section)
+ struct internal_reloc *reloc,
+ asymbol **symbols,
+ bfd *abfd,
+ asection *section)
{
relent->address = reloc->r_vaddr;
rtype2howto (relent, reloc);
static void
extra_case (bfd *in_abfd,
- struct bfd_link_info *link_info,
- struct bfd_link_order *link_order,
- arelent *reloc,
- bfd_byte *data,
- unsigned int *src_ptr,
- unsigned int *dst_ptr)
+ struct bfd_link_info *link_info,
+ struct bfd_link_order *link_order,
+ arelent *reloc,
+ bfd_byte *data,
+ unsigned int *src_ptr,
+ unsigned int *dst_ptr)
{
asection * input_section = link_order->u.indirect.section;
int val;
static reloc_howto_type *
coff_z8k_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
switch (code)
{
- case BFD_RELOC_8: return & r_imm8;
- case BFD_RELOC_16: return & r_da;
- case BFD_RELOC_32: return & r_imm32;
- case BFD_RELOC_8_PCREL: return & r_jr;
- case BFD_RELOC_16_PCREL: return & r_rel16;
- case BFD_RELOC_Z8K_DISP7: return & r_disp7;
- case BFD_RELOC_Z8K_CALLR: return & r_callr;
- case BFD_RELOC_Z8K_IMM4L: return & r_imm4l;
+ case BFD_RELOC_8: return & r_imm8;
+ case BFD_RELOC_16: return & r_da;
+ case BFD_RELOC_32: return & r_imm32;
+ case BFD_RELOC_8_PCREL: return & r_jr;
+ case BFD_RELOC_16_PCREL: return & r_rel16;
+ case BFD_RELOC_Z8K_DISP7: return & r_disp7;
+ case BFD_RELOC_Z8K_CALLR: return & r_callr;
+ case BFD_RELOC_Z8K_IMM4L: return & r_imm4l;
default: BFD_FAIL ();
return 0;
}
static void
reloc_processing (arelent *relent,
- struct internal_reloc *reloc,
- asymbol **symbols,
- bfd *abfd,
- asection *section)
+ struct internal_reloc *reloc,
+ asymbol **symbols,
+ bfd *abfd,
+ asection *section)
{
relent->address = reloc->r_vaddr;
rtype2howto (relent, reloc);
static void
extra_case (bfd *in_abfd,
- struct bfd_link_info *link_info,
- struct bfd_link_order *link_order,
- arelent *reloc,
- bfd_byte *data,
- unsigned int *src_ptr,
- unsigned int *dst_ptr)
+ struct bfd_link_info *link_info,
+ struct bfd_link_order *link_order,
+ arelent *reloc,
+ bfd_byte *data,
+ unsigned int *src_ptr,
+ unsigned int *dst_ptr)
{
asection * input_section = link_order->u.indirect.section;
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1, since we're in the odd byte of the
- word and the pc's been incremented. */
+ word and the pc's been incremented. */
if (gap & 1)
abort ();
+ input_section->output_offset
+ input_section->output_section->vma);
int gap = dst - dot - 1; /* -1, since we're in the odd byte of the
- word and the pc's been incremented. */
+ word and the pc's been incremented. */
if (gap & 1)
abort ();
input_section, reloc->address);
bfd_put_8 (in_abfd,
- (bfd_get_8 ( in_abfd, data + *dst_ptr) & 0x80) + (-gap & 0x7f),
- data + *dst_ptr);
+ (bfd_get_8 ( in_abfd, data + *dst_ptr) & 0x80) + (-gap & 0x7f),
+ data + *dst_ptr);
(*dst_ptr)++;
(*src_ptr)++;
break;
gap /= 2;
bfd_put_16 (in_abfd,
- (bfd_get_16 ( in_abfd, data + *dst_ptr) & 0xf000) | (-gap & 0x0fff),
- data + *dst_ptr);
+ (bfd_get_16 ( in_abfd, data + *dst_ptr) & 0xf000) | (-gap & 0x0fff),
+ data + *dst_ptr);
(*dst_ptr) += 2;
(*src_ptr) += 2;
break;
static void
_bfd_xcoff64_swap_aux_in (bfd *abfd, void *ext1, int type, int in_class,
- int indx, int numaux, void *in1)
+ int indx, int numaux, void *in1)
{
union external_auxent *ext = (union external_auxent *) ext1;
union internal_auxent *in = (union internal_auxent *) in1;
{
in->x_file.x_n.x_zeroes = 0;
in->x_file.x_n.x_offset =
- H_GET_32 (abfd, ext->x_file.x_n.x_n.x_offset);
+ H_GET_32 (abfd, ext->x_file.x_n.x_n.x_offset);
}
else
{
static unsigned int
_bfd_xcoff64_swap_aux_out (bfd *abfd, void *inp, int type, int in_class,
- int indx ATTRIBUTE_UNUSED,
- int numaux ATTRIBUTE_UNUSED,
- void *extp)
+ int indx ATTRIBUTE_UNUSED,
+ int numaux ATTRIBUTE_UNUSED,
+ void *extp)
{
union internal_auxent *in = (union internal_auxent *) inp;
union external_auxent *ext = (union external_auxent *) extp;
{
H_PUT_32 (abfd, 0, ext->x_file.x_n.x_n.x_zeroes);
H_PUT_32 (abfd, in->x_file.x_n.x_offset,
- ext->x_file.x_n.x_n.x_offset);
+ ext->x_file.x_n.x_n.x_offset);
}
else
{
static bfd_boolean
_bfd_xcoff64_put_symbol_name (struct bfd_link_info *info,
struct bfd_strtab_hash *strtab,
- struct internal_syment *sym,
- const char *name)
+ struct internal_syment *sym,
+ const char *name)
{
bfd_boolean hash;
bfd_size_type indx;
static bfd_boolean
_bfd_xcoff64_put_ldsymbol_name (bfd *abfd ATTRIBUTE_UNUSED,
- struct xcoff_loader_info *ldinfo,
- struct internal_ldsym *ldsym,
- const char *name)
+ struct xcoff_loader_info *ldinfo,
+ struct internal_ldsym *ldsym,
+ const char *name)
{
size_t len;
len = strlen (name);
static void
xcoff64_swap_ldhdr_in (bfd *abfd,
- const void *s,
- struct internal_ldhdr *dst)
+ const void *s,
+ struct internal_ldhdr *dst)
{
const struct external_ldhdr *src = (const struct external_ldhdr *) s;
static bfd_boolean
xcoff64_reloc_type_br (bfd *input_bfd,
- asection *input_section,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- struct internal_reloc *rel,
- struct internal_syment *sym ATTRIBUTE_UNUSED,
- struct reloc_howto_struct *howto,
- bfd_vma val,
- bfd_vma addend,
- bfd_vma *relocation,
- bfd_byte *contents)
+ asection *input_section,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct internal_reloc *rel,
+ struct internal_syment *sym ATTRIBUTE_UNUSED,
+ struct reloc_howto_struct *howto,
+ bfd_vma val,
+ bfd_vma addend,
+ bfd_vma *relocation,
+ bfd_byte *contents)
{
struct xcoff_link_hash_entry *h;
bfd_vma section_offset;
bfd_boolean
xcoff64_ppc_relocate_section (bfd *output_bfd,
- struct bfd_link_info *info,
- bfd *input_bfd,
- asection *input_section,
- bfd_byte *contents,
- struct internal_reloc *relocs,
- struct internal_syment *syms,
- asection **sections)
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ struct internal_reloc *relocs,
+ struct internal_syment *syms,
+ asection **sections)
{
struct internal_reloc *rel;
struct internal_reloc *relend;
reloc_howto_type *
xcoff64_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
switch (code)
{
do \
{ \
(VAR) = sizeof (VAR) > sizeof (long) \
- ? _bfd_strntoll (FIELD, 10, sizeof FIELD) \
+ ? _bfd_strntoll (FIELD, 10, sizeof FIELD) \
: _bfd_strntol (FIELD, 10, sizeof FIELD); \
} \
while (0)
static asection *
xcoff64_create_csect_from_smclas (bfd *abfd, union internal_auxent *aux,
- const char *symbol_name)
+ const char *symbol_name)
{
asection *return_value = NULL;
static bfd_boolean
xcoff64_is_lineno_count_overflow (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_vma value ATTRIBUTE_UNUSED)
+ bfd_vma value ATTRIBUTE_UNUSED)
{
return FALSE;
}
static bfd_boolean
xcoff64_is_reloc_count_overflow (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_vma value ATTRIBUTE_UNUSED)
+ bfd_vma value ATTRIBUTE_UNUSED)
{
return FALSE;
}
static bfd_vma
xcoff64_loader_symbol_offset (bfd *abfd ATTRIBUTE_UNUSED,
- struct internal_ldhdr *ldhdr)
+ struct internal_ldhdr *ldhdr)
{
return (ldhdr->l_symoff);
}
static bfd_vma
xcoff64_loader_reloc_offset (bfd *abfd ATTRIBUTE_UNUSED,
- struct internal_ldhdr *ldhdr)
+ struct internal_ldhdr *ldhdr)
{
return (ldhdr->l_rldoff);
}
static bfd_boolean
xcoff64_generate_rtinit (bfd *abfd, const char *init, const char *fini,
- bfd_boolean rtld)
+ bfd_boolean rtld)
{
bfd_byte filehdr_ext[FILHSZ];
bfd_byte scnhdr_ext[SCNHSZ * 3];
#define COFFLONGSECTIONCATHELPER(x,y) x ## y
/* If the input macro Y is blank or '1', return an odd number; if it is
'0', return an even number. Result undefined in all other cases. */
-#define BLANKOR1TOODD(y) COFFLONGSECTIONCATHELPER(1,y)
+#define BLANKOR1TOODD(y) COFFLONGSECTIONCATHELPER(1,y)
/* Defined to numerical 0 or 1 according to whether generation of long
section names is disabled or enabled by default. */
#define COFF_ENABLE_LONG_SECTION_NAMES (BLANKOR1TOODD(COFF_LONG_SECTION_NAMES) & 1)
#endif /* _LIT */
}
else if (CONST_STRNEQ (sec_name, DOT_DEBUG)
- || CONST_STRNEQ (sec_name, DOT_ZDEBUG))
+ || CONST_STRNEQ (sec_name, DOT_ZDEBUG))
{
/* Handle the XCOFF debug section and DWARF2 debug sections. */
if (!sec_name[6])
}
#ifdef COFF_LONG_SECTION_NAMES
else if (CONST_STRNEQ (sec_name, GNU_LINKONCE_WI)
- || CONST_STRNEQ (sec_name, GNU_LINKONCE_WT))
+ || CONST_STRNEQ (sec_name, GNU_LINKONCE_WT))
{
styp_flags = STYP_DEBUG_INFO;
}
int i;
for (i = 0; i < XCOFF_DWSECT_NBR_NAMES; i++)
- if (!strcmp (sec_name, xcoff_dwsect_names[i].name))
- {
- styp_flags = STYP_DWARF | xcoff_dwsect_names[i].flag;
- break;
- }
+ if (!strcmp (sec_name, xcoff_dwsect_names[i].name))
+ {
+ styp_flags = STYP_DWARF | xcoff_dwsect_names[i].flag;
+ break;
+ }
}
#endif
/* Try and figure out what it should be */
if (is_dbg)
{
sec_flags &= (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
- | SEC_LINK_DUPLICATES_SAME_CONTENTS
- | SEC_LINK_DUPLICATES_SAME_SIZE);
+ | SEC_LINK_DUPLICATES_SAME_CONTENTS
+ | SEC_LINK_DUPLICATES_SAME_SIZE);
sec_flags |= SEC_DEBUGGING | SEC_READONLY;
}
styp_flags |= IMAGE_SCN_LNK_COMDAT;
if ((sec_flags
& (SEC_LINK_DUPLICATES_DISCARD | SEC_LINK_DUPLICATES_SAME_CONTENTS
- | SEC_LINK_DUPLICATES_SAME_SIZE)) != 0)
+ | SEC_LINK_DUPLICATES_SAME_SIZE)) != 0)
styp_flags |= IMAGE_SCN_LNK_COMDAT;
/* skip LINKER_CREATED */
.
. bfd_boolean (*_bfd_coff_pointerize_aux_hook)
. (bfd *, combined_entry_type *, combined_entry_type *,
-. unsigned int, combined_entry_type *);
+. unsigned int, combined_entry_type *);
.
. bfd_boolean (*_bfd_coff_print_aux)
. (bfd *, FILE *, combined_entry_type *, combined_entry_type *,
-. combined_entry_type *, unsigned int);
+. combined_entry_type *, unsigned int);
.
. void (*_bfd_coff_reloc16_extra_cases)
. (bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *,
-. bfd_byte *, unsigned int *, unsigned int *);
+. bfd_byte *, unsigned int *, unsigned int *);
.
. int (*_bfd_coff_reloc16_estimate)
. (bfd *, asection *, arelent *, unsigned int,
-. struct bfd_link_info *);
+. struct bfd_link_info *);
.
. enum coff_symbol_classification (*_bfd_coff_classify_symbol)
. (bfd *, struct internal_syment *);
.
. bfd_boolean (*_bfd_coff_relocate_section)
. (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
-. struct internal_reloc *, struct internal_syment *, asection **);
+. struct internal_reloc *, struct internal_syment *, asection **);
.
. reloc_howto_type *(*_bfd_coff_rtype_to_howto)
. (bfd *, asection *, struct internal_reloc *,
-. struct coff_link_hash_entry *, struct internal_syment *,
-. bfd_vma *);
+. struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *);
.
. bfd_boolean (*_bfd_coff_adjust_symndx)
. (bfd *, struct bfd_link_info *, bfd *, asection *,
-. struct internal_reloc *, bfd_boolean *);
+. struct internal_reloc *, bfd_boolean *);
.
. bfd_boolean (*_bfd_coff_link_add_one_symbol)
. (struct bfd_link_info *, bfd *, const char *, flagword,
-. asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean,
-. struct bfd_link_hash_entry **);
+. asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean,
+. struct bfd_link_hash_entry **);
.
. bfd_boolean (*_bfd_coff_link_output_has_begun)
. (bfd *, struct coff_final_link_info *);
. (abfd, file, base, symbol, aux, indaux))
.
.#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\
-. reloc, data, src_ptr, dst_ptr)\
+. reloc, data, src_ptr, dst_ptr)\
. ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\
. (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr))
.
. ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\
. (obfd, info, ibfd, sec, rel, adjustedp))
.#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\
-. value, string, cp, coll, hashp)\
+. value, string, cp, coll, hashp)\
. ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\
. (info, abfd, name, flags, section, value, string, cp, coll, hashp))
.
int i;
for (i = 0; i < XCOFF_DWSECT_NBR_NAMES; i++)
- if (strcmp (bfd_get_section_name (abfd, section),
- xcoff_dwsect_names[i].name) == 0)
- {
- section->alignment_power = 0;
- sclass = C_DWARF;
- break;
- }
+ if (strcmp (bfd_get_section_name (abfd, section),
+ xcoff_dwsect_names[i].name) == 0)
+ {
+ section->alignment_power = 0;
+ sclass = C_DWARF;
+ break;
+ }
}
#endif
and the native linker doesn't try to align the text sections.
For example:
- 0 .text 000054cc 10000128 10000128 00000128 2**5
- CONTENTS, ALLOC, LOAD, CODE
+ 0 .text 000054cc 10000128 10000128 00000128 2**5
+ CONTENTS, ALLOC, LOAD, CODE
*/
if (!strcmp (current->name, _TEXT)
/* xgettext:c-format */
(_("%B:%s section %s: alignment 2**%u not representable"),
abfd, warn ? " warning:" : "", current->name,
- current->alignment_power);
+ current->alignment_power);
if (!warn)
{
bfd_set_error (bfd_error_nonrepresentable_section);
return FALSE;
- }
+ }
}
#endif
- a (four byte) word holding the length of this record, in words,
- a word that always seems to be set to "2",
- the path to a shared library, null-terminated and then padded
- to a whole word boundary.
+ to a whole word boundary.
bfd_assert calls have been added to alert if an attempt is made
to write a section which doesn't follow these assumptions. The
case C_THUMBSTATFUNC:/* Thumb static function. */
#endif
#ifdef RS6000COFF_C
- case C_DWARF: /* A label in a dwarf section. */
- case C_INFO: /* A label in a comment section. */
+ case C_DWARF: /* A label in a dwarf section. */
+ case C_INFO: /* A label in a comment section. */
#endif
case C_LABEL: /* Label. */
if (src->u.syment.n_scnum == N_DEBUG)
&& src->u.syment.n_scnum == 0)
break;
#ifdef RS6000COFF_C
- /* XCOFF specific: deleted entry. */
- if (src->u.syment.n_value == C_NULL_VALUE)
- break;
+ /* XCOFF specific: deleted entry. */
+ if (src->u.syment.n_value == C_NULL_VALUE)
+ break;
#endif
/* Fall through. */
case C_EXTDEF: /* External definition. */
{
asection *sec;
char * name;
- char buf[SYMNMLEN + 1];
+ char buf[SYMNMLEN + 1];
name = _bfd_coff_internal_syment_name (abfd, syment, buf)
- sec = coff_section_from_bfd_index (abfd, syment->n_scnum);
+ sec = coff_section_from_bfd_index (abfd, syment->n_scnum);
if (sec != NULL && name != NULL
&& (strcmp (bfd_get_section_name (abfd, sec), name) == 0))
return COFF_SYMBOL_PE_SECTION;
const char *strings;
/* Flag that this BFD uses long names, even though the format might
- expect them to be off by default. This won't directly affect the
- format of any output BFD created from this one, but the information
- can be used to decide what to do. */
+ expect them to be off by default. This won't directly affect the
+ format of any output BFD created from this one, but the information
+ can be used to decide what to do. */
bfd_coff_set_long_section_names (abfd, TRUE);
memcpy (buf, hdr->s_name + 1, SCNNMLEN - 1);
buf[SCNNMLEN - 1] = '\0';
return FALSE;
strings += strindex;
name = (char *) bfd_alloc (abfd,
- (bfd_size_type) strlen (strings) + 1 + 1);
+ (bfd_size_type) strlen (strings) + 1 + 1);
if (name == NULL)
return FALSE;
strcpy (name, strings);
{
/* Assorted wastage to null-terminate the name, thanks AT&T! */
name = (char *) bfd_alloc (abfd,
- (bfd_size_type) sizeof (hdr->s_name) + 1 + 1);
+ (bfd_size_type) sizeof (hdr->s_name) + 1 + 1);
if (name == NULL)
return FALSE;
strncpy (name, (char *) &hdr->s_name[0], sizeof (hdr->s_name));
memcpy (new_name + 2, name + 1, len);
}
}
- break;
+ break;
case decompress:
if (!bfd_init_section_decompress_status (abfd, return_section))
{
ECOFF as well. */
const bfd_target *
coff_real_object_p (bfd *,
- unsigned,
- struct internal_filehdr *,
- struct internal_aouthdr *);
+ unsigned,
+ struct internal_filehdr *,
+ struct internal_aouthdr *);
const bfd_target *
coff_real_object_p (bfd *abfd,
unsigned nscns,
if (limit == 0)
{
/* This may be from the backend linker, in which case the
- lineno_count in the sections is correct. */
+ lineno_count in the sections is correct. */
for (s = abfd->sections; s != NULL; s = s->next)
total += s->lineno_count;
return total;
coff_symbol_type *q = coffsymbol (q_maybe);
/* The AIX 4.1 compiler can sometimes generate line numbers
- attached to debugging symbols. We try to simply ignore
- those here. */
+ attached to debugging symbols. We try to simply ignore
+ those here. */
if (q->lineno != NULL
&& q->symbol.section->owner != NULL)
{
/* This symbol has line numbers. Increment the owning
- section's linenumber count. */
+ section's linenumber count. */
alent *l = q->lineno;
do
syment->n_value = (coff_symbol_ptr->symbol.value
+ coff_symbol_ptr->symbol.section->output_offset);
if (! obj_pe (abfd))
- {
- syment->n_value += (syment->n_sclass == C_STATLAB)
- ? coff_symbol_ptr->symbol.section->output_section->lma
- : coff_symbol_ptr->symbol.section->output_section->vma;
- }
+ {
+ syment->n_value += (syment->n_sclass == C_STATLAB)
+ ? coff_symbol_ptr->symbol.section->output_section->lma
+ : coff_symbol_ptr->symbol.section->output_section->vma;
+ }
}
else
{
if (s->fix_line)
{
/* The value is the offset into the line number entries
- for the symbol's section. On output, the symbol's
- section should be N_DEBUG. */
+ for the symbol's section. On output, the symbol's
+ section should be N_DEBUG. */
s->u.syment.n_value =
(coff_symbol_ptr->symbol.section->output_section->line_filepos
+ s->u.syment.n_value * bfd_coff_linesz (bfd_ptr));
if (bfd_coff_force_symnames_in_strings (abfd))
{
- native->u.syment._n._n_n._n_offset =
+ native->u.syment._n._n_n._n_offset =
(*string_size_p + STRING_SIZE_SIZE);
native->u.syment._n._n_n._n_zeroes = 0;
*string_size_p += 6; /* strlen(".file") + 1 */
}
else
- strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN);
+ strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN);
BFD_ASSERT (! (native + 1)->is_sym);
auxent = &(native + 1)->u.auxent;
{
symbol->name = "";
if (isym != NULL)
- memset (isym, 0, sizeof (*isym));
+ memset (isym, 0, sizeof (*isym));
return TRUE;
}
native = dummy;
else if (symbol->flags & BSF_DEBUGGING)
{
/* There isn't much point to writing out a debugging symbol
- unless we are prepared to convert it into COFF debugging
- format. So, we just ignore them. We must clobber the symbol
- name to keep it from being put in the string table. */
+ unless we are prepared to convert it into COFF debugging
+ format. So, we just ignore them. We must clobber the symbol
+ name to keep it from being put in the string table. */
symbol->name = "";
if (isym != NULL)
- memset (isym, 0, sizeof (*isym));
+ memset (isym, 0, sizeof (*isym));
return TRUE;
}
else
native->u.syment.n_value += output_section->vma;
/* Copy the any flags from the file header into the symbol.
- FIXME: Why? */
+ FIXME: Why? */
{
coff_symbol_type *c = coff_symbol_from (symbol);
if (c != (coff_symbol_type *) NULL)
else
{
/* We would normally not write anything here, but we'll write
- out 4 so that any stupid coff reader which tries to read the
- string table even when there isn't one won't croak. */
+ out 4 so that any stupid coff reader which tries to read the
+ string table even when there isn't one won't croak. */
unsigned int size = STRING_SIZE_SIZE;
bfd_byte buffer[STRING_SIZE_SIZE];
if (size < obj_raw_syment_count (abfd)
|| (bfd_get_file_size (abfd) > 0
&& size > bfd_get_file_size (abfd)))
-
+
{
_bfd_error_handler (_("%B: corrupt symbol count: %#Lx"),
abfd, obj_raw_syment_count (abfd));
bfd_set_error (bfd_error_bad_value);
return NULL;
}
-
+
strings = (char *) bfd_malloc (strsize + 1);
if (strings == NULL)
return NULL;
else
{
/* Ordinary short filename, put into memory anyway. The
- Microsoft PE tools sometimes store a filename in
- multiple AUX entries. */
+ Microsoft PE tools sometimes store a filename in
+ multiple AUX entries. */
if (internal_ptr->u.syment.n_numaux > 1
&& coff_data (abfd)->pe)
internal_ptr->u.syment._n._n_n._n_offset =
char *newstring;
/* Find the length of this string without walking into memory
- that isn't ours. */
+ that isn't ours. */
for (i = 0; i < 8; ++i)
if (internal_ptr->u.syment._n._n_name[i] == '\0')
break;
else if (!bfd_coff_symname_in_debug (abfd, &internal_ptr->u.syment))
{
/* Long name already. Point symbol at the string in the
- table. */
+ table. */
if (string_table == NULL)
{
string_table = _bfd_coff_read_string_table (abfd);
bfd_boolean
coff_find_nearest_line_with_names (bfd *abfd,
- asymbol **symbols,
- asection *section,
- bfd_vma offset,
- const char **filename_ptr,
- const char **functionname_ptr,
- unsigned int *line_ptr,
- const struct dwarf_debug_section *debug_sections)
+ asymbol **symbols,
+ asection *section,
+ bfd_vma offset,
+ const char **filename_ptr,
+ const char **functionname_ptr,
+ unsigned int *line_ptr,
+ const struct dwarf_debug_section *debug_sections)
{
bfd_boolean found;
unsigned int i;
file_addr += coff_section_from_bfd_index (abfd,
p2->u.syment.n_scnum)->vma;
/* We use <= MAXDIFF here so that if we get a zero length
- file, we actually use the next file entry. */
+ file, we actually use the next file entry. */
if (p2 < pend
&& offset + sec_vma >= file_addr
&& offset + sec_vma - file_addr <= maxdiff)
if (discriminator_ptr)
*discriminator_ptr = 0;
return coff_find_nearest_line_with_names (abfd, symbols, section, offset,
- filename_ptr, functionname_ptr,
- line_ptr, dwarf_debug_sections);
+ filename_ptr, functionname_ptr,
+ line_ptr, dwarf_debug_sections);
}
bfd_boolean
/* Change the class of a coff symbol held by BFD. */
bfd_boolean
-bfd_coff_set_symbol_class (bfd * abfd,
- asymbol * symbol,
- unsigned int symbol_class)
+bfd_coff_set_symbol_class (bfd * abfd,
+ asymbol * symbol,
+ unsigned int symbol_class)
{
coff_symbol_type * csym;
if (h != NULL)
{
switch (h->root.type)
- {
- case bfd_link_hash_defined:
- case bfd_link_hash_defweak:
- return h->root.u.def.section;
+ {
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ return h->root.u.def.section;
- case bfd_link_hash_common:
- return h->root.u.c.p->section;
+ case bfd_link_hash_common:
+ return h->root.u.c.p->section;
case bfd_link_hash_undefweak:
if (h->symbol_class == C_NT_WEAK && h->numaux == 1)
break;
case bfd_link_hash_undefined:
- default:
- break;
- }
+ default:
+ break;
+ }
return NULL;
}
struct coff_reloc_cookie cookie;
if (!init_reloc_cookie_for_section (&cookie, info, sec))
- ret = FALSE;
+ ret = FALSE;
else
- {
- for (; cookie.rel < cookie.relend; cookie.rel++)
- {
+ {
+ for (; cookie.rel < cookie.relend; cookie.rel++)
+ {
if (!_bfd_coff_gc_mark_reloc (info, sec, gc_mark_hook, &cookie))
{
ret = FALSE;
break;
}
}
- fini_reloc_cookie_for_section (&cookie, sec);
- }
+ fini_reloc_cookie_for_section (&cookie, sec);
+ }
}
return ret;
for (o = sub->sections; o != NULL; o = o->next)
{
/* Keep debug and special sections. */
- if ((o->flags & (SEC_DEBUGGING | SEC_LINKER_CREATED)) != 0
+ if ((o->flags & (SEC_DEBUGGING | SEC_LINKER_CREATED)) != 0
|| (o->flags & (SEC_ALLOC | SEC_LOAD | SEC_RELOC)) == 0)
o->gc_mark = 1;
- else if (CONST_STRNEQ (o->name, ".idata")
+ else if (CONST_STRNEQ (o->name, ".idata")
|| CONST_STRNEQ (o->name, ".pdata")
|| CONST_STRNEQ (o->name, ".xdata")
|| CONST_STRNEQ (o->name, ".rsrc"))
asection *o;
if (bfd_get_flavour (sub) != bfd_target_coff_flavour)
- continue;
+ continue;
for (o = sub->sections; o != NULL; o = o->next)
- {
+ {
if (((o->flags & (SEC_EXCLUDE | SEC_KEEP)) == SEC_KEEP
|| CONST_STRNEQ (o->name, ".vectors")
|| CONST_STRNEQ (o->name, ".ctors")
if (!_bfd_coff_gc_mark (info, o, _bfd_coff_gc_mark_hook))
return FALSE;
}
- }
+ }
}
/* Allow the backend to mark additional target specific sections. */
goto error_return;
/* We must copy the name into memory if we got it from the
- syment itself, rather than the string table. */
+ syment itself, rather than the string table. */
copy = default_copy;
if (sym._n._n_n._n_zeroes != 0
|| sym._n._n_n._n_offset == 0)
addit = TRUE;
/* In the PE format, section symbols actually refer to the
- start of the output section. We handle them specially
- here. */
+ start of the output section. We handle them specially
+ here. */
if (obj_pe (abfd) && (flags & BSF_SECTION_SYM) != 0)
{
*sym_hash = coff_link_hash_lookup (coff_hash_table (info),
COFF_LINK_HASH_PE_SECTION_SYMBOL;
/* Limit the alignment of a common symbol to the possible
- alignment of a section. There is no point to permitting
- a higher alignment for a common symbol: we can not
- guarantee it, and it may cause us to allocate extra space
- in the common section. */
+ alignment of a section. There is no point to permitting
+ a higher alignment for a common symbol: we can not
+ guarantee it, and it may cause us to allocate extra space
+ in the common section. */
if (section == bfd_com_section_ptr
&& (*sym_hash)->root.type == bfd_link_hash_common
&& ((*sym_hash)->root.u.c.p->alignment_power
if (bfd_get_flavour (info->output_bfd) == bfd_get_flavour (abfd))
{
/* If we don't have any symbol information currently in
- the hash table, or if we are looking at a symbol
- definition, then update the symbol class and type in
- the hash table. */
- if (((*sym_hash)->symbol_class == C_NULL
- && (*sym_hash)->type == T_NULL)
- || sym.n_scnum != 0
- || (sym.n_value != 0
- && (*sym_hash)->root.type != bfd_link_hash_defined
- && (*sym_hash)->root.type != bfd_link_hash_defweak))
- {
- (*sym_hash)->symbol_class = sym.n_sclass;
- if (sym.n_type != T_NULL)
- {
- /* We want to warn if the type changed, but not
- if it changed from an unspecified type.
- Testing the whole type byte may work, but the
- change from (e.g.) a function of unspecified
- type to function of known type also wants to
- skip the warning. */
- if ((*sym_hash)->type != T_NULL
- && (*sym_hash)->type != sym.n_type
- && !(DTYPE ((*sym_hash)->type) == DTYPE (sym.n_type)
- && (BTYPE ((*sym_hash)->type) == T_NULL
- || BTYPE (sym.n_type) == T_NULL)))
+ the hash table, or if we are looking at a symbol
+ definition, then update the symbol class and type in
+ the hash table. */
+ if (((*sym_hash)->symbol_class == C_NULL
+ && (*sym_hash)->type == T_NULL)
+ || sym.n_scnum != 0
+ || (sym.n_value != 0
+ && (*sym_hash)->root.type != bfd_link_hash_defined
+ && (*sym_hash)->root.type != bfd_link_hash_defweak))
+ {
+ (*sym_hash)->symbol_class = sym.n_sclass;
+ if (sym.n_type != T_NULL)
+ {
+ /* We want to warn if the type changed, but not
+ if it changed from an unspecified type.
+ Testing the whole type byte may work, but the
+ change from (e.g.) a function of unspecified
+ type to function of known type also wants to
+ skip the warning. */
+ if ((*sym_hash)->type != T_NULL
+ && (*sym_hash)->type != sym.n_type
+ && !(DTYPE ((*sym_hash)->type) == DTYPE (sym.n_type)
+ && (BTYPE ((*sym_hash)->type) == T_NULL
+ || BTYPE (sym.n_type) == T_NULL)))
_bfd_error_handler
/* xgettext: c-format */
(_("Warning: type of symbol `%s' changed"
" from %d to %d in %B"),
name, (*sym_hash)->type, sym.n_type, abfd);
- /* We don't want to change from a meaningful
- base type to a null one, but if we know
- nothing, take what little we might now know. */
- if (BTYPE (sym.n_type) != T_NULL
- || (*sym_hash)->type == T_NULL)
+ /* We don't want to change from a meaningful
+ base type to a null one, but if we know
+ nothing, take what little we might now know. */
+ if (BTYPE (sym.n_type) != T_NULL
+ || (*sym_hash)->type == T_NULL)
(*sym_hash)->type = sym.n_type;
- }
- (*sym_hash)->auxbfd = abfd;
+ }
+ (*sym_hash)->auxbfd = abfd;
if (sym.n_numaux != 0)
{
union internal_auxent *alloc;
&& (*sym_hash)->numaux != 0)
{
/* Some PE sections (such as .bss) have a zero size in
- the section header, but a non-zero size in the AUX
- record. Correct that here.
+ the section header, but a non-zero size in the AUX
+ record. Correct that here.
FIXME: This is not at all the right place to do this.
For example, it won't help objdump. This needs to be
section->size = (*sym_hash)->aux[0].x_scn.x_scnlen;
/* FIXME: We could test whether the section sizes
- matches the size in the aux entry, but apparently
- that sometimes fails unexpectedly. */
+ matches the size in the aux entry, but apparently
+ that sometimes fails unexpectedly. */
}
}
&& strlen (o->name) > SCNNMLEN)
{
/* This section has a long name which must go in the string
- table. This must correspond to the code in
- coff_write_object_contents which puts the string index
- into the s_name field of the section header. That is why
- we pass hash as FALSE. */
+ table. This must correspond to the code in
+ coff_write_object_contents which puts the string index
+ into the s_name field of the section header. That is why
+ we pass hash as FALSE. */
if (_bfd_stringtab_add (flaginfo.strtab, o->name, FALSE, FALSE)
== (bfd_size_type) -1)
goto error_return;
unsigned int i;
/* We use section_count + 1, rather than section_count, because
- the target_index fields are 1 based. */
+ the target_index fields are 1 based. */
amt = abfd->section_count + 1;
amt *= sizeof (struct coff_link_section_info);
flaginfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt);
if (o->reloc_count != 0)
{
/* We don't know the indices of global symbols until we have
- written out all the local symbols. For each section in
- the output file, we keep an array of pointers to hash
- table entries. Each entry in the array corresponds to a
- reloc. When we find a reloc against a global symbol, we
- set the corresponding entry in this array so that we can
- fix up the symbol index after we have written out all the
- local symbols.
+ written out all the local symbols. For each section in
+ the output file, we keep an array of pointers to hash
+ table entries. Each entry in the array corresponds to a
+ reloc. When we find a reloc against a global symbol, we
+ set the corresponding entry in this array so that we can
+ fix up the symbol index after we have written out all the
+ local symbols.
Because of this problem, we also keep the relocs in
memory until the end of the link. This wastes memory,
amt = o->reloc_count;
amt *= sizeof (struct internal_reloc);
flaginfo.section_info[o->target_index].relocs =
- (struct internal_reloc *) bfd_malloc (amt);
+ (struct internal_reloc *) bfd_malloc (amt);
amt = o->reloc_count;
amt *= sizeof (struct coff_link_hash_entry *);
flaginfo.section_info[o->target_index].rel_hashes =
- (struct coff_link_hash_entry **) bfd_malloc (amt);
+ (struct coff_link_hash_entry **) bfd_malloc (amt);
if (flaginfo.section_info[o->target_index].relocs == NULL
|| flaginfo.section_info[o->target_index].rel_hashes == NULL)
goto error_return;
}
/* Extract the flag indicating if this symbol is used by a
- relocation. */
+ relocation. */
if ((flaginfo->info->strip != strip_none
|| flaginfo->info->discard != discard_none)
&& bfd_link_relocatable (flaginfo->info))
case COFF_SYMBOL_LOCAL:
/* This is a local symbol. Skip it if we are discarding
- local symbols. */
+ local symbols. */
if (flaginfo->info->discard == discard_all && ! dont_skip_symbol)
skip = TRUE;
break;
#endif
/* If we stripping debugging symbols, and this is a debugging
- symbol, then skip it. FIXME: gas sets the section to N_ABS
- for some types of debugging symbols; I don't know if this is
- a bug or not. In any case, we handle it here. */
+ symbol, then skip it. FIXME: gas sets the section to N_ABS
+ for some types of debugging symbols; I don't know if this is
+ a bug or not. In any case, we handle it here. */
if (! skip
&& flaginfo->info->strip == strip_debugger
&& ! dont_skip_symbol
}
/* If this is an enum, struct, or union tag, see if we have
- already output an identical type. */
+ already output an identical type. */
if (! skip
&& !flaginfo->info->traditional_format
&& (isym.n_sclass == C_ENTAG
return FALSE;
/* Ignore fake names invented by compiler; treat them all as
- the same name. */
+ the same name. */
if (*name == '~' || *name == '.' || *name == '$'
|| (*name == bfd_get_symbol_leading_char (input_bfd)
&& (name[1] == '~' || name[1] == '.' || name[1] == '$')))
return FALSE;
/* Allocate memory to hold type information. If this turns
- out to be a duplicate, we pass this address to
- bfd_release. */
+ out to be a duplicate, we pass this address to
+ bfd_release. */
amt = sizeof (struct coff_debug_merge_type);
mt = (struct coff_debug_merge_type *) bfd_alloc (input_bfd, amt);
if (mt == NULL)
mt->type_class = isym.n_sclass;
/* Pick up the aux entry, which points to the end of the tag
- entries. */
+ entries. */
bfd_coff_swap_aux_in (input_bfd, (esym + isymesz),
isym.n_type, isym.n_sclass, 0, isym.n_numaux,
&aux);
amt = sizeof (struct coff_debug_merge_element);
*epp = (struct coff_debug_merge_element *)
- bfd_alloc (input_bfd, amt);
+ bfd_alloc (input_bfd, amt);
if (*epp == NULL)
return FALSE;
}
/* See if we already have a definition which matches this
- type. We always output the type if it has no elements,
- for simplicity. */
+ type. We always output the type if it has no elements,
+ for simplicity. */
if (mt->elements == NULL)
bfd_release (input_bfd, mt);
else
&& flaginfo->last_file.n_value != (bfd_vma) output_index)
{
/* We must correct the value of the last C_FILE
- entry. */
+ entry. */
flaginfo->last_file.n_value = output_index;
if ((bfd_size_type) flaginfo->last_file_index >= syment_base)
{
if (h == NULL)
{
/* This can happen if there were errors earlier in
- the link. */
+ the link. */
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
h = *sym_hash;
/* The m68k-motorola-sysv assembler will sometimes
- generate two symbols with the same name, but only one
- will have aux entries. */
+ generate two symbols with the same name, but only one
+ will have aux entries. */
BFD_ASSERT (isymp->n_numaux == 0
|| h->numaux == 0
|| h->numaux == isymp->n_numaux);
&& indx < obj_raw_syment_count (input_bfd))
{
/* We look forward through the symbol for
- the index of the next symbol we are going
- to include. I don't know if this is
- entirely right. */
+ the index of the next symbol we are going
+ to include. I don't know if this is
+ entirely right. */
while ((flaginfo->sym_indices[indx] < 0
|| ((bfd_size_type) flaginfo->sym_indices[indx]
< syment_base))
file_ptr pos;
/* We have already written out the last
- .bf aux entry. We need to write it
- out again. We borrow *outsym
- temporarily. FIXME: This case should
- be made faster. */
+ .bf aux entry. We need to write it
+ out again. We borrow *outsym
+ temporarily. FIXME: This case should
+ be made faster. */
bfd_coff_swap_aux_out (output_bfd,
&flaginfo->last_bf,
isymp->n_type,
else
{
/* The endndx field of this aux entry must
- be updated with the symbol number of the
- next .bf symbol. */
+ be updated with the symbol number of the
+ next .bf symbol. */
flaginfo->last_bf = *auxp;
flaginfo->last_bf_index = (((outsym - flaginfo->outsyms)
/ osymesz)
}
if (!skipping)
- {
+ {
bfd_coff_swap_lineno_out (output_bfd, &iline, oeline);
oeline += linesz;
}
}
/* Call processor specific code to relocate the section
- contents. */
+ contents. */
if (! bfd_coff_relocate_section (output_bfd, flaginfo->info,
input_bfd, o,
contents,
char buf[SYMNMLEN + 1];
/* This reloc is against a symbol we are
- stripping. This should have been handled
+ stripping. This should have been handled
by the 'dont_skip_symbol' code in the while
loop at the top of this function. */
is = flaginfo->internal_syms + irel->r_symndx;
auxp = h->aux + i;
/* Look for a section aux entry here using the same tests that
- coff_swap_aux_out uses. */
+ coff_swap_aux_out uses. */
if (i == 0
&& (isym.n_sclass == C_STAT
|| isym.n_sclass == C_HIDDEN)
auxp->x_scn.x_scnlen = sec->size;
/* For PE, an overflow on the final link reportedly does
- not matter. FIXME: Why not? */
+ not matter. FIXME: Why not? */
if (sec->reloc_count > 0xffff
&& (! obj_pe (output_bfd)
|| bfd_link_relocatable (flaginfo->info)))
}
loc = link_order->offset * bfd_octets_per_byte (output_bfd);
ok = bfd_set_section_contents (output_bfd, output_section, buf,
- loc, size);
+ loc, size);
free (buf);
if (! ok)
return FALSE;
if (link_order->type == bfd_section_reloc_link_order)
{
/* We need to somehow locate a symbol in the right section. The
- symbol must either have a value of zero, or we must adjust
- the addend by the value of the symbol. FIXME: Write this
- when we need it. The old linker couldn't handle this anyhow. */
+ symbol must either have a value of zero, or we must adjust
+ the addend by the value of the symbol. FIXME: Write this
+ when we need it. The old linker couldn't handle this anyhow. */
abort ();
*rel_hash_ptr = NULL;
irel->r_symndx = 0;
}
/* COFF treats common symbols in one of two ways. Either the
- size of the symbol is included in the section contents, or it
- is not. We assume that the size is not included, and force
- the rtype_to_howto function to adjust the addend as needed. */
+ size of the symbol is included in the section contents, or it
+ is not. We assume that the size is not included, and force
+ the rtype_to_howto function to adjust the addend as needed. */
if (sym != NULL && sym->n_scnum != 0)
addend = - sym->n_value;
else
return FALSE;
/* If we are doing a relocatable link, then we can just ignore
- a PC relative reloc that is pcrel_offset. It will already
- have the correct value. If this is not a relocatable link,
- then we should ignore the symbol value. */
+ a PC relative reloc that is pcrel_offset. It will already
+ have the correct value. If this is not a relocatable link,
+ then we should ignore the symbol value. */
if (howto->pc_relative && howto->pcrel_offset)
{
if (bfd_link_relocatable (info))
/* PR 19623: Relocations against symbols in
the absolute sections should ignored. */
- if (bfd_is_abs_section (sec))
+ if (bfd_is_abs_section (sec))
continue;
- val = (sec->output_section->vma
+ val = (sec->output_section->vma
+ sec->output_offset
+ sym->n_value);
if (! obj_pe (input_bfd))
else if (h->root.type == bfd_link_hash_undefweak)
{
- if (h->symbol_class == C_NT_WEAK && h->numaux == 1)
+ if (h->symbol_class == C_NT_WEAK && h->numaux == 1)
{
/* See _Microsoft Portable Executable and Common Object
- File Format Specification_, section 5.5.3.
+ File Format Specification_, section 5.5.3.
Note that weak symbols without aux records are a GNU
extension.
FIXME: All weak externals are treated as having
}
}
else
- /* This is a GNU extension. */
+ /* This is a GNU extension. */
val = 0;
}
in->x_scn.x_nlinno = GET_SCN_NLINNO (abfd, ext);
/* PE defines some extra fields; we zero them out for
- safety. */
+ safety. */
in->x_scn.x_checksum = 0;
in->x_scn.x_associated = 0;
in->x_scn.x_comdat = 0;
if (rc != Z_OK)
break;
strm.next_out = ((Bytef*) uncompressed_buffer
- + (uncompressed_size - strm.avail_out));
+ + (uncompressed_size - strm.avail_out));
rc = inflate (&strm, Z_FINISH);
if (rc != Z_STREAM_END)
break;
if (bfd_get_section_contents (abfd, sec, header, 0, header_size))
{
if (compression_header_size == 0)
- /* In this case, it should be "ZLIB" followed by the uncompressed
+ /* In this case, it should be "ZLIB" followed by the uncompressed
section size, 8 bytes in big-endian order. */
compressed = CONST_STRNEQ ((char*) header , "ZLIB");
else
/*
FUNCTION
- generic_core_file_matches_executable_p
+ generic_core_file_matches_executable_p
SYNOPSIS
- bfd_boolean generic_core_file_matches_executable_p
- (bfd *core_bfd, bfd *exec_bfd);
+ bfd_boolean generic_core_file_matches_executable_p
+ (bfd *core_bfd, bfd *exec_bfd);
DESCRIPTION
- Return TRUE if the core file attached to @var{core_bfd}
- was generated by a run of the executable file attached
- to @var{exec_bfd}. The match is based on executable
- basenames only.
-
- Note: When not able to determine the core file failing
- command or the executable name, we still return TRUE even
- though we're not sure that core file and executable match.
- This is to avoid generating a false warning in situations
- where we really don't know whether they match or not.
+ Return TRUE if the core file attached to @var{core_bfd}
+ was generated by a run of the executable file attached
+ to @var{exec_bfd}. The match is based on executable
+ basenames only.
+
+ Note: When not able to determine the core file failing
+ command or the executable name, we still return TRUE even
+ though we're not sure that core file and executable match.
+ This is to avoid generating a false warning in situations
+ where we really don't know whether they match or not.
*/
bfd_boolean
PRINT, \
3, \
DEFAULT, \
- bfd_default_compatible, \
+ bfd_default_compatible, \
bfd_default_scan, \
bfd_arch_default_fill, \
NEXT, \
unsigned long namesz;
unsigned long descsz;
unsigned long type;
- char * descr;
+ char * descr;
if (buffer_size < offsetof (arm_Note, name))
return FALSE;
return TRUE;
}
-#define NOTE_ARCH_STRING "arch: "
+#define NOTE_ARCH_STRING "arch: "
bfd_boolean
bfd_arm_update_notes (bfd *abfd, const char *note_section)
{
- asection * arm_arch_section;
- bfd_size_type buffer_size;
- bfd_byte * buffer;
- char * arch_string;
- char * expected;
+ asection * arm_arch_section;
+ bfd_size_type buffer_size;
+ bfd_byte * buffer;
+ char * arch_string;
+ char * expected;
/* Look for a note section. If one is present check the architecture
string encoded in it, and set it to the current architecture if it is
unsigned int
bfd_arm_get_mach_from_notes (bfd *abfd, const char *note_section)
{
- asection * arm_arch_section;
- bfd_size_type buffer_size;
- bfd_byte * buffer;
- char * arch_string;
- int i;
+ asection * arm_arch_section;
+ bfd_size_type buffer_size;
+ bfd_byte * buffer;
+ char * arch_string;
+ int i;
/* Look for a note section. If one is present check the architecture
string encoded in it, and set it to the current architecture if it is
{
/* Special case for ATmega[16]03 (avr:3) and ATmega83 (avr:4). */
if ((a->mach == bfd_mach_avr3 && b->mach == bfd_mach_avr4)
- || (a->mach == bfd_mach_avr4 && b->mach == bfd_mach_avr3))
+ || (a->mach == bfd_mach_avr4 && b->mach == bfd_mach_avr3))
return NULL;
if (a->mach <= b->mach)
const bfd_arch_info_type bfd_bfin_arch =
{
- 16, /* Bits in a word. */
- 32, /* Bits in an address. */
- 8, /* Bits in a byte. */
+ 16, /* Bits in a word. */
+ 32, /* Bits in an address. */
+ 8, /* Bits in a byte. */
bfd_arch_bfin,
- 0, /* Only one machine. */
- "bfin", /* Arch name. */
- "bfin", /* Arch printable name. */
- 4, /* Section align power. */
- TRUE, /* The one and only. */
+ 0, /* Only one machine. */
+ "bfin", /* Arch name. */
+ "bfin", /* Arch printable name. */
+ 4, /* Section align power. */
+ TRUE, /* The one and only. */
bfd_default_compatible,
bfd_default_scan,
bfd_arch_default_fill,
const bfd_arch_info_type bfd_cr16_arch =
{
- 16, /* 16 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
+ 16, /* 16 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_cr16, /* enum bfd_architecture arch. */
bfd_mach_cr16,
- "cr16", /* Arch name. */
- "cr16", /* Printable name. */
- 1, /* Unsigned int section alignment power. */
- TRUE, /* The one and only. */
+ "cr16", /* Arch name. */
+ "cr16", /* Printable name. */
+ 1, /* Unsigned int section alignment power. */
+ TRUE, /* The one and only. */
bfd_default_compatible,
bfd_default_scan,
bfd_arch_default_fill,
"cr16c",
"cr16c",
1,
- TRUE, /* The one and only. */
+ TRUE, /* The one and only. */
bfd_default_compatible,
bfd_default_scan,
bfd_arch_default_fill,
8, /* 8 bits in a byte. */
bfd_arch_crx, /* enum bfd_architecture arch. */
bfd_mach_crx,
- "crx", /* Arch name. */
- "crx", /* Printable name. */
- 1, /* Unsigned int section alignment power. */
- TRUE, /* The one and only. */
+ "crx", /* Arch name. */
+ "crx", /* Printable name. */
+ 1, /* Unsigned int section alignment power. */
+ TRUE, /* The one and only. */
bfd_default_compatible,
bfd_default_scan,
bfd_arch_default_fill,
bfd_mach_d10v_ts3,
"d10v",
"d10v:ts3",
- 4, /* Section alignment power. */
+ 4, /* Section alignment power. */
FALSE,
bfd_default_compatible,
bfd_default_scan,
#define FRV_ARCH(MACHINE, NAME, DEFAULT, NEXT) \
{ \
- 32, /* 32 bits in a word */ \
- 32, /* 32 bits in an address */ \
- 8, /* 8 bits in a byte */ \
+ 32, /* 32 bits in a word */ \
+ 32, /* 32 bits in an address */ \
+ 8, /* 8 bits in a byte */ \
bfd_arch_frv, /* architecture */ \
MACHINE, /* which machine */ \
"frv", /* architecture name */ \
static const bfd_arch_info_type arch_info_struct[] =
{
{
- 32, /* 32 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
- bfd_arch_ft32, /* enum bfd_architecture arch. */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+ bfd_arch_ft32, /* enum bfd_architecture arch. */
bfd_mach_ft32,
- "ft32", /* Arch name. */
- "ft32", /* Printable name. */
- 2, /* Unsigned int section alignment power. */
- FALSE, /* The one and only. */
+ "ft32", /* Arch name. */
+ "ft32", /* Printable name. */
+ 2, /* Unsigned int section alignment power. */
+ FALSE, /* The one and only. */
bfd_default_compatible,
bfd_default_scan,
bfd_arch_default_fill,
&arch_info_struct[1],
},
{
- 32, /* 32 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
- bfd_arch_ft32, /* enum bfd_architecture arch. */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+ bfd_arch_ft32, /* enum bfd_architecture arch. */
bfd_mach_ft32b,
- "ft32b", /* Arch name. */
- "ft32b", /* Printable name. */
- 2, /* Unsigned int section alignment power. */
- FALSE, /* The one and only. */
+ "ft32b", /* Arch name. */
+ "ft32b", /* Printable name. */
+ 2, /* Unsigned int section alignment power. */
+ FALSE, /* The one and only. */
bfd_default_compatible,
bfd_default_scan,
bfd_arch_default_fill,
const bfd_arch_info_type bfd_ft32_arch =
{
- 32, /* 32 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
- bfd_arch_ft32, /* enum bfd_architecture arch. */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+ bfd_arch_ft32, /* enum bfd_architecture arch. */
bfd_mach_ft32,
- "ft32", /* Arch name. */
- "ft32", /* Printable name. */
- 2, /* Unsigned int section alignment power. */
- TRUE, /* The one and only. */
+ "ft32", /* Arch name. */
+ "ft32", /* Printable name. */
+ 2, /* Unsigned int section alignment power. */
+ TRUE, /* The one and only. */
bfd_default_compatible,
bfd_default_scan,
bfd_arch_default_fill,
{
/* Hack alert: old old machines are really 16 and 24 bit arch ... */
{
- 32, /* 32 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_i370,
- 360, /* For the 360. */
+ 360, /* For the 360. */
"i370",
"i370:360",
3,
- FALSE, /* Not the default. */
+ FALSE, /* Not the default. */
bfd_default_compatible,
bfd_default_scan,
bfd_arch_default_fill,
&arch_info_struct[1]
},
{
- 32, /* 32 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_i370,
- 370, /* For the 370. */
+ 370, /* For the 370. */
"i370",
"i370:370",
3,
- FALSE, /* Not the default. */
+ FALSE, /* Not the default. */
bfd_default_compatible,
bfd_default_scan,
bfd_arch_default_fill,
const bfd_arch_info_type bfd_i370_arch =
{
- 32, /* 32 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_i370,
0, /* For the 360/370 common architecture. */
"i370",
"i370:common",
3,
- TRUE, /* The default. */
+ TRUE, /* The default. */
bfd_default_compatible,
bfd_default_scan,
bfd_arch_default_fill,
#define ERROR 0
#define CORE bfd_mach_i960_core /*1*/
-#define KA bfd_mach_i960_ka_sa /*2*/
-#define KB bfd_mach_i960_kb_sb /*3*/
-#define MC bfd_mach_i960_mc /*4*/
-#define XA bfd_mach_i960_xa /*5*/
-#define CA bfd_mach_i960_ca /*6*/
+#define KA bfd_mach_i960_ka_sa /*2*/
+#define KB bfd_mach_i960_kb_sb /*3*/
+#define MC bfd_mach_i960_mc /*4*/
+#define XA bfd_mach_i960_xa /*5*/
+#define CA bfd_mach_i960_ca /*6*/
#define JX bfd_mach_i960_jx /*7*/
#define HX bfd_mach_i960_hx /*8*/
#define MAX_ARCH ((int)HX)
{ ERROR, CORE, KA, KB, MC, XA, CA, JX, HX },
{ CORE, CORE, KA, KB, MC, XA, CA, JX, HX },
{ KA, KA, KA, KB, MC, XA, ERROR, ERROR, ERROR},
- { KB, KB, KB, KB, MC, XA, ERROR, ERROR, ERROR},
+ { KB, KB, KB, KB, MC, XA, ERROR, ERROR, ERROR},
{ MC, MC, MC, MC, MC, XA, ERROR, ERROR, ERROR},
{ XA, XA, XA, XA, XA, XA, ERROR, ERROR, ERROR},
{ CA, CA, ERROR, ERROR, ERROR, ERROR, CA, ERROR, ERROR},
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
{
new_insn |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1))
- << self->field[i].shift);
+ << self->field[i].shift);
value >>= self->field[i].bits;
}
if (value)
for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i)
{
new_insn |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1))
- << self->field[i].shift);
+ << self->field[i].shift);
sign_bit = (svalue >> (self->field[i].bits - 1)) & 1;
svalue >>= self->field[i].bits;
}
"a branch target" },
{ REL, ins_imms4, ext_imms4, 0, {{20, 13}, { 1, 36}}, 0, /* TGT25c */
"a branch target" },
- { REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* TGT64 */
+ { REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* TGT64 */
"a branch target" },
{ ABS, ins_const, ext_const, 0, {{0, 0}}, 0, /* LDXMOV */
"ip2k", /* Architecture name. */
"ip2022", /* Machine name. */
1, /* Section align power. */
- FALSE, /* The default ? */
+ FALSE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
bfd_arch_default_fill, /* Default fill. */
const bfd_arch_info_type bfd_lm32_arch =
{
- 32, /* Bits in word. */
- 32, /* Bits in address. */
- 8, /* Bits in byte. */
- bfd_arch_lm32, /* Enum bfd_architecture. */
- bfd_mach_lm32, /* Machine number. */
- "lm32", /* Architecture name. */
- "lm32", /* Printable name. */
- 4, /* Alignment. */
- TRUE, /* Is this the default machine for the target. */
- bfd_default_compatible, /* Function callback to test if two files have compatible machines. */
+ 32, /* Bits in word. */
+ 32, /* Bits in address. */
+ 8, /* Bits in byte. */
+ bfd_arch_lm32, /* Enum bfd_architecture. */
+ bfd_mach_lm32, /* Machine number. */
+ "lm32", /* Architecture name. */
+ "lm32", /* Printable name. */
+ 4, /* Alignment. */
+ TRUE, /* Is this the default machine for the target. */
+ bfd_default_compatible, /* Function callback to test if two files have compatible machines. */
bfd_default_scan,
bfd_arch_default_fill,
- NULL /* Next. */
+ NULL /* Next. */
};
-
bfd_default_compatible, bfd_default_scan, bfd_arch_default_fill, next }
#define M32R2_NEXT & arch_info_struct [1]
-#define NEXT & arch_info_struct [0]
+#define NEXT & arch_info_struct [0]
static const bfd_arch_info_type arch_info_struct[] =
{
const bfd_arch_info_type bfd_mcore_arch =
{
- 32, /* 32 bits in a word */
- 32, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
- bfd_arch_mcore, /* Architecture */
- 0, /* Machine number - 0 for now */
- "MCore", /* Architecture name */
- "MCore", /* Printable name */
- 3, /* Section align power */
- TRUE, /* Is this the default architecture ? */
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
+ bfd_arch_mcore, /* Architecture */
+ 0, /* Machine number - 0 for now */
+ "MCore", /* Architecture name */
+ "MCore", /* Printable name */
+ 3, /* Section align power */
+ TRUE, /* Is this the default architecture ? */
bfd_default_compatible, /* Architecture comparison function */
- bfd_default_scan, /* String to architecture conversion */
+ bfd_default_scan, /* String to architecture conversion */
bfd_arch_default_fill, /* Default fill. */
- NULL /* Next in list */
+ NULL /* Next in list */
};
const bfd_arch_info_type bfd_microblaze_arch =
{
- 32, /* 32 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
- bfd_arch_microblaze, /* Architecture. */
- 0, /* Machine number - 0 for now. */
- "microblaze", /* Architecture name. */
- "MicroBlaze", /* Printable name. */
- 3, /* Section align power. */
- TRUE, /* Is this the default architecture ? */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
+ bfd_arch_microblaze, /* Architecture. */
+ 0, /* Machine number - 0 for now. */
+ "microblaze", /* Architecture name. */
+ "MicroBlaze", /* Printable name. */
+ 3, /* Section align power. */
+ TRUE, /* Is this the default architecture ? */
bfd_default_compatible, /* Architecture comparison function. */
- bfd_default_scan, /* String to architecture conversion. */
+ bfd_default_scan, /* String to architecture conversion. */
bfd_arch_default_fill, /* Default fill. */
- NULL /* Next in list. */
+ NULL /* Next in list. */
};
static const bfd_arch_info_type arch_info_struct[] =
{
- N (32, 32, bfd_mach_mips3000, "mips:3000", FALSE, NN(I_mips3000)),
- N (32, 32, bfd_mach_mips3900, "mips:3900", FALSE, NN(I_mips3900)),
- N (64, 64, bfd_mach_mips4000, "mips:4000", FALSE, NN(I_mips4000)),
- N (32, 32, bfd_mach_mips4010, "mips:4010", FALSE, NN(I_mips4010)),
- N (64, 64, bfd_mach_mips4100, "mips:4100", FALSE, NN(I_mips4100)),
- N (64, 64, bfd_mach_mips4111, "mips:4111", FALSE, NN(I_mips4111)),
- N (64, 64, bfd_mach_mips4120, "mips:4120", FALSE, NN(I_mips4120)),
- N (64, 64, bfd_mach_mips4300, "mips:4300", FALSE, NN(I_mips4300)),
- N (64, 64, bfd_mach_mips4400, "mips:4400", FALSE, NN(I_mips4400)),
- N (64, 64, bfd_mach_mips4600, "mips:4600", FALSE, NN(I_mips4600)),
- N (64, 64, bfd_mach_mips4650, "mips:4650", FALSE, NN(I_mips4650)),
- N (64, 64, bfd_mach_mips5000, "mips:5000", FALSE, NN(I_mips5000)),
- N (64, 64, bfd_mach_mips5400, "mips:5400", FALSE, NN(I_mips5400)),
- N (64, 64, bfd_mach_mips5500, "mips:5500", FALSE, NN(I_mips5500)),
- N (64, 32, bfd_mach_mips5900, "mips:5900", FALSE, NN(I_mips5900)),
- N (32, 32, bfd_mach_mips6000, "mips:6000", FALSE, NN(I_mips6000)),
- N (64, 64, bfd_mach_mips7000, "mips:7000", FALSE, NN(I_mips7000)),
- N (64, 64, bfd_mach_mips8000, "mips:8000", FALSE, NN(I_mips8000)),
- N (64, 64, bfd_mach_mips9000, "mips:9000", FALSE, NN(I_mips9000)),
- N (64, 64, bfd_mach_mips10000,"mips:10000", FALSE, NN(I_mips10000)),
- N (64, 64, bfd_mach_mips12000,"mips:12000", FALSE, NN(I_mips12000)),
- N (64, 64, bfd_mach_mips14000,"mips:14000", FALSE, NN(I_mips14000)),
- N (64, 64, bfd_mach_mips16000,"mips:16000", FALSE, NN(I_mips16000)),
- N (64, 64, bfd_mach_mips16, "mips:16", FALSE, NN(I_mips16)),
- N (64, 64, bfd_mach_mips5, "mips:mips5", FALSE, NN(I_mips5)),
- N (32, 32, bfd_mach_mipsisa32, "mips:isa32", FALSE, NN(I_mipsisa32)),
+ N (32, 32, bfd_mach_mips3000, "mips:3000", FALSE, NN(I_mips3000)),
+ N (32, 32, bfd_mach_mips3900, "mips:3900", FALSE, NN(I_mips3900)),
+ N (64, 64, bfd_mach_mips4000, "mips:4000", FALSE, NN(I_mips4000)),
+ N (32, 32, bfd_mach_mips4010, "mips:4010", FALSE, NN(I_mips4010)),
+ N (64, 64, bfd_mach_mips4100, "mips:4100", FALSE, NN(I_mips4100)),
+ N (64, 64, bfd_mach_mips4111, "mips:4111", FALSE, NN(I_mips4111)),
+ N (64, 64, bfd_mach_mips4120, "mips:4120", FALSE, NN(I_mips4120)),
+ N (64, 64, bfd_mach_mips4300, "mips:4300", FALSE, NN(I_mips4300)),
+ N (64, 64, bfd_mach_mips4400, "mips:4400", FALSE, NN(I_mips4400)),
+ N (64, 64, bfd_mach_mips4600, "mips:4600", FALSE, NN(I_mips4600)),
+ N (64, 64, bfd_mach_mips4650, "mips:4650", FALSE, NN(I_mips4650)),
+ N (64, 64, bfd_mach_mips5000, "mips:5000", FALSE, NN(I_mips5000)),
+ N (64, 64, bfd_mach_mips5400, "mips:5400", FALSE, NN(I_mips5400)),
+ N (64, 64, bfd_mach_mips5500, "mips:5500", FALSE, NN(I_mips5500)),
+ N (64, 32, bfd_mach_mips5900, "mips:5900", FALSE, NN(I_mips5900)),
+ N (32, 32, bfd_mach_mips6000, "mips:6000", FALSE, NN(I_mips6000)),
+ N (64, 64, bfd_mach_mips7000, "mips:7000", FALSE, NN(I_mips7000)),
+ N (64, 64, bfd_mach_mips8000, "mips:8000", FALSE, NN(I_mips8000)),
+ N (64, 64, bfd_mach_mips9000, "mips:9000", FALSE, NN(I_mips9000)),
+ N (64, 64, bfd_mach_mips10000,"mips:10000", FALSE, NN(I_mips10000)),
+ N (64, 64, bfd_mach_mips12000,"mips:12000", FALSE, NN(I_mips12000)),
+ N (64, 64, bfd_mach_mips14000,"mips:14000", FALSE, NN(I_mips14000)),
+ N (64, 64, bfd_mach_mips16000,"mips:16000", FALSE, NN(I_mips16000)),
+ N (64, 64, bfd_mach_mips16, "mips:16", FALSE, NN(I_mips16)),
+ N (64, 64, bfd_mach_mips5, "mips:mips5", FALSE, NN(I_mips5)),
+ N (32, 32, bfd_mach_mipsisa32, "mips:isa32", FALSE, NN(I_mipsisa32)),
N (32, 32, bfd_mach_mipsisa32r2,"mips:isa32r2", FALSE, NN(I_mipsisa32r2)),
N (32, 32, bfd_mach_mipsisa32r3,"mips:isa32r3", FALSE, NN(I_mipsisa32r3)),
N (32, 32, bfd_mach_mipsisa32r5,"mips:isa32r5", FALSE, NN(I_mipsisa32r5)),
N (32, 32, bfd_mach_mipsisa32r6,"mips:isa32r6", FALSE, NN(I_mipsisa32r6)),
- N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)),
+ N (64, 64, bfd_mach_mipsisa64, "mips:isa64", FALSE, NN(I_mipsisa64)),
N (64, 64, bfd_mach_mipsisa64r2,"mips:isa64r2", FALSE, NN(I_mipsisa64r2)),
N (64, 64, bfd_mach_mipsisa64r3,"mips:isa64r3", FALSE, NN(I_mipsisa64r3)),
N (64, 64, bfd_mach_mipsisa64r5,"mips:isa64r5", FALSE, NN(I_mipsisa64r5)),
N (64, 64, bfd_mach_mipsisa64r6,"mips:isa64r6", FALSE, NN(I_mipsisa64r6)),
- N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, NN(I_sb1)),
- N (64, 64, bfd_mach_mips_loongson_2e, "mips:loongson_2e", FALSE, NN(I_loongson_2e)),
- N (64, 64, bfd_mach_mips_loongson_2f, "mips:loongson_2f", FALSE, NN(I_loongson_2f)),
- N (64, 64, bfd_mach_mips_loongson_3a, "mips:loongson_3a", FALSE, NN(I_loongson_3a)),
+ N (64, 64, bfd_mach_mips_sb1, "mips:sb1", FALSE, NN(I_sb1)),
+ N (64, 64, bfd_mach_mips_loongson_2e, "mips:loongson_2e", FALSE, NN(I_loongson_2e)),
+ N (64, 64, bfd_mach_mips_loongson_2f, "mips:loongson_2f", FALSE, NN(I_loongson_2f)),
+ N (64, 64, bfd_mach_mips_loongson_3a, "mips:loongson_3a", FALSE, NN(I_loongson_3a)),
N (64, 64, bfd_mach_mips_octeon,"mips:octeon", FALSE, NN(I_mipsocteon)),
N (64, 64, bfd_mach_mips_octeonp,"mips:octeon+", FALSE, NN(I_mipsocteonp)),
N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2", FALSE, NN(I_mipsocteon2)),
N (64, 64, bfd_mach_mips_octeon3, "mips:octeon3", FALSE, NN(I_mipsocteon3)),
- N (64, 64, bfd_mach_mips_xlr, "mips:xlr", FALSE, NN(I_xlr)),
+ N (64, 64, bfd_mach_mips_xlr, "mips:xlr", FALSE, NN(I_xlr)),
N (32, 32, bfd_mach_mips_interaptiv_mr2, "mips:interaptiv-mr2", FALSE,
NN(I_interaptiv_mr2)),
N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,0)
const bfd_arch_info_type bfd_moxie_arch =
{
- 32, /* 32 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_moxie, /* enum bfd_architecture arch. */
bfd_mach_moxie,
- "moxie", /* Arch name. */
- "moxie", /* Printable name. */
- 2, /* Unsigned int section alignment power. */
- TRUE, /* The one and only. */
+ "moxie", /* Arch name. */
+ "moxie", /* Printable name. */
+ 2, /* Unsigned int section alignment power. */
+ TRUE, /* The one and only. */
bfd_default_compatible,
bfd_default_scan,
bfd_arch_default_fill,
"mt", /* Architecture name. */
"ms1-003", /* Printable name. */
1, /* Section align power. */
- FALSE, /* The default ? */
+ FALSE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
bfd_arch_default_fill, /* Default fill. */
- &arch_info_struct[1] /* Next in list. */
+ &arch_info_struct[1] /* Next in list. */
},
{
32, /* Bits per word - not really true. */
32, /* Bits per address. */
8, /* Bits per byte. */
bfd_arch_mt, /* Architecture. */
- bfd_mach_ms2, /* Machine. */
+ bfd_mach_ms2, /* Machine. */
"mt", /* Architecture name. */
"ms2", /* Printable name. */
1, /* Section align power. */
- FALSE, /* The default ? */
+ FALSE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
bfd_arch_default_fill, /* Default fill. */
"mt", /* Architecture name. */
"ms1", /* Printable name. */
1, /* Section align power. */
- TRUE, /* The default ? */
+ TRUE, /* The default ? */
bfd_default_compatible, /* Architecture comparison fn. */
bfd_default_scan, /* String to architecture convert fn. */
bfd_arch_default_fill, /* Default fill. */
DEFAULT, \
nios2_compatible, \
bfd_default_scan, \
- bfd_arch_default_fill, \
+ bfd_arch_default_fill, \
NEXT \
}
R result
Do this:
- i i i i i o o o o o from bfd_get<size>
- and S S S S S to get the size offset we want
- + r r r r r r r r r r to get the final value to place
- and D D D D D to chop to right size
+ i i i i i o o o o o from bfd_get<size>
+ and S S S S S to get the size offset we want
+ + r r r r r r r r r r to get the final value to place
+ and D D D D D to chop to right size
-----------------------
A A A A A
And this:
- ... i i i i i o o o o o from bfd_get<size>
- and N N N N N get instruction
+ ... i i i i i o o o o o from bfd_get<size>
+ and N N N N N get instruction
-----------------------
... B B B B B
And then:
B B B B B
- or A A A A A
+ or A A A A A
-----------------------
- R R R R R R R R R R put into bfd_put<size>. */
+ R R R R R R R R R R put into bfd_put<size>. */
#define DOIT(x) \
x = ( (x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask))
const bfd_arch_info_type bfd_or1k_arch =
{
- 32, /* 32 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_or1k,
bfd_mach_or1k,
"or1k",
const bfd_arch_info_type bfd_or1knd_arch =
{
- 32, /* 32 bits in a word. */
- 32, /* 32 bits in an address. */
- 8, /* 8 bits in a byte. */
+ 32, /* 32 bits in a word. */
+ 32, /* 32 bits in an address. */
+ 8, /* 8 bits in a byte. */
bfd_arch_or1k,
bfd_mach_or1knd,
"or1knd",
&bfd_powerpc_archs[13]
},
{
- 32, /* 32 bits in a word */
- 32, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_powerpc,
bfd_mach_ppc_e500,
"powerpc",
&bfd_powerpc_archs[14]
},
{
- 32, /* 32 bits in a word */
- 32, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_powerpc,
bfd_mach_ppc_e500mc,
"powerpc",
&bfd_powerpc_archs[15]
},
{
- 64, /* 64 bits in a word */
- 64, /* 64 bits in an address */
- 8, /* 8 bits in a byte */
+ 64, /* 64 bits in a word */
+ 64, /* 64 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_powerpc,
bfd_mach_ppc_e500mc64,
"powerpc",
&bfd_powerpc_archs[16]
},
{
- 32, /* 32 bits in a word */
- 32, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_powerpc,
bfd_mach_ppc_860,
"powerpc",
&bfd_powerpc_archs[17]
},
{
- 32, /* 32 bits in a word */
- 32, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_powerpc,
bfd_mach_ppc_750,
"powerpc",
&bfd_powerpc_archs[18]
},
{
- 32, /* 32 bits in a word */
- 32, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
+ 32, /* 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_powerpc,
bfd_mach_ppc_titan,
"powerpc",
&bfd_powerpc_archs[19]
},
{
- 16, /* 16 or 32 bits in a word */
- 32, /* 32 bits in an address */
- 8, /* 8 bits in a byte */
+ 16, /* 16 or 32 bits in a word */
+ 32, /* 32 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_powerpc,
bfd_mach_ppc_vle,
"powerpc",
&bfd_powerpc_archs[20]
},
{
- 64, /* 64 bits in a word */
- 64, /* 64 bits in an address */
- 8, /* 8 bits in a byte */
+ 64, /* 64 bits in a word */
+ 64, /* 64 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_powerpc,
bfd_mach_ppc_e5500,
"powerpc",
&bfd_powerpc_archs[21]
},
{
- 64, /* 64 bits in a word */
- 64, /* 64 bits in an address */
- 8, /* 8 bits in a byte */
+ 64, /* 64 bits in a word */
+ 64, /* 64 bits in an address */
+ 8, /* 8 bits in a byte */
bfd_arch_powerpc,
bfd_mach_ppc_e6500,
"powerpc",
DEFAULT, \
bfd_default_compatible, \
bfd_default_scan, \
- bfd_arch_default_fill, \
+ bfd_arch_default_fill, \
NEXT \
}
#include "libbfd.h"
#include "../opcodes/sh-opc.h"
-#define SH_NEXT arch_info_struct + 0
-#define SH2_NEXT arch_info_struct + 1
-#define SH2E_NEXT arch_info_struct + 2
-#define SH_DSP_NEXT arch_info_struct + 3
-#define SH3_NEXT arch_info_struct + 4
-#define SH3_NOMMU_NEXT arch_info_struct + 5
-#define SH3_DSP_NEXT arch_info_struct + 6
-#define SH3E_NEXT arch_info_struct + 7
-#define SH4_NEXT arch_info_struct + 8
-#define SH4A_NEXT arch_info_struct + 9
-#define SH4AL_DSP_NEXT arch_info_struct + 10
-#define SH4_NOFPU_NEXT arch_info_struct + 11
-#define SH4_NOMMU_NOFPU_NEXT arch_info_struct + 12
-#define SH4A_NOFPU_NEXT arch_info_struct + 13
-#define SH2A_NEXT arch_info_struct + 14
-#define SH2A_NOFPU_NEXT arch_info_struct + 15
+#define SH_NEXT arch_info_struct + 0
+#define SH2_NEXT arch_info_struct + 1
+#define SH2E_NEXT arch_info_struct + 2
+#define SH_DSP_NEXT arch_info_struct + 3
+#define SH3_NEXT arch_info_struct + 4
+#define SH3_NOMMU_NEXT arch_info_struct + 5
+#define SH3_DSP_NEXT arch_info_struct + 6
+#define SH3E_NEXT arch_info_struct + 7
+#define SH4_NEXT arch_info_struct + 8
+#define SH4A_NEXT arch_info_struct + 9
+#define SH4AL_DSP_NEXT arch_info_struct + 10
+#define SH4_NOFPU_NEXT arch_info_struct + 11
+#define SH4_NOMMU_NOFPU_NEXT arch_info_struct + 12
+#define SH4A_NOFPU_NEXT arch_info_struct + 13
+#define SH2A_NEXT arch_info_struct + 14
+#define SH2A_NOFPU_NEXT arch_info_struct + 15
#define SH2A_NOFPU_OR_SH4_NOMMU_NOFPU_NEXT arch_info_struct + 16
-#define SH2A_NOFPU_OR_SH3_NOMMU_NEXT arch_info_struct + 17
-#define SH2A_OR_SH4_NEXT arch_info_struct + 18
-#define SH2A_OR_SH3E_NEXT arch_info_struct + 19
-#define SH64_NEXT NULL
+#define SH2A_NOFPU_OR_SH3_NOMMU_NEXT arch_info_struct + 17
+#define SH2A_OR_SH4_NEXT arch_info_struct + 18
+#define SH2A_OR_SH3E_NEXT arch_info_struct + 19
+#define SH64_NEXT NULL
static const bfd_arch_info_type arch_info_struct[] =
{
static struct { unsigned long bfd_mach, arch, arch_up; } bfd_to_arch_table[] =
{
- { bfd_mach_sh, arch_sh1, arch_sh_up },
- { bfd_mach_sh2, arch_sh2, arch_sh2_up },
- { bfd_mach_sh2e, arch_sh2e, arch_sh2e_up },
- { bfd_mach_sh_dsp, arch_sh_dsp, arch_sh_dsp_up },
- { bfd_mach_sh2a, arch_sh2a, arch_sh2a_up },
- { bfd_mach_sh2a_nofpu, arch_sh2a_nofpu, arch_sh2a_nofpu_up },
-
- { bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu, arch_sh2a_nofpu_or_sh4_nommu_nofpu, arch_sh2a_nofpu_or_sh4_nommu_nofpu_up },
- { bfd_mach_sh2a_nofpu_or_sh3_nommu, arch_sh2a_nofpu_or_sh3_nommu, arch_sh2a_nofpu_or_sh3_nommu_up },
- { bfd_mach_sh2a_or_sh4, arch_sh2a_or_sh4, arch_sh2a_or_sh4_up },
+ { bfd_mach_sh, arch_sh1, arch_sh_up },
+ { bfd_mach_sh2, arch_sh2, arch_sh2_up },
+ { bfd_mach_sh2e, arch_sh2e, arch_sh2e_up },
+ { bfd_mach_sh_dsp, arch_sh_dsp, arch_sh_dsp_up },
+ { bfd_mach_sh2a, arch_sh2a, arch_sh2a_up },
+ { bfd_mach_sh2a_nofpu, arch_sh2a_nofpu, arch_sh2a_nofpu_up },
+
+ { bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu, arch_sh2a_nofpu_or_sh4_nommu_nofpu, arch_sh2a_nofpu_or_sh4_nommu_nofpu_up },
+ { bfd_mach_sh2a_nofpu_or_sh3_nommu, arch_sh2a_nofpu_or_sh3_nommu, arch_sh2a_nofpu_or_sh3_nommu_up },
+ { bfd_mach_sh2a_or_sh4, arch_sh2a_or_sh4, arch_sh2a_or_sh4_up },
{ bfd_mach_sh2a_or_sh3e, arch_sh2a_or_sh3e, arch_sh2a_or_sh3e_up },
- { bfd_mach_sh3, arch_sh3, arch_sh3_up },
- { bfd_mach_sh3_nommu, arch_sh3_nommu, arch_sh3_nommu_up },
- { bfd_mach_sh3_dsp, arch_sh3_dsp, arch_sh3_dsp_up },
- { bfd_mach_sh3e, arch_sh3e, arch_sh3e_up },
- { bfd_mach_sh4, arch_sh4, arch_sh4_up },
- { bfd_mach_sh4a, arch_sh4a, arch_sh4a_up },
- { bfd_mach_sh4al_dsp, arch_sh4al_dsp, arch_sh4al_dsp_up },
- { bfd_mach_sh4_nofpu, arch_sh4_nofpu, arch_sh4_nofpu_up },
+ { bfd_mach_sh3, arch_sh3, arch_sh3_up },
+ { bfd_mach_sh3_nommu, arch_sh3_nommu, arch_sh3_nommu_up },
+ { bfd_mach_sh3_dsp, arch_sh3_dsp, arch_sh3_dsp_up },
+ { bfd_mach_sh3e, arch_sh3e, arch_sh3e_up },
+ { bfd_mach_sh4, arch_sh4, arch_sh4_up },
+ { bfd_mach_sh4a, arch_sh4a, arch_sh4a_up },
+ { bfd_mach_sh4al_dsp, arch_sh4al_dsp, arch_sh4al_dsp_up },
+ { bfd_mach_sh4_nofpu, arch_sh4_nofpu, arch_sh4_nofpu_up },
{ bfd_mach_sh4_nommu_nofpu, arch_sh4_nommu_nofpu, arch_sh4_nommu_nofpu_up },
- { bfd_mach_sh4a_nofpu, arch_sh4a_nofpu, arch_sh4a_nofpu_up },
- { 0, 0, 0 } /* Terminator. */
+ { bfd_mach_sh4a_nofpu, arch_sh4a_nofpu, arch_sh4a_nofpu_up },
+ { 0, 0, 0 } /* Terminator. */
};
/* Conceptually: Find the architecture with the least number
of extra features or, if they have the same number, then
the greatest number of required features. Disregard
- architectures where the required features alone do
+ architectures where the required features alone do
not describe a valid architecture. */
if (((try & ~arch_set) < (best & ~arch_set)
|| ((try & ~arch_set) == (best & ~arch_set)
"spu", /* architecture name */
"spu:256K", /* printable name */
3, /* aligned power */
- TRUE, /* the default machine for the architecture */
+ TRUE, /* the default machine for the architecture */
spu_compatible, /* the spu is only compatible with itself, see above */
bfd_default_scan,
bfd_arch_default_fill,
static const bfd_arch_info_type arch_info_struct[] =
{
- N (bfd_mach_v850e3v5, "v850e3v5", FALSE, & arch_info_struct[1]),
- N (bfd_mach_v850e3v5, "v850e2v4", FALSE, & arch_info_struct[2]),
- N (bfd_mach_v850e2v3, "v850e2v3", FALSE, & arch_info_struct[3]),
- N (bfd_mach_v850e2, "v850e2", FALSE, & arch_info_struct[4]),
- N (bfd_mach_v850e1, "v850e1", FALSE, & arch_info_struct[5]),
- N (bfd_mach_v850e, "v850e", FALSE, NULL)
+ N (bfd_mach_v850e3v5, "v850e3v5", FALSE, & arch_info_struct[1]),
+ N (bfd_mach_v850e3v5, "v850e2v4", FALSE, & arch_info_struct[2]),
+ N (bfd_mach_v850e2v3, "v850e2v3", FALSE, & arch_info_struct[3]),
+ N (bfd_mach_v850e2, "v850e2", FALSE, & arch_info_struct[4]),
+ N (bfd_mach_v850e1, "v850e1", FALSE, & arch_info_struct[5]),
+ N (bfd_mach_v850e, "v850e", FALSE, NULL)
};
#undef NEXT
static const bfd_arch_info_type arch_info_struct[] =
{
- R (bfd_mach_v850e3v5, "v850e3v5", FALSE, & arch_info_struct[1]),
- R (bfd_mach_v850e3v5, "v850e2v4", FALSE, & arch_info_struct[2]),
- R (bfd_mach_v850e2v3, "v850e2v3", FALSE, & arch_info_struct[3]),
- R (bfd_mach_v850e2, "v850e2", FALSE, & arch_info_struct[4]),
- R (bfd_mach_v850e1, "v850e1", FALSE, & arch_info_struct[5]),
- R (bfd_mach_v850e, "v850e", FALSE, & arch_info_struct[6]),
- R (bfd_mach_v850, "v850-rh850", FALSE, NULL) /* For backwards compatibility. */
+ R (bfd_mach_v850e3v5, "v850e3v5", FALSE, & arch_info_struct[1]),
+ R (bfd_mach_v850e3v5, "v850e2v4", FALSE, & arch_info_struct[2]),
+ R (bfd_mach_v850e2v3, "v850e2v3", FALSE, & arch_info_struct[3]),
+ R (bfd_mach_v850e2, "v850e2", FALSE, & arch_info_struct[4]),
+ R (bfd_mach_v850e1, "v850e1", FALSE, & arch_info_struct[5]),
+ R (bfd_mach_v850e, "v850e", FALSE, & arch_info_struct[6]),
+ R (bfd_mach_v850, "v850-rh850", FALSE, NULL) /* For backwards compatibility. */
};
const bfd_arch_info_type bfd_v850_rh850_arch =
- R (bfd_mach_v850, "v850:rh850", TRUE, & arch_info_struct[0]);
+ R (bfd_mach_v850, "v850:rh850", TRUE, & arch_info_struct[0]);
bfd_mach_xgate,
"xgate",
"xgate",
- 4, /* Section alignment power. */
+ 4, /* Section alignment power. */
TRUE,
bfd_default_compatible,
bfd_default_scan,
static const bfd_arch_info_type arch_info_struct[] =
{
N (bfd_mach_z80strict, "z80-strict", FALSE, M(1)),
- N (bfd_mach_z80, "z80", FALSE, M(2)),
- N (bfd_mach_z80full, "z80-full", FALSE, M(3)),
- N (bfd_mach_r800, "r800", FALSE, NULL)
+ N (bfd_mach_z80, "z80", FALSE, M(2)),
+ N (bfd_mach_z80full, "z80-full", FALSE, M(3)),
+ N (bfd_mach_r800, "r800", FALSE, NULL)
};
const bfd_arch_info_type bfd_z80_arch = N (0, "z80-any", TRUE, M(0));
s|$|"|
s|, \([^ ]*\)$| and \1|
s|^|/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically generated from |
-s|\(.\{60\}[^ ]* \)|\1\
+s|\(.\{60\}[^ ]*\) |\1\
|g
s|$|.\
Run "make headers" in your build bfd/ to regenerate. */\
Return FALSE if the die is invalidly formatted; TRUE otherwise. */
static bfd_boolean
-parse_die (bfd * abfd,
+parse_die (bfd * abfd,
struct die_info * aDieInfo,
- bfd_byte * aDiePtr,
- bfd_byte * aDiePtrEnd)
+ bfd_byte * aDiePtr,
+ bfd_byte * aDiePtrEnd)
{
bfd_byte *this_die = aDiePtr;
bfd_byte *xptr = this_die;
unsigned short attr;
/* Parse the attribute based on its form. This section
- must handle all dwarf1 forms, but need only handle the
+ must handle all dwarf1 forms, but need only handle the
actual attributes that we care about. */
attr = bfd_get_16 (abfd, xptr);
xptr += 2;
/* Allocate an array for the entries. */
amt = sizeof (struct linenumber) * aUnit->line_count;
aUnit->linenumber_table = (struct linenumber *) bfd_alloc (stash->abfd,
- amt);
+ amt);
if (!aUnit->linenumber_table)
return FALSE;
if (aUnit->first_child)
for (eachDie = aUnit->first_child;
- eachDie < stash->debug_section_end;
+ eachDie < stash->debug_section_end;
)
{
struct die_info eachDieInfo;
not it's sibling. */
if (aDieInfo.sibling
&& stash->currentDie + aDieInfo.length
- < stash->debug_section_end
+ < stash->debug_section_end
&& stash->currentDie + aDieInfo.length
- != stash->debug_section + aDieInfo.sibling)
+ != stash->debug_section + aDieInfo.sibling)
aUnit->first_child = stash->currentDie + aDieInfo.length;
else
aUnit->first_child = 0;
This includes a pointer to an alternate bfd which contains *extra*,
possibly duplicate debug sections, and pointers to the loaded
.debug_str and .debug_info sections from this bfd. */
- bfd * alt_bfd_ptr;
- bfd_byte * alt_dwarf_str_buffer;
- bfd_size_type alt_dwarf_str_size;
- bfd_byte * alt_dwarf_info_buffer;
- bfd_size_type alt_dwarf_info_size;
+ bfd * alt_bfd_ptr;
+ bfd_byte * alt_dwarf_str_buffer;
+ bfd_size_type alt_dwarf_str_size;
+ bfd_byte * alt_dwarf_info_buffer;
+ bfd_size_type alt_dwarf_info_size;
/* A pointer to the memory block allocated for info_ptr. Neither
info_ptr nor sec_info_ptr are guaranteed to stay pointing to the
/* Status of info hash. */
int info_hash_status;
-#define STASH_INFO_HASH_OFF 0
-#define STASH_INFO_HASH_ON 1
+#define STASH_INFO_HASH_OFF 0
+#define STASH_INFO_HASH_ON 1
#define STASH_INFO_HASH_DISABLED 2
/* True if we opened bfd_ptr. */
the located section does not contain at least OFFSET bytes. */
static bfd_boolean
-read_section (bfd * abfd,
+read_section (bfd * abfd,
const struct dwarf_debug_section *sec,
asymbol ** syms,
bfd_uint64_t offset,
problem, or if the string is empty. */
static char *
-read_string (bfd * abfd ATTRIBUTE_UNUSED,
- bfd_byte * buf,
- bfd_byte * buf_end,
+read_string (bfd * abfd ATTRIBUTE_UNUSED,
+ bfd_byte * buf,
+ bfd_byte * buf_end,
unsigned int * bytes_read_ptr)
{
bfd_byte *str = buf;
static char *
read_indirect_string (struct comp_unit * unit,
- bfd_byte * buf,
- bfd_byte * buf_end,
- unsigned int * bytes_read_ptr)
+ bfd_byte * buf,
+ bfd_byte * buf_end,
+ unsigned int * bytes_read_ptr)
{
bfd_uint64_t offset;
struct dwarf2_debug *stash = unit->stash;
static char *
read_indirect_line_string (struct comp_unit * unit,
- bfd_byte * buf,
- bfd_byte * buf_end,
+ bfd_byte * buf,
+ bfd_byte * buf_end,
unsigned int * bytes_read_ptr)
{
bfd_uint64_t offset;
static char *
read_alt_indirect_string (struct comp_unit * unit,
- bfd_byte * buf,
- bfd_byte * buf_end,
+ bfd_byte * buf,
+ bfd_byte * buf_end,
unsigned int * bytes_read_ptr)
{
bfd_uint64_t offset;
static bfd_byte *
read_attribute_value (struct attribute * attr,
- unsigned form,
- bfd_vma implicit_const,
+ unsigned form,
+ bfd_vma implicit_const,
struct comp_unit * unit,
- bfd_byte * info_ptr,
- bfd_byte * info_ptr_end)
+ bfd_byte * info_ptr,
+ bfd_byte * info_ptr_end)
{
bfd *abfd = unit->abfd;
unsigned int bytes_read;
read_attribute (struct attribute * attr,
struct attr_abbrev * abbrev,
struct comp_unit * unit,
- bfd_byte * info_ptr,
- bfd_byte * info_ptr_end)
+ bfd_byte * info_ptr,
+ bfd_byte * info_ptr_end)
{
attr->name = abbrev->name;
info_ptr = read_attribute_value (attr, abbrev->form, abbrev->implicit_const,
struct line_sequence
{
- bfd_vma low_pc;
+ bfd_vma low_pc;
struct line_sequence* prev_sequence;
- struct line_info* last_line; /* Largest VMA. */
- struct line_info** line_info_lookup;
+ struct line_info* last_line; /* Largest VMA. */
+ struct line_info** line_info_lookup;
bfd_size_type num_lines;
};
struct line_info_table
{
- bfd * abfd;
- unsigned int num_files;
- unsigned int num_dirs;
- unsigned int num_sequences;
- char * comp_dir;
- char ** dirs;
- struct fileinfo* files;
+ bfd * abfd;
+ unsigned int num_files;
+ unsigned int num_dirs;
+ unsigned int num_sequences;
+ char * comp_dir;
+ char ** dirs;
+ struct fileinfo* files;
struct line_sequence* sequences;
- struct line_info* lcl_head; /* Local head; used in 'add_line_info'. */
+ struct line_info* lcl_head; /* Local head; used in 'add_line_info'. */
};
/* Remember some information about each function. If the function is
struct funcinfo * funcinfo;
/* The lowest address for this specific function. */
- bfd_vma low_addr;
+ bfd_vma low_addr;
/* The highest address of this function before the lookup table is sorted.
The highest address of all prior functions after the lookup table is
sorted, which is used for binary search. */
- bfd_vma high_addr;
+ bfd_vma high_addr;
};
struct varinfo
static bfd_boolean
sort_line_sequences (struct line_info_table* table)
{
- bfd_size_type amt;
- struct line_sequence* sequences;
- struct line_sequence* seq;
- unsigned int n = 0;
- unsigned int num_sequences = table->num_sequences;
- bfd_vma last_high_pc;
+ bfd_size_type amt;
+ struct line_sequence* sequences;
+ struct line_sequence* seq;
+ unsigned int n = 0;
+ unsigned int num_sequences = table->num_sequences;
+ bfd_vma last_high_pc;
if (num_sequences == 0)
return TRUE;
if (unit->lookup_funcinfo_table[number_of_functions - 1].high_addr < addr)
return FALSE;
-
+
/* Find the first function in the lookup table which may contain the
specified address. */
low = 0;
if (stash != NULL)
{
if (stash->orig_bfd == abfd
- && section_vma_same (abfd, stash))
- {
- /* Check that we did previously find some debug information
- before attempting to make use of it. */
- if (stash->bfd_ptr != NULL)
- {
- if (do_place && !place_sections (abfd, stash))
- return FALSE;
- return TRUE;
- }
-
- return FALSE;
- }
+ && section_vma_same (abfd, stash))
+ {
+ /* Check that we did previously find some debug information
+ before attempting to make use of it. */
+ if (stash->bfd_ptr != NULL)
+ {
+ if (do_place && !place_sections (abfd, stash))
+ return FALSE;
+ return TRUE;
+ }
+
+ return FALSE;
+ }
_bfd_dwarf2_cleanup_debug_info (abfd, pinfo);
memset (stash, 0, amt);
}
addr = offset;
/* If we have no SYMBOL but the section we're looking at is not a
- code section, then take a look through the list of symbols to see
- if we have a symbol at the address we're looking for. If we do
- then use this to look up line information. This will allow us to
- give file and line results for data symbols. We exclude code
- symbols here, if we look up a function symbol and then look up the
- line information we'll actually return the line number for the
- opening '{' rather than the function definition line. This is
- because looking up by symbol uses the line table, in which the
- first line for a function is usually the opening '{', while
- looking up the function by section + offset uses the
- DW_AT_decl_line from the function DW_TAG_subprogram for the line,
- which will be the line of the function name. */
+ code section, then take a look through the list of symbols to see
+ if we have a symbol at the address we're looking for. If we do
+ then use this to look up line information. This will allow us to
+ give file and line results for data symbols. We exclude code
+ symbols here, if we look up a function symbol and then look up the
+ line information we'll actually return the line number for the
+ opening '{' rather than the function definition line. This is
+ because looking up by symbol uses the line table, in which the
+ first line for a function is usually the opening '{', while
+ looking up the function by section + offset uses the
+ DW_AT_decl_line from the function DW_TAG_subprogram for the line,
+ which will be the line of the function name. */
if (symbols != NULL && (section->flags & SEC_CODE) == 0)
{
asymbol **tmp;
{
symbol = *tmp;
do_line = TRUE;
- /* For local symbols, keep going in the hope we find a
- global. */
- if ((symbol->flags & BSF_GLOBAL) != 0)
- break;
+ /* For local symbols, keep going in the hope we find a
+ global. */
+ if ((symbol->flags & BSF_GLOBAL) != 0)
+ break;
}
}
}
/* This stuff is somewhat copied from coffcode.h. */
static asection bfd_debug_section =
{
- /* name, id, index, next, prev, flags, user_set_vma, */
- "*DEBUG*", 0, 0, NULL, NULL, 0, 0,
- /* linker_mark, linker_has_input, gc_mark, compress_status, */
- 0, 0, 1, 0,
- /* segment_mark, sec_info_type, use_rela_p, */
- 0, 0, 0,
+ /* name, id, index, next, prev, flags, user_set_vma, */
+ "*DEBUG*", 0, 0, NULL, NULL, 0, 0,
+ /* linker_mark, linker_has_input, gc_mark, compress_status, */
+ 0, 0, 1, 0,
+ /* segment_mark, sec_info_type, use_rela_p, */
+ 0, 0, 0,
/* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */
- 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
/* vma, lma, size, rawsize, compressed_size, relax, relax_count, */
- 0, 0, 0, 0, 0, 0, 0,
- /* output_offset, output_section, alignment_power, */
- 0, NULL, 0,
+ 0, 0, 0, 0, 0, 0, 0,
+ /* output_offset, output_section, alignment_power, */
+ 0, NULL, 0,
/* relocation, orelocation, reloc_count, filepos, rel_filepos, */
- NULL, NULL, 0, 0, 0,
- /* line_filepos, userdata, contents, lineno, lineno_count, */
- 0, NULL, NULL, NULL, 0,
- /* entsize, kept_section, moving_line_filepos, */
- 0, NULL, 0,
- /* target_index, used_by_bfd, constructor_chain, owner, */
- 0, NULL, NULL, NULL,
- /* symbol, */
+ NULL, NULL, 0, 0, 0,
+ /* line_filepos, userdata, contents, lineno, lineno_count, */
+ 0, NULL, NULL, NULL, 0,
+ /* entsize, kept_section, moving_line_filepos, */
+ 0, NULL, 0,
+ /* target_index, used_by_bfd, constructor_chain, owner, */
+ 0, NULL, NULL, NULL,
+ /* symbol, */
NULL,
- /* symbol_ptr_ptr, */
+ /* symbol_ptr_ptr, */
NULL,
- /* map_head, map_tail */
+ /* map_head, map_tail */
{ NULL }, { NULL }
};
}
styp_flags [] =
{
- { _TEXT, STYP_TEXT },
- { _DATA, STYP_DATA },
- { _SDATA, STYP_SDATA },
- { _RDATA, STYP_RDATA },
- { _LITA, STYP_LITA },
- { _LIT8, STYP_LIT8 },
- { _LIT4, STYP_LIT4 },
- { _BSS, STYP_BSS },
- { _SBSS, STYP_SBSS },
- { _INIT, STYP_ECOFF_INIT },
- { _FINI, STYP_ECOFF_FINI },
- { _PDATA, STYP_PDATA },
- { _XDATA, STYP_XDATA },
- { _LIB, STYP_ECOFF_LIB },
- { _GOT, STYP_GOT },
- { _HASH, STYP_HASH },
- { _DYNAMIC, STYP_DYNAMIC },
- { _LIBLIST, STYP_LIBLIST },
- { _RELDYN, STYP_RELDYN },
- { _CONFLIC, STYP_CONFLIC },
- { _DYNSTR, STYP_DYNSTR },
- { _DYNSYM, STYP_DYNSYM },
- { _RCONST, STYP_RCONST }
+ { _TEXT, STYP_TEXT },
+ { _DATA, STYP_DATA },
+ { _SDATA, STYP_SDATA },
+ { _RDATA, STYP_RDATA },
+ { _LITA, STYP_LITA },
+ { _LIT8, STYP_LIT8 },
+ { _LIT4, STYP_LIT4 },
+ { _BSS, STYP_BSS },
+ { _SBSS, STYP_SBSS },
+ { _INIT, STYP_ECOFF_INIT },
+ { _FINI, STYP_ECOFF_FINI },
+ { _PDATA, STYP_PDATA },
+ { _XDATA, STYP_XDATA },
+ { _LIB, STYP_ECOFF_LIB },
+ { _GOT, STYP_GOT },
+ { _HASH, STYP_HASH },
+ { _DYNAMIC, STYP_DYNAMIC },
+ { _LIBLIST, STYP_LIBLIST },
+ { _RELDYN, STYP_RELDYN },
+ { _CONFLIC, STYP_CONFLIC },
+ { _DYNSTR, STYP_DYNSTR },
+ { _DYNSYM, STYP_DYNSYM },
+ { _RCONST, STYP_RCONST }
};
long styp = 0;
{
asym->flags = BSF_LOCAL;
/* Normally, a local stProc symbol will have a corresponding
- external symbol. We mark the local symbol as a debugging
- symbol, in order to prevent nm from printing both out.
- Similarly, we mark stLabel and stabs symbols as debugging
- symbols. In both cases, we do want to set the value
- correctly based on the symbol class. */
+ external symbol. We mark the local symbol as a debugging
+ symbol, in order to prevent nm from printing both out.
+ Similarly, we mark stLabel and stabs symbols as debugging
+ symbols. In both cases, we do want to set the value
+ correctly based on the symbol class. */
if (ecoff_sym->st == stProc
|| ecoff_sym->st == stLabel
|| ECOFF_IS_STAB (ecoff_sym))
if (qualifiers[0].type != tqNil)
{
/* Snarf up any array bounds in the correct order. Arrays
- store 5 successive words in the aux. table:
- word 0 RNDXR to type of the bounds (ie, int)
- word 1 Current file descriptor index
- word 2 low bound
- word 3 high bound (or -1 if [])
- word 4 stride size in bits. */
+ store 5 successive words in the aux. table:
+ word 0 RNDXR to type of the bounds (ie, int)
+ word 1 Current file descriptor index
+ word 2 low bound
+ word 3 high bound (or -1 if [])
+ word 4 stride size in bits. */
for (i = 0; i < 7; i++)
{
if (qualifiers[i].type == tqArray)
bfd_size_type amt = sizeof (struct ecoff_find_line);
ecoff_data (abfd)->find_line_info =
- (struct ecoff_find_line *) bfd_zalloc (abfd, amt);
+ (struct ecoff_find_line *) bfd_zalloc (abfd, amt);
if (ecoff_data (abfd)->find_line_info == NULL)
return FALSE;
}
&& (abfd->flags & D_PAGED) != 0)
{
/* Skip up to the next page for an unallocated section, such
- as the .comment section on the Alpha. This leaves room
- for the .bss section. */
+ as the .comment section on the Alpha. This leaves room
+ for the .bss section. */
first_nonalloc = FALSE;
sofar = (sofar + round - 1) &~ (round - 1);
file_sofar = (file_sofar + round - 1) &~ (round - 1);
The Alpha seems to use ________64E[BL]E[BL]_. */
-#define ARMAP_BIG_ENDIAN 'B'
-#define ARMAP_LITTLE_ENDIAN 'L'
-#define ARMAP_MARKER 'E'
-#define ARMAP_START_LENGTH 10
+#define ARMAP_BIG_ENDIAN 'B'
+#define ARMAP_LITTLE_ENDIAN 'L'
+#define ARMAP_MARKER 'E'
+#define ARMAP_START_LENGTH 10
#define ARMAP_HEADER_MARKER_INDEX 10
-#define ARMAP_HEADER_ENDIAN_INDEX 11
-#define ARMAP_OBJECT_MARKER_INDEX 12
-#define ARMAP_OBJECT_ENDIAN_INDEX 13
-#define ARMAP_END_INDEX 14
-#define ARMAP_END "_ "
+#define ARMAP_HEADER_ENDIAN_INDEX 11
+#define ARMAP_OBJECT_MARKER_INDEX 12
+#define ARMAP_OBJECT_ENDIAN_INDEX 13
+#define ARMAP_END_INDEX 14
+#define ARMAP_END "_ "
/* This is a magic number used in the hashing algorithm. */
-#define ARMAP_HASH_MAGIC 0x9dd68ab5
+#define ARMAP_HASH_MAGIC 0x9dd68ab5
/* This returns the hash value to use for a string. It also sets
*REHASH to the rehash adjustment if the first slot is taken. SIZE
else \
{ \
bfd_size_type amt = (bfd_size_type) size * symhdr->count; \
- debug->ptr = (type) bfd_malloc (amt); \
+ debug->ptr = (type) bfd_malloc (amt); \
if (debug->ptr == NULL) \
{ \
- ret = FALSE; \
- goto return_something; \
+ ret = FALSE; \
+ goto return_something; \
} \
if (bfd_seek (input_bfd, (file_ptr) symhdr->offset, SEEK_SET) != 0 \
|| bfd_bread (debug->ptr, amt, input_bfd) != amt) \
{ \
- ret = FALSE; \
- goto return_something; \
+ ret = FALSE; \
+ goto return_something; \
} \
}
struct bfd_link_hash_entry *h;
/* Treat a reloc against a defined symbol as though it were
- actually against the section. */
+ actually against the section. */
h = bfd_wrapped_link_hash_lookup (output_bfd, info,
link_order->u.reloc.p->u.name,
FALSE, FALSE, FALSE);
type = bfd_section_reloc_link_order;
section = h->u.def.section->output_section;
/* It seems that we ought to add the symbol value to the
- addend here, but in practice it has already been added
- because it was passed to constructor_callback. */
+ addend here, but in practice it has already been added
+ because it was passed to constructor_callback. */
addend += section->vma + h->u.def.section->output_offset;
}
else
/* now the fun stuff... */
if (bigend)
{
- intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_BIG);
- intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_BIG);
- intern->bt = (ext->t_bits1[0] & TIR_BITS1_BT_BIG)
- >> TIR_BITS1_BT_SH_BIG;
- intern->tq4 = (ext->t_tq45[0] & TIR_BITS_TQ4_BIG)
+ intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_BIG);
+ intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_BIG);
+ intern->bt = (ext->t_bits1[0] & TIR_BITS1_BT_BIG)
+ >> TIR_BITS1_BT_SH_BIG;
+ intern->tq4 = (ext->t_tq45[0] & TIR_BITS_TQ4_BIG)
>> TIR_BITS_TQ4_SH_BIG;
- intern->tq5 = (ext->t_tq45[0] & TIR_BITS_TQ5_BIG)
+ intern->tq5 = (ext->t_tq45[0] & TIR_BITS_TQ5_BIG)
>> TIR_BITS_TQ5_SH_BIG;
- intern->tq0 = (ext->t_tq01[0] & TIR_BITS_TQ0_BIG)
+ intern->tq0 = (ext->t_tq01[0] & TIR_BITS_TQ0_BIG)
>> TIR_BITS_TQ0_SH_BIG;
- intern->tq1 = (ext->t_tq01[0] & TIR_BITS_TQ1_BIG)
+ intern->tq1 = (ext->t_tq01[0] & TIR_BITS_TQ1_BIG)
>> TIR_BITS_TQ1_SH_BIG;
- intern->tq2 = (ext->t_tq23[0] & TIR_BITS_TQ2_BIG)
+ intern->tq2 = (ext->t_tq23[0] & TIR_BITS_TQ2_BIG)
>> TIR_BITS_TQ2_SH_BIG;
- intern->tq3 = (ext->t_tq23[0] & TIR_BITS_TQ3_BIG)
+ intern->tq3 = (ext->t_tq23[0] & TIR_BITS_TQ3_BIG)
>> TIR_BITS_TQ3_SH_BIG;
}
else
{
- intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_LITTLE);
- intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_LITTLE);
- intern->bt = (ext->t_bits1[0] & TIR_BITS1_BT_LITTLE)
+ intern->fBitfield = 0 != (ext->t_bits1[0] & TIR_BITS1_FBITFIELD_LITTLE);
+ intern->continued = 0 != (ext->t_bits1[0] & TIR_BITS1_CONTINUED_LITTLE);
+ intern->bt = (ext->t_bits1[0] & TIR_BITS1_BT_LITTLE)
>> TIR_BITS1_BT_SH_LITTLE;
- intern->tq4 = (ext->t_tq45[0] & TIR_BITS_TQ4_LITTLE)
+ intern->tq4 = (ext->t_tq45[0] & TIR_BITS_TQ4_LITTLE)
>> TIR_BITS_TQ4_SH_LITTLE;
- intern->tq5 = (ext->t_tq45[0] & TIR_BITS_TQ5_LITTLE)
+ intern->tq5 = (ext->t_tq45[0] & TIR_BITS_TQ5_LITTLE)
>> TIR_BITS_TQ5_SH_LITTLE;
- intern->tq0 = (ext->t_tq01[0] & TIR_BITS_TQ0_LITTLE)
+ intern->tq0 = (ext->t_tq01[0] & TIR_BITS_TQ0_LITTLE)
>> TIR_BITS_TQ0_SH_LITTLE;
- intern->tq1 = (ext->t_tq01[0] & TIR_BITS_TQ1_LITTLE)
+ intern->tq1 = (ext->t_tq01[0] & TIR_BITS_TQ1_LITTLE)
>> TIR_BITS_TQ1_SH_LITTLE;
- intern->tq2 = (ext->t_tq23[0] & TIR_BITS_TQ2_LITTLE)
+ intern->tq2 = (ext->t_tq23[0] & TIR_BITS_TQ2_LITTLE)
>> TIR_BITS_TQ2_SH_LITTLE;
- intern->tq3 = (ext->t_tq23[0] & TIR_BITS_TQ3_LITTLE)
+ intern->tq3 = (ext->t_tq23[0] & TIR_BITS_TQ3_LITTLE)
>> TIR_BITS_TQ3_SH_LITTLE;
}
{
intern->rfd = (ext->r_bits[0] << RNDX_BITS0_RFD_SH_LEFT_BIG)
| ((ext->r_bits[1] & RNDX_BITS1_RFD_BIG)
- >> RNDX_BITS1_RFD_SH_BIG);
+ >> RNDX_BITS1_RFD_SH_BIG);
intern->index = ((ext->r_bits[1] & RNDX_BITS1_INDEX_BIG)
- << RNDX_BITS1_INDEX_SH_LEFT_BIG)
+ << RNDX_BITS1_INDEX_SH_LEFT_BIG)
| (ext->r_bits[2] << RNDX_BITS2_INDEX_SH_LEFT_BIG)
| (ext->r_bits[3] << RNDX_BITS3_INDEX_SH_LEFT_BIG);
}
{
intern->rfd = (ext->r_bits[0] << RNDX_BITS0_RFD_SH_LEFT_LITTLE)
| ((ext->r_bits[1] & RNDX_BITS1_RFD_LITTLE)
- << RNDX_BITS1_RFD_SH_LEFT_LITTLE);
+ << RNDX_BITS1_RFD_SH_LEFT_LITTLE);
intern->index = ((ext->r_bits[1] & RNDX_BITS1_INDEX_LITTLE)
- >> RNDX_BITS1_INDEX_SH_LITTLE)
+ >> RNDX_BITS1_INDEX_SH_LITTLE)
| (ext->r_bits[2] << RNDX_BITS2_INDEX_SH_LEFT_LITTLE)
| ((unsigned int) ext->r_bits[3]
<< RNDX_BITS3_INDEX_SH_LEFT_LITTLE);
if (bfd_link_relocatable (info))
{
if (!add_memory_shuffle (ainfo, &ainfo->ss, &ainfo->ss_end,
- (bfd_byte *) string, len + 1))
+ (bfd_byte *) string, len + 1))
return -1;
ret = symhdr->issMax;
symhdr->issMax += len + 1;
(output format has been edited for our purposes):
FDR [2]: (main.C): First instruction: 0x12000207c <x>
- PDR [5] for File [2]: LoopTest__Xv <0x1200020a0> (a)
- PDR [7] for File [2]: foo__Xv <0x120002168>
- FDR [1]: (-1): First instruction: 0x1200020e8 <y>
- PDR [3] for File [1]: <0x120001ad0> (b)
- FDR [6]: (-1): First instruction: 0x1200026f0 <z>
+ PDR [5] for File [2]: LoopTest__Xv <0x1200020a0> (a)
+ PDR [7] for File [2]: foo__Xv <0x120002168>
+ FDR [1]: (-1): First instruction: 0x1200020e8 <y>
+ PDR [3] for File [1]: <0x120001ad0> (b)
+ FDR [6]: (-1): First instruction: 0x1200026f0 <z>
(a) In the case of PDR5, the vma is such that the first few instructions
of the procedure can be found. But since the size of this procedure is
unsigned char *line_end;
int lineno;
/* This file uses ECOFF debugging information. Each FDR has a
- list of procedure descriptors (PDR). The address in the FDR
- is the absolute address of the first procedure. The address
- in the first PDR gives the offset of that procedure relative
- to the object file's base-address. The addresses in
- subsequent PDRs specify each procedure's address relative to
- the object file's base-address. To make things more juicy,
- whenever the PROF bit in the PDR is set, the real entry point
- of the procedure may be 16 bytes below what would normally be
- the procedure's entry point. Instead, DEC came up with a
- wicked scheme to create profiled libraries "on the fly":
- instead of shipping a regular and a profiled version of each
- library, they insert 16 bytes of unused space in front of
- each procedure and set the "prof" bit in the PDR to indicate
- that there is a gap there (this is done automagically by "as"
- when option "-pg" is specified). Thus, normally, you link
- against such a library and, except for lots of 16 byte gaps
- between functions, things will behave as usual. However,
- when invoking "ld" with option "-pg", it will fill those gaps
- with code that calls mcount(). It then moves the function's
- entry point down by 16 bytes, and out pops a binary that has
- all functions profiled.
-
- NOTE: Neither FDRs nor PDRs are strictly sorted in memory
- order. For example, when including header-files that
- define functions, the FDRs follow behind the including
- file, even though their code may have been generated at
- a lower address. File coff-alpha.c from libbfd
- illustrates this (use "odump -PFv" to look at a file's
- FDR/PDR). Similarly, PDRs are sometimes out of order
- as well. An example of this is OSF/1 v3.0 libc's
- malloc.c. I'm not sure why this happens, but it could
- be due to optimizations that reorder a function's
- position within an object-file.
-
- Strategy:
-
- On the first call to this function, we build a table of FDRs
- that is sorted by the base-address of the object-file the FDR
- is referring to. Notice that each object-file may contain
- code from multiple source files (e.g., due to code defined in
- include files). Thus, for any given base-address, there may
- be multiple FDRs (but this case is, fortunately, uncommon).
- lookup(addr) guarantees to return the first FDR that applies
- to address ADDR. Thus, after invoking lookup(), we have a
- list of FDRs that may contain the PDR for ADDR. Next, we
- walk through the PDRs of these FDRs and locate the one that
- is closest to ADDR (i.e., for which the difference between
- ADDR and the PDR's entry point is positive and minimal).
- Once, the right FDR and PDR are located, we simply walk
- through the line-number table to lookup the line-number that
- best matches ADDR. Obviously, things could be sped up by
- keeping a sorted list of PDRs instead of a sorted list of
- FDRs. However, this would increase space requirements
- considerably, which is undesirable. */
+ list of procedure descriptors (PDR). The address in the FDR
+ is the absolute address of the first procedure. The address
+ in the first PDR gives the offset of that procedure relative
+ to the object file's base-address. The addresses in
+ subsequent PDRs specify each procedure's address relative to
+ the object file's base-address. To make things more juicy,
+ whenever the PROF bit in the PDR is set, the real entry point
+ of the procedure may be 16 bytes below what would normally be
+ the procedure's entry point. Instead, DEC came up with a
+ wicked scheme to create profiled libraries "on the fly":
+ instead of shipping a regular and a profiled version of each
+ library, they insert 16 bytes of unused space in front of
+ each procedure and set the "prof" bit in the PDR to indicate
+ that there is a gap there (this is done automagically by "as"
+ when option "-pg" is specified). Thus, normally, you link
+ against such a library and, except for lots of 16 byte gaps
+ between functions, things will behave as usual. However,
+ when invoking "ld" with option "-pg", it will fill those gaps
+ with code that calls mcount(). It then moves the function's
+ entry point down by 16 bytes, and out pops a binary that has
+ all functions profiled.
+
+ NOTE: Neither FDRs nor PDRs are strictly sorted in memory
+ order. For example, when including header-files that
+ define functions, the FDRs follow behind the including
+ file, even though their code may have been generated at
+ a lower address. File coff-alpha.c from libbfd
+ illustrates this (use "odump -PFv" to look at a file's
+ FDR/PDR). Similarly, PDRs are sometimes out of order
+ as well. An example of this is OSF/1 v3.0 libc's
+ malloc.c. I'm not sure why this happens, but it could
+ be due to optimizations that reorder a function's
+ position within an object-file.
+
+ Strategy:
+
+ On the first call to this function, we build a table of FDRs
+ that is sorted by the base-address of the object-file the FDR
+ is referring to. Notice that each object-file may contain
+ code from multiple source files (e.g., due to code defined in
+ include files). Thus, for any given base-address, there may
+ be multiple FDRs (but this case is, fortunately, uncommon).
+ lookup(addr) guarantees to return the first FDR that applies
+ to address ADDR. Thus, after invoking lookup(), we have a
+ list of FDRs that may contain the PDR for ADDR. Next, we
+ walk through the PDRs of these FDRs and locate the one that
+ is closest to ADDR (i.e., for which the difference between
+ ADDR and the PDR's entry point is positive and minimal).
+ Once, the right FDR and PDR are located, we simply walk
+ through the line-number table to lookup the line-number that
+ best matches ADDR. Obviously, things could be sped up by
+ keeping a sorted list of PDRs instead of a sorted list of
+ FDRs. However, this would increase space requirements
+ considerably, which is undesirable. */
external_pdr_size = debug_swap->external_pdr_size;
/* eraxxon: The Horrible Hack: Because of the problems above, set 'i'
i = 0;
/* Search FDR list starting at tab[i] for the PDR that best matches
- OFFSET. Normally, the FDR list is only one entry long. */
+ OFFSET. Normally, the FDR list is only one entry long. */
best_fdr = NULL;
do
{
/* eraxxon: 'dist' and 'min_dist' can be negative now
- because we iterate over every FDR rather than just ones
- with a base address less than or equal to 'offset'. */
+ because we iterate over every FDR rather than just ones
+ with a base address less than or equal to 'offset'. */
bfd_signed_vma dist = -1, min_dist = -1;
char *pdr_hold;
char *pdr_end;
dist = offset - (pdr.adr - 0x10 * pdr.prof);
/* eraxxon: 'dist' can be negative now. Note that
- 'min_dist' can be negative if 'pdr_hold' below is NULL. */
+ 'min_dist' can be negative if 'pdr_hold' below is NULL. */
if (!pdr_hold || (dist >= 0 && dist < min_dist))
{
min_dist = dist;
pdr_ptr = best_pdr;
(*debug_swap->swap_pdr_in) (abfd, pdr_ptr, &pdr);
/* Now we can look for the actual line number. The line numbers
- are stored in a very funky format, which I won't try to
- describe. The search is bounded by the end of the FDRs line
- number entries. */
+ are stored in a very funky format, which I won't try to
+ describe. The search is bounded by the end of the FDRs line
+ number entries. */
line_end = debug_info->line + fdr_ptr->cbLineOffset + fdr_ptr->cbLine;
/* Make offset relative to procedure entry. */
}
/* If fdr_ptr->rss is -1, then this file does not have full
- symbols, at least according to gdb/mipsread.c. */
+ symbols, at least according to gdb/mipsread.c. */
if (fdr_ptr->rss == -1)
{
line_info->cache.filename = NULL;
debug_info->ss + fdr_ptr->issBase + sym.iss;
/* Check the next symbol to see if it is also an
- N_SO symbol. */
+ N_SO symbol. */
if (sym_ptr + external_sym_size < sym_ptr_end)
{
SYMR nextsym;
if (ECOFF_IS_STAB (&nextsym)
&& ECOFF_UNMARK_STAB (nextsym.index) == N_SO)
{
- directory_name = current_file_name;
+ directory_name = current_file_name;
main_file_name = current_file_name =
debug_info->ss + fdr_ptr->issBase + nextsym.iss;
sym_ptr += external_sym_size;
main_file_name = line_file_name;
/* We need to remove the stuff after the colon in the function
- name. We also need to put the directory name and the file
- name together. */
+ name. We also need to put the directory name and the file
+ name together. */
if (function_name == NULL)
len = funclen = 0;
else
*ext = *(struct hdr_ext *) ext_copy;
- intern->magic = H_GET_S16 (abfd, ext->h_magic);
- intern->vstamp = H_GET_S16 (abfd, ext->h_vstamp);
- intern->ilineMax = H_GET_32 (abfd, ext->h_ilineMax);
- intern->cbLine = ECOFF_GET_OFF (abfd, ext->h_cbLine);
- intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->h_cbLineOffset);
- intern->idnMax = H_GET_32 (abfd, ext->h_idnMax);
- intern->cbDnOffset = ECOFF_GET_OFF (abfd, ext->h_cbDnOffset);
- intern->ipdMax = H_GET_32 (abfd, ext->h_ipdMax);
- intern->cbPdOffset = ECOFF_GET_OFF (abfd, ext->h_cbPdOffset);
- intern->isymMax = H_GET_32 (abfd, ext->h_isymMax);
- intern->cbSymOffset = ECOFF_GET_OFF (abfd, ext->h_cbSymOffset);
- intern->ioptMax = H_GET_32 (abfd, ext->h_ioptMax);
- intern->cbOptOffset = ECOFF_GET_OFF (abfd, ext->h_cbOptOffset);
- intern->iauxMax = H_GET_32 (abfd, ext->h_iauxMax);
- intern->cbAuxOffset = ECOFF_GET_OFF (abfd, ext->h_cbAuxOffset);
- intern->issMax = H_GET_32 (abfd, ext->h_issMax);
- intern->cbSsOffset = ECOFF_GET_OFF (abfd, ext->h_cbSsOffset);
- intern->issExtMax = H_GET_32 (abfd, ext->h_issExtMax);
+ intern->magic = H_GET_S16 (abfd, ext->h_magic);
+ intern->vstamp = H_GET_S16 (abfd, ext->h_vstamp);
+ intern->ilineMax = H_GET_32 (abfd, ext->h_ilineMax);
+ intern->cbLine = ECOFF_GET_OFF (abfd, ext->h_cbLine);
+ intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->h_cbLineOffset);
+ intern->idnMax = H_GET_32 (abfd, ext->h_idnMax);
+ intern->cbDnOffset = ECOFF_GET_OFF (abfd, ext->h_cbDnOffset);
+ intern->ipdMax = H_GET_32 (abfd, ext->h_ipdMax);
+ intern->cbPdOffset = ECOFF_GET_OFF (abfd, ext->h_cbPdOffset);
+ intern->isymMax = H_GET_32 (abfd, ext->h_isymMax);
+ intern->cbSymOffset = ECOFF_GET_OFF (abfd, ext->h_cbSymOffset);
+ intern->ioptMax = H_GET_32 (abfd, ext->h_ioptMax);
+ intern->cbOptOffset = ECOFF_GET_OFF (abfd, ext->h_cbOptOffset);
+ intern->iauxMax = H_GET_32 (abfd, ext->h_iauxMax);
+ intern->cbAuxOffset = ECOFF_GET_OFF (abfd, ext->h_cbAuxOffset);
+ intern->issMax = H_GET_32 (abfd, ext->h_issMax);
+ intern->cbSsOffset = ECOFF_GET_OFF (abfd, ext->h_cbSsOffset);
+ intern->issExtMax = H_GET_32 (abfd, ext->h_issExtMax);
intern->cbSsExtOffset = ECOFF_GET_OFF (abfd, ext->h_cbSsExtOffset);
- intern->ifdMax = H_GET_32 (abfd, ext->h_ifdMax);
- intern->cbFdOffset = ECOFF_GET_OFF (abfd, ext->h_cbFdOffset);
- intern->crfd = H_GET_32 (abfd, ext->h_crfd);
- intern->cbRfdOffset = ECOFF_GET_OFF (abfd, ext->h_cbRfdOffset);
- intern->iextMax = H_GET_32 (abfd, ext->h_iextMax);
- intern->cbExtOffset = ECOFF_GET_OFF (abfd, ext->h_cbExtOffset);
+ intern->ifdMax = H_GET_32 (abfd, ext->h_ifdMax);
+ intern->cbFdOffset = ECOFF_GET_OFF (abfd, ext->h_cbFdOffset);
+ intern->crfd = H_GET_32 (abfd, ext->h_crfd);
+ intern->cbRfdOffset = ECOFF_GET_OFF (abfd, ext->h_cbRfdOffset);
+ intern->iextMax = H_GET_32 (abfd, ext->h_iextMax);
+ intern->cbExtOffset = ECOFF_GET_OFF (abfd, ext->h_cbExtOffset);
#ifdef TEST
if (memcmp ((char *) ext, (char *) intern, sizeof (*intern)) != 0)
*intern = *intern_copy;
- H_PUT_S16 (abfd, intern->magic, ext->h_magic);
- H_PUT_S16 (abfd, intern->vstamp, ext->h_vstamp);
- H_PUT_32 (abfd, intern->ilineMax, ext->h_ilineMax);
- ECOFF_PUT_OFF (abfd, intern->cbLine, ext->h_cbLine);
+ H_PUT_S16 (abfd, intern->magic, ext->h_magic);
+ H_PUT_S16 (abfd, intern->vstamp, ext->h_vstamp);
+ H_PUT_32 (abfd, intern->ilineMax, ext->h_ilineMax);
+ ECOFF_PUT_OFF (abfd, intern->cbLine, ext->h_cbLine);
ECOFF_PUT_OFF (abfd, intern->cbLineOffset, ext->h_cbLineOffset);
- H_PUT_32 (abfd, intern->idnMax, ext->h_idnMax);
+ H_PUT_32 (abfd, intern->idnMax, ext->h_idnMax);
ECOFF_PUT_OFF (abfd, intern->cbDnOffset, ext->h_cbDnOffset);
- H_PUT_32 (abfd, intern->ipdMax, ext->h_ipdMax);
+ H_PUT_32 (abfd, intern->ipdMax, ext->h_ipdMax);
ECOFF_PUT_OFF (abfd, intern->cbPdOffset, ext->h_cbPdOffset);
- H_PUT_32 (abfd, intern->isymMax, ext->h_isymMax);
+ H_PUT_32 (abfd, intern->isymMax, ext->h_isymMax);
ECOFF_PUT_OFF (abfd, intern->cbSymOffset, ext->h_cbSymOffset);
- H_PUT_32 (abfd, intern->ioptMax, ext->h_ioptMax);
+ H_PUT_32 (abfd, intern->ioptMax, ext->h_ioptMax);
ECOFF_PUT_OFF (abfd, intern->cbOptOffset, ext->h_cbOptOffset);
- H_PUT_32 (abfd, intern->iauxMax, ext->h_iauxMax);
+ H_PUT_32 (abfd, intern->iauxMax, ext->h_iauxMax);
ECOFF_PUT_OFF (abfd, intern->cbAuxOffset, ext->h_cbAuxOffset);
- H_PUT_32 (abfd, intern->issMax, ext->h_issMax);
+ H_PUT_32 (abfd, intern->issMax, ext->h_issMax);
ECOFF_PUT_OFF (abfd, intern->cbSsOffset, ext->h_cbSsOffset);
- H_PUT_32 (abfd, intern->issExtMax, ext->h_issExtMax);
+ H_PUT_32 (abfd, intern->issExtMax, ext->h_issExtMax);
ECOFF_PUT_OFF (abfd, intern->cbSsExtOffset, ext->h_cbSsExtOffset);
- H_PUT_32 (abfd, intern->ifdMax, ext->h_ifdMax);
+ H_PUT_32 (abfd, intern->ifdMax, ext->h_ifdMax);
ECOFF_PUT_OFF (abfd, intern->cbFdOffset, ext->h_cbFdOffset);
- H_PUT_32 (abfd, intern->crfd, ext->h_crfd);
+ H_PUT_32 (abfd, intern->crfd, ext->h_crfd);
ECOFF_PUT_OFF (abfd, intern->cbRfdOffset, ext->h_cbRfdOffset);
- H_PUT_32 (abfd, intern->iextMax, ext->h_iextMax);
+ H_PUT_32 (abfd, intern->iextMax, ext->h_iextMax);
ECOFF_PUT_OFF (abfd, intern->cbExtOffset, ext->h_cbExtOffset);
#ifdef TEST
*ext = *(struct fdr_ext *) ext_copy;
- intern->adr = ECOFF_GET_OFF (abfd, ext->f_adr);
- intern->rss = H_GET_32 (abfd, ext->f_rss);
+ intern->adr = ECOFF_GET_OFF (abfd, ext->f_adr);
+ intern->rss = H_GET_32 (abfd, ext->f_rss);
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
if (intern->rss == (signed long) 0xffffffff)
intern->rss = -1;
#endif
- intern->issBase = H_GET_32 (abfd, ext->f_issBase);
- intern->cbSs = ECOFF_GET_OFF (abfd, ext->f_cbSs);
- intern->isymBase = H_GET_32 (abfd, ext->f_isymBase);
- intern->csym = H_GET_32 (abfd, ext->f_csym);
- intern->ilineBase = H_GET_32 (abfd, ext->f_ilineBase);
- intern->cline = H_GET_32 (abfd, ext->f_cline);
- intern->ioptBase = H_GET_32 (abfd, ext->f_ioptBase);
- intern->copt = H_GET_32 (abfd, ext->f_copt);
+ intern->issBase = H_GET_32 (abfd, ext->f_issBase);
+ intern->cbSs = ECOFF_GET_OFF (abfd, ext->f_cbSs);
+ intern->isymBase = H_GET_32 (abfd, ext->f_isymBase);
+ intern->csym = H_GET_32 (abfd, ext->f_csym);
+ intern->ilineBase = H_GET_32 (abfd, ext->f_ilineBase);
+ intern->cline = H_GET_32 (abfd, ext->f_cline);
+ intern->ioptBase = H_GET_32 (abfd, ext->f_ioptBase);
+ intern->copt = H_GET_32 (abfd, ext->f_copt);
#if defined (ECOFF_32) || defined (ECOFF_SIGNED_32)
- intern->ipdFirst = H_GET_16 (abfd, ext->f_ipdFirst);
- intern->cpd = H_GET_16 (abfd, ext->f_cpd);
+ intern->ipdFirst = H_GET_16 (abfd, ext->f_ipdFirst);
+ intern->cpd = H_GET_16 (abfd, ext->f_cpd);
#endif
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
- intern->ipdFirst = H_GET_32 (abfd, ext->f_ipdFirst);
- intern->cpd = H_GET_32 (abfd, ext->f_cpd);
+ intern->ipdFirst = H_GET_32 (abfd, ext->f_ipdFirst);
+ intern->cpd = H_GET_32 (abfd, ext->f_cpd);
#endif
- intern->iauxBase = H_GET_32 (abfd, ext->f_iauxBase);
- intern->caux = H_GET_32 (abfd, ext->f_caux);
- intern->rfdBase = H_GET_32 (abfd, ext->f_rfdBase);
- intern->crfd = H_GET_32 (abfd, ext->f_crfd);
+ intern->iauxBase = H_GET_32 (abfd, ext->f_iauxBase);
+ intern->caux = H_GET_32 (abfd, ext->f_caux);
+ intern->rfdBase = H_GET_32 (abfd, ext->f_rfdBase);
+ intern->crfd = H_GET_32 (abfd, ext->f_crfd);
/* Now the fun stuff... */
if (bfd_header_big_endian (abfd))
}
intern->reserved = 0;
- intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->f_cbLineOffset);
- intern->cbLine = ECOFF_GET_OFF (abfd, ext->f_cbLine);
+ intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->f_cbLineOffset);
+ intern->cbLine = ECOFF_GET_OFF (abfd, ext->f_cbLine);
#ifdef TEST
if (memcmp ((char *) ext, (char *) intern, sizeof (*intern)) != 0)
memset ((void *) intern, 0, sizeof (*intern));
- intern->adr = ECOFF_GET_OFF (abfd, ext->p_adr);
- intern->isym = H_GET_32 (abfd, ext->p_isym);
- intern->iline = H_GET_32 (abfd, ext->p_iline);
- intern->regmask = H_GET_32 (abfd, ext->p_regmask);
- intern->regoffset = H_GET_S32 (abfd, ext->p_regoffset);
- intern->iopt = H_GET_S32 (abfd, ext->p_iopt);
- intern->fregmask = H_GET_32 (abfd, ext->p_fregmask);
- intern->fregoffset = H_GET_S32 (abfd, ext->p_fregoffset);
- intern->frameoffset = H_GET_S32 (abfd, ext->p_frameoffset);
- intern->framereg = H_GET_16 (abfd, ext->p_framereg);
- intern->pcreg = H_GET_16 (abfd, ext->p_pcreg);
- intern->lnLow = H_GET_32 (abfd, ext->p_lnLow);
- intern->lnHigh = H_GET_32 (abfd, ext->p_lnHigh);
- intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->p_cbLineOffset);
+ intern->adr = ECOFF_GET_OFF (abfd, ext->p_adr);
+ intern->isym = H_GET_32 (abfd, ext->p_isym);
+ intern->iline = H_GET_32 (abfd, ext->p_iline);
+ intern->regmask = H_GET_32 (abfd, ext->p_regmask);
+ intern->regoffset = H_GET_S32 (abfd, ext->p_regoffset);
+ intern->iopt = H_GET_S32 (abfd, ext->p_iopt);
+ intern->fregmask = H_GET_32 (abfd, ext->p_fregmask);
+ intern->fregoffset = H_GET_S32 (abfd, ext->p_fregoffset);
+ intern->frameoffset = H_GET_S32 (abfd, ext->p_frameoffset);
+ intern->framereg = H_GET_16 (abfd, ext->p_framereg);
+ intern->pcreg = H_GET_16 (abfd, ext->p_pcreg);
+ intern->lnLow = H_GET_32 (abfd, ext->p_lnLow);
+ intern->lnHigh = H_GET_32 (abfd, ext->p_lnHigh);
+ intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->p_cbLineOffset);
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
if (intern->isym == (signed long) 0xffffffff)
/* Make it reasonable to do in-place. */
*intern = *intern_copy;
- ECOFF_PUT_OFF (abfd, intern->adr, ext->p_adr);
- H_PUT_32 (abfd, intern->isym, ext->p_isym);
- H_PUT_32 (abfd, intern->iline, ext->p_iline);
- H_PUT_32 (abfd, intern->regmask, ext->p_regmask);
- H_PUT_32 (abfd, intern->regoffset, ext->p_regoffset);
- H_PUT_32 (abfd, intern->iopt, ext->p_iopt);
- H_PUT_32 (abfd, intern->fregmask, ext->p_fregmask);
- H_PUT_32 (abfd, intern->fregoffset, ext->p_fregoffset);
- H_PUT_32 (abfd, intern->frameoffset, ext->p_frameoffset);
- H_PUT_16 (abfd, intern->framereg, ext->p_framereg);
- H_PUT_16 (abfd, intern->pcreg, ext->p_pcreg);
- H_PUT_32 (abfd, intern->lnLow, ext->p_lnLow);
- H_PUT_32 (abfd, intern->lnHigh, ext->p_lnHigh);
+ ECOFF_PUT_OFF (abfd, intern->adr, ext->p_adr);
+ H_PUT_32 (abfd, intern->isym, ext->p_isym);
+ H_PUT_32 (abfd, intern->iline, ext->p_iline);
+ H_PUT_32 (abfd, intern->regmask, ext->p_regmask);
+ H_PUT_32 (abfd, intern->regoffset, ext->p_regoffset);
+ H_PUT_32 (abfd, intern->iopt, ext->p_iopt);
+ H_PUT_32 (abfd, intern->fregmask, ext->p_fregmask);
+ H_PUT_32 (abfd, intern->fregoffset, ext->p_fregoffset);
+ H_PUT_32 (abfd, intern->frameoffset, ext->p_frameoffset);
+ H_PUT_16 (abfd, intern->framereg, ext->p_framereg);
+ H_PUT_16 (abfd, intern->pcreg, ext->p_pcreg);
+ H_PUT_32 (abfd, intern->lnLow, ext->p_lnLow);
+ H_PUT_32 (abfd, intern->lnHigh, ext->p_lnHigh);
ECOFF_PUT_OFF (abfd, intern->cbLineOffset, ext->p_cbLineOffset);
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
*ext = *(struct sym_ext *) ext_copy;
- intern->iss = H_GET_32 (abfd, ext->s_iss);
- intern->value = ECOFF_GET_OFF (abfd, ext->s_value);
+ intern->iss = H_GET_32 (abfd, ext->s_iss);
+ intern->value = ECOFF_GET_OFF (abfd, ext->s_value);
#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64)
if (intern->iss == (signed long) 0xffffffff)
/* Now the fun stuff... */
if (bfd_header_big_endian (abfd))
{
- intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_BIG)
+ intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_BIG)
>> SYM_BITS1_ST_SH_BIG;
- intern->sc = ((ext->s_bits1[0] & SYM_BITS1_SC_BIG)
+ intern->sc = ((ext->s_bits1[0] & SYM_BITS1_SC_BIG)
<< SYM_BITS1_SC_SH_LEFT_BIG)
| ((ext->s_bits2[0] & SYM_BITS2_SC_BIG)
>> SYM_BITS2_SC_SH_BIG);
- intern->reserved = 0 != (ext->s_bits2[0] & SYM_BITS2_RESERVED_BIG);
- intern->index = ((ext->s_bits2[0] & SYM_BITS2_INDEX_BIG)
+ intern->reserved = 0 != (ext->s_bits2[0] & SYM_BITS2_RESERVED_BIG);
+ intern->index = ((ext->s_bits2[0] & SYM_BITS2_INDEX_BIG)
<< SYM_BITS2_INDEX_SH_LEFT_BIG)
| (ext->s_bits3[0] << SYM_BITS3_INDEX_SH_LEFT_BIG)
| (ext->s_bits4[0] << SYM_BITS4_INDEX_SH_LEFT_BIG);
}
else
{
- intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_LITTLE)
+ intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_LITTLE)
>> SYM_BITS1_ST_SH_LITTLE;
- intern->sc = ((ext->s_bits1[0] & SYM_BITS1_SC_LITTLE)
+ intern->sc = ((ext->s_bits1[0] & SYM_BITS1_SC_LITTLE)
>> SYM_BITS1_SC_SH_LITTLE)
| ((ext->s_bits2[0] & SYM_BITS2_SC_LITTLE)
<< SYM_BITS2_SC_SH_LEFT_LITTLE);
- intern->reserved = 0 != (ext->s_bits2[0] & SYM_BITS2_RESERVED_LITTLE);
- intern->index = ((ext->s_bits2[0] & SYM_BITS2_INDEX_LITTLE)
+ intern->reserved = 0 != (ext->s_bits2[0] & SYM_BITS2_RESERVED_LITTLE);
+ intern->index = ((ext->s_bits2[0] & SYM_BITS2_INDEX_LITTLE)
>> SYM_BITS2_INDEX_SH_LITTLE)
| (ext->s_bits3[0] << SYM_BITS3_INDEX_SH_LEFT_LITTLE)
| ((unsigned int) ext->s_bits4[0]
.eh_frame input section that contains the CIE. */
union {
struct cie *full_cie;
- struct eh_cie_fde *merged_with;
- asection *sec;
+ struct eh_cie_fde *merged_with;
+ asection *sec;
} u;
/* The offset of the personality data from the start of the CIE,
#define elf_hash_table_id(table) ((table) -> hash_table_id)
/* Returns TRUE if the hash table is a struct elf_link_hash_table. */
-#define is_elf_hash_table(htab) \
+#define is_elf_hash_table(htab) \
(((struct bfd_link_hash_table *) (htab))->type == bfd_link_elf_hash_table)
/* Used by bfd_sym_from_r_symndx to cache a small number of local
bfd_boolean (*elf_backend_copy_special_section_fields)
(const bfd *ibfd, bfd *obfd, const Elf_Internal_Shdr *isection,
Elf_Internal_Shdr *osection);
-
+
/* Used to handle bad SHF_LINK_ORDER input. */
void (*link_order_error_handler) (const char *, ...);
typedef struct elf_section_list
{
- Elf_Internal_Shdr hdr;
- unsigned int ndx;
+ Elf_Internal_Shdr hdr;
+ unsigned int ndx;
struct elf_section_list * next;
} elf_section_list;
hdr_info->array_count--;
hdr_info->u.compact.entries[hdr_info->array_count] = NULL;
i--;
- }
+ }
}
}
sec_info = (struct eh_frame_sec_info *)
bfd_zmalloc (sizeof (struct eh_frame_sec_info)
- + (num_entries - 1) * sizeof (struct eh_cie_fde));
+ + (num_entries - 1) * sizeof (struct eh_cie_fde));
REQUIRE (sec_info);
/* We need to have a "struct cie" for each CIE in this section. */
{
aug++;
REQUIRE (read_uleb128 (&buf, end, &cie->augmentation_size));
- ENSURE_NO_RELOCS (buf);
+ ENSURE_NO_RELOCS (buf);
}
while (*aug != '\0')
bfd_byte *p;
this_inf->set_loc = (unsigned int *)
- bfd_malloc ((set_loc_count + 1) * sizeof (unsigned int));
+ bfd_malloc ((set_loc_count + 1) * sizeof (unsigned int));
REQUIRE (this_inf->set_loc);
this_inf->set_loc[0] = set_loc_count;
p = insns;
if (info->eh_frame_hdr_type == COMPACT_EH_HDR)
{
/* For compact frames we only add the header. The actual table comes
- from the .eh_frame_entry sections. */
+ from the .eh_frame_entry sections. */
sec->size = 8;
}
else
{
hdr_info->frame_hdr_is_compact = FALSE;
hdr_info->u.dwarf.array = (struct eh_frame_array_ent *)
- bfd_malloc (hdr_info->u.dwarf.fde_count
+ bfd_malloc (hdr_info->u.dwarf.fde_count
* sizeof (*hdr_info->u.dwarf.array));
}
if (hdr_info->u.dwarf.array == NULL)
p->offset = p->u.indirect.section->output_offset;
if (p->next != NULL)
- i--;
+ i--;
}
if (i != 0)
/* The .eh_frame_hdr format for DWARF frames:
ubyte version (currently 1)
- ubyte eh_frame_ptr_enc (DW_EH_PE_* encoding of pointer to start of
+ ubyte eh_frame_ptr_enc (DW_EH_PE_* encoding of pointer to start of
.eh_frame section)
ubyte fde_count_enc (DW_EH_PE_* encoding of total FDE count
number (or DW_EH_PE_omit if there is no
external constraints require 32 or 64 bit specific code. We remap
the definitions/functions as necessary here. */
#if ARCH_SIZE == 64
-#define ELF_R_TYPE(X) ELF64_R_TYPE(X)
-#define ELF_R_SYM(X) ELF64_R_SYM(X)
+#define ELF_R_TYPE(X) ELF64_R_TYPE(X)
+#define ELF_R_SYM(X) ELF64_R_SYM(X)
#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 elf_hppa_relocate_section elf64_hppa_relocate_section
-#define elf_hppa_final_link elf64_hppa_final_link
+#define elf_hppa_final_link elf64_hppa_final_link
#endif
#if ARCH_SIZE == 32
-#define ELF_R_TYPE(X) ELF32_R_TYPE(X)
-#define ELF_R_SYM(X) ELF32_R_SYM(X)
+#define ELF_R_TYPE(X) ELF32_R_TYPE(X)
+#define ELF_R_SYM(X) ELF32_R_SYM(X)
#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 elf_hppa_relocate_section elf32_hppa_relocate_section
-#define elf_hppa_final_link elf32_hppa_final_link
+#define elf_hppa_final_link elf32_hppa_final_link
#endif
/* ELF/PA relocation howto entries. */
There are quite a few relaxing opportunities available on the mn10200:
- * jsr:24 -> jsr:16 2 bytes
+ * jsr:24 -> jsr:16 2 bytes
* jmp:24 -> jmp:16 2 bytes
* jmp:16 -> bra:8 1 byte
&& h->root.type != bfd_link_hash_defweak)
{
/* This appears to be a reference to an undefined
- symbol. Just ignore it--it will be caught by the
- regular reloc processing. */
+ symbol. Just ignore it--it will be caught by the
+ regular reloc processing. */
continue;
}
struct
{
bfd_signed_vma refcount;
- bfd_vma offset;
- char got_allocated;
- char rel_emitted;
+ bfd_vma offset;
+ char got_allocated;
+ char rel_emitted;
} tls_ldm_got;
};
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
- NULL, /* special handler. */
+ NULL, /* special handler. */
"R_MN10300_SYM_DIFF", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
- NULL, /* special handler. */
+ NULL, /* special handler. */
"R_MN10300_ALIGN", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
}
static int
-elf_mn10300_tls_transition (struct bfd_link_info * info,
- int r_type,
+elf_mn10300_tls_transition (struct bfd_link_info * info,
+ int r_type,
struct elf_link_hash_entry * h,
- asection * sec,
- bfd_boolean counting)
+ asection * sec,
+ bfd_boolean counting)
{
bfd_boolean is_local;
this reloc and the PLT reloc. */
static int
-mn10300_do_tls_transition (bfd * input_bfd,
- unsigned int r_type,
- unsigned int tls_r_type,
- bfd_byte * contents,
- bfd_vma offset)
+mn10300_do_tls_transition (bfd * input_bfd,
+ unsigned int r_type,
+ unsigned int tls_r_type,
+ bfd_byte * contents,
+ bfd_vma offset)
{
bfd_byte *op = contents + offset;
int gotreg = 0;
accordingly, copying the operands as needed. The conversions
we do are as follows (IE,GOTIE,LE):
- 1111 1100 1010 01Dn [-- abs32 --] MOV (x@indntpoff),Dn
- 1111 1100 0000 DnAm [-- abs32 --] MOV (x@gotntpoff,Am),Dn
- 1111 1100 1100 11Dn [-- abs32 --] MOV x@tpoff,Dn
+ 1111 1100 1010 01Dn [-- abs32 --] MOV (x@indntpoff),Dn
+ 1111 1100 0000 DnAm [-- abs32 --] MOV (x@gotntpoff,Am),Dn
+ 1111 1100 1100 11Dn [-- abs32 --] MOV x@tpoff,Dn
- 1111 1100 1010 00An [-- abs32 --] MOV (x@indntpoff),An
- 1111 1100 0010 AnAm [-- abs32 --] MOV (x@gotntpoff,Am),An
- 1111 1100 1101 11An [-- abs32 --] MOV x@tpoff,An
+ 1111 1100 1010 00An [-- abs32 --] MOV (x@indntpoff),An
+ 1111 1100 0010 AnAm [-- abs32 --] MOV (x@gotntpoff,Am),An
+ 1111 1100 1101 11An [-- abs32 --] MOV x@tpoff,An
1111 1110 0000 1110 Rnnn Xxxx [-- abs32 --] MOV (x@indntpoff),Rn
1111 1110 0000 1010 Rnnn Rmmm [-- abs32 --] MOV (x@indntpoff,Rm),Rn
case R_MN10300_TLS_IE:
case R_MN10300_TLS_GOTIE: tls_type = GOT_TLS_IE; break;
case R_MN10300_TLS_GD: tls_type = GOT_TLS_GD; break;
- default: tls_type = GOT_NORMAL; break;
+ default: tls_type = GOT_NORMAL; break;
}
sgot = htab->root.sgot;
There are quite a few relaxing opportunities available on the mn10300:
- * calls:32 -> calls:16 2 bytes
+ * calls:32 -> calls:16 2 bytes
* call:32 -> call:16 2 bytes
* call:32 -> calls:32 1 byte
}
static void
-_bfd_mn10300_copy_indirect_symbol (struct bfd_link_info * info,
- struct elf_link_hash_entry * dir,
- struct elf_link_hash_entry * ind)
+_bfd_mn10300_copy_indirect_symbol (struct bfd_link_info * info,
+ struct elf_link_hash_entry * dir,
+ struct elf_link_hash_entry * ind)
{
struct elf32_mn10300_link_hash_entry * edir;
struct elf32_mn10300_link_hash_entry * eind;
if (h->plt.offset != (bfd_vma) -1)
{
- asection * splt;
- asection * sgot;
- asection * srel;
- bfd_vma plt_index;
- bfd_vma got_offset;
+ asection * splt;
+ asection * sgot;
+ asection * srel;
+ bfd_vma plt_index;
+ bfd_vma got_offset;
Elf_Internal_Rela rel;
/* This symbol has an entry in the procedure linkage table. Set
if (h->got.offset != (bfd_vma) -1)
{
- asection * sgot;
- asection * srel;
+ asection * sgot;
+ asection * srel;
Elf_Internal_Rela rel;
/* This symbol has an entry in the global offset table. Set it up. */
if (h->needs_copy)
{
- asection * s;
+ asection * s;
Elf_Internal_Rela rel;
/* This symbol needs a copy reloc. Set it up. */
if (elf_hash_table (info)->dynamic_sections_created)
{
- asection * splt;
+ asection * splt;
Elf32_External_Dyn * dyncon;
Elf32_External_Dyn * dynconend;
if (h->plt.refcount <= 0 && h->got.refcount <= 0)
{
/* When building shared library, we need to handle the case
- where it is marked with regular reference, but not non-GOT
+ where it is marked with regular reference, but not non-GOT
reference. It may happen if we didn't see STT_GNU_IFUNC
symbol at the time when checking relocations. */
if (bfd_link_pic (info)
bfd_size_type size;
size = symtab_hdr->sh_info;
- size *= (sizeof (bfd_signed_vma) /* local got */
- + sizeof (struct plt_entry) /* local plt */
- + sizeof(char)); /* local tls type */
+ size *= (sizeof (bfd_signed_vma) /* local got */
+ + sizeof (struct plt_entry) /* local plt */
+ + sizeof(char)); /* local tls type */
elf_local_got_refcounts (abfd) = ((bfd_signed_vma *)
bfd_zalloc (abfd, size));
if (elf_local_got_refcounts (abfd) == NULL)
subclass. */
if (entry == NULL)
entry = (struct bfd_hash_entry *)
- bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry));
+ bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry));
if (entry == NULL)
return NULL;
bfd_size_type amt = sizeof (struct elf_strtab_hash_entry *);
tab->alloced *= 2;
tab->array = (struct elf_strtab_hash_entry **)
- bfd_realloc_or_free (tab->array, tab->alloced * amt);
+ bfd_realloc_or_free (tab->array, tab->alloced * amt);
if (tab->array == NULL)
return (size_t) -1;
}
&& (*hash_ptr)->root.u.def.section->output_section != NULL)
{
/* This is a relocation from an executable or shared
- library against a symbol in a different shared
- library. We are creating a definition in the output
- file but it does not come from any of our normal (.o)
- files. ie. a PLT stub. Normally this would be a
- relocation against against SHN_UNDEF with the VMA of
- the PLT stub. This upsets the VxWorks loader.
- Convert it to a section-relative relocation. This
- gets some other symbols (for instance .dynbss), but
- is conservatively correct. */
+ library against a symbol in a different shared
+ library. We are creating a definition in the output
+ file but it does not come from any of our normal (.o)
+ files. ie. a PLT stub. Normally this would be a
+ relocation against against SHN_UNDEF with the VMA of
+ the PLT stub. This upsets the VxWorks loader.
+ Convert it to a section-relative relocation. This
+ gets some other symbols (for instance .dynbss), but
+ is conservatively correct. */
for (j = 0; j < bed->s->int_rels_per_ext_rel; j++)
{
asection *sec = (*hash_ptr)->root.u.def.section;
if (extshndx_buf == NULL)
{
alloc_extshndx = (Elf_External_Sym_Shndx *)
- bfd_malloc2 (symcount, sizeof (Elf_External_Sym_Shndx));
+ bfd_malloc2 (symcount, sizeof (Elf_External_Sym_Shndx));
extshndx_buf = alloc_extshndx;
}
if (extshndx_buf == NULL
if (intsym_buf == NULL)
{
alloc_intsym = (Elf_Internal_Sym *)
- bfd_malloc2 (symcount, sizeof (Elf_Internal_Sym));
+ bfd_malloc2 (symcount, sizeof (Elf_Internal_Sym));
intsym_buf = alloc_intsym;
if (intsym_buf == NULL)
goto out;
/* Convert the symbols to internal form. */
isymend = intsym_buf + symcount;
for (esym = (const bfd_byte *) extsym_buf, isym = intsym_buf,
- shndx = extshndx_buf;
+ shndx = extshndx_buf;
isym < isymend;
esym += extsym_size, isym++, shndx = shndx != NULL ? shndx + 1 : NULL)
if (!(*bed->s->swap_symbol_in) (ibfd, esym, shndx, isym))
elf_tdata (abfd)->num_group = num_group;
elf_tdata (abfd)->group_sect_ptr = (Elf_Internal_Shdr **)
- bfd_alloc2 (abfd, num_group, sizeof (Elf_Internal_Shdr *));
+ bfd_alloc2 (abfd, num_group, sizeof (Elf_Internal_Shdr *));
if (elf_tdata (abfd)->group_sect_ptr == NULL)
return FALSE;
memset (elf_tdata (abfd)->group_sect_ptr, 0, num_group * sizeof (Elf_Internal_Shdr *));
unsigned char *src;
Elf_Internal_Group *dest;
- /* Make sure the group section has a BFD section
- attached to it. */
- if (!bfd_section_from_shdr (abfd, i))
- return FALSE;
-
+ /* Make sure the group section has a BFD section
+ attached to it. */
+ if (!bfd_section_from_shdr (abfd, i))
+ return FALSE;
+
/* Add to list of sections. */
elf_tdata (abfd)->group_sect_ptr[num_group] = shdr;
num_group += 1;
BFD_ASSERT (sizeof (*dest) >= 4);
amt = shdr->sh_size * sizeof (*dest) / 4;
shdr->contents = (unsigned char *)
- bfd_alloc2 (abfd, shdr->sh_size, sizeof (*dest) / 4);
+ bfd_alloc2 (abfd, shdr->sh_size, sizeof (*dest) / 4);
/* PR binutils/4110: Handle corrupt group headers. */
if (shdr->contents == NULL)
{
const Elf_Internal_Shdr * b)
{
return
- a->sh_type == b->sh_type
+ a->sh_type == b->sh_type
&& (a->sh_flags & ~ SHF_INFO_LINK)
== (b->sh_flags & ~ SHF_INFO_LINK)
&& a->sh_addralign == b->sh_addralign
/* PR 19938: Attempt to set the ELF section header fields of an OS or
Processor specific section, based upon a matching input section.
Returns TRUE upon success, FALSE otherwise. */
-
+
static bfd_boolean
copy_special_section_fields (const bfd *ibfd,
bfd *obfd,
return changed;
}
-
+
/* Copy the program header and other data from one object module to
another. */
if (elf_elfheader (ibfd)->e_ident[EI_ABIVERSION])
elf_elfheader (obfd)->e_ident[EI_ABIVERSION]
= elf_elfheader (ibfd)->e_ident[EI_ABIVERSION];
-
+
/* Copy object attributes. */
_bfd_elf_copy_obj_attributes (ibfd, obfd);
goto error_return;
extdynend = extdyn + s->size;
/* PR 17512: file: id:000006,sig:06,src:000000,op:flip4,pos:5664.
- Fix range check. */
+ Fix range check. */
for (; extdyn <= (extdynend - extdynsize); extdyn += extdynsize)
{
Elf_Internal_Dyn dyn;
for (entry = elf_symtab_shndx_list (abfd); entry != NULL; entry = entry->next)
if (entry->ndx == shindex)
goto success;
-
+
entry = bfd_alloc (abfd, sizeof * entry);
if (entry == NULL)
goto fail;
static const struct bfd_elf_special_section special_sections_b[] =
{
{ STRING_COMMA_LEN (".bss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_c[] =
{
{ STRING_COMMA_LEN (".comment"), 0, SHT_PROGBITS, 0 },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_d[] =
{
- { STRING_COMMA_LEN (".data"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
- { STRING_COMMA_LEN (".data1"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { STRING_COMMA_LEN (".data"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { STRING_COMMA_LEN (".data1"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
/* There are more DWARF sections than these, but they needn't be added here
unless you have to cope with broken compilers that don't emit section
attributes or you want to help the user writing assembler. */
- { STRING_COMMA_LEN (".debug"), 0, SHT_PROGBITS, 0 },
- { STRING_COMMA_LEN (".debug_line"), 0, SHT_PROGBITS, 0 },
- { STRING_COMMA_LEN (".debug_info"), 0, SHT_PROGBITS, 0 },
- { STRING_COMMA_LEN (".debug_abbrev"), 0, SHT_PROGBITS, 0 },
+ { STRING_COMMA_LEN (".debug"), 0, SHT_PROGBITS, 0 },
+ { STRING_COMMA_LEN (".debug_line"), 0, SHT_PROGBITS, 0 },
+ { STRING_COMMA_LEN (".debug_info"), 0, SHT_PROGBITS, 0 },
+ { STRING_COMMA_LEN (".debug_abbrev"), 0, SHT_PROGBITS, 0 },
{ STRING_COMMA_LEN (".debug_aranges"), 0, SHT_PROGBITS, 0 },
- { STRING_COMMA_LEN (".dynamic"), 0, SHT_DYNAMIC, SHF_ALLOC },
- { STRING_COMMA_LEN (".dynstr"), 0, SHT_STRTAB, SHF_ALLOC },
- { STRING_COMMA_LEN (".dynsym"), 0, SHT_DYNSYM, SHF_ALLOC },
- { NULL, 0, 0, 0, 0 }
+ { STRING_COMMA_LEN (".dynamic"), 0, SHT_DYNAMIC, SHF_ALLOC },
+ { STRING_COMMA_LEN (".dynstr"), 0, SHT_STRTAB, SHF_ALLOC },
+ { STRING_COMMA_LEN (".dynsym"), 0, SHT_DYNSYM, SHF_ALLOC },
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_f[] =
{
- { STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
{ STRING_COMMA_LEN (".fini_array"), -2, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE },
- { NULL, 0 , 0, 0, 0 }
+ { NULL, 0 , 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_g[] =
{
{ STRING_COMMA_LEN (".gnu.linkonce.b"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
- { STRING_COMMA_LEN (".gnu.lto_"), -1, SHT_PROGBITS, SHF_EXCLUDE },
- { STRING_COMMA_LEN (".got"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
- { STRING_COMMA_LEN (".gnu.version"), 0, SHT_GNU_versym, 0 },
+ { STRING_COMMA_LEN (".gnu.lto_"), -1, SHT_PROGBITS, SHF_EXCLUDE },
+ { STRING_COMMA_LEN (".got"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { STRING_COMMA_LEN (".gnu.version"), 0, SHT_GNU_versym, 0 },
{ STRING_COMMA_LEN (".gnu.version_d"), 0, SHT_GNU_verdef, 0 },
{ STRING_COMMA_LEN (".gnu.version_r"), 0, SHT_GNU_verneed, 0 },
- { STRING_COMMA_LEN (".gnu.liblist"), 0, SHT_GNU_LIBLIST, SHF_ALLOC },
- { STRING_COMMA_LEN (".gnu.conflict"), 0, SHT_RELA, SHF_ALLOC },
- { STRING_COMMA_LEN (".gnu.hash"), 0, SHT_GNU_HASH, SHF_ALLOC },
- { NULL, 0, 0, 0, 0 }
+ { STRING_COMMA_LEN (".gnu.liblist"), 0, SHT_GNU_LIBLIST, SHF_ALLOC },
+ { STRING_COMMA_LEN (".gnu.conflict"), 0, SHT_RELA, SHF_ALLOC },
+ { STRING_COMMA_LEN (".gnu.hash"), 0, SHT_GNU_HASH, SHF_ALLOC },
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_h[] =
{
- { STRING_COMMA_LEN (".hash"), 0, SHT_HASH, SHF_ALLOC },
- { NULL, 0, 0, 0, 0 }
+ { STRING_COMMA_LEN (".hash"), 0, SHT_HASH, SHF_ALLOC },
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_i[] =
{
- { STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
{ STRING_COMMA_LEN (".init_array"), -2, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE },
- { STRING_COMMA_LEN (".interp"), 0, SHT_PROGBITS, 0 },
- { NULL, 0, 0, 0, 0 }
+ { STRING_COMMA_LEN (".interp"), 0, SHT_PROGBITS, 0 },
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_l[] =
{
{ STRING_COMMA_LEN (".line"), 0, SHT_PROGBITS, 0 },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_n[] =
{
{ STRING_COMMA_LEN (".note.GNU-stack"), 0, SHT_PROGBITS, 0 },
- { STRING_COMMA_LEN (".note"), -1, SHT_NOTE, 0 },
- { NULL, 0, 0, 0, 0 }
+ { STRING_COMMA_LEN (".note"), -1, SHT_NOTE, 0 },
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_p[] =
{
{ STRING_COMMA_LEN (".preinit_array"), -2, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE },
- { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
- { NULL, 0, 0, 0, 0 }
+ { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_r[] =
{
{ STRING_COMMA_LEN (".rodata"), -2, SHT_PROGBITS, SHF_ALLOC },
{ STRING_COMMA_LEN (".rodata1"), 0, SHT_PROGBITS, SHF_ALLOC },
- { STRING_COMMA_LEN (".rela"), -1, SHT_RELA, 0 },
- { STRING_COMMA_LEN (".rel"), -1, SHT_REL, 0 },
- { NULL, 0, 0, 0, 0 }
+ { STRING_COMMA_LEN (".rela"), -1, SHT_RELA, 0 },
+ { STRING_COMMA_LEN (".rel"), -1, SHT_REL, 0 },
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_s[] =
/* See struct bfd_elf_special_section declaration for the semantics of
this special case where .prefix_length != strlen (.prefix). */
{ ".stabstr", 5, 3, SHT_STRTAB, 0 },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_t[] =
{
- { STRING_COMMA_LEN (".text"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
- { STRING_COMMA_LEN (".tbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
+ { STRING_COMMA_LEN (".text"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { STRING_COMMA_LEN (".tbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
{ STRING_COMMA_LEN (".tdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section special_sections_z[] =
{
- { STRING_COMMA_LEN (".zdebug_line"), 0, SHT_PROGBITS, 0 },
- { STRING_COMMA_LEN (".zdebug_info"), 0, SHT_PROGBITS, 0 },
+ { STRING_COMMA_LEN (".zdebug_line"), 0, SHT_PROGBITS, 0 },
+ { STRING_COMMA_LEN (".zdebug_info"), 0, SHT_PROGBITS, 0 },
{ STRING_COMMA_LEN (".zdebug_abbrev"), 0, SHT_PROGBITS, 0 },
{ STRING_COMMA_LEN (".zdebug_aranges"), 0, SHT_PROGBITS, 0 },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
static const struct bfd_elf_special_section * const special_sections[] =
if (sdata == NULL)
{
sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd,
- sizeof (*sdata));
+ sizeof (*sdata));
if (sdata == NULL)
return FALSE;
sec->used_by_bfd = sdata;
/* Set up the list of section header pointers, in agreement with the
indices. */
i_shdrp = (Elf_Internal_Shdr **) bfd_zalloc2 (abfd, section_number,
- sizeof (Elf_Internal_Shdr *));
+ sizeof (Elf_Internal_Shdr *));
if (i_shdrp == NULL)
return FALSE;
i_shdrp[0] = (Elf_Internal_Shdr *) bfd_zalloc (abfd,
- sizeof (Elf_Internal_Shdr));
+ sizeof (Elf_Internal_Shdr));
if (i_shdrp[0] == NULL)
{
bfd_release (abfd, i_shdrp);
/* Now sort the symbols so the local symbols are first. */
new_syms = (asymbol **) bfd_alloc2 (abfd, num_locals + num_globals,
- sizeof (asymbol *));
+ sizeof (asymbol *));
if (new_syms == NULL)
return FALSE;
struct elf_segment_map *m;
m = (struct elf_segment_map *) bfd_zalloc (abfd,
- sizeof (struct elf_segment_map));
+ sizeof (struct elf_segment_map));
if (m == NULL)
return NULL;
m->next = NULL;
/* Select the allocated sections, and sort them. */
sections = (asection **) bfd_malloc2 (bfd_count_sections (abfd),
- sizeof (asection *));
+ sizeof (asection *));
if (sections == NULL)
goto error_return;
== 0);
phdrs = (Elf_Internal_Phdr *)
bfd_zalloc2 (abfd,
- (elf_program_header_size (abfd) / bed->s->sizeof_phdr),
- sizeof (Elf_Internal_Phdr));
+ (elf_program_header_size (abfd) / bed->s->sizeof_phdr),
+ sizeof (Elf_Internal_Phdr));
elf_tdata (abfd)->phdr = phdrs;
if (phdrs == NULL)
return FALSE;
if (p->p_filesz + adjust < p->p_memsz)
{
/* We have a PROGBITS section following NOBITS ones.
- Allocate file space for the NOBITS section(s) and
+ Allocate file space for the NOBITS section(s) and
zero it. */
adjust = p->p_memsz - p->p_filesz;
if (!write_zeros (abfd, off, adjust))
abort ();
p->p_memsz = p->p_filesz;
/* Preserve the alignment and flags if they are valid. The
- gold linker generates RW/4 for the PT_GNU_RELRO section.
+ gold linker generates RW/4 for the PT_GNU_RELRO section.
It is better for objcopy/strip to honor these attributes
otherwise gdb will choke when using separate debug files.
*/
FIXME: We used to have code here to sort the PT_LOAD segments into
ascending order, as per the ELF spec. But this breaks some programs,
including the Linux kernel. But really either the spec should be
- changed or the programs updated. */
+ changed or the programs updated. */
if (alloc > 1
&& tdata->phdr[0].p_type == PT_PHDR
&& ! bed->elf_backend_allow_non_load_phdr (abfd, tdata->phdr, alloc)
/* Special segments, such as the PT_PHDR segment, may contain
no sections, but ordinary, loadable segments should contain
something. They are allowed by the ELF spec however, so only
- a warning is produced.
+ a warning is produced.
There is however the valid use case of embedded systems which
have segments with p_filesz of 0 and a p_memsz > 0 to initialize
flash memory with zeros. No warning is shown for that case. */
}
outbound_syms = (bfd_byte *) bfd_alloc2 (abfd, 1 + symcount,
- bed->s->sizeof_sym);
+ bed->s->sizeof_sym);
if (outbound_syms == NULL)
{
error_return:
else
{
iverneed->vn_auxptr = (struct elf_internal_vernaux *)
- bfd_alloc2 (abfd, iverneed->vn_cnt,
- sizeof (Elf_Internal_Vernaux));
+ bfd_alloc2 (abfd, iverneed->vn_cnt,
+ sizeof (Elf_Internal_Vernaux));
if (iverneed->vn_auxptr == NULL)
goto error_return_verref;
}
else
{
iverdef->vd_auxptr = (struct elf_internal_verdaux *)
- bfd_alloc2 (abfd, iverdef->vd_cnt,
- sizeof (Elf_Internal_Verdaux));
+ bfd_alloc2 (abfd, iverdef->vd_cnt,
+ sizeof (Elf_Internal_Verdaux));
if (iverdef->vd_auxptr == NULL)
goto error_return_verdef;
}
freeidx++;
elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *)
- bfd_zalloc2 (abfd, freeidx, sizeof (Elf_Internal_Verdef));
+ bfd_zalloc2 (abfd, freeidx, sizeof (Elf_Internal_Verdef));
if (elf_tdata (abfd)->verdef == NULL)
goto error_return;
forward-backward labels (aka local labels) as locals.
These labels have the form:
- L0^A.* (fake symbols)
+ L0^A.* (fake symbols)
[.]?L[0123456789]+{^A|^B}[0123456789]* (local labels)
case NT_PPC_VSX:
if (note->namesz == 6
- && strcmp (note->namedata, "LINUX") == 0)
- return elfcore_grok_ppc_vsx (abfd, note);
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_ppc_vsx (abfd, note);
else
- return TRUE;
+ return TRUE;
case NT_S390_HIGH_GPRS:
if (note->namesz == 6
- && strcmp (note->namedata, "LINUX") == 0)
- return elfcore_grok_s390_high_gprs (abfd, note);
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_s390_high_gprs (abfd, note);
else
- return TRUE;
+ return TRUE;
case NT_S390_TIMER:
if (note->namesz == 6
- && strcmp (note->namedata, "LINUX") == 0)
- return elfcore_grok_s390_timer (abfd, note);
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_s390_timer (abfd, note);
else
- return TRUE;
+ return TRUE;
case NT_S390_TODCMP:
if (note->namesz == 6
- && strcmp (note->namedata, "LINUX") == 0)
- return elfcore_grok_s390_todcmp (abfd, note);
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_s390_todcmp (abfd, note);
else
- return TRUE;
+ return TRUE;
case NT_S390_TODPREG:
if (note->namesz == 6
- && strcmp (note->namedata, "LINUX") == 0)
- return elfcore_grok_s390_todpreg (abfd, note);
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_s390_todpreg (abfd, note);
else
- return TRUE;
+ return TRUE;
case NT_S390_CTRS:
if (note->namesz == 6
- && strcmp (note->namedata, "LINUX") == 0)
- return elfcore_grok_s390_ctrs (abfd, note);
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_s390_ctrs (abfd, note);
else
- return TRUE;
+ return TRUE;
case NT_S390_PREFIX:
if (note->namesz == 6
- && strcmp (note->namedata, "LINUX") == 0)
- return elfcore_grok_s390_prefix (abfd, note);
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_s390_prefix (abfd, note);
else
- return TRUE;
+ return TRUE;
case NT_S390_LAST_BREAK:
if (note->namesz == 6
- && strcmp (note->namedata, "LINUX") == 0)
- return elfcore_grok_s390_last_break (abfd, note);
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_s390_last_break (abfd, note);
else
- return TRUE;
+ return TRUE;
case NT_S390_SYSTEM_CALL:
if (note->namesz == 6
- && strcmp (note->namedata, "LINUX") == 0)
- return elfcore_grok_s390_system_call (abfd, note);
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_s390_system_call (abfd, note);
else
- return TRUE;
+ return TRUE;
case NT_S390_TDB:
if (note->namesz == 6
- && strcmp (note->namedata, "LINUX") == 0)
- return elfcore_grok_s390_tdb (abfd, note);
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_s390_tdb (abfd, note);
else
- return TRUE;
+ return TRUE;
case NT_S390_VXRS_LOW:
if (note->namesz == 6
if (sect == NULL)
return FALSE;
- sect->size = note->descsz;
- sect->filepos = note->descpos;
+ sect->size = note->descsz;
+ sect->filepos = note->descpos;
sect->alignment_power = 2;
return (elfcore_maybe_make_sect (abfd, ".qnx_core_status", sect));
if (sect == NULL)
return FALSE;
- sect->size = note->descsz;
- sect->filepos = note->descpos;
+ sect->size = note->descsz;
+ sect->filepos = note->descpos;
sect->alignment_power = 2;
/* This is the current thread. */
if (sect == NULL)
return FALSE;
- sect->size = note->descsz;
- sect->filepos = note->descpos;
+ sect->size = note->descsz;
+ sect->filepos = note->descpos;
sect->alignment_power = 1;
return TRUE;
char *
elfcore_write_ppc_vsx (bfd *abfd,
- char *buf,
- int *bufsiz,
- const void *ppc_vsx,
- int size)
+ char *buf,
+ int *bufsiz,
+ const void *ppc_vsx,
+ int size)
{
char *note_name = "LINUX";
return elfcore_write_note (abfd, buf, bufsiz,
- note_name, NT_PPC_VSX, ppc_vsx, size);
+ note_name, NT_PPC_VSX, ppc_vsx, size);
}
static char *
{
char *note_name = "LINUX";
return elfcore_write_note (abfd, buf, bufsiz,
- note_name, NT_S390_HIGH_GPRS,
+ note_name, NT_S390_HIGH_GPRS,
s390_high_gprs, size);
}
char *
elfcore_write_s390_timer (bfd *abfd,
- char *buf,
- int *bufsiz,
- const void *s390_timer,
- int size)
+ char *buf,
+ int *bufsiz,
+ const void *s390_timer,
+ int size)
{
char *note_name = "LINUX";
return elfcore_write_note (abfd, buf, bufsiz,
- note_name, NT_S390_TIMER, s390_timer, size);
+ note_name, NT_S390_TIMER, s390_timer, size);
}
char *
elfcore_write_s390_todcmp (bfd *abfd,
- char *buf,
- int *bufsiz,
- const void *s390_todcmp,
- int size)
+ char *buf,
+ int *bufsiz,
+ const void *s390_todcmp,
+ int size)
{
char *note_name = "LINUX";
return elfcore_write_note (abfd, buf, bufsiz,
- note_name, NT_S390_TODCMP, s390_todcmp, size);
+ note_name, NT_S390_TODCMP, s390_todcmp, size);
}
char *
elfcore_write_s390_todpreg (bfd *abfd,
- char *buf,
- int *bufsiz,
- const void *s390_todpreg,
- int size)
+ char *buf,
+ int *bufsiz,
+ const void *s390_todpreg,
+ int size)
{
char *note_name = "LINUX";
return elfcore_write_note (abfd, buf, bufsiz,
- note_name, NT_S390_TODPREG, s390_todpreg, size);
+ note_name, NT_S390_TODPREG, s390_todpreg, size);
}
char *
elfcore_write_s390_ctrs (bfd *abfd,
- char *buf,
- int *bufsiz,
- const void *s390_ctrs,
- int size)
+ char *buf,
+ int *bufsiz,
+ const void *s390_ctrs,
+ int size)
{
char *note_name = "LINUX";
return elfcore_write_note (abfd, buf, bufsiz,
- note_name, NT_S390_CTRS, s390_ctrs, size);
+ note_name, NT_S390_CTRS, s390_ctrs, size);
}
char *
elfcore_write_s390_prefix (bfd *abfd,
- char *buf,
- int *bufsiz,
- const void *s390_prefix,
- int size)
+ char *buf,
+ int *bufsiz,
+ const void *s390_prefix,
+ int size)
{
char *note_name = "LINUX";
return elfcore_write_note (abfd, buf, bufsiz,
- note_name, NT_S390_PREFIX, s390_prefix, size);
+ note_name, NT_S390_PREFIX, s390_prefix, size);
}
char *
{
char *note_name = "LINUX";
return elfcore_write_note (abfd, buf, bufsiz,
- note_name, NT_S390_LAST_BREAK,
+ note_name, NT_S390_LAST_BREAK,
s390_last_break, size);
}
{
char *note_name = "LINUX";
return elfcore_write_note (abfd, buf, bufsiz,
- note_name, NT_S390_SYSTEM_CALL,
+ note_name, NT_S390_SYSTEM_CALL,
s390_system_call, size);
}
{
char *note_name = "LINUX";
return elfcore_write_note (abfd, buf, bufsiz,
- note_name, NT_S390_TDB, s390_tdb, size);
+ note_name, NT_S390_TDB, s390_tdb, size);
}
char *
return FALSE;
switch (bfd_get_format (abfd))
- {
+ {
default:
return TRUE;
#define ELF_MAXPAGESIZE 0x1000
/* Rename global functions. */
-#define _bfd_mn10300_elf_merge_private_bfd_data _bfd_am33_elf_merge_private_bfd_data
-#define _bfd_mn10300_elf_object_p _bfd_am33_elf_object_p
-#define _bfd_mn10300_elf_final_write_processing _bfd_am33_elf_final_write_processing
+#define _bfd_mn10300_elf_merge_private_bfd_data _bfd_am33_elf_merge_private_bfd_data
+#define _bfd_mn10300_elf_object_p _bfd_am33_elf_object_p
+#define _bfd_mn10300_elf_final_write_processing _bfd_am33_elf_final_write_processing
/* Support for core dump NOTE sections. */
static bfd_boolean
if (_htab->dynamic_sections_created == TRUE) \
{ \
BFD_ASSERT (_htab->srel##SECTION &&_htab->srel##SECTION->contents); \
- _loc = _htab->srel##SECTION->contents \
- + ((_htab->srel##SECTION->reloc_count) \
- * sizeof (Elf32_External_Rela)); \
- _htab->srel##SECTION->reloc_count++; \
- _rel.r_addend = ADDEND; \
- _rel.r_offset = (_htab->s##SECTION)->output_section->vma \
- + (_htab->s##SECTION)->output_offset + OFFSET; \
- BFD_ASSERT ((long) SYM_IDX != -1); \
- _rel.r_info = ELF32_R_INFO (SYM_IDX, TYPE); \
- bfd_elf32_swap_reloca_out (BFD, &_rel, _loc); \
+ _loc = _htab->srel##SECTION->contents \
+ + ((_htab->srel##SECTION->reloc_count) \
+ * sizeof (Elf32_External_Rela)); \
+ _htab->srel##SECTION->reloc_count++; \
+ _rel.r_addend = ADDEND; \
+ _rel.r_offset = (_htab->s##SECTION)->output_section->vma \
+ + (_htab->s##SECTION)->output_offset + OFFSET; \
+ BFD_ASSERT ((long) SYM_IDX != -1); \
+ _rel.r_info = ELF32_R_INFO (SYM_IDX, TYPE); \
+ bfd_elf32_swap_reloca_out (BFD, &_rel, _loc); \
} \
}
#else
#define PRINT_DEBUG_RELOC_INFO_BEFORE(...)
-#define PRINT_DEBUG_RELOC_INFO_AFTER
+#define PRINT_DEBUG_RELOC_INFO_AFTER
#endif /* ARC_ENABLE_DEBUG */
corresponding to the st_shndx field of each
local symbol. */
static bfd_boolean
-elf_arc_relocate_section (bfd * output_bfd,
+elf_arc_relocate_section (bfd * output_bfd,
struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * relocs,
Elf_Internal_Sym * local_syms,
- asection ** local_sections)
+ asection ** local_sections)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- Elf_Internal_Rela * rel;
- Elf_Internal_Rela * wrel;
- Elf_Internal_Rela * relend;
+ Elf_Internal_Rela * rel;
+ Elf_Internal_Rela * wrel;
+ Elf_Internal_Rela * relend;
struct elf_link_hash_table * htab = elf_hash_table (info);
symtab_hdr = &((elf_tdata (input_bfd))->symtab_hdr);
relend = relocs + input_section->reloc_count;
for (; rel < relend; wrel++, rel++)
{
- enum elf_arc_reloc_type r_type;
+ enum elf_arc_reloc_type r_type;
reloc_howto_type * howto;
unsigned long r_symndx;
struct elf_link_hash_entry * h;
Elf_Internal_Sym * sym;
asection * sec;
struct elf_link_hash_entry * h2;
- const char * msg;
+ const char * msg;
bfd_boolean unresolved_reloc = FALSE;
struct arc_relocation_data reloc_data =
.reloc_offset = 0,
.reloc_addend = 0,
.got_offset_value = 0,
- .sym_value = 0,
+ .sym_value = 0,
.sym_section = NULL,
.howto = NULL,
.input_section = NULL,
{
create_got_dynrelocs_for_single_entry (
got_entry_for_type (list,
- arc_got_entry_type_for_reloc (howto)),
+ arc_got_entry_type_for_reloc (howto)),
output_bfd, info, NULL);
}
}
#define elf_backend_obj_attrs_arg_type elf32_arc_obj_attrs_arg_type
#undef elf_backend_obj_attrs_section_type
#define elf_backend_obj_attrs_section_type SHT_ARC_ATTRIBUTES
-#define elf_backend_obj_attrs_handle_unknown elf32_arc_obj_attrs_handle_unknown
+#define elf_backend_obj_attrs_handle_unknown elf32_arc_obj_attrs_handle_unknown
-#define elf_backend_section_from_shdr elf32_arc_section_from_shdr
+#define elf_backend_section_from_shdr elf32_arc_section_from_shdr
#include "elf32-target.h"
? bfd_elf32_swap_reloc_out \
: bfd_elf32_swap_reloca_out)
-#define elf_info_to_howto 0
-#define elf_info_to_howto_rel elf32_arm_info_to_howto
+#define elf_info_to_howto 0
+#define elf_info_to_howto_rel elf32_arm_info_to_howto
#define ARM_ELF_ABI_VERSION 0
#define ARM_ELF_OS_ABI_VERSION ELFOSABI_ARM
0x07ff2fff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_THM_PC8, /* type */
+ HOWTO (R_ARM_THM_PC8, /* type */
1, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
/* Dynamic TLS relocations. */
HOWTO (R_ARM_TLS_DTPMOD32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_TLS_DTPMOD32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_TLS_DTPOFF32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_TLS_DTPOFF32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_TLS_TPOFF32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_TLS_TPOFF32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Relocs used in ARM Linux */
HOWTO (R_ARM_COPY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_COPY", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_GLOB_DAT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_GLOB_DAT", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_JUMP_SLOT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_JUMP_SLOT", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_RELATIVE, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_RELATIVE", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_GOTOFF32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_GOTOFF32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_GOTPC, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
TRUE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_GOTPC", /* name */
TRUE), /* pcrel_offset */
HOWTO (R_ARM_GOT32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_GOT32", /* name */
FALSE), /* pcrel_offset */
HOWTO (R_ARM_PLT32, /* type */
- 2, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 24, /* bitsize */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 24, /* bitsize */
TRUE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_PLT32", /* name */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_ALU_PC_G0, /* type */
+ HOWTO (R_ARM_ALU_PC_G0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_ALU_PC_G0", /* name */
+ "R_ARM_ALU_PC_G0", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_ALU_PC_G1, /* type */
+ HOWTO (R_ARM_ALU_PC_G1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_ALU_PC_G1", /* name */
+ "R_ARM_ALU_PC_G1", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_ALU_PC_G2, /* type */
+ HOWTO (R_ARM_ALU_PC_G2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_ALU_PC_G2", /* name */
+ "R_ARM_ALU_PC_G2", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDR_PC_G1, /* type */
+ HOWTO (R_ARM_LDR_PC_G1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDR_PC_G1", /* name */
+ "R_ARM_LDR_PC_G1", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDR_PC_G2, /* type */
+ HOWTO (R_ARM_LDR_PC_G2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDR_PC_G2", /* name */
+ "R_ARM_LDR_PC_G2", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDRS_PC_G0, /* type */
+ HOWTO (R_ARM_LDRS_PC_G0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDRS_PC_G0", /* name */
+ "R_ARM_LDRS_PC_G0", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDRS_PC_G1, /* type */
+ HOWTO (R_ARM_LDRS_PC_G1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDRS_PC_G1", /* name */
+ "R_ARM_LDRS_PC_G1", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDRS_PC_G2, /* type */
+ HOWTO (R_ARM_LDRS_PC_G2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDRS_PC_G2", /* name */
+ "R_ARM_LDRS_PC_G2", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDC_PC_G0, /* type */
+ HOWTO (R_ARM_LDC_PC_G0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDC_PC_G0", /* name */
+ "R_ARM_LDC_PC_G0", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDC_PC_G1, /* type */
+ HOWTO (R_ARM_LDC_PC_G1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDC_PC_G1", /* name */
+ "R_ARM_LDC_PC_G1", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDC_PC_G2, /* type */
+ HOWTO (R_ARM_LDC_PC_G2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDC_PC_G2", /* name */
+ "R_ARM_LDC_PC_G2", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_ALU_SB_G0_NC, /* type */
+ HOWTO (R_ARM_ALU_SB_G0_NC, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_ALU_SB_G0_NC", /* name */
+ "R_ARM_ALU_SB_G0_NC", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_ALU_SB_G0, /* type */
+ HOWTO (R_ARM_ALU_SB_G0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_ALU_SB_G0", /* name */
+ "R_ARM_ALU_SB_G0", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_ALU_SB_G1_NC, /* type */
+ HOWTO (R_ARM_ALU_SB_G1_NC, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_ALU_SB_G1_NC", /* name */
+ "R_ARM_ALU_SB_G1_NC", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_ALU_SB_G1, /* type */
+ HOWTO (R_ARM_ALU_SB_G1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_ALU_SB_G1", /* name */
+ "R_ARM_ALU_SB_G1", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_ALU_SB_G2, /* type */
+ HOWTO (R_ARM_ALU_SB_G2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_ALU_SB_G2", /* name */
+ "R_ARM_ALU_SB_G2", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDR_SB_G0, /* type */
+ HOWTO (R_ARM_LDR_SB_G0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDR_SB_G0", /* name */
+ "R_ARM_LDR_SB_G0", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDR_SB_G1, /* type */
+ HOWTO (R_ARM_LDR_SB_G1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDR_SB_G1", /* name */
+ "R_ARM_LDR_SB_G1", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDR_SB_G2, /* type */
+ HOWTO (R_ARM_LDR_SB_G2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDR_SB_G2", /* name */
+ "R_ARM_LDR_SB_G2", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDRS_SB_G0, /* type */
+ HOWTO (R_ARM_LDRS_SB_G0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDRS_SB_G0", /* name */
+ "R_ARM_LDRS_SB_G0", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDRS_SB_G1, /* type */
+ HOWTO (R_ARM_LDRS_SB_G1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDRS_SB_G1", /* name */
+ "R_ARM_LDRS_SB_G1", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDRS_SB_G2, /* type */
+ HOWTO (R_ARM_LDRS_SB_G2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDRS_SB_G2", /* name */
+ "R_ARM_LDRS_SB_G2", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDC_SB_G0, /* type */
+ HOWTO (R_ARM_LDC_SB_G0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDC_SB_G0", /* name */
+ "R_ARM_LDC_SB_G0", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDC_SB_G1, /* type */
+ HOWTO (R_ARM_LDC_SB_G1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDC_SB_G1", /* name */
+ "R_ARM_LDC_SB_G1", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
- HOWTO (R_ARM_LDC_SB_G2, /* type */
+ HOWTO (R_ARM_LDC_SB_G2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_LDC_SB_G2", /* name */
+ "R_ARM_LDC_SB_G2", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
0x00000fff, /* dst_mask */
FALSE), /* pcrel_offset */
- EMPTY_HOWTO (R_ARM_GOTRELAX), /* reserved for future GOT-load optimizations */
+ EMPTY_HOWTO (R_ARM_GOTRELAX), /* reserved for future GOT-load optimizations */
/* GNU extension to record C++ vtable member usage */
- HOWTO (R_ARM_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (R_ARM_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_ARM_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_ARM_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_ARM_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
+ NULL, /* special_function */
"R_ARM_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_THM_JUMP11, /* type */
1, /* rightshift */
/* TLS relocations */
HOWTO (R_ARM_TLS_GD32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
NULL, /* special_function */
"R_ARM_TLS_GD32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_TLS_LDM32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_TLS_LDM32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_TLS_LDO32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_TLS_LDO32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_TLS_IE32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
NULL, /* special_function */
"R_ARM_TLS_IE32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_TLS_LE32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
- NULL, /* special_function */
+ NULL, /* special_function */
"R_ARM_TLS_LE32", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_ARM_TLS_LDO12, /* type */
0, /* rightshift */
static reloc_howto_type elf32_arm_howto_table_2[1] =
{
HOWTO (R_ARM_IRELATIVE, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_IRELATIVE", /* name */
struct elf32_arm_reloc_map
{
bfd_reloc_code_real_type bfd_reloc_val;
- unsigned char elf_reloc_val;
+ unsigned char elf_reloc_val;
};
/* All entries in this list must also be present in elf32_arm_howto_table. */
static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
{
- {BFD_RELOC_NONE, R_ARM_NONE},
+ {BFD_RELOC_NONE, R_ARM_NONE},
{BFD_RELOC_ARM_PCREL_BRANCH, R_ARM_PC24},
{BFD_RELOC_ARM_PCREL_CALL, R_ARM_CALL},
{BFD_RELOC_ARM_PCREL_JUMP, R_ARM_JUMP24},
- {BFD_RELOC_ARM_PCREL_BLX, R_ARM_XPC25},
- {BFD_RELOC_THUMB_PCREL_BLX, R_ARM_THM_XPC22},
- {BFD_RELOC_32, R_ARM_ABS32},
- {BFD_RELOC_32_PCREL, R_ARM_REL32},
- {BFD_RELOC_8, R_ARM_ABS8},
- {BFD_RELOC_16, R_ARM_ABS16},
- {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12},
+ {BFD_RELOC_ARM_PCREL_BLX, R_ARM_XPC25},
+ {BFD_RELOC_THUMB_PCREL_BLX, R_ARM_THM_XPC22},
+ {BFD_RELOC_32, R_ARM_ABS32},
+ {BFD_RELOC_32_PCREL, R_ARM_REL32},
+ {BFD_RELOC_8, R_ARM_ABS8},
+ {BFD_RELOC_16, R_ARM_ABS16},
+ {BFD_RELOC_ARM_OFFSET_IMM, R_ARM_ABS12},
{BFD_RELOC_ARM_THUMB_OFFSET, R_ARM_THM_ABS5},
{BFD_RELOC_THUMB_PCREL_BRANCH25, R_ARM_THM_JUMP24},
{BFD_RELOC_THUMB_PCREL_BRANCH23, R_ARM_THM_CALL},
{BFD_RELOC_THUMB_PCREL_BRANCH20, R_ARM_THM_JUMP19},
{BFD_RELOC_THUMB_PCREL_BRANCH9, R_ARM_THM_JUMP8},
{BFD_RELOC_THUMB_PCREL_BRANCH7, R_ARM_THM_JUMP6},
- {BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT},
- {BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT},
- {BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE},
- {BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF32},
- {BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC},
- {BFD_RELOC_ARM_GOT_PREL, R_ARM_GOT_PREL},
- {BFD_RELOC_ARM_GOT32, R_ARM_GOT32},
- {BFD_RELOC_ARM_PLT32, R_ARM_PLT32},
+ {BFD_RELOC_ARM_GLOB_DAT, R_ARM_GLOB_DAT},
+ {BFD_RELOC_ARM_JUMP_SLOT, R_ARM_JUMP_SLOT},
+ {BFD_RELOC_ARM_RELATIVE, R_ARM_RELATIVE},
+ {BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF32},
+ {BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC},
+ {BFD_RELOC_ARM_GOT_PREL, R_ARM_GOT_PREL},
+ {BFD_RELOC_ARM_GOT32, R_ARM_GOT32},
+ {BFD_RELOC_ARM_PLT32, R_ARM_PLT32},
{BFD_RELOC_ARM_TARGET1, R_ARM_TARGET1},
{BFD_RELOC_ARM_ROSEGREL32, R_ARM_ROSEGREL32},
{BFD_RELOC_ARM_SBREL32, R_ARM_SBREL32},
{BFD_RELOC_ARM_PREL31, R_ARM_PREL31},
{BFD_RELOC_ARM_TARGET2, R_ARM_TARGET2},
- {BFD_RELOC_ARM_PLT32, R_ARM_PLT32},
- {BFD_RELOC_ARM_TLS_GOTDESC, R_ARM_TLS_GOTDESC},
- {BFD_RELOC_ARM_TLS_CALL, R_ARM_TLS_CALL},
+ {BFD_RELOC_ARM_PLT32, R_ARM_PLT32},
+ {BFD_RELOC_ARM_TLS_GOTDESC, R_ARM_TLS_GOTDESC},
+ {BFD_RELOC_ARM_TLS_CALL, R_ARM_TLS_CALL},
{BFD_RELOC_ARM_THM_TLS_CALL, R_ARM_THM_TLS_CALL},
- {BFD_RELOC_ARM_TLS_DESCSEQ, R_ARM_TLS_DESCSEQ},
+ {BFD_RELOC_ARM_TLS_DESCSEQ, R_ARM_TLS_DESCSEQ},
{BFD_RELOC_ARM_THM_TLS_DESCSEQ, R_ARM_THM_TLS_DESCSEQ},
- {BFD_RELOC_ARM_TLS_DESC, R_ARM_TLS_DESC},
+ {BFD_RELOC_ARM_TLS_DESC, R_ARM_TLS_DESC},
{BFD_RELOC_ARM_TLS_GD32, R_ARM_TLS_GD32},
{BFD_RELOC_ARM_TLS_LDO32, R_ARM_TLS_LDO32},
{BFD_RELOC_ARM_TLS_LDM32, R_ARM_TLS_LDM32},
{BFD_RELOC_ARM_TLS_DTPMOD32, R_ARM_TLS_DTPMOD32},
{BFD_RELOC_ARM_TLS_DTPOFF32, R_ARM_TLS_DTPOFF32},
- {BFD_RELOC_ARM_TLS_TPOFF32, R_ARM_TLS_TPOFF32},
- {BFD_RELOC_ARM_TLS_IE32, R_ARM_TLS_IE32},
- {BFD_RELOC_ARM_TLS_LE32, R_ARM_TLS_LE32},
- {BFD_RELOC_ARM_IRELATIVE, R_ARM_IRELATIVE},
+ {BFD_RELOC_ARM_TLS_TPOFF32, R_ARM_TLS_TPOFF32},
+ {BFD_RELOC_ARM_TLS_IE32, R_ARM_TLS_IE32},
+ {BFD_RELOC_ARM_TLS_LE32, R_ARM_TLS_LE32},
+ {BFD_RELOC_ARM_IRELATIVE, R_ARM_IRELATIVE},
{BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT},
{BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY},
{BFD_RELOC_ARM_MOVW, R_ARM_MOVW_ABS_NC},
}
}
-#define TARGET_LITTLE_SYM arm_elf32_le_vec
-#define TARGET_LITTLE_NAME "elf32-littlearm"
-#define TARGET_BIG_SYM arm_elf32_be_vec
-#define TARGET_BIG_NAME "elf32-bigarm"
+#define TARGET_LITTLE_SYM arm_elf32_le_vec
+#define TARGET_LITTLE_NAME "elf32-littlearm"
+#define TARGET_BIG_SYM arm_elf32_be_vec
+#define TARGET_BIG_NAME "elf32-bigarm"
#define elf_backend_grok_prstatus elf32_arm_nabi_grok_prstatus
#define elf_backend_grok_psinfo elf32_arm_nabi_grok_psinfo
linker first. */
static const bfd_vma elf32_arm_plt0_entry [] =
{
- 0xe52de004, /* str lr, [sp, #-4]! */
- 0xe59fe004, /* ldr lr, [pc, #4] */
- 0xe08fe00e, /* add lr, pc, lr */
- 0xe5bef008, /* ldr pc, [lr, #8]! */
- 0x00000000, /* &GOT[0] - . */
+ 0xe52de004, /* str lr, [sp, #-4]! */
+ 0xe59fe004, /* ldr lr, [pc, #4] */
+ 0xe08fe00e, /* add lr, pc, lr */
+ 0xe5bef008, /* ldr pc, [lr, #8]! */
+ 0x00000000, /* &GOT[0] - . */
};
/* By default subsequent entries in a procedure linkage table look like
which can cope with arbitrary displacements. */
static const bfd_vma elf32_arm_plt_entry_long [] =
{
- 0xe28fc200, /* add ip, pc, #0xN0000000 */
- 0xe28cc600, /* add ip, ip, #0xNN00000 */
+ 0xe28fc200, /* add ip, pc, #0xN0000000 */
+ 0xe28cc600, /* add ip, ip, #0xNN00000 */
0xe28cca00, /* add ip, ip, #0xNN000 */
0xe5bcf000, /* ldr pc, [ip, #0xNNN]! */
};
{
/* NOTE: As this is a mixture of 16-bit and 32-bit instructions,
an instruction maybe encoded to one or two array elements. */
- 0xf8dfb500, /* push {lr} */
- 0x44fee008, /* ldr.w lr, [pc, #8] */
- /* add lr, pc */
+ 0xf8dfb500, /* push {lr} */
+ 0x44fee008, /* ldr.w lr, [pc, #8] */
+ /* add lr, pc */
0xff08f85e, /* ldr.w pc, [lr, #8]! */
- 0x00000000, /* &GOT[0] - . */
+ 0x00000000, /* &GOT[0] - . */
};
/* Subsequent entries in a procedure linkage table for thumb only target
{
/* NOTE: As this is a mixture of 16-bit and 32-bit instructions,
an instruction maybe encoded to one or two array elements. */
- 0x0c00f240, /* movw ip, #0xNNNN */
- 0x0c00f2c0, /* movt ip, #0xNNNN */
- 0xf8dc44fc, /* add ip, pc */
- 0xbf00f000 /* ldr.w pc, [ip] */
- /* nop */
+ 0x0c00f240, /* movw ip, #0xNNNN */
+ 0x0c00f2c0, /* movt ip, #0xNNNN */
+ 0xf8dc44fc, /* add ip, pc */
+ 0xbf00f000 /* ldr.w pc, [ip] */
+ /* nop */
};
/* The format of the first entry in the procedure linkage table
for a VxWorks executable. */
static const bfd_vma elf32_arm_vxworks_exec_plt0_entry[] =
{
- 0xe52dc008, /* str ip,[sp,#-8]! */
- 0xe59fc000, /* ldr ip,[pc] */
- 0xe59cf008, /* ldr pc,[ip,#8] */
- 0x00000000, /* .long _GLOBAL_OFFSET_TABLE_ */
+ 0xe52dc008, /* str ip,[sp,#-8]! */
+ 0xe59fc000, /* ldr ip,[pc] */
+ 0xe59cf008, /* ldr pc,[ip,#8] */
+ 0x00000000, /* .long _GLOBAL_OFFSET_TABLE_ */
};
/* The format of subsequent entries in a VxWorks executable. */
static const bfd_vma elf32_arm_vxworks_exec_plt_entry[] =
{
- 0xe59fc000, /* ldr ip,[pc] */
- 0xe59cf000, /* ldr pc,[ip] */
- 0x00000000, /* .long @got */
- 0xe59fc000, /* ldr ip,[pc] */
- 0xea000000, /* b _PLT */
- 0x00000000, /* .long @pltindex*sizeof(Elf32_Rela) */
+ 0xe59fc000, /* ldr ip,[pc] */
+ 0xe59cf000, /* ldr pc,[ip] */
+ 0x00000000, /* .long @got */
+ 0xe59fc000, /* ldr ip,[pc] */
+ 0xea000000, /* b _PLT */
+ 0x00000000, /* .long @pltindex*sizeof(Elf32_Rela) */
};
/* The format of entries in a VxWorks shared library. */
static const bfd_vma elf32_arm_vxworks_shared_plt_entry[] =
{
- 0xe59fc000, /* ldr ip,[pc] */
- 0xe79cf009, /* ldr pc,[ip,r9] */
- 0x00000000, /* .long @got */
- 0xe59fc000, /* ldr ip,[pc] */
- 0xe599f008, /* ldr pc,[r9,#8] */
- 0x00000000, /* .long @pltindex*sizeof(Elf32_Rela) */
+ 0xe59fc000, /* ldr ip,[pc] */
+ 0xe79cf009, /* ldr pc,[ip,r9] */
+ 0x00000000, /* .long @got */
+ 0xe59fc000, /* ldr ip,[pc] */
+ 0xe599f008, /* ldr pc,[r9,#8] */
+ 0x00000000, /* .long @pltindex*sizeof(Elf32_Rela) */
};
/* An initial stub used if the PLT entry is referenced from Thumb code. */
address spaces. */
static const bfd_vma elf32_arm_symbian_plt_entry [] =
{
- 0xe51ff004, /* ldr pc, [pc, #-4] */
- 0x00000000, /* dcd R_ARM_GLOB_DAT(X) */
+ 0xe51ff004, /* ldr pc, [pc, #-4] */
+ 0x00000000, /* dcd R_ARM_GLOB_DAT(X) */
};
/* The first entry in a procedure linkage table looks like
typedef struct
{
- bfd_vma data;
+ bfd_vma data;
enum stub_insn_type type;
- unsigned int r_type;
- int reloc_addend;
+ unsigned int r_type;
+ int reloc_addend;
} insn_sequence;
/* Arm/Thumb -> Arm/Thumb long branch stub. On V5T and above, use blx
to reach the stub if necessary. */
static const insn_sequence elf32_arm_stub_long_branch_any_any[] =
{
- ARM_INSN (0xe51ff004), /* ldr pc, [pc, #-4] */
+ ARM_INSN (0xe51ff004), /* ldr pc, [pc, #-4] */
DATA_WORD (0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(X) */
};
available. */
static const insn_sequence elf32_arm_stub_long_branch_v4t_arm_thumb[] =
{
- ARM_INSN (0xe59fc000), /* ldr ip, [pc, #0] */
- ARM_INSN (0xe12fff1c), /* bx ip */
+ ARM_INSN (0xe59fc000), /* ldr ip, [pc, #0] */
+ ARM_INSN (0xe12fff1c), /* bx ip */
DATA_WORD (0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(X) */
};
/* Thumb -> Thumb long branch stub. Used on M-profile architectures. */
static const insn_sequence elf32_arm_stub_long_branch_thumb_only[] =
{
- THUMB16_INSN (0xb401), /* push {r0} */
- THUMB16_INSN (0x4802), /* ldr r0, [pc, #8] */
- THUMB16_INSN (0x4684), /* mov ip, r0 */
- THUMB16_INSN (0xbc01), /* pop {r0} */
- THUMB16_INSN (0x4760), /* bx ip */
- THUMB16_INSN (0xbf00), /* nop */
+ THUMB16_INSN (0xb401), /* push {r0} */
+ THUMB16_INSN (0x4802), /* ldr r0, [pc, #8] */
+ THUMB16_INSN (0x4684), /* mov ip, r0 */
+ THUMB16_INSN (0xbc01), /* pop {r0} */
+ THUMB16_INSN (0x4760), /* bx ip */
+ THUMB16_INSN (0xbf00), /* nop */
DATA_WORD (0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(X) */
};
/* Thumb -> Thumb long branch stub in thumb2 encoding. Used on armv7. */
static const insn_sequence elf32_arm_stub_long_branch_thumb2_only[] =
{
- THUMB32_INSN (0xf85ff000), /* ldr.w pc, [pc, #-0] */
+ THUMB32_INSN (0xf85ff000), /* ldr.w pc, [pc, #-0] */
DATA_WORD (0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(x) */
};
{
THUMB32_MOVW (0xf2400c00), /* mov.w ip, R_ARM_MOVW_ABS_NC */
THUMB32_MOVT (0xf2c00c00), /* movt ip, R_ARM_MOVT_ABS << 16 */
- THUMB16_INSN (0x4760), /* bx ip */
+ THUMB16_INSN (0x4760), /* bx ip */
};
/* V4T Thumb -> Thumb long branch stub. Using the stack is not
allowed. */
static const insn_sequence elf32_arm_stub_long_branch_v4t_thumb_thumb[] =
{
- THUMB16_INSN (0x4778), /* bx pc */
- THUMB16_INSN (0x46c0), /* nop */
- ARM_INSN (0xe59fc000), /* ldr ip, [pc, #0] */
- ARM_INSN (0xe12fff1c), /* bx ip */
+ THUMB16_INSN (0x4778), /* bx pc */
+ THUMB16_INSN (0x46c0), /* nop */
+ ARM_INSN (0xe59fc000), /* ldr ip, [pc, #0] */
+ ARM_INSN (0xe12fff1c), /* bx ip */
DATA_WORD (0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(X) */
};
available. */
static const insn_sequence elf32_arm_stub_long_branch_v4t_thumb_arm[] =
{
- THUMB16_INSN (0x4778), /* bx pc */
- THUMB16_INSN (0x46c0), /* nop */
- ARM_INSN (0xe51ff004), /* ldr pc, [pc, #-4] */
+ THUMB16_INSN (0x4778), /* bx pc */
+ THUMB16_INSN (0x46c0), /* nop */
+ ARM_INSN (0xe51ff004), /* ldr pc, [pc, #-4] */
DATA_WORD (0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(X) */
};
one, when the destination is close enough. */
static const insn_sequence elf32_arm_stub_short_branch_v4t_thumb_arm[] =
{
- THUMB16_INSN (0x4778), /* bx pc */
- THUMB16_INSN (0x46c0), /* nop */
+ THUMB16_INSN (0x4778), /* bx pc */
+ THUMB16_INSN (0x46c0), /* nop */
ARM_REL_INSN (0xea000000, -8), /* b (X-8) */
};
blx to reach the stub if necessary. */
static const insn_sequence elf32_arm_stub_long_branch_any_arm_pic[] =
{
- ARM_INSN (0xe59fc000), /* ldr ip, [pc] */
- ARM_INSN (0xe08ff00c), /* add pc, pc, ip */
+ ARM_INSN (0xe59fc000), /* ldr ip, [pc] */
+ ARM_INSN (0xe08ff00c), /* add pc, pc, ip */
DATA_WORD (0, R_ARM_REL32, -4), /* dcd R_ARM_REL32(X-4) */
};
ARMv7). */
static const insn_sequence elf32_arm_stub_long_branch_any_thumb_pic[] =
{
- ARM_INSN (0xe59fc004), /* ldr ip, [pc, #4] */
- ARM_INSN (0xe08fc00c), /* add ip, pc, ip */
- ARM_INSN (0xe12fff1c), /* bx ip */
+ ARM_INSN (0xe59fc004), /* ldr ip, [pc, #4] */
+ ARM_INSN (0xe08fc00c), /* add ip, pc, ip */
+ ARM_INSN (0xe12fff1c), /* bx ip */
DATA_WORD (0, R_ARM_REL32, 0), /* dcd R_ARM_REL32(X) */
};
/* V4T ARM -> ARM long branch stub, PIC. */
static const insn_sequence elf32_arm_stub_long_branch_v4t_arm_thumb_pic[] =
{
- ARM_INSN (0xe59fc004), /* ldr ip, [pc, #4] */
- ARM_INSN (0xe08fc00c), /* add ip, pc, ip */
- ARM_INSN (0xe12fff1c), /* bx ip */
+ ARM_INSN (0xe59fc004), /* ldr ip, [pc, #4] */
+ ARM_INSN (0xe08fc00c), /* add ip, pc, ip */
+ ARM_INSN (0xe12fff1c), /* bx ip */
DATA_WORD (0, R_ARM_REL32, 0), /* dcd R_ARM_REL32(X) */
};
/* V4T Thumb -> ARM long branch stub, PIC. */
static const insn_sequence elf32_arm_stub_long_branch_v4t_thumb_arm_pic[] =
{
- THUMB16_INSN (0x4778), /* bx pc */
- THUMB16_INSN (0x46c0), /* nop */
- ARM_INSN (0xe59fc000), /* ldr ip, [pc, #0] */
- ARM_INSN (0xe08cf00f), /* add pc, ip, pc */
+ THUMB16_INSN (0x4778), /* bx pc */
+ THUMB16_INSN (0x46c0), /* nop */
+ ARM_INSN (0xe59fc000), /* ldr ip, [pc, #0] */
+ ARM_INSN (0xe08cf00f), /* add pc, ip, pc */
DATA_WORD (0, R_ARM_REL32, -4), /* dcd R_ARM_REL32(X) */
};
architectures. */
static const insn_sequence elf32_arm_stub_long_branch_thumb_only_pic[] =
{
- THUMB16_INSN (0xb401), /* push {r0} */
- THUMB16_INSN (0x4802), /* ldr r0, [pc, #8] */
- THUMB16_INSN (0x46fc), /* mov ip, pc */
- THUMB16_INSN (0x4484), /* add ip, r0 */
- THUMB16_INSN (0xbc01), /* pop {r0} */
- THUMB16_INSN (0x4760), /* bx ip */
+ THUMB16_INSN (0xb401), /* push {r0} */
+ THUMB16_INSN (0x4802), /* ldr r0, [pc, #8] */
+ THUMB16_INSN (0x46fc), /* mov ip, pc */
+ THUMB16_INSN (0x4484), /* add ip, r0 */
+ THUMB16_INSN (0xbc01), /* pop {r0} */
+ THUMB16_INSN (0x4760), /* bx ip */
DATA_WORD (0, R_ARM_REL32, 4), /* dcd R_ARM_REL32(X) */
};
allowed. */
static const insn_sequence elf32_arm_stub_long_branch_v4t_thumb_thumb_pic[] =
{
- THUMB16_INSN (0x4778), /* bx pc */
- THUMB16_INSN (0x46c0), /* nop */
- ARM_INSN (0xe59fc004), /* ldr ip, [pc, #4] */
- ARM_INSN (0xe08fc00c), /* add ip, pc, ip */
- ARM_INSN (0xe12fff1c), /* bx ip */
+ THUMB16_INSN (0x4778), /* bx pc */
+ THUMB16_INSN (0x46c0), /* nop */
+ ARM_INSN (0xe59fc004), /* ldr ip, [pc, #4] */
+ ARM_INSN (0xe08fc00c), /* add ip, pc, ip */
+ ARM_INSN (0xe12fff1c), /* bx ip */
DATA_WORD (0, R_ARM_REL32, 0), /* dcd R_ARM_REL32(X) */
};
long PIC stub. We can use r1 as a scratch -- and cannot use ip. */
static const insn_sequence elf32_arm_stub_long_branch_any_tls_pic[] =
{
- ARM_INSN (0xe59f1000), /* ldr r1, [pc] */
- ARM_INSN (0xe08ff001), /* add pc, pc, r1 */
+ ARM_INSN (0xe59f1000), /* ldr r1, [pc] */
+ ARM_INSN (0xe08ff001), /* add pc, pc, r1 */
DATA_WORD (0, R_ARM_REL32, -4), /* dcd R_ARM_REL32(X-4) */
};
long PIC stub. We can use r1 as a scratch -- and cannot use ip. */
static const insn_sequence elf32_arm_stub_long_branch_v4t_thumb_tls_pic[] =
{
- THUMB16_INSN (0x4778), /* bx pc */
- THUMB16_INSN (0x46c0), /* nop */
- ARM_INSN (0xe59f1000), /* ldr r1, [pc, #0] */
- ARM_INSN (0xe081f00f), /* add pc, r1, pc */
+ THUMB16_INSN (0x4778), /* bx pc */
+ THUMB16_INSN (0x46c0), /* nop */
+ ARM_INSN (0xe59f1000), /* ldr r1, [pc, #0] */
+ ARM_INSN (0xe081f00f), /* add pc, r1, pc */
DATA_WORD (0, R_ARM_REL32, -4), /* dcd R_ARM_REL32(X) */
};
{
ARM_INSN (0xe59fc00c), /* ldr ip, [pc, #12] */
ARM_INSN (0xe3ccc13f), /* bic ip, ip, #0xc000000f */
- ARM_INSN (0xe12fff1c), /* bx ip */
- ARM_INSN (0xe320f000), /* nop */
- ARM_INSN (0xe125be70), /* bkpt 0x5be0 */
- DATA_WORD (0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(X) */
- DATA_WORD (0, R_ARM_NONE, 0), /* .word 0 */
- DATA_WORD (0, R_ARM_NONE, 0), /* .word 0 */
+ ARM_INSN (0xe12fff1c), /* bx ip */
+ ARM_INSN (0xe320f000), /* nop */
+ ARM_INSN (0xe125be70), /* bkpt 0x5be0 */
+ DATA_WORD (0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(X) */
+ DATA_WORD (0, R_ARM_NONE, 0), /* .word 0 */
+ DATA_WORD (0, R_ARM_NONE, 0), /* .word 0 */
};
/* NaCl ARM -> ARM long branch stub, PIC. */
static const insn_sequence elf32_arm_stub_long_branch_arm_nacl_pic[] =
{
ARM_INSN (0xe59fc00c), /* ldr ip, [pc, #12] */
- ARM_INSN (0xe08cc00f), /* add ip, ip, pc */
+ ARM_INSN (0xe08cc00f), /* add ip, ip, pc */
ARM_INSN (0xe3ccc13f), /* bic ip, ip, #0xc000000f */
- ARM_INSN (0xe12fff1c), /* bx ip */
- ARM_INSN (0xe125be70), /* bkpt 0x5be0 */
- DATA_WORD (0, R_ARM_REL32, 8), /* dcd R_ARM_REL32(X+8) */
- DATA_WORD (0, R_ARM_NONE, 0), /* .word 0 */
- DATA_WORD (0, R_ARM_NONE, 0), /* .word 0 */
+ ARM_INSN (0xe12fff1c), /* bx ip */
+ ARM_INSN (0xe125be70), /* bkpt 0x5be0 */
+ DATA_WORD (0, R_ARM_REL32, 8), /* dcd R_ARM_REL32(X+8) */
+ DATA_WORD (0, R_ARM_NONE, 0), /* .word 0 */
+ DATA_WORD (0, R_ARM_NONE, 0), /* .word 0 */
};
/* Stub used for transition to secure state (aka SG veneer). */
static const insn_sequence elf32_arm_stub_a8_veneer_b_cond[] =
{
- THUMB16_BCOND_INSN (0xd001), /* b<cond>.n true. */
+ THUMB16_BCOND_INSN (0xd001), /* b<cond>.n true. */
THUMB32_B_INSN (0xf000b800, -4), /* b.w insn_after_original_branch. */
THUMB32_B_INSN (0xf000b800, -4) /* true: b.w original_branch_dest. */
};
/* ST_BRANCH_TO_ARM is nonsense to thumb-only targets when we
are considering a function call relocation. */
if (thumb_only && (r_type == R_ARM_THM_CALL || r_type == R_ARM_THM_JUMP24
- || r_type == R_ARM_THM_JUMP19)
+ || r_type == R_ARM_THM_JUMP19)
&& branch_type == ST_BRANCH_TO_ARM)
branch_type = ST_BRANCH_TO_THUMB;
&& (((r_type == R_ARM_THM_CALL
|| r_type == R_ARM_THM_TLS_CALL) && !globals->use_blx)
|| (r_type == R_ARM_THM_JUMP24)
- || (r_type == R_ARM_THM_JUMP19))
+ || (r_type == R_ARM_THM_JUMP19))
&& !use_plt))
{
/* If we need to insert a Thumb-Thumb long branch stub to a
static const insn32 a2t2p_add_pc_insn = 0xe08cc00f;
static const insn32 a2t3p_bx_r12_insn = 0xe12fff1c;
-/* Thumb->ARM: Thumb->(non-interworking aware) ARM
+/* Thumb->ARM: Thumb->(non-interworking aware) ARM
- .thumb .thumb
- .align 2 .align 2
- __func_from_thumb: __func_from_thumb:
- bx pc push {r6, lr}
- nop ldr r6, __func_addr
- .arm mov lr, pc
- b func bx r6
+ .thumb .thumb
+ .align 2 .align 2
+ __func_from_thumb: __func_from_thumb:
+ bx pc push {r6, lr}
+ nop ldr r6, __func_addr
+ .arm mov lr, pc
+ b func bx r6
.arm
;; back_to_thumb
ldmia r13! {r6, lr}
bx lr
__func_addr:
- .word func */
+ .word func */
#define THUMB2ARM_GLUE_SIZE 8
static const insn16 t2a1_bx_pc_insn = 0x4778;
static int
elf32_thumb_to_arm_stub (struct bfd_link_info * info,
- const char * name,
- bfd * input_bfd,
- bfd * output_bfd,
- asection * input_section,
- bfd_byte * hit_data,
- asection * sym_sec,
- bfd_vma offset,
- bfd_signed_vma addend,
- bfd_vma val,
+ const char * name,
+ bfd * input_bfd,
+ bfd * output_bfd,
+ asection * input_section,
+ bfd_byte * hit_data,
+ asection * sym_sec,
+ bfd_vma offset,
+ bfd_signed_vma addend,
+ bfd_vma val,
char **error_message)
{
asection * s = 0;
static struct elf_link_hash_entry *
elf32_arm_create_thumb_stub (struct bfd_link_info * info,
- const char * name,
- bfd * input_bfd,
- bfd * output_bfd,
- asection * sym_sec,
- bfd_vma val,
- asection * s,
- char ** error_message)
+ const char * name,
+ bfd * input_bfd,
+ bfd * output_bfd,
+ asection * sym_sec,
+ bfd_vma val,
+ asection * s,
+ char ** error_message)
{
bfd_vma my_offset;
long int ret_offset;
static int
elf32_arm_to_thumb_stub (struct bfd_link_info * info,
- const char * name,
- bfd * input_bfd,
- bfd * output_bfd,
- asection * input_section,
- bfd_byte * hit_data,
- asection * sym_sec,
- bfd_vma offset,
- bfd_signed_vma addend,
- bfd_vma val,
+ const char * name,
+ bfd * input_bfd,
+ bfd * output_bfd,
+ asection * input_section,
+ bfd_byte * hit_data,
+ asection * sym_sec,
+ bfd_vma offset,
+ bfd_signed_vma addend,
+ bfd_vma val,
char **error_message)
{
unsigned long int tmp;
/* Perform a relocation as part of a final link. */
static bfd_reloc_status_type
-elf32_arm_final_link_relocate (reloc_howto_type * howto,
- bfd * input_bfd,
- bfd * output_bfd,
- asection * input_section,
- bfd_byte * contents,
- Elf_Internal_Rela * rel,
- bfd_vma value,
- struct bfd_link_info * info,
- asection * sym_sec,
- const char * sym_name,
- unsigned char st_type,
- enum arm_st_branch_type branch_type,
+elf32_arm_final_link_relocate (reloc_howto_type * howto,
+ bfd * input_bfd,
+ bfd * output_bfd,
+ asection * input_section,
+ bfd_byte * contents,
+ Elf_Internal_Rela * rel,
+ bfd_vma value,
+ struct bfd_link_info * info,
+ asection * sym_sec,
+ const char * sym_name,
+ unsigned char st_type,
+ enum arm_st_branch_type branch_type,
struct elf_link_hash_entry * h,
- bfd_boolean * unresolved_reloc_p,
- char ** error_message)
-{
- unsigned long r_type = howto->type;
- unsigned long r_symndx;
- bfd_byte * hit_data = contents + rel->r_offset;
- bfd_vma * local_got_offsets;
- bfd_vma * local_tlsdesc_gotents;
- asection * sgot;
- asection * splt;
- asection * sreloc = NULL;
- asection * srelgot;
- bfd_vma addend;
- bfd_signed_vma signed_addend;
- unsigned char dynreloc_st_type;
- bfd_vma dynreloc_value;
+ bfd_boolean * unresolved_reloc_p,
+ char ** error_message)
+{
+ unsigned long r_type = howto->type;
+ unsigned long r_symndx;
+ bfd_byte * hit_data = contents + rel->r_offset;
+ bfd_vma * local_got_offsets;
+ bfd_vma * local_tlsdesc_gotents;
+ asection * sgot;
+ asection * splt;
+ asection * sreloc = NULL;
+ asection * srelgot;
+ bfd_vma addend;
+ bfd_signed_vma signed_addend;
+ unsigned char dynreloc_st_type;
+ bfd_vma dynreloc_value;
struct elf32_arm_link_hash_table * globals;
struct elf32_arm_link_hash_entry *eh;
- union gotplt_union *root_plt;
- struct arm_plt_info *arm_plt;
- bfd_vma plt_offset;
- bfd_vma gotplt_offset;
- bfd_boolean has_iplt_entry;
- bfd_boolean resolved_to_zero;
+ union gotplt_union *root_plt;
+ struct arm_plt_info *arm_plt;
+ bfd_vma plt_offset;
+ bfd_vma gotplt_offset;
+ bfd_boolean has_iplt_entry;
+ bfd_boolean resolved_to_zero;
globals = elf32_arm_hash_table (info);
if (globals == NULL)
bfd_signed_vma reloc_signed_max = 0xffffe;
bfd_signed_vma reloc_signed_min = -0x100000;
bfd_signed_vma signed_check;
- enum elf32_arm_stub_type stub_type = arm_stub_none;
+ enum elf32_arm_stub_type stub_type = arm_stub_none;
struct elf32_arm_stub_hash_entry *stub_entry;
struct elf32_arm_link_hash_entry *hash;
hash = (struct elf32_arm_link_hash_entry *)h;
stub_type = arm_type_of_stub (info, input_section, rel,
- st_type, &branch_type,
- hash, value, sym_sec,
- input_bfd, sym_name);
+ st_type, &branch_type,
+ hash, value, sym_sec,
+ input_bfd, sym_name);
if (stub_type != arm_stub_none)
{
stub_entry = elf32_arm_get_stub_entry (input_section,
- sym_sec, h,
- rel, globals,
- stub_type);
+ sym_sec, h,
+ rel, globals,
+ stub_type);
if (stub_entry != NULL)
{
- value = (stub_entry->stub_offset
- + stub_entry->stub_sec->output_offset
- + stub_entry->stub_sec->output_section->vma);
+ value = (stub_entry->stub_offset
+ + stub_entry->stub_sec->output_offset
+ + stub_entry->stub_sec->output_section->vma);
}
}
addend = ((insn >> 4) & 0xf000)
| ((insn >> 15) & 0x0800)
| ((insn >> 4) & 0x0700)
- | (insn & 0x00ff);
+ | (insn & 0x00ff);
signed_addend = (addend ^ 0x8000) - 0x8000;
}
/* Add INCREMENT to the reloc (of type HOWTO) at ADDRESS. */
static void
-arm_add_to_rel (bfd * abfd,
- bfd_byte * address,
+arm_add_to_rel (bfd * abfd,
+ bfd_byte * address,
reloc_howto_type * howto,
- bfd_signed_vma increment)
+ bfd_signed_vma increment)
{
bfd_signed_vma addend;
}
else
{
- bfd_vma contents;
+ bfd_vma contents;
contents = bfd_get_32 (abfd, address);
/* Relocate an ARM ELF section. */
static bfd_boolean
-elf32_arm_relocate_section (bfd * output_bfd,
+elf32_arm_relocate_section (bfd * output_bfd,
struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
- Elf_Internal_Rela * relocs,
- Elf_Internal_Sym * local_syms,
- asection ** local_sections)
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
+ Elf_Internal_Rela * relocs,
+ Elf_Internal_Sym * local_syms,
+ asection ** local_sections)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
relend = relocs + input_section->reloc_count;
for (; rel < relend; rel++)
{
- int r_type;
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ int r_type;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- arelent bfd_reloc;
- char sym_type;
- bfd_boolean unresolved_reloc = FALSE;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ arelent bfd_reloc;
+ char sym_type;
+ bfd_boolean unresolved_reloc = FALSE;
char *error_message = NULL;
r_symndx = ELF32_R_SYM (rel->r_info);
};
const int v6_m[] =
{
- -1, /* PRE_V4. */
- -1, /* V4. */
+ -1, /* PRE_V4. */
+ -1, /* V4. */
T(V6K), /* V4T. */
T(V6K), /* V5T. */
T(V6K), /* V5TE. */
};
const int v6s_m[] =
{
- -1, /* PRE_V4. */
- -1, /* V4. */
+ -1, /* PRE_V4. */
+ -1, /* V4. */
T(V6K), /* V4T. */
T(V6K), /* V5T. */
T(V6K), /* V5TE. */
};
const int v7e_m[] =
{
- -1, /* PRE_V4. */
- -1, /* V4. */
+ -1, /* PRE_V4. */
+ -1, /* V4. */
T(V7E_M), /* V4T. */
T(V7E_M), /* V5T. */
T(V7E_M), /* V5TE. */
and STT_ARM_TFUNC is considered to a function type. */
static bfd_boolean
-arm_elf_find_function (bfd * abfd ATTRIBUTE_UNUSED,
+arm_elf_find_function (bfd * abfd ATTRIBUTE_UNUSED,
asymbol ** symbols,
asection * section,
- bfd_vma offset,
+ bfd_vma offset,
const char ** filename_ptr,
const char ** functionname_ptr)
{
that it uses arm_elf_find_function. */
static bfd_boolean
-elf32_arm_find_nearest_line (bfd * abfd,
- asymbol ** symbols,
- asection * section,
- bfd_vma offset,
+elf32_arm_find_nearest_line (bfd * abfd,
+ asymbol ** symbols,
+ asection * section,
+ bfd_vma offset,
const char ** filename_ptr,
const char ** functionname_ptr,
unsigned int * line_ptr,
}
static bfd_boolean
-elf32_arm_find_inliner_info (bfd * abfd,
+elf32_arm_find_inliner_info (bfd * abfd,
const char ** filename_ptr,
const char ** functionname_ptr,
unsigned int * line_ptr)
static bfd_byte *
stm32l4xx_fill_stub_udf (struct elf32_arm_link_hash_table * htab,
- bfd * output_bfd,
- const bfd_byte * const base_stub_contents,
- bfd_byte * const from_stub_contents,
- const bfd_byte * const end_stub_contents)
+ bfd * output_bfd,
+ const bfd_byte * const base_stub_contents,
+ bfd_byte * const from_stub_contents,
+ const bfd_byte * const end_stub_contents)
{
bfd_byte *current_stub_contents = from_stub_contents;
#define ELF_MINPAGESIZE 0x1000
#define ELF_COMMONPAGESIZE 0x1000
-#define bfd_elf32_mkobject elf32_arm_mkobject
+#define bfd_elf32_mkobject elf32_arm_mkobject
#define bfd_elf32_bfd_copy_private_bfd_data elf32_arm_copy_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data elf32_arm_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags elf32_arm_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data elf32_arm_print_private_bfd_data
-#define bfd_elf32_bfd_link_hash_table_create elf32_arm_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_create elf32_arm_link_hash_table_create
#define bfd_elf32_bfd_reloc_type_lookup elf32_arm_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup elf32_arm_reloc_name_lookup
-#define bfd_elf32_find_nearest_line elf32_arm_find_nearest_line
-#define bfd_elf32_find_inliner_info elf32_arm_find_inliner_info
+#define bfd_elf32_find_nearest_line elf32_arm_find_nearest_line
+#define bfd_elf32_find_inliner_info elf32_arm_find_inliner_info
#define bfd_elf32_new_section_hook elf32_arm_new_section_hook
#define bfd_elf32_bfd_is_target_special_symbol elf32_arm_is_target_special_symbol
#define bfd_elf32_bfd_final_link elf32_arm_final_link
-#define bfd_elf32_get_synthetic_symtab elf32_arm_get_synthetic_symtab
+#define bfd_elf32_get_synthetic_symtab elf32_arm_get_synthetic_symtab
-#define elf_backend_get_symbol_type elf32_arm_get_symbol_type
-#define elf_backend_gc_mark_hook elf32_arm_gc_mark_hook
+#define elf_backend_get_symbol_type elf32_arm_get_symbol_type
+#define elf_backend_gc_mark_hook elf32_arm_gc_mark_hook
#define elf_backend_gc_mark_extra_sections elf32_arm_gc_mark_extra_sections
-#define elf_backend_check_relocs elf32_arm_check_relocs
+#define elf_backend_check_relocs elf32_arm_check_relocs
#define elf_backend_update_relocs elf32_arm_update_relocs
#define elf_backend_relocate_section elf32_arm_relocate_section
#define elf_backend_write_section elf32_arm_write_section
#define elf_backend_adjust_dynamic_symbol elf32_arm_adjust_dynamic_symbol
-#define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections
+#define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections
#define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections
#define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections
#define elf_backend_post_process_headers elf32_arm_post_process_headers
#define elf_backend_reloc_type_class elf32_arm_reloc_type_class
#define elf_backend_object_p elf32_arm_object_p
-#define elf_backend_fake_sections elf32_arm_fake_sections
-#define elf_backend_section_from_shdr elf32_arm_section_from_shdr
-#define elf_backend_final_write_processing elf32_arm_final_write_processing
-#define elf_backend_copy_indirect_symbol elf32_arm_copy_indirect_symbol
+#define elf_backend_fake_sections elf32_arm_fake_sections
+#define elf_backend_section_from_shdr elf32_arm_section_from_shdr
+#define elf_backend_final_write_processing elf32_arm_final_write_processing
+#define elf_backend_copy_indirect_symbol elf32_arm_copy_indirect_symbol
#define elf_backend_size_info elf32_arm_size_info
#define elf_backend_modify_segment_map elf32_arm_modify_segment_map
-#define elf_backend_additional_program_headers elf32_arm_additional_program_headers
-#define elf_backend_output_arch_local_syms elf32_arm_output_arch_local_syms
+#define elf_backend_additional_program_headers elf32_arm_additional_program_headers
+#define elf_backend_output_arch_local_syms elf32_arm_output_arch_local_syms
#define elf_backend_filter_implib_symbols elf32_arm_filter_implib_symbols
-#define elf_backend_begin_write_processing elf32_arm_begin_write_processing
+#define elf_backend_begin_write_processing elf32_arm_begin_write_processing
#define elf_backend_add_symbol_hook elf32_arm_add_symbol_hook
#define elf_backend_count_additional_relocs elf32_arm_count_additional_relocs
#define elf_backend_symbol_processing elf32_arm_backend_symbol_processing
#define elf_backend_got_header_size 12
#define elf_backend_extern_protected_data 1
-#undef elf_backend_obj_attrs_vendor
+#undef elf_backend_obj_attrs_vendor
#define elf_backend_obj_attrs_vendor "aeabi"
-#undef elf_backend_obj_attrs_section
+#undef elf_backend_obj_attrs_section
#define elf_backend_obj_attrs_section ".ARM.attributes"
-#undef elf_backend_obj_attrs_arg_type
+#undef elf_backend_obj_attrs_arg_type
#define elf_backend_obj_attrs_arg_type elf32_arm_obj_attrs_arg_type
-#undef elf_backend_obj_attrs_section_type
+#undef elf_backend_obj_attrs_section_type
#define elf_backend_obj_attrs_section_type SHT_ARM_ATTRIBUTES
#define elf_backend_obj_attrs_order elf32_arm_obj_attrs_order
-#define elf_backend_obj_attrs_handle_unknown elf32_arm_obj_attrs_handle_unknown
+#define elf_backend_obj_attrs_handle_unknown elf32_arm_obj_attrs_handle_unknown
-#undef elf_backend_section_flags
+#undef elf_backend_section_flags
#define elf_backend_section_flags elf32_arm_section_flags
-#undef elf_backend_lookup_section_flags_hook
-#define elf_backend_lookup_section_flags_hook elf32_arm_lookup_section_flags
+#undef elf_backend_lookup_section_flags_hook
+#define elf_backend_lookup_section_flags_hook elf32_arm_lookup_section_flags
#define elf_backend_linux_prpsinfo32_ugid16 TRUE
/* VxWorks Targets. */
-#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM arm_elf32_vxworks_le_vec
-#undef TARGET_LITTLE_NAME
-#define TARGET_LITTLE_NAME "elf32-littlearm-vxworks"
-#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM arm_elf32_vxworks_be_vec
-#undef TARGET_BIG_NAME
-#define TARGET_BIG_NAME "elf32-bigarm-vxworks"
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM arm_elf32_vxworks_le_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-littlearm-vxworks"
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM arm_elf32_vxworks_be_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-bigarm-vxworks"
/* Like elf32_arm_link_hash_table_create -- but overrides
appropriately for VxWorks. */
/* Symbian OS Targets. */
-#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM arm_elf32_symbian_le_vec
-#undef TARGET_LITTLE_NAME
-#define TARGET_LITTLE_NAME "elf32-littlearm-symbian"
-#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM arm_elf32_symbian_be_vec
-#undef TARGET_BIG_NAME
-#define TARGET_BIG_NAME "elf32-bigarm-symbian"
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM arm_elf32_symbian_le_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-littlearm-symbian"
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM arm_elf32_symbian_be_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-bigarm-symbian"
/* Like elf32_arm_link_hash_table_create -- but overrides
appropriately for Symbian OS. */
the loadable read-only segment. The post-linker may wish to
refer to these sections, but they are not part of the final
program image. */
- { STRING_COMMA_LEN (".dynamic"), 0, SHT_DYNAMIC, 0 },
- { STRING_COMMA_LEN (".dynstr"), 0, SHT_STRTAB, 0 },
- { STRING_COMMA_LEN (".dynsym"), 0, SHT_DYNSYM, 0 },
- { STRING_COMMA_LEN (".got"), 0, SHT_PROGBITS, 0 },
- { STRING_COMMA_LEN (".hash"), 0, SHT_HASH, 0 },
+ { STRING_COMMA_LEN (".dynamic"), 0, SHT_DYNAMIC, 0 },
+ { STRING_COMMA_LEN (".dynstr"), 0, SHT_STRTAB, 0 },
+ { STRING_COMMA_LEN (".dynsym"), 0, SHT_DYNSYM, 0 },
+ { STRING_COMMA_LEN (".got"), 0, SHT_PROGBITS, 0 },
+ { STRING_COMMA_LEN (".hash"), 0, SHT_HASH, 0 },
/* These sections do not need to be writable as the SymbianOS
postlinker will arrange things so that no dynamic relocation is
required. */
- { STRING_COMMA_LEN (".init_array"), 0, SHT_INIT_ARRAY, SHF_ALLOC },
- { STRING_COMMA_LEN (".fini_array"), 0, SHT_FINI_ARRAY, SHF_ALLOC },
+ { STRING_COMMA_LEN (".init_array"), 0, SHT_INIT_ARRAY, SHF_ALLOC },
+ { STRING_COMMA_LEN (".fini_array"), 0, SHT_FINI_ARRAY, SHF_ALLOC },
{ STRING_COMMA_LEN (".preinit_array"), 0, SHT_PREINIT_ARRAY, SHF_ALLOC },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
static void
#undef bfd_elf32_bfd_link_hash_table_create
#define bfd_elf32_bfd_link_hash_table_create elf32_arm_symbian_link_hash_table_create
#undef elf_backend_special_sections
-#define elf_backend_special_sections elf32_arm_symbian_special_sections
+#define elf_backend_special_sections elf32_arm_symbian_special_sections
#undef elf_backend_begin_write_processing
#define elf_backend_begin_write_processing elf32_arm_symbian_begin_write_processing
#undef elf_backend_final_write_processing
bfd_vma vector_base;
/* Assorted information used by elf32_avr_size_stubs. */
- unsigned int bfd_count;
- unsigned int top_index;
- asection ** input_list;
+ unsigned int bfd_count;
+ unsigned int top_index;
+ asection ** input_list;
Elf_Internal_Sym ** all_local_syms;
/* Tables for mapping vma beyond the 128k boundary to the address of the
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* A low 8 bit absolute relocation of 24 bit program memory address.
For LDI command. Will be changed when linker stubs are needed. */
- HOWTO (R_AVR_LO8_LDI_GS, /* type */
- 1, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_AVR_LO8_LDI_GS", /* name */
- FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_AVR_LO8_LDI_GS, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_AVR_LO8_LDI_GS", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* A low 8 bit absolute relocation of 24 bit program memory address.
For LDI command. Will be changed when linker stubs are needed. */
- HOWTO (R_AVR_HI8_LDI_GS, /* type */
- 9, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_AVR_HI8_LDI_GS", /* name */
- FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_AVR_HI8_LDI_GS, /* type */
+ 9, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_AVR_HI8_LDI_GS", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 8 bit offset. */
HOWTO (R_AVR_8, /* type */
0, /* rightshift */
0xffffff, /* dst_mask */
FALSE), /* pcrel_offset */
HOWTO (R_AVR_DIFF8, /* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_avr_diff_reloc, /* special_function */
- "R_AVR_DIFF8", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xff, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (R_AVR_DIFF16, /* type */
- 0, /* rightshift */
+ "R_AVR_DIFF8", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_AVR_DIFF16, /* type */
+ 0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_avr_diff_reloc,/* special_function */
- "R_AVR_DIFF16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
- HOWTO (R_AVR_DIFF32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ "R_AVR_DIFF16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+ HOWTO (R_AVR_DIFF32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_avr_diff_reloc,/* special_function */
- "R_AVR_DIFF32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ "R_AVR_DIFF32", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 7 bit immediate for LDS/STS in Tiny core. */
HOWTO (R_AVR_LDS_STS_16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 7, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 7, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_AVR_LDS_STS_16", /* name */
- FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
+ "R_AVR_LDS_STS_16", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
HOWTO (R_AVR_PORT6, /* type */
FALSE, /* partial_inplace */
0xffffff, /* src_mask */
0xffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* A 32 bit PC relative relocation. */
HOWTO (R_AVR_32_PCREL, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
TRUE, /* pc_relative */
- 0, /* bitpos */
+ 0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_AVR_32_PCREL", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
TRUE), /* pcrel_offset */
};
static const struct avr_reloc_map avr_reloc_map[] =
{
- { BFD_RELOC_NONE, R_AVR_NONE },
- { BFD_RELOC_32, R_AVR_32 },
- { BFD_RELOC_AVR_7_PCREL, R_AVR_7_PCREL },
- { BFD_RELOC_AVR_13_PCREL, R_AVR_13_PCREL },
- { BFD_RELOC_16, R_AVR_16 },
- { BFD_RELOC_AVR_16_PM, R_AVR_16_PM },
- { BFD_RELOC_AVR_LO8_LDI, R_AVR_LO8_LDI},
- { BFD_RELOC_AVR_HI8_LDI, R_AVR_HI8_LDI },
- { BFD_RELOC_AVR_HH8_LDI, R_AVR_HH8_LDI },
- { BFD_RELOC_AVR_MS8_LDI, R_AVR_MS8_LDI },
- { BFD_RELOC_AVR_LO8_LDI_NEG, R_AVR_LO8_LDI_NEG },
- { BFD_RELOC_AVR_HI8_LDI_NEG, R_AVR_HI8_LDI_NEG },
- { BFD_RELOC_AVR_HH8_LDI_NEG, R_AVR_HH8_LDI_NEG },
- { BFD_RELOC_AVR_MS8_LDI_NEG, R_AVR_MS8_LDI_NEG },
- { BFD_RELOC_AVR_LO8_LDI_PM, R_AVR_LO8_LDI_PM },
- { BFD_RELOC_AVR_LO8_LDI_GS, R_AVR_LO8_LDI_GS },
- { BFD_RELOC_AVR_HI8_LDI_PM, R_AVR_HI8_LDI_PM },
- { BFD_RELOC_AVR_HI8_LDI_GS, R_AVR_HI8_LDI_GS },
- { BFD_RELOC_AVR_HH8_LDI_PM, R_AVR_HH8_LDI_PM },
+ { BFD_RELOC_NONE, R_AVR_NONE },
+ { BFD_RELOC_32, R_AVR_32 },
+ { BFD_RELOC_AVR_7_PCREL, R_AVR_7_PCREL },
+ { BFD_RELOC_AVR_13_PCREL, R_AVR_13_PCREL },
+ { BFD_RELOC_16, R_AVR_16 },
+ { BFD_RELOC_AVR_16_PM, R_AVR_16_PM },
+ { BFD_RELOC_AVR_LO8_LDI, R_AVR_LO8_LDI},
+ { BFD_RELOC_AVR_HI8_LDI, R_AVR_HI8_LDI },
+ { BFD_RELOC_AVR_HH8_LDI, R_AVR_HH8_LDI },
+ { BFD_RELOC_AVR_MS8_LDI, R_AVR_MS8_LDI },
+ { BFD_RELOC_AVR_LO8_LDI_NEG, R_AVR_LO8_LDI_NEG },
+ { BFD_RELOC_AVR_HI8_LDI_NEG, R_AVR_HI8_LDI_NEG },
+ { BFD_RELOC_AVR_HH8_LDI_NEG, R_AVR_HH8_LDI_NEG },
+ { BFD_RELOC_AVR_MS8_LDI_NEG, R_AVR_MS8_LDI_NEG },
+ { BFD_RELOC_AVR_LO8_LDI_PM, R_AVR_LO8_LDI_PM },
+ { BFD_RELOC_AVR_LO8_LDI_GS, R_AVR_LO8_LDI_GS },
+ { BFD_RELOC_AVR_HI8_LDI_PM, R_AVR_HI8_LDI_PM },
+ { BFD_RELOC_AVR_HI8_LDI_GS, R_AVR_HI8_LDI_GS },
+ { BFD_RELOC_AVR_HH8_LDI_PM, R_AVR_HH8_LDI_PM },
{ BFD_RELOC_AVR_LO8_LDI_PM_NEG, R_AVR_LO8_LDI_PM_NEG },
{ BFD_RELOC_AVR_HI8_LDI_PM_NEG, R_AVR_HI8_LDI_PM_NEG },
{ BFD_RELOC_AVR_HH8_LDI_PM_NEG, R_AVR_HH8_LDI_PM_NEG },
- { BFD_RELOC_AVR_CALL, R_AVR_CALL },
- { BFD_RELOC_AVR_LDI, R_AVR_LDI },
- { BFD_RELOC_AVR_6, R_AVR_6 },
- { BFD_RELOC_AVR_6_ADIW, R_AVR_6_ADIW },
- { BFD_RELOC_8, R_AVR_8 },
- { BFD_RELOC_AVR_8_LO, R_AVR_8_LO8 },
- { BFD_RELOC_AVR_8_HI, R_AVR_8_HI8 },
- { BFD_RELOC_AVR_8_HLO, R_AVR_8_HLO8 },
- { BFD_RELOC_AVR_DIFF8, R_AVR_DIFF8 },
- { BFD_RELOC_AVR_DIFF16, R_AVR_DIFF16 },
- { BFD_RELOC_AVR_DIFF32, R_AVR_DIFF32 },
- { BFD_RELOC_AVR_LDS_STS_16, R_AVR_LDS_STS_16},
- { BFD_RELOC_AVR_PORT6, R_AVR_PORT6},
- { BFD_RELOC_AVR_PORT5, R_AVR_PORT5},
- { BFD_RELOC_32_PCREL, R_AVR_32_PCREL}
+ { BFD_RELOC_AVR_CALL, R_AVR_CALL },
+ { BFD_RELOC_AVR_LDI, R_AVR_LDI },
+ { BFD_RELOC_AVR_6, R_AVR_6 },
+ { BFD_RELOC_AVR_6_ADIW, R_AVR_6_ADIW },
+ { BFD_RELOC_8, R_AVR_8 },
+ { BFD_RELOC_AVR_8_LO, R_AVR_8_LO8 },
+ { BFD_RELOC_AVR_8_HI, R_AVR_8_HI8 },
+ { BFD_RELOC_AVR_8_HLO, R_AVR_8_HLO8 },
+ { BFD_RELOC_AVR_DIFF8, R_AVR_DIFF8 },
+ { BFD_RELOC_AVR_DIFF16, R_AVR_DIFF16 },
+ { BFD_RELOC_AVR_DIFF32, R_AVR_DIFF32 },
+ { BFD_RELOC_AVR_LDS_STS_16, R_AVR_LDS_STS_16},
+ { BFD_RELOC_AVR_PORT6, R_AVR_PORT6},
+ { BFD_RELOC_AVR_PORT5, R_AVR_PORT5},
+ { BFD_RELOC_32_PCREL, R_AVR_32_PCREL}
};
/* Meant to be filled one day with the wrap around address for the
static struct bfd_hash_entry *
stub_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table,
- const char *string)
+ struct bfd_hash_table *table,
+ const char *string)
{
/* Allocate the structure if it has not already been allocated by a
subclass. */
if (entry == NULL)
{
entry = bfd_hash_allocate (table,
- sizeof (struct elf32_avr_stub_hash_entry));
+ sizeof (struct elf32_avr_stub_hash_entry));
if (entry == NULL)
- return entry;
+ return entry;
}
/* Call the allocation method of the superclass. */
return NULL;
if (!_bfd_elf_link_hash_table_init (&htab->etab, abfd,
- elf32_avr_link_hash_newfunc,
- sizeof (struct elf_link_hash_entry),
+ elf32_avr_link_hash_newfunc,
+ sizeof (struct elf_link_hash_entry),
AVR_ELF_DATA))
{
free (htab);
/* Init the stub hash table too. */
if (!bfd_hash_table_init (&htab->bstab, stub_hash_newfunc,
- sizeof (struct elf32_avr_stub_hash_entry)))
+ sizeof (struct elf32_avr_stub_hash_entry)))
{
_bfd_elf_link_hash_table_free (abfd);
return NULL;
static bfd_vma
avr_get_stub_addr (bfd_vma srel,
- struct elf32_avr_link_hash_table *htab)
+ struct elf32_avr_link_hash_table *htab)
{
unsigned int sindex;
bfd_vma stub_sec_addr =
- (htab->stub_sec->output_section->vma +
+ (htab->stub_sec->output_section->vma +
htab->stub_sec->output_offset);
for (sindex = 0; sindex < htab->amt_max_entry_cnt; sindex ++)
static bfd_reloc_status_type
bfd_elf_avr_diff_reloc (bfd *abfd ATTRIBUTE_UNUSED,
arelent *reloc_entry ATTRIBUTE_UNUSED,
- asymbol *symbol ATTRIBUTE_UNUSED,
- void *data ATTRIBUTE_UNUSED,
- asection *input_section ATTRIBUTE_UNUSED,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- char **error_message ATTRIBUTE_UNUSED)
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
return bfd_reloc_ok;
}
routines, but a few relocs, we have to do them ourselves. */
static bfd_reloc_status_type
-avr_final_link_relocate (reloc_howto_type * howto,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
- Elf_Internal_Rela * rel,
- bfd_vma relocation,
- struct elf32_avr_link_hash_table * htab)
+avr_final_link_relocate (reloc_howto_type * howto,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
+ Elf_Internal_Rela * rel,
+ bfd_vma relocation,
+ struct elf32_avr_link_hash_table * htab)
{
bfd_reloc_status_type r = bfd_reloc_ok;
- bfd_vma x;
+ bfd_vma x;
bfd_signed_vma srel;
bfd_signed_vma reloc_addr;
- bfd_boolean use_stubs = FALSE;
+ bfd_boolean use_stubs = FALSE;
/* Usually is 0, unless we are generating code for a bootloader. */
- bfd_signed_vma base_addr = htab->vector_base;
+ bfd_signed_vma base_addr = htab->vector_base;
/* Absolute addr of the reloc in the final excecutable. */
reloc_addr = rel->r_offset + input_section->output_section->vma
/* Check for overflow. */
if (srel < -2048 || srel > 2047)
{
- /* Relative distance is too large. */
+ /* Relative distance is too large. */
/* Always apply WRAPAROUND for avr2, avr25, and avr4. */
switch (bfd_get_mach (input_bfd))
srel = (bfd_signed_vma) relocation + rel->r_addend;
if (((srel > 0) && (srel & 0xffff) > 255)
|| ((srel < 0) && ((-srel) & 0xffff) > 128))
- /* Remove offset for data/eeprom section. */
- return bfd_reloc_overflow;
+ /* Remove offset for data/eeprom section. */
+ return bfd_reloc_overflow;
x = bfd_get_16 (input_bfd, contents);
x = (x & 0xf0f0) | (srel & 0xf) | ((srel << 4) & 0xf00);
return bfd_reloc_overflow;
x = bfd_get_16 (input_bfd, contents);
x = (x & 0xd3f8) | ((srel & 7) | ((srel & (3 << 3)) << 7)
- | ((srel & (1 << 5)) << 8));
+ | ((srel & (1 << 5)) << 8));
bfd_put_16 (input_bfd, x, contents);
break;
srel = (bfd_signed_vma) relocation + rel->r_addend;
if (use_stubs
- && avr_stub_is_required_for_16_bit_reloc (srel - base_addr))
- {
- bfd_vma old_srel = srel;
-
- /* We need to use the address of the stub instead. */
- srel = avr_get_stub_addr (srel, htab);
- if (debug_stubs)
- printf ("LD: Using jump stub (at 0x%x) with destination 0x%x for "
- "reloc at address 0x%x.\n",
- (unsigned int) srel,
- (unsigned int) old_srel,
- (unsigned int) reloc_addr);
+ && avr_stub_is_required_for_16_bit_reloc (srel - base_addr))
+ {
+ bfd_vma old_srel = srel;
+
+ /* We need to use the address of the stub instead. */
+ srel = avr_get_stub_addr (srel, htab);
+ if (debug_stubs)
+ printf ("LD: Using jump stub (at 0x%x) with destination 0x%x for "
+ "reloc at address 0x%x.\n",
+ (unsigned int) srel,
+ (unsigned int) old_srel,
+ (unsigned int) reloc_addr);
if (avr_stub_is_required_for_16_bit_reloc (srel - base_addr))
return bfd_reloc_outofrange;
- }
+ }
if (srel & 1)
return bfd_reloc_outofrange;
srel = (bfd_signed_vma) relocation + rel->r_addend;
if (use_stubs
- && avr_stub_is_required_for_16_bit_reloc (srel - base_addr))
- {
- bfd_vma old_srel = srel;
-
- /* We need to use the address of the stub instead. */
- srel = avr_get_stub_addr (srel, htab);
- if (debug_stubs)
- printf ("LD: Using jump stub (at 0x%x) with destination 0x%x for "
- "reloc at address 0x%x.\n",
- (unsigned int) srel,
- (unsigned int) old_srel,
- (unsigned int) reloc_addr);
+ && avr_stub_is_required_for_16_bit_reloc (srel - base_addr))
+ {
+ bfd_vma old_srel = srel;
+
+ /* We need to use the address of the stub instead. */
+ srel = avr_get_stub_addr (srel, htab);
+ if (debug_stubs)
+ printf ("LD: Using jump stub (at 0x%x) with destination 0x%x for "
+ "reloc at address 0x%x.\n",
+ (unsigned int) srel,
+ (unsigned int) old_srel,
+ (unsigned int) reloc_addr);
if (avr_stub_is_required_for_16_bit_reloc (srel - base_addr))
return bfd_reloc_outofrange;
- }
+ }
if (srel & 1)
return bfd_reloc_outofrange;
srel = (bfd_signed_vma) relocation + rel->r_addend;
if (use_stubs
- && avr_stub_is_required_for_16_bit_reloc (srel - base_addr))
- {
- bfd_vma old_srel = srel;
-
- /* We need to use the address of the stub instead. */
- srel = avr_get_stub_addr (srel,htab);
- if (debug_stubs)
- printf ("LD: Using jump stub (at 0x%x) with destination 0x%x for "
- "reloc at address 0x%x.\n",
- (unsigned int) srel,
- (unsigned int) old_srel,
- (unsigned int) reloc_addr);
+ && avr_stub_is_required_for_16_bit_reloc (srel - base_addr))
+ {
+ bfd_vma old_srel = srel;
+
+ /* We need to use the address of the stub instead. */
+ srel = avr_get_stub_addr (srel,htab);
+ if (debug_stubs)
+ printf ("LD: Using jump stub (at 0x%x) with destination 0x%x for "
+ "reloc at address 0x%x.\n",
+ (unsigned int) srel,
+ (unsigned int) old_srel,
+ (unsigned int) reloc_addr);
if (avr_stub_is_required_for_16_bit_reloc (srel - base_addr))
return bfd_reloc_outofrange;
- }
+ }
if (srel & 1)
return bfd_reloc_outofrange;
contents += rel->r_offset;
srel = (bfd_signed_vma) relocation + rel->r_addend;
if ((srel & 0xFFFF) < 0x40 || (srel & 0xFFFF) > 0xbf)
- return bfd_reloc_outofrange;
+ return bfd_reloc_outofrange;
srel = srel & 0x7f;
x = bfd_get_16 (input_bfd, contents);
x |= (srel & 0x0f) | ((srel & 0x30) << 5) | ((srel & 0x40) << 2);
contents += rel->r_offset;
srel = (bfd_signed_vma) relocation + rel->r_addend;
if ((srel & 0xffff) > 0x3f)
- return bfd_reloc_outofrange;
+ return bfd_reloc_outofrange;
x = bfd_get_16 (input_bfd, contents);
x = (x & 0xf9f0) | ((srel & 0x30) << 5) | (srel & 0x0f);
bfd_put_16 (input_bfd, x, contents);
contents += rel->r_offset;
srel = (bfd_signed_vma) relocation + rel->r_addend;
if ((srel & 0xffff) > 0x1f)
- return bfd_reloc_outofrange;
+ return bfd_reloc_outofrange;
x = bfd_get_16 (input_bfd, contents);
x = (x & 0xff07) | ((srel & 0x1f) << 3);
bfd_put_16 (input_bfd, x, contents);
Elf_Internal_Sym *local_syms,
asection **local_sections)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- Elf_Internal_Rela * rel;
- Elf_Internal_Rela * relend;
+ Elf_Internal_Rela * rel;
+ Elf_Internal_Rela * relend;
struct elf32_avr_link_hash_table * htab = avr_link_hash_table (info);
if (htab == NULL)
for (rel = relocs; rel < relend; rel ++)
{
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- const char * name;
- int r_type;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char * name;
+ int r_type;
r_type = ELF32_R_TYPE (rel->r_info);
r_symndx = ELF32_R_SYM (rel->r_info);
elf32_avr_is_diff_reloc (Elf_Internal_Rela *irel)
{
return (ELF32_R_TYPE (irel->r_info) == R_AVR_DIFF8
- ||ELF32_R_TYPE (irel->r_info) == R_AVR_DIFF16
- || ELF32_R_TYPE (irel->r_info) == R_AVR_DIFF32);
+ ||ELF32_R_TYPE (irel->r_info) == R_AVR_DIFF16
+ || ELF32_R_TYPE (irel->r_info) == R_AVR_DIFF32);
}
/* Reduce the diff value written in the section by count if the shrinked
static void
elf32_avr_adjust_diff_reloc_value (bfd *abfd,
- struct bfd_section *isec,
- Elf_Internal_Rela *irel,
- bfd_vma symval,
- bfd_vma shrinked_insn_address,
- int count)
+ struct bfd_section *isec,
+ Elf_Internal_Rela *irel,
+ bfd_vma symval,
+ bfd_vma shrinked_insn_address,
+ int count)
{
unsigned char *reloc_contents = NULL;
unsigned char *isec_contents = elf_section_data (isec)->this_hdr.contents;
{
case R_AVR_DIFF8:
{
- bfd_put_signed_8 (abfd, new_diff, reloc_contents);
- break;
+ bfd_put_signed_8 (abfd, new_diff, reloc_contents);
+ break;
}
case R_AVR_DIFF16:
{
- bfd_put_signed_16 (abfd, new_diff & 0xFFFF, reloc_contents);
- break;
+ bfd_put_signed_16 (abfd, new_diff & 0xFFFF, reloc_contents);
+ break;
}
case R_AVR_DIFF32:
{
- bfd_put_signed_32 (abfd, new_diff & 0xFFFFFFFF, reloc_contents);
- break;
+ bfd_put_signed_32 (abfd, new_diff & 0xFFFFFFFF, reloc_contents);
+ break;
}
default:
{
- BFD_FAIL();
+ BFD_FAIL();
}
}
static void
elf32_avr_adjust_reloc_if_spans_insn (bfd *abfd,
- asection *isec,
- Elf_Internal_Rela *irel, bfd_vma symval,
- bfd_vma shrinked_insn_address,
- bfd_vma shrink_boundary,
- int count)
+ asection *isec,
+ Elf_Internal_Rela *irel, bfd_vma symval,
+ bfd_vma shrinked_insn_address,
+ bfd_vma shrink_boundary,
+ int count)
{
if (elf32_avr_is_diff_reloc (irel))
{
elf32_avr_adjust_diff_reloc_value (abfd, isec, irel,
- symval,
- shrinked_insn_address,
- count);
+ symval,
+ shrinked_insn_address,
+ count);
}
else
{
bfd_vma reloc_value = symval + irel->r_addend;
bfd_boolean addend_within_shrink_boundary =
- (reloc_value <= shrink_boundary);
+ (reloc_value <= shrink_boundary);
bfd_boolean reloc_spans_insn =
- (symval <= shrinked_insn_address
- && reloc_value > shrinked_insn_address
- && addend_within_shrink_boundary);
+ (symval <= shrinked_insn_address
+ && reloc_value > shrinked_insn_address
+ && addend_within_shrink_boundary);
if (! reloc_spans_insn)
- return;
+ return;
irel->r_addend -= count;
if (debug_relax)
- printf ("Relocation's addend needed to be fixed \n");
+ printf ("Relocation's addend needed to be fixed \n");
}
}
static bfd_boolean
avr_should_move_sym (symvalue symval,
- bfd_vma start,
- bfd_vma end,
- bfd_boolean did_pad)
+ bfd_vma start,
+ bfd_vma end,
+ bfd_boolean did_pad)
{
bfd_boolean sym_within_boundary =
- did_pad ? symval < end : symval <= end;
+ did_pad ? symval < end : symval <= end;
return (symval > start && sym_within_boundary);
}
static bfd_boolean
avr_should_reduce_sym_size (symvalue symval,
- symvalue symend,
- bfd_vma start,
- bfd_vma end,
- bfd_boolean did_pad)
+ symvalue symend,
+ bfd_vma start,
+ bfd_vma end,
+ bfd_boolean did_pad)
{
bfd_boolean sym_end_within_boundary =
- did_pad ? symend < end : symend <= end;
+ did_pad ? symend < end : symend <= end;
return (symval <= start && symend > start && sym_end_within_boundary);
}
static bfd_boolean
avr_should_increase_sym_size (symvalue symval,
- symvalue symend,
- bfd_vma start,
- bfd_vma end,
- bfd_boolean did_pad)
+ symvalue symend,
+ bfd_vma start,
+ bfd_vma end,
+ bfd_boolean did_pad)
{
return avr_should_move_sym (symval, start, end, did_pad)
- && symend >= end && did_pad;
+ && symend >= end && did_pad;
}
/* Delete some bytes from a section while changing the size of an instruction.
static bfd_boolean
elf32_avr_relax_delete_bytes (bfd *abfd,
- asection *sec,
- bfd_vma addr,
- int count,
- bfd_boolean delete_shrinks_insn)
+ asection *sec,
+ bfd_vma addr,
+ int count,
+ bfd_boolean delete_shrinks_insn)
{
Elf_Internal_Shdr *symtab_hdr;
unsigned int sec_shndx;
if (relax_info->records.count > 0)
{
/* There should be no property record within the range of deleted
- bytes, however, there might be a property record for ADDR, this is
- how we handle alignment directives.
- Find the next (if any) property record after the deleted bytes. */
+ bytes, however, there might be a property record for ADDR, this is
+ how we handle alignment directives.
+ Find the next (if any) property record after the deleted bytes. */
unsigned int i;
for (i = 0; i < relax_info->records.count; ++i)
- {
- bfd_vma offset = relax_info->records.items [i].offset;
-
- BFD_ASSERT (offset <= addr || offset >= (addr + count));
- if (offset >= (addr + count))
- {
- prop_record = &relax_info->records.items [i];
- toaddr = offset;
- break;
- }
- }
+ {
+ bfd_vma offset = relax_info->records.items [i].offset;
+
+ BFD_ASSERT (offset <= addr || offset >= (addr + count));
+ if (offset >= (addr + count))
+ {
+ prop_record = &relax_info->records.items [i];
+ toaddr = offset;
+ break;
+ }
+ }
}
irel = elf_section_data (sec)->relocs;
if (toaddr - addr - count > 0)
{
memmove (contents + addr, contents + addr + count,
- (size_t) (toaddr - addr - count));
+ (size_t) (toaddr - addr - count));
did_shrink = TRUE;
}
if (prop_record == NULL)
/* Use the property record to fill in the bytes we've opened up. */
int fill = 0;
switch (prop_record->type)
- {
- case RECORD_ORG_AND_FILL:
- fill = prop_record->data.org.fill;
- /* Fall through. */
- case RECORD_ORG:
- break;
- case RECORD_ALIGN_AND_FILL:
- fill = prop_record->data.align.fill;
- /* Fall through. */
- case RECORD_ALIGN:
- prop_record->data.align.preceding_deleted += count;
- break;
- };
+ {
+ case RECORD_ORG_AND_FILL:
+ fill = prop_record->data.org.fill;
+ /* Fall through. */
+ case RECORD_ORG:
+ break;
+ case RECORD_ALIGN_AND_FILL:
+ fill = prop_record->data.align.fill;
+ /* Fall through. */
+ case RECORD_ALIGN:
+ prop_record->data.align.preceding_deleted += count;
+ break;
+ };
/* If toaddr == (addr + count), then we didn't delete anything, yet
- we fill count bytes backwards from toaddr. This is still ok - we
- end up overwriting the bytes we would have deleted. We just need
- to remember we didn't delete anything i.e. don't set did_shrink,
- so that we don't corrupt reloc offsets or symbol values.*/
+ we fill count bytes backwards from toaddr. This is still ok - we
+ end up overwriting the bytes we would have deleted. We just need
+ to remember we didn't delete anything i.e. don't set did_shrink,
+ so that we don't corrupt reloc offsets or symbol values.*/
memset (contents + toaddr - count, fill, count);
did_pad = TRUE;
}
bfd_vma old_reloc_address;
old_reloc_address = (sec->output_section->vma
- + sec->output_offset + irel->r_offset);
+ + sec->output_offset + irel->r_offset);
/* Get the new reloc address. */
if ((irel->r_offset > addr
- && irel->r_offset < toaddr))
- {
- if (debug_relax)
- printf ("Relocation at address 0x%x needs to be moved.\n"
- "Old section offset: 0x%x, New section offset: 0x%x \n",
- (unsigned int) old_reloc_address,
- (unsigned int) irel->r_offset,
- (unsigned int) ((irel->r_offset) - count));
-
- irel->r_offset -= count;
- }
+ && irel->r_offset < toaddr))
+ {
+ if (debug_relax)
+ printf ("Relocation at address 0x%x needs to be moved.\n"
+ "Old section offset: 0x%x, New section offset: 0x%x \n",
+ (unsigned int) old_reloc_address,
+ (unsigned int) irel->r_offset,
+ (unsigned int) ((irel->r_offset) - count));
+
+ irel->r_offset -= count;
+ }
}
/* The reloc's own addresses are now ok. However, we need to readjust
the reloc's addend, i.e. the reloc's value if two conditions are met:
1.) the reloc is relative to a symbol in this section that
- is located in front of the shrinked instruction
+ is located in front of the shrinked instruction
2.) symbol plus addend end up behind the shrinked instruction.
The most common case where this happens are relocs relative to
continue;
shrinked_insn_address = (sec->output_section->vma
- + sec->output_offset + addr);
+ + sec->output_offset + addr);
if (delete_shrinks_insn)
- shrinked_insn_address -= count;
+ shrinked_insn_address -= count;
irel = elf_section_data (isec)->relocs;
/* PR 12161: Read in the relocs for this section if necessary. */
if (irel == NULL)
- irel = _bfd_elf_link_read_relocs (abfd, isec, NULL, NULL, TRUE);
+ irel = _bfd_elf_link_read_relocs (abfd, isec, NULL, NULL, TRUE);
for (irelend = irel + isec->reloc_count;
- irel < irelend;
- irel++)
- {
- /* Read this BFD's local symbols if we haven't done
- so already. */
- if (isymbuf == NULL && symtab_hdr->sh_info != 0)
- {
- isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
- if (isymbuf == NULL)
- isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
- symtab_hdr->sh_info, 0,
- NULL, NULL, NULL);
- if (isymbuf == NULL)
- return FALSE;
- }
-
- /* Get the value of the symbol referred to by the reloc. */
- if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
- {
- /* A local symbol. */
- asection *sym_sec;
-
- isym = isymbuf + ELF32_R_SYM (irel->r_info);
- sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
- symval = isym->st_value;
- /* If the reloc is absolute, it will not have
- a symbol or section associated with it. */
- if (sym_sec == sec)
- {
- /* If there is an alignment boundary, we only need to
- adjust addends that end up below the boundary. */
- bfd_vma shrink_boundary = (toaddr
- + sec->output_section->vma
- + sec->output_offset);
-
- symval += sym_sec->output_section->vma
- + sym_sec->output_offset;
-
- if (debug_relax)
- printf ("Checking if the relocation's "
- "addend needs corrections.\n"
- "Address of anchor symbol: 0x%x \n"
- "Address of relocation target: 0x%x \n"
- "Address of relaxed insn: 0x%x \n",
- (unsigned int) symval,
- (unsigned int) (symval + irel->r_addend),
- (unsigned int) shrinked_insn_address);
-
- elf32_avr_adjust_reloc_if_spans_insn (abfd, isec, irel,
- symval,
- shrinked_insn_address,
- shrink_boundary,
- count);
- }
+ irel < irelend;
+ irel++)
+ {
+ /* Read this BFD's local symbols if we haven't done
+ so already. */
+ if (isymbuf == NULL && symtab_hdr->sh_info != 0)
+ {
+ isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (isymbuf == NULL)
+ isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
+ symtab_hdr->sh_info, 0,
+ NULL, NULL, NULL);
+ if (isymbuf == NULL)
+ return FALSE;
+ }
+
+ /* Get the value of the symbol referred to by the reloc. */
+ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
+ {
+ /* A local symbol. */
+ asection *sym_sec;
+
+ isym = isymbuf + ELF32_R_SYM (irel->r_info);
+ sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ symval = isym->st_value;
+ /* If the reloc is absolute, it will not have
+ a symbol or section associated with it. */
+ if (sym_sec == sec)
+ {
+ /* If there is an alignment boundary, we only need to
+ adjust addends that end up below the boundary. */
+ bfd_vma shrink_boundary = (toaddr
+ + sec->output_section->vma
+ + sec->output_offset);
+
+ symval += sym_sec->output_section->vma
+ + sym_sec->output_offset;
+
+ if (debug_relax)
+ printf ("Checking if the relocation's "
+ "addend needs corrections.\n"
+ "Address of anchor symbol: 0x%x \n"
+ "Address of relocation target: 0x%x \n"
+ "Address of relaxed insn: 0x%x \n",
+ (unsigned int) symval,
+ (unsigned int) (symval + irel->r_addend),
+ (unsigned int) shrinked_insn_address);
+
+ elf32_avr_adjust_reloc_if_spans_insn (abfd, isec, irel,
+ symval,
+ shrinked_insn_address,
+ shrink_boundary,
+ count);
+ }
/* else...Reference symbol is absolute. No adjustment needed. */
}
/* else...Reference symbol is extern. No need for adjusting
for (; isym < isymend; isym++)
{
if (isym->st_shndx == sec_shndx)
- {
- symvalue symval = isym->st_value;
- symvalue symend = symval + isym->st_size;
- if (avr_should_reduce_sym_size (symval, symend,
- addr, toaddr, did_pad))
- {
- /* If this assert fires then we have a symbol that ends
- part way through an instruction. Does that make
- sense? */
- BFD_ASSERT (isym->st_value + isym->st_size >= addr + count);
- isym->st_size -= count;
- }
- else if (avr_should_increase_sym_size (symval, symend,
- addr, toaddr, did_pad))
- isym->st_size += count;
-
- if (avr_should_move_sym (symval, addr, toaddr, did_pad))
- isym->st_value -= count;
- }
+ {
+ symvalue symval = isym->st_value;
+ symvalue symend = symval + isym->st_size;
+ if (avr_should_reduce_sym_size (symval, symend,
+ addr, toaddr, did_pad))
+ {
+ /* If this assert fires then we have a symbol that ends
+ part way through an instruction. Does that make
+ sense? */
+ BFD_ASSERT (isym->st_value + isym->st_size >= addr + count);
+ isym->st_size -= count;
+ }
+ else if (avr_should_increase_sym_size (symval, symend,
+ addr, toaddr, did_pad))
+ isym->st_size += count;
+
+ if (avr_should_move_sym (symval, addr, toaddr, did_pad))
+ isym->st_value -= count;
+ }
}
}
/* Now adjust the global symbols defined in this section. */
symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)
- - symtab_hdr->sh_info);
+ - symtab_hdr->sh_info);
sym_hashes = elf_sym_hashes (abfd);
end_hashes = sym_hashes + symcount;
for (; sym_hashes < end_hashes; sym_hashes++)
{
struct elf_link_hash_entry *sym_hash = *sym_hashes;
if ((sym_hash->root.type == bfd_link_hash_defined
- || sym_hash->root.type == bfd_link_hash_defweak)
- && sym_hash->root.u.def.section == sec)
- {
- symvalue symval = sym_hash->root.u.def.value;
- symvalue symend = symval + sym_hash->size;
-
- if (avr_should_reduce_sym_size (symval, symend,
- addr, toaddr, did_pad))
- {
- /* If this assert fires then we have a symbol that ends
- part way through an instruction. Does that make
- sense? */
- BFD_ASSERT (symend >= addr + count);
- sym_hash->size -= count;
- }
- else if (avr_should_increase_sym_size (symval, symend,
- addr, toaddr, did_pad))
- sym_hash->size += count;
-
- if (avr_should_move_sym (symval, addr, toaddr, did_pad))
- sym_hash->root.u.def.value -= count;
- }
+ || sym_hash->root.type == bfd_link_hash_defweak)
+ && sym_hash->root.u.def.section == sec)
+ {
+ symvalue symval = sym_hash->root.u.def.value;
+ symvalue symend = symval + sym_hash->size;
+
+ if (avr_should_reduce_sym_size (symval, symend,
+ addr, toaddr, did_pad))
+ {
+ /* If this assert fires then we have a symbol that ends
+ part way through an instruction. Does that make
+ sense? */
+ BFD_ASSERT (symend >= addr + count);
+ sym_hash->size -= count;
+ }
+ else if (avr_should_increase_sym_size (symval, symend,
+ addr, toaddr, did_pad))
+ sym_hash->size += count;
+
+ if (avr_should_move_sym (symval, addr, toaddr, did_pad))
+ sym_hash->root.u.def.value -= count;
+ }
}
return TRUE;
struct elf_link_hash_entry *h = elf_sym_hashes (abfd)[indx];
while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
switch (h->root.type)
{
elf_sym_hashes (abfd)[indx];
while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
+ || h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
+ || h->root.type == bfd_link_hash_defweak)
offset = h->root.u.def.value;
}
return offset;
BFD_ASSERT (relax_info != NULL);
if (relax_info->records.count
- == relax_info->records.allocated)
- {
- /* Allocate more space. */
- bfd_size_type size;
-
- relax_info->records.allocated += 10;
- size = (sizeof (struct avr_property_record)
- * relax_info->records.allocated);
- relax_info->records.items
- = bfd_realloc (relax_info->records.items, size);
- }
+ == relax_info->records.allocated)
+ {
+ /* Allocate more space. */
+ bfd_size_type size;
+
+ relax_info->records.allocated += 10;
+ size = (sizeof (struct avr_property_record)
+ * relax_info->records.allocated);
+ relax_info->records.items
+ = bfd_realloc (relax_info->records.items, size);
+ }
memcpy (&relax_info->records.items [relax_info->records.count],
- &r_list->records [i],
- sizeof (struct avr_property_record));
+ &r_list->records [i],
+ sizeof (struct avr_property_record));
relax_info->records.count++;
}
}
if (a->section != b->section)
return (bfd_get_section_vma (a->section->owner, a->section)
- - bfd_get_section_vma (b->section->owner, b->section));
+ - bfd_get_section_vma (b->section->owner, b->section));
return (a->type - b->type);
}
r_list = avr_elf32_load_property_records (abfd);
if (r_list != NULL)
- avr_elf32_assign_records_to_sections (r_list);
+ avr_elf32_assign_records_to_sections (r_list);
free (r_list);
}
for (abfd = link_info->input_bfds; abfd != NULL; abfd = abfd->link.next)
for (sec = abfd->sections; sec != NULL; sec = sec->next)
{
- struct avr_relax_info *relax_info = get_avr_relax_info (sec);
- if (relax_info && relax_info->records.count > 0)
- {
- unsigned int i;
-
- qsort (relax_info->records.items,
- relax_info->records.count,
- sizeof (struct avr_property_record),
- avr_property_record_compare);
-
- /* For debug purposes, list all the descriptors. */
- for (i = 0; i < relax_info->records.count; ++i)
- {
- switch (relax_info->records.items [i].type)
- {
- case RECORD_ORG:
- break;
- case RECORD_ORG_AND_FILL:
- break;
- case RECORD_ALIGN:
- break;
- case RECORD_ALIGN_AND_FILL:
- break;
- };
- }
- }
+ struct avr_relax_info *relax_info = get_avr_relax_info (sec);
+ if (relax_info && relax_info->records.count > 0)
+ {
+ unsigned int i;
+
+ qsort (relax_info->records.items,
+ relax_info->records.count,
+ sizeof (struct avr_property_record),
+ avr_property_record_compare);
+
+ /* For debug purposes, list all the descriptors. */
+ for (i = 0; i < relax_info->records.count; ++i)
+ {
+ switch (relax_info->records.items [i].type)
+ {
+ case RECORD_ORG:
+ break;
+ case RECORD_ORG_AND_FILL:
+ break;
+ case RECORD_ALIGN:
+ break;
+ case RECORD_ALIGN_AND_FILL:
+ break;
+ };
+ }
+ }
}
}
static bfd_boolean
elf32_avr_relax_section (bfd *abfd,
asection *sec,
- struct bfd_link_info *link_info,
- bfd_boolean *again)
+ struct bfd_link_info *link_info,
+ bfd_boolean *again)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *internal_relocs;
bfd_size_type last_estimated_stub_section_size = htab->stub_sec->size;
if (debug_relax)
- printf ("Relaxing the stub section. Size prior to this pass: %i\n",
- (int) last_estimated_stub_section_size);
+ printf ("Relaxing the stub section. Size prior to this pass: %i\n",
+ (int) last_estimated_stub_section_size);
elf32_avr_size_stubs (htab->stub_sec->output_section->owner,
- link_info, FALSE);
+ link_info, FALSE);
/* Check if the number of trampolines changed. */
if (last_estimated_stub_section_size != htab->stub_sec->size)
- *again = TRUE;
+ *again = TRUE;
if (debug_relax)
- printf ("Size of stub section after this pass: %i\n",
- (int) htab->stub_sec->size);
+ printf ("Size of stub section after this pass: %i\n",
+ (int) htab->stub_sec->size);
return TRUE;
}
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, NULL, NULL, link_info->keep_memory));
+ (abfd, sec, NULL, NULL, link_info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
if ( ELF32_R_TYPE (irel->r_info) != R_AVR_13_PCREL
&& ELF32_R_TYPE (irel->r_info) != R_AVR_7_PCREL
&& ELF32_R_TYPE (irel->r_info) != R_AVR_CALL)
- continue;
+ continue;
/* Get the section contents if we haven't done so already. */
if (contents == NULL)
- {
- /* Get cached copy if it exists. */
- if (elf_section_data (sec)->this_hdr.contents != NULL)
- contents = elf_section_data (sec)->this_hdr.contents;
- else
- {
- /* Go get them off disk. */
- if (! bfd_malloc_and_get_section (abfd, sec, &contents))
- goto error_return;
- }
- }
+ {
+ /* Get cached copy if it exists. */
+ if (elf_section_data (sec)->this_hdr.contents != NULL)
+ contents = elf_section_data (sec)->this_hdr.contents;
+ else
+ {
+ /* Go get them off disk. */
+ if (! bfd_malloc_and_get_section (abfd, sec, &contents))
+ goto error_return;
+ }
+ }
/* Read this BFD's local symbols if we haven't done so already. */
if (isymbuf == NULL && symtab_hdr->sh_info != 0)
- {
- isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
- if (isymbuf == NULL)
- isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
- symtab_hdr->sh_info, 0,
- NULL, NULL, NULL);
- if (isymbuf == NULL)
- goto error_return;
- }
+ {
+ isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (isymbuf == NULL)
+ isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
+ symtab_hdr->sh_info, 0,
+ NULL, NULL, NULL);
+ if (isymbuf == NULL)
+ goto error_return;
+ }
/* Get the value of the symbol referred to by the reloc. */
if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
- {
- /* A local symbol. */
- Elf_Internal_Sym *isym;
- asection *sym_sec;
-
- isym = isymbuf + ELF32_R_SYM (irel->r_info);
- sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
- symval = isym->st_value;
- /* If the reloc is absolute, it will not have
- a symbol or section associated with it. */
- if (sym_sec)
- symval += sym_sec->output_section->vma
- + sym_sec->output_offset;
- }
+ {
+ /* A local symbol. */
+ Elf_Internal_Sym *isym;
+ asection *sym_sec;
+
+ isym = isymbuf + ELF32_R_SYM (irel->r_info);
+ sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ symval = isym->st_value;
+ /* If the reloc is absolute, it will not have
+ a symbol or section associated with it. */
+ if (sym_sec)
+ symval += sym_sec->output_section->vma
+ + sym_sec->output_offset;
+ }
else
- {
- unsigned long indx;
- struct elf_link_hash_entry *h;
-
- /* An external symbol. */
- indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
- h = elf_sym_hashes (abfd)[indx];
- BFD_ASSERT (h != NULL);
- if (h->root.type != bfd_link_hash_defined
- && h->root.type != bfd_link_hash_defweak)
+ {
+ unsigned long indx;
+ struct elf_link_hash_entry *h;
+
+ /* An external symbol. */
+ indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ BFD_ASSERT (h != NULL);
+ if (h->root.type != bfd_link_hash_defined
+ && h->root.type != bfd_link_hash_defweak)
/* This appears to be a reference to an undefined
symbol. Just ignore it--it will be caught by the
regular reloc processing. */
continue;
- symval = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
- }
+ symval = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
/* For simplicity of coding, we are going to modify the section
- contents, the section relocs, and the BFD symbol table. We
- must tell the rest of the code not to free up this
- information. It would be possible to instead create a table
- of changes which have to be made, as is done in coff-mips.c;
- that would be more work, but would require less memory when
- the linker is run. */
+ contents, the section relocs, and the BFD symbol table. We
+ must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
switch (ELF32_R_TYPE (irel->r_info))
- {
+ {
/* Try to turn a 22-bit absolute call/jump into an 13-bit
pc-relative rcall/rjmp. */
case R_AVR_CALL:
- {
- bfd_vma value = symval + irel->r_addend;
- bfd_vma dot, gap;
- int distance_short_enough = 0;
-
- /* Get the address of this instruction. */
- dot = (sec->output_section->vma
- + sec->output_offset + irel->r_offset);
-
- /* Compute the distance from this insn to the branch target. */
- gap = value - dot;
-
- /* Check if the gap falls in the range that can be accommodated
- in 13bits signed (It is 12bits when encoded, as we deal with
- word addressing). */
- if (!shrinkable && ((int) gap >= -4096 && (int) gap <= 4095))
- distance_short_enough = 1;
- /* If shrinkable, then we can check for a range of distance which
- is two bytes farther on both the directions because the call
- or jump target will be closer by two bytes after the
- relaxation. */
- else if (shrinkable && ((int) gap >= -4094 && (int) gap <= 4097))
- distance_short_enough = 1;
-
- /* Here we handle the wrap-around case. E.g. for a 16k device
- we could use a rjmp to jump from address 0x100 to 0x3d00!
- In order to make this work properly, we need to fill the
- vaiable avr_pc_wrap_around with the appropriate value.
- I.e. 0x4000 for a 16k device. */
- {
+ {
+ bfd_vma value = symval + irel->r_addend;
+ bfd_vma dot, gap;
+ int distance_short_enough = 0;
+
+ /* Get the address of this instruction. */
+ dot = (sec->output_section->vma
+ + sec->output_offset + irel->r_offset);
+
+ /* Compute the distance from this insn to the branch target. */
+ gap = value - dot;
+
+ /* Check if the gap falls in the range that can be accommodated
+ in 13bits signed (It is 12bits when encoded, as we deal with
+ word addressing). */
+ if (!shrinkable && ((int) gap >= -4096 && (int) gap <= 4095))
+ distance_short_enough = 1;
+ /* If shrinkable, then we can check for a range of distance which
+ is two bytes farther on both the directions because the call
+ or jump target will be closer by two bytes after the
+ relaxation. */
+ else if (shrinkable && ((int) gap >= -4094 && (int) gap <= 4097))
+ distance_short_enough = 1;
+
+ /* Here we handle the wrap-around case. E.g. for a 16k device
+ we could use a rjmp to jump from address 0x100 to 0x3d00!
+ In order to make this work properly, we need to fill the
+ vaiable avr_pc_wrap_around with the appropriate value.
+ I.e. 0x4000 for a 16k device. */
+ {
/* Shrinking the code size makes the gaps larger in the
case of wrap-arounds. So we use a heuristical safety
margin to avoid that during relax the distance gets
if (rgap >= (-4092 + safety_margin)
&& rgap <= (4094 - safety_margin))
distance_short_enough = 1;
- }
-
- if (distance_short_enough)
- {
- unsigned char code_msb;
- unsigned char code_lsb;
-
- if (debug_relax)
- printf ("shrinking jump/call instruction at address 0x%x"
- " in section %s\n\n",
- (int) dot, sec->name);
-
- /* Note that we've changed the relocs, section contents,
- etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- elf_section_data (sec)->this_hdr.contents = contents;
- symtab_hdr->contents = (unsigned char *) isymbuf;
-
- /* Get the instruction code for relaxing. */
- code_lsb = bfd_get_8 (abfd, contents + irel->r_offset);
- code_msb = bfd_get_8 (abfd, contents + irel->r_offset + 1);
-
- /* Mask out the relocation bits. */
- code_msb &= 0x94;
- code_lsb &= 0x0E;
- if (code_msb == 0x94 && code_lsb == 0x0E)
- {
- /* we are changing call -> rcall . */
- bfd_put_8 (abfd, 0x00, contents + irel->r_offset);
- bfd_put_8 (abfd, 0xD0, contents + irel->r_offset + 1);
- }
- else if (code_msb == 0x94 && code_lsb == 0x0C)
- {
- /* we are changeing jump -> rjmp. */
- bfd_put_8 (abfd, 0x00, contents + irel->r_offset);
- bfd_put_8 (abfd, 0xC0, contents + irel->r_offset + 1);
- }
- else
- abort ();
-
- /* Fix the relocation's type. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_AVR_13_PCREL);
-
- /* We should not modify the ordering if 'shrinkable' is
- FALSE. */
- if (!shrinkable)
- {
- /* Let's insert a nop. */
- bfd_put_8 (abfd, 0x00, contents + irel->r_offset + 2);
- bfd_put_8 (abfd, 0x00, contents + irel->r_offset + 3);
- }
- else
- {
- /* Delete two bytes of data. */
- if (!elf32_avr_relax_delete_bytes (abfd, sec,
- irel->r_offset + 2, 2,
- TRUE))
- goto error_return;
-
- /* That will change things, so, we should relax again.
- Note that this is not required, and it may be slow. */
- *again = TRUE;
- }
- }
- }
+ }
+
+ if (distance_short_enough)
+ {
+ unsigned char code_msb;
+ unsigned char code_lsb;
+
+ if (debug_relax)
+ printf ("shrinking jump/call instruction at address 0x%x"
+ " in section %s\n\n",
+ (int) dot, sec->name);
+
+ /* Note that we've changed the relocs, section contents,
+ etc. */
+ elf_section_data (sec)->relocs = internal_relocs;
+ elf_section_data (sec)->this_hdr.contents = contents;
+ symtab_hdr->contents = (unsigned char *) isymbuf;
+
+ /* Get the instruction code for relaxing. */
+ code_lsb = bfd_get_8 (abfd, contents + irel->r_offset);
+ code_msb = bfd_get_8 (abfd, contents + irel->r_offset + 1);
+
+ /* Mask out the relocation bits. */
+ code_msb &= 0x94;
+ code_lsb &= 0x0E;
+ if (code_msb == 0x94 && code_lsb == 0x0E)
+ {
+ /* we are changing call -> rcall . */
+ bfd_put_8 (abfd, 0x00, contents + irel->r_offset);
+ bfd_put_8 (abfd, 0xD0, contents + irel->r_offset + 1);
+ }
+ else if (code_msb == 0x94 && code_lsb == 0x0C)
+ {
+ /* we are changeing jump -> rjmp. */
+ bfd_put_8 (abfd, 0x00, contents + irel->r_offset);
+ bfd_put_8 (abfd, 0xC0, contents + irel->r_offset + 1);
+ }
+ else
+ abort ();
+
+ /* Fix the relocation's type. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_AVR_13_PCREL);
+
+ /* We should not modify the ordering if 'shrinkable' is
+ FALSE. */
+ if (!shrinkable)
+ {
+ /* Let's insert a nop. */
+ bfd_put_8 (abfd, 0x00, contents + irel->r_offset + 2);
+ bfd_put_8 (abfd, 0x00, contents + irel->r_offset + 3);
+ }
+ else
+ {
+ /* Delete two bytes of data. */
+ if (!elf32_avr_relax_delete_bytes (abfd, sec,
+ irel->r_offset + 2, 2,
+ TRUE))
+ goto error_return;
+
+ /* That will change things, so, we should relax again.
+ Note that this is not required, and it may be slow. */
+ *again = TRUE;
+ }
+ }
+ }
/* Fall through. */
- default:
- {
- unsigned char code_msb;
- unsigned char code_lsb;
- bfd_vma dot;
-
- code_msb = bfd_get_8 (abfd, contents + irel->r_offset + 1);
- code_lsb = bfd_get_8 (abfd, contents + irel->r_offset + 0);
-
- /* Get the address of this instruction. */
- dot = (sec->output_section->vma
- + sec->output_offset + irel->r_offset);
-
- /* Here we look for rcall/ret or call/ret sequences that could be
- safely replaced by rjmp/ret or jmp/ret. */
- if (((code_msb & 0xf0) == 0xd0)
- && avr_replace_call_ret_sequences)
- {
- /* This insn is a rcall. */
- unsigned char next_insn_msb = 0;
- unsigned char next_insn_lsb = 0;
-
- if (irel->r_offset + 3 < sec->size)
- {
- next_insn_msb =
+ default:
+ {
+ unsigned char code_msb;
+ unsigned char code_lsb;
+ bfd_vma dot;
+
+ code_msb = bfd_get_8 (abfd, contents + irel->r_offset + 1);
+ code_lsb = bfd_get_8 (abfd, contents + irel->r_offset + 0);
+
+ /* Get the address of this instruction. */
+ dot = (sec->output_section->vma
+ + sec->output_offset + irel->r_offset);
+
+ /* Here we look for rcall/ret or call/ret sequences that could be
+ safely replaced by rjmp/ret or jmp/ret. */
+ if (((code_msb & 0xf0) == 0xd0)
+ && avr_replace_call_ret_sequences)
+ {
+ /* This insn is a rcall. */
+ unsigned char next_insn_msb = 0;
+ unsigned char next_insn_lsb = 0;
+
+ if (irel->r_offset + 3 < sec->size)
+ {
+ next_insn_msb =
bfd_get_8 (abfd, contents + irel->r_offset + 3);
- next_insn_lsb =
+ next_insn_lsb =
bfd_get_8 (abfd, contents + irel->r_offset + 2);
- }
+ }
if ((0x95 == next_insn_msb) && (0x08 == next_insn_lsb))
- {
- /* The next insn is a ret. We now convert the rcall insn
- into a rjmp instruction. */
- code_msb &= 0xef;
- bfd_put_8 (abfd, code_msb, contents + irel->r_offset + 1);
- if (debug_relax)
- printf ("converted rcall/ret sequence at address 0x%x"
- " into rjmp/ret sequence. Section is %s\n\n",
- (int) dot, sec->name);
- *again = TRUE;
- break;
- }
- }
- else if ((0x94 == (code_msb & 0xfe))
+ {
+ /* The next insn is a ret. We now convert the rcall insn
+ into a rjmp instruction. */
+ code_msb &= 0xef;
+ bfd_put_8 (abfd, code_msb, contents + irel->r_offset + 1);
+ if (debug_relax)
+ printf ("converted rcall/ret sequence at address 0x%x"
+ " into rjmp/ret sequence. Section is %s\n\n",
+ (int) dot, sec->name);
+ *again = TRUE;
+ break;
+ }
+ }
+ else if ((0x94 == (code_msb & 0xfe))
&& (0x0e == (code_lsb & 0x0e))
&& avr_replace_call_ret_sequences)
- {
- /* This insn is a call. */
- unsigned char next_insn_msb = 0;
- unsigned char next_insn_lsb = 0;
-
- if (irel->r_offset + 5 < sec->size)
- {
- next_insn_msb =
+ {
+ /* This insn is a call. */
+ unsigned char next_insn_msb = 0;
+ unsigned char next_insn_lsb = 0;
+
+ if (irel->r_offset + 5 < sec->size)
+ {
+ next_insn_msb =
bfd_get_8 (abfd, contents + irel->r_offset + 5);
- next_insn_lsb =
+ next_insn_lsb =
bfd_get_8 (abfd, contents + irel->r_offset + 4);
- }
-
- if ((0x95 == next_insn_msb) && (0x08 == next_insn_lsb))
- {
- /* The next insn is a ret. We now convert the call insn
- into a jmp instruction. */
-
- code_lsb &= 0xfd;
- bfd_put_8 (abfd, code_lsb, contents + irel->r_offset);
- if (debug_relax)
- printf ("converted call/ret sequence at address 0x%x"
- " into jmp/ret sequence. Section is %s\n\n",
- (int) dot, sec->name);
- *again = TRUE;
- break;
- }
- }
- else if ((0xc0 == (code_msb & 0xf0))
- || ((0x94 == (code_msb & 0xfe))
- && (0x0c == (code_lsb & 0x0e))))
- {
- /* This insn is a rjmp or a jmp. */
- unsigned char next_insn_msb = 0;
- unsigned char next_insn_lsb = 0;
- int insn_size;
-
- if (0xc0 == (code_msb & 0xf0))
- insn_size = 2; /* rjmp insn */
- else
- insn_size = 4; /* jmp insn */
-
- if (irel->r_offset + insn_size + 1 < sec->size)
- {
- next_insn_msb =
+ }
+
+ if ((0x95 == next_insn_msb) && (0x08 == next_insn_lsb))
+ {
+ /* The next insn is a ret. We now convert the call insn
+ into a jmp instruction. */
+
+ code_lsb &= 0xfd;
+ bfd_put_8 (abfd, code_lsb, contents + irel->r_offset);
+ if (debug_relax)
+ printf ("converted call/ret sequence at address 0x%x"
+ " into jmp/ret sequence. Section is %s\n\n",
+ (int) dot, sec->name);
+ *again = TRUE;
+ break;
+ }
+ }
+ else if ((0xc0 == (code_msb & 0xf0))
+ || ((0x94 == (code_msb & 0xfe))
+ && (0x0c == (code_lsb & 0x0e))))
+ {
+ /* This insn is a rjmp or a jmp. */
+ unsigned char next_insn_msb = 0;
+ unsigned char next_insn_lsb = 0;
+ int insn_size;
+
+ if (0xc0 == (code_msb & 0xf0))
+ insn_size = 2; /* rjmp insn */
+ else
+ insn_size = 4; /* jmp insn */
+
+ if (irel->r_offset + insn_size + 1 < sec->size)
+ {
+ next_insn_msb =
bfd_get_8 (abfd, contents + irel->r_offset
+ insn_size + 1);
- next_insn_lsb =
+ next_insn_lsb =
bfd_get_8 (abfd, contents + irel->r_offset
+ insn_size);
- }
-
- if ((0x95 == next_insn_msb) && (0x08 == next_insn_lsb))
- {
- /* The next insn is a ret. We possibly could delete
- this ret. First we need to check for preceding
- sbis/sbic/sbrs or cpse "skip" instructions. */
-
- int there_is_preceding_non_skip_insn = 1;
- bfd_vma address_of_ret;
-
- address_of_ret = dot + insn_size;
-
- if (debug_relax && (insn_size == 2))
- printf ("found rjmp / ret sequence at address 0x%x\n",
- (int) dot);
- if (debug_relax && (insn_size == 4))
- printf ("found jmp / ret sequence at address 0x%x\n",
- (int) dot);
-
- /* We have to make sure that there is a preceding insn. */
- if (irel->r_offset >= 2)
- {
- unsigned char preceding_msb;
- unsigned char preceding_lsb;
+ }
- preceding_msb =
+ if ((0x95 == next_insn_msb) && (0x08 == next_insn_lsb))
+ {
+ /* The next insn is a ret. We possibly could delete
+ this ret. First we need to check for preceding
+ sbis/sbic/sbrs or cpse "skip" instructions. */
+
+ int there_is_preceding_non_skip_insn = 1;
+ bfd_vma address_of_ret;
+
+ address_of_ret = dot + insn_size;
+
+ if (debug_relax && (insn_size == 2))
+ printf ("found rjmp / ret sequence at address 0x%x\n",
+ (int) dot);
+ if (debug_relax && (insn_size == 4))
+ printf ("found jmp / ret sequence at address 0x%x\n",
+ (int) dot);
+
+ /* We have to make sure that there is a preceding insn. */
+ if (irel->r_offset >= 2)
+ {
+ unsigned char preceding_msb;
+ unsigned char preceding_lsb;
+
+ preceding_msb =
bfd_get_8 (abfd, contents + irel->r_offset - 1);
- preceding_lsb =
+ preceding_lsb =
bfd_get_8 (abfd, contents + irel->r_offset - 2);
- /* sbic. */
- if (0x99 == preceding_msb)
- there_is_preceding_non_skip_insn = 0;
+ /* sbic. */
+ if (0x99 == preceding_msb)
+ there_is_preceding_non_skip_insn = 0;
- /* sbis. */
- if (0x9b == preceding_msb)
- there_is_preceding_non_skip_insn = 0;
+ /* sbis. */
+ if (0x9b == preceding_msb)
+ there_is_preceding_non_skip_insn = 0;
- /* sbrc */
- if ((0xfc == (preceding_msb & 0xfe)
+ /* sbrc */
+ if ((0xfc == (preceding_msb & 0xfe)
&& (0x00 == (preceding_lsb & 0x08))))
- there_is_preceding_non_skip_insn = 0;
+ there_is_preceding_non_skip_insn = 0;
- /* sbrs */
- if ((0xfe == (preceding_msb & 0xfe)
+ /* sbrs */
+ if ((0xfe == (preceding_msb & 0xfe)
&& (0x00 == (preceding_lsb & 0x08))))
- there_is_preceding_non_skip_insn = 0;
-
- /* cpse */
- if (0x10 == (preceding_msb & 0xfc))
- there_is_preceding_non_skip_insn = 0;
-
- if (there_is_preceding_non_skip_insn == 0)
- if (debug_relax)
- printf ("preceding skip insn prevents deletion of"
- " ret insn at Addy 0x%x in section %s\n",
- (int) dot + 2, sec->name);
- }
- else
- {
- /* There is no previous instruction. */
- there_is_preceding_non_skip_insn = 0;
- }
-
- if (there_is_preceding_non_skip_insn)
- {
- /* We now only have to make sure that there is no
- local label defined at the address of the ret
- instruction and that there is no local relocation
- in this section pointing to the ret. */
-
- int deleting_ret_is_safe = 1;
- unsigned int section_offset_of_ret_insn =
+ there_is_preceding_non_skip_insn = 0;
+
+ /* cpse */
+ if (0x10 == (preceding_msb & 0xfc))
+ there_is_preceding_non_skip_insn = 0;
+
+ if (there_is_preceding_non_skip_insn == 0)
+ if (debug_relax)
+ printf ("preceding skip insn prevents deletion of"
+ " ret insn at Addy 0x%x in section %s\n",
+ (int) dot + 2, sec->name);
+ }
+ else
+ {
+ /* There is no previous instruction. */
+ there_is_preceding_non_skip_insn = 0;
+ }
+
+ if (there_is_preceding_non_skip_insn)
+ {
+ /* We now only have to make sure that there is no
+ local label defined at the address of the ret
+ instruction and that there is no local relocation
+ in this section pointing to the ret. */
+
+ int deleting_ret_is_safe = 1;
+ unsigned int section_offset_of_ret_insn =
irel->r_offset + insn_size;
- Elf_Internal_Sym *isym, *isymend;
- unsigned int sec_shndx;
+ Elf_Internal_Sym *isym, *isymend;
+ unsigned int sec_shndx;
struct bfd_section *isec;
- sec_shndx =
+ sec_shndx =
_bfd_elf_section_from_bfd_section (abfd, sec);
- /* Check for local symbols. */
- isym = (Elf_Internal_Sym *) symtab_hdr->contents;
- isymend = isym + symtab_hdr->sh_info;
+ /* Check for local symbols. */
+ isym = (Elf_Internal_Sym *) symtab_hdr->contents;
+ isymend = isym + symtab_hdr->sh_info;
/* PR 6019: There may not be any local symbols. */
- for (; isym != NULL && isym < isymend; isym++)
+ for (; isym != NULL && isym < isymend; isym++)
{
if (isym->st_value == section_offset_of_ret_insn
&& isym->st_shndx == sec_shndx)
*again = TRUE;
break;
}
- }
- }
- }
- break;
- }
- }
+ }
+ }
+ }
+ break;
+ }
+ }
}
if (!*again)
{
/* Look through all the property records in this section to see if
- there's any alignment records that can be moved. */
+ there's any alignment records that can be moved. */
struct avr_relax_info *relax_info;
relax_info = get_avr_relax_info (sec);
if (relax_info->records.count > 0)
- {
- unsigned int i;
-
- for (i = 0; i < relax_info->records.count; ++i)
- {
- switch (relax_info->records.items [i].type)
- {
- case RECORD_ORG:
- case RECORD_ORG_AND_FILL:
- break;
- case RECORD_ALIGN:
- case RECORD_ALIGN_AND_FILL:
- {
- struct avr_property_record *record;
- unsigned long bytes_to_align;
- int count = 0;
-
- /* Look for alignment directives that have had enough
- bytes deleted before them, such that the directive
- can be moved backwards and still maintain the
- required alignment. */
- record = &relax_info->records.items [i];
- bytes_to_align
- = (unsigned long) (1 << record->data.align.bytes);
- while (record->data.align.preceding_deleted >=
- bytes_to_align)
- {
- record->data.align.preceding_deleted
- -= bytes_to_align;
- count += bytes_to_align;
- }
-
- if (count > 0)
- {
- bfd_vma addr = record->offset;
-
- /* We can delete COUNT bytes and this alignment
- directive will still be correctly aligned.
- First move the alignment directive, then delete
- the bytes. */
- record->offset -= count;
- elf32_avr_relax_delete_bytes (abfd, sec,
- addr - count,
- count, FALSE);
- *again = TRUE;
- }
- }
- break;
- }
- }
- }
+ {
+ unsigned int i;
+
+ for (i = 0; i < relax_info->records.count; ++i)
+ {
+ switch (relax_info->records.items [i].type)
+ {
+ case RECORD_ORG:
+ case RECORD_ORG_AND_FILL:
+ break;
+ case RECORD_ALIGN:
+ case RECORD_ALIGN_AND_FILL:
+ {
+ struct avr_property_record *record;
+ unsigned long bytes_to_align;
+ int count = 0;
+
+ /* Look for alignment directives that have had enough
+ bytes deleted before them, such that the directive
+ can be moved backwards and still maintain the
+ required alignment. */
+ record = &relax_info->records.items [i];
+ bytes_to_align
+ = (unsigned long) (1 << record->data.align.bytes);
+ while (record->data.align.preceding_deleted >=
+ bytes_to_align)
+ {
+ record->data.align.preceding_deleted
+ -= bytes_to_align;
+ count += bytes_to_align;
+ }
+
+ if (count > 0)
+ {
+ bfd_vma addr = record->offset;
+
+ /* We can delete COUNT bytes and this alignment
+ directive will still be correctly aligned.
+ First move the alignment directive, then delete
+ the bytes. */
+ record->offset -= count;
+ elf32_avr_relax_delete_bytes (abfd, sec,
+ addr - count,
+ count, FALSE);
+ *again = TRUE;
+ }
+ }
+ break;
+ }
+ }
+ }
}
if (contents != NULL
&& elf_section_data (sec)->this_hdr.contents != contents)
{
if (! link_info->keep_memory)
- free (contents);
+ free (contents);
else
- {
- /* Cache the section contents for elf_link_input_bfd. */
- elf_section_data (sec)->this_hdr.contents = contents;
- }
+ {
+ /* Cache the section contents for elf_link_input_bfd. */
+ elf_section_data (sec)->this_hdr.contents = contents;
+ }
}
if (internal_relocs != NULL
static bfd_byte *
elf32_avr_get_relocated_section_contents (bfd *output_bfd,
- struct bfd_link_info *link_info,
- struct bfd_link_order *link_order,
- bfd_byte *data,
- bfd_boolean relocatable,
- asymbol **symbols)
+ struct bfd_link_info *link_info,
+ struct bfd_link_order *link_order,
+ bfd_byte *data,
+ bfd_boolean relocatable,
+ asymbol **symbols)
{
Elf_Internal_Shdr *symtab_hdr;
asection *input_section = link_order->u.indirect.section;
if (relocatable
|| elf_section_data (input_section)->this_hdr.contents == NULL)
return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
- link_order, data,
- relocatable,
- symbols);
+ link_order, data,
+ relocatable,
+ symbols);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
memcpy (data, elf_section_data (input_section)->this_hdr.contents,
- (size_t) input_section->size);
+ (size_t) input_section->size);
if ((input_section->flags & SEC_RELOC) != 0
&& input_section->reloc_count > 0)
bfd_size_type amt;
internal_relocs = (_bfd_elf_link_read_relocs
- (input_bfd, input_section, NULL, NULL, FALSE));
+ (input_bfd, input_section, NULL, NULL, FALSE));
if (internal_relocs == NULL)
- goto error_return;
+ goto error_return;
if (symtab_hdr->sh_info != 0)
- {
- isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
- if (isymbuf == NULL)
- isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr,
- symtab_hdr->sh_info, 0,
- NULL, NULL, NULL);
- if (isymbuf == NULL)
- goto error_return;
- }
+ {
+ isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (isymbuf == NULL)
+ isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr,
+ symtab_hdr->sh_info, 0,
+ NULL, NULL, NULL);
+ if (isymbuf == NULL)
+ goto error_return;
+ }
amt = symtab_hdr->sh_info;
amt *= sizeof (asection *);
sections = bfd_malloc (amt);
if (sections == NULL && amt != 0)
- goto error_return;
+ goto error_return;
isymend = isymbuf + symtab_hdr->sh_info;
for (isym = isymbuf, secpp = sections; isym < isymend; ++isym, ++secpp)
- {
- asection *isec;
-
- if (isym->st_shndx == SHN_UNDEF)
- isec = bfd_und_section_ptr;
- else if (isym->st_shndx == SHN_ABS)
- isec = bfd_abs_section_ptr;
- else if (isym->st_shndx == SHN_COMMON)
- isec = bfd_com_section_ptr;
- else
- isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx);
-
- *secpp = isec;
- }
+ {
+ asection *isec;
+
+ if (isym->st_shndx == SHN_UNDEF)
+ isec = bfd_und_section_ptr;
+ else if (isym->st_shndx == SHN_ABS)
+ isec = bfd_abs_section_ptr;
+ else if (isym->st_shndx == SHN_COMMON)
+ isec = bfd_com_section_ptr;
+ else
+ isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx);
+
+ *secpp = isec;
+ }
if (! elf32_avr_relocate_section (output_bfd, link_info, input_bfd,
- input_section, data, internal_relocs,
- isymbuf, sections))
- goto error_return;
+ input_section, data, internal_relocs,
+ isymbuf, sections))
+ goto error_return;
if (sections != NULL)
- free (sections);
+ free (sections);
if (isymbuf != NULL
- && symtab_hdr->contents != (unsigned char *) isymbuf)
- free (isymbuf);
+ && symtab_hdr->contents != (unsigned char *) isymbuf)
+ free (isymbuf);
if (elf_section_data (input_section)->relocs != internal_relocs)
- free (internal_relocs);
+ free (internal_relocs);
}
return data;
static char *
avr_stub_name (const asection *symbol_section,
- const bfd_vma symbol_offset,
- const Elf_Internal_Rela *rela)
+ const bfd_vma symbol_offset,
+ const Elf_Internal_Rela *rela)
{
char *stub_name;
bfd_size_type len;
stub_name = bfd_malloc (len);
sprintf (stub_name, "%08x+%08x",
- symbol_section->id & 0xffffffff,
- (unsigned int) ((rela->r_addend & 0xffffffff) + symbol_offset));
+ symbol_section->id & 0xffffffff,
+ (unsigned int) ((rela->r_addend & 0xffffffff) + symbol_offset));
return stub_name;
}
static struct elf32_avr_stub_hash_entry *
avr_add_stub (const char *stub_name,
- struct elf32_avr_link_hash_table *htab)
+ struct elf32_avr_link_hash_table *htab)
{
struct elf32_avr_stub_hash_entry *hsh;
if (debug_stubs)
printf ("Building one Stub. Address: 0x%x, Offset: 0x%x\n",
- (unsigned int) target,
- (unsigned int) hsh->stub_offset);
+ (unsigned int) target,
+ (unsigned int) hsh->stub_offset);
/* We now have to add the information on the jump target to the bare
opcode bits already set in jmp_insn. */
nr = htab->amt_entry_cnt + 1;
if (nr <= htab->amt_max_entry_cnt)
{
- htab->amt_entry_cnt = nr;
+ htab->amt_entry_cnt = nr;
- htab->amt_stub_offsets[nr - 1] = hsh->stub_offset;
- htab->amt_destination_addr[nr - 1] = target;
+ htab->amt_stub_offsets[nr - 1] = hsh->stub_offset;
+ htab->amt_destination_addr[nr - 1] = target;
}
}
static bfd_boolean
avr_mark_stub_not_to_be_necessary (struct bfd_hash_entry *bh,
- void *in_arg ATTRIBUTE_UNUSED)
+ void *in_arg ATTRIBUTE_UNUSED)
{
struct elf32_avr_stub_hash_entry *hsh;
void
elf32_avr_setup_params (struct bfd_link_info *info,
- bfd *avr_stub_bfd,
- asection *avr_stub_section,
- bfd_boolean no_stubs,
- bfd_boolean deb_stubs,
- bfd_boolean deb_relax,
- bfd_vma pc_wrap_around,
- bfd_boolean call_ret_replacement)
+ bfd *avr_stub_bfd,
+ asection *avr_stub_section,
+ bfd_boolean no_stubs,
+ bfd_boolean deb_stubs,
+ bfd_boolean deb_relax,
+ bfd_vma pc_wrap_around,
+ bfd_boolean call_ret_replacement)
{
struct elf32_avr_link_hash_table *htab = avr_link_hash_table (info);
int
elf32_avr_setup_section_lists (bfd *output_bfd,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *input_bfd;
unsigned int bfd_count;
{
bfd_count += 1;
for (section = input_bfd->sections;
- section != NULL;
- section = section->next)
+ section != NULL;
+ section = section->next)
if (top_id < section->id)
top_id = section->id;
}
bfd_boolean
elf32_avr_size_stubs (bfd *output_bfd,
- struct bfd_link_info *info,
- bfd_boolean is_prealloc_run)
+ struct bfd_link_info *info,
+ bfd_boolean is_prealloc_run)
{
struct elf32_avr_link_hash_table *htab;
int stub_changed = 0;
unsigned int bfd_indx;
/* We will have to re-generate the stub hash table each time anything
- in memory has changed. */
+ in memory has changed. */
bfd_hash_traverse (&htab->bstab, avr_mark_stub_not_to_be_necessary, htab);
for (input_bfd = info->input_bfds, bfd_indx = 0;
- input_bfd != NULL;
- input_bfd = input_bfd->link.next, bfd_indx++)
- {
- Elf_Internal_Shdr *symtab_hdr;
- asection *section;
- Elf_Internal_Sym *local_syms;
-
- /* We'll need the symbol table in a second. */
- symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
- if (symtab_hdr->sh_info == 0)
- continue;
-
- local_syms = htab->all_local_syms[bfd_indx];
-
- /* Walk over each section attached to the input bfd. */
- for (section = input_bfd->sections;
- section != NULL;
- section = section->next)
- {
- Elf_Internal_Rela *internal_relocs, *irelaend, *irela;
-
- /* If there aren't any relocs, then there's nothing more
- to do. */
- if ((section->flags & SEC_RELOC) == 0
- || section->reloc_count == 0)
- continue;
-
- /* If this section is a link-once section that will be
- discarded, then don't create any stubs. */
- if (section->output_section == NULL
- || section->output_section->owner != output_bfd)
- continue;
-
- /* Get the relocs. */
- internal_relocs
- = _bfd_elf_link_read_relocs (input_bfd, section, NULL, NULL,
- info->keep_memory);
- if (internal_relocs == NULL)
- goto error_ret_free_local;
-
- /* Now examine each relocation. */
- irela = internal_relocs;
- irelaend = irela + section->reloc_count;
- for (; irela < irelaend; irela++)
- {
- unsigned int r_type, r_indx;
- struct elf32_avr_stub_hash_entry *hsh;
- asection *sym_sec;
- bfd_vma sym_value;
- bfd_vma destination;
- struct elf_link_hash_entry *hh;
- char *stub_name;
-
- r_type = ELF32_R_TYPE (irela->r_info);
- r_indx = ELF32_R_SYM (irela->r_info);
-
- /* Only look for 16 bit GS relocs. No other reloc will need a
- stub. */
- if (!((r_type == R_AVR_16_PM)
- || (r_type == R_AVR_LO8_LDI_GS)
- || (r_type == R_AVR_HI8_LDI_GS)))
- continue;
-
- /* Now determine the call target, its name, value,
- section. */
- sym_sec = NULL;
- sym_value = 0;
- destination = 0;
- hh = NULL;
- if (r_indx < symtab_hdr->sh_info)
- {
- /* It's a local symbol. */
- Elf_Internal_Sym *sym;
- Elf_Internal_Shdr *hdr;
+ input_bfd != NULL;
+ input_bfd = input_bfd->link.next, bfd_indx++)
+ {
+ Elf_Internal_Shdr *symtab_hdr;
+ asection *section;
+ Elf_Internal_Sym *local_syms;
+
+ /* We'll need the symbol table in a second. */
+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ if (symtab_hdr->sh_info == 0)
+ continue;
+
+ local_syms = htab->all_local_syms[bfd_indx];
+
+ /* Walk over each section attached to the input bfd. */
+ for (section = input_bfd->sections;
+ section != NULL;
+ section = section->next)
+ {
+ Elf_Internal_Rela *internal_relocs, *irelaend, *irela;
+
+ /* If there aren't any relocs, then there's nothing more
+ to do. */
+ if ((section->flags & SEC_RELOC) == 0
+ || section->reloc_count == 0)
+ continue;
+
+ /* If this section is a link-once section that will be
+ discarded, then don't create any stubs. */
+ if (section->output_section == NULL
+ || section->output_section->owner != output_bfd)
+ continue;
+
+ /* Get the relocs. */
+ internal_relocs
+ = _bfd_elf_link_read_relocs (input_bfd, section, NULL, NULL,
+ info->keep_memory);
+ if (internal_relocs == NULL)
+ goto error_ret_free_local;
+
+ /* Now examine each relocation. */
+ irela = internal_relocs;
+ irelaend = irela + section->reloc_count;
+ for (; irela < irelaend; irela++)
+ {
+ unsigned int r_type, r_indx;
+ struct elf32_avr_stub_hash_entry *hsh;
+ asection *sym_sec;
+ bfd_vma sym_value;
+ bfd_vma destination;
+ struct elf_link_hash_entry *hh;
+ char *stub_name;
+
+ r_type = ELF32_R_TYPE (irela->r_info);
+ r_indx = ELF32_R_SYM (irela->r_info);
+
+ /* Only look for 16 bit GS relocs. No other reloc will need a
+ stub. */
+ if (!((r_type == R_AVR_16_PM)
+ || (r_type == R_AVR_LO8_LDI_GS)
+ || (r_type == R_AVR_HI8_LDI_GS)))
+ continue;
+
+ /* Now determine the call target, its name, value,
+ section. */
+ sym_sec = NULL;
+ sym_value = 0;
+ destination = 0;
+ hh = NULL;
+ if (r_indx < symtab_hdr->sh_info)
+ {
+ /* It's a local symbol. */
+ Elf_Internal_Sym *sym;
+ Elf_Internal_Shdr *hdr;
unsigned int shndx;
- sym = local_syms + r_indx;
- if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
- sym_value = sym->st_value;
+ sym = local_syms + r_indx;
+ if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
+ sym_value = sym->st_value;
shndx = sym->st_shndx;
if (shndx < elf_numsections (input_bfd))
{
+ sym_sec->output_offset
+ sym_sec->output_section->vma);
}
- }
- else
- {
- /* It's an external symbol. */
- int e_indx;
-
- e_indx = r_indx - symtab_hdr->sh_info;
- hh = elf_sym_hashes (input_bfd)[e_indx];
-
- while (hh->root.type == bfd_link_hash_indirect
- || hh->root.type == bfd_link_hash_warning)
- hh = (struct elf_link_hash_entry *)
- (hh->root.u.i.link);
-
- if (hh->root.type == bfd_link_hash_defined
- || hh->root.type == bfd_link_hash_defweak)
- {
- sym_sec = hh->root.u.def.section;
- sym_value = hh->root.u.def.value;
- if (sym_sec->output_section != NULL)
- destination = (sym_value + irela->r_addend
- + sym_sec->output_offset
- + sym_sec->output_section->vma);
- }
- else if (hh->root.type == bfd_link_hash_undefweak)
- {
- if (! bfd_link_pic (info))
- continue;
- }
- else if (hh->root.type == bfd_link_hash_undefined)
- {
- if (! (info->unresolved_syms_in_objects == RM_IGNORE
- && (ELF_ST_VISIBILITY (hh->other)
- == STV_DEFAULT)))
- continue;
- }
- else
- {
- bfd_set_error (bfd_error_bad_value);
-
- error_ret_free_internal:
- if (elf_section_data (section)->relocs == NULL)
- free (internal_relocs);
- goto error_ret_free_local;
- }
- }
-
- if (! avr_stub_is_required_for_16_bit_reloc
+ }
+ else
+ {
+ /* It's an external symbol. */
+ int e_indx;
+
+ e_indx = r_indx - symtab_hdr->sh_info;
+ hh = elf_sym_hashes (input_bfd)[e_indx];
+
+ while (hh->root.type == bfd_link_hash_indirect
+ || hh->root.type == bfd_link_hash_warning)
+ hh = (struct elf_link_hash_entry *)
+ (hh->root.u.i.link);
+
+ if (hh->root.type == bfd_link_hash_defined
+ || hh->root.type == bfd_link_hash_defweak)
+ {
+ sym_sec = hh->root.u.def.section;
+ sym_value = hh->root.u.def.value;
+ if (sym_sec->output_section != NULL)
+ destination = (sym_value + irela->r_addend
+ + sym_sec->output_offset
+ + sym_sec->output_section->vma);
+ }
+ else if (hh->root.type == bfd_link_hash_undefweak)
+ {
+ if (! bfd_link_pic (info))
+ continue;
+ }
+ else if (hh->root.type == bfd_link_hash_undefined)
+ {
+ if (! (info->unresolved_syms_in_objects == RM_IGNORE
+ && (ELF_ST_VISIBILITY (hh->other)
+ == STV_DEFAULT)))
+ continue;
+ }
+ else
+ {
+ bfd_set_error (bfd_error_bad_value);
+
+ error_ret_free_internal:
+ if (elf_section_data (section)->relocs == NULL)
+ free (internal_relocs);
+ goto error_ret_free_local;
+ }
+ }
+
+ if (! avr_stub_is_required_for_16_bit_reloc
(destination - htab->vector_base))
- {
- if (!is_prealloc_run)
+ {
+ if (!is_prealloc_run)
/* We are having a reloc that does't need a stub. */
continue;
/* We don't right now know if a stub will be needed.
Let's rather be on the safe side. */
- }
-
- /* Get the name of this stub. */
- stub_name = avr_stub_name (sym_sec, sym_value, irela);
-
- if (!stub_name)
- goto error_ret_free_internal;
-
-
- hsh = avr_stub_hash_lookup (&htab->bstab,
- stub_name,
- FALSE, FALSE);
- if (hsh != NULL)
- {
- /* The proper stub has already been created. Mark it
- to be used and write the possibly changed destination
- value. */
- hsh->is_actually_needed = TRUE;
- hsh->target_value = destination;
- free (stub_name);
- continue;
- }
-
- hsh = avr_add_stub (stub_name, htab);
- if (hsh == NULL)
- {
- free (stub_name);
- goto error_ret_free_internal;
- }
-
- hsh->is_actually_needed = TRUE;
- hsh->target_value = destination;
-
- if (debug_stubs)
- printf ("Adding stub with destination 0x%x to the"
- " hash table.\n", (unsigned int) destination);
- if (debug_stubs)
- printf ("(Pre-Alloc run: %i)\n", is_prealloc_run);
-
- stub_changed = TRUE;
- }
-
- /* We're done with the internal relocs, free them. */
- if (elf_section_data (section)->relocs == NULL)
- free (internal_relocs);
- }
- }
+ }
+
+ /* Get the name of this stub. */
+ stub_name = avr_stub_name (sym_sec, sym_value, irela);
+
+ if (!stub_name)
+ goto error_ret_free_internal;
+
+
+ hsh = avr_stub_hash_lookup (&htab->bstab,
+ stub_name,
+ FALSE, FALSE);
+ if (hsh != NULL)
+ {
+ /* The proper stub has already been created. Mark it
+ to be used and write the possibly changed destination
+ value. */
+ hsh->is_actually_needed = TRUE;
+ hsh->target_value = destination;
+ free (stub_name);
+ continue;
+ }
+
+ hsh = avr_add_stub (stub_name, htab);
+ if (hsh == NULL)
+ {
+ free (stub_name);
+ goto error_ret_free_internal;
+ }
+
+ hsh->is_actually_needed = TRUE;
+ hsh->target_value = destination;
+
+ if (debug_stubs)
+ printf ("Adding stub with destination 0x%x to the"
+ " hash table.\n", (unsigned int) destination);
+ if (debug_stubs)
+ printf ("(Pre-Alloc run: %i)\n", is_prealloc_run);
+
+ stub_changed = TRUE;
+ }
+
+ /* We're done with the internal relocs, free them. */
+ if (elf_section_data (section)->relocs == NULL)
+ free (internal_relocs);
+ }
+ }
/* Re-Calculate the number of needed stubs. */
htab->stub_sec->size = 0;
bfd_hash_traverse (&htab->bstab, avr_size_one_stub, htab);
if (!stub_changed)
- break;
+ break;
stub_changed = FALSE;
}
htab->amt_entry_cnt = 0;
htab->amt_max_entry_cnt = total_size / 4;
htab->amt_stub_offsets = bfd_malloc (sizeof (bfd_vma)
- * htab->amt_max_entry_cnt);
+ * htab->amt_max_entry_cnt);
htab->amt_destination_addr = bfd_malloc (sizeof (bfd_vma)
* htab->amt_max_entry_cnt );
static void
avr_find_section_for_address (bfd *abfd,
- asection *section, void *data)
+ asection *section, void *data)
{
struct avr_find_section_data *fs_data
= (struct avr_find_section_data *) data;
/* Load the relocations for the '.avr.prop' section if there are any, and
sort them. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, sec, NULL, NULL, FALSE));
+ (abfd, sec, NULL, NULL, FALSE));
if (internal_relocs)
qsort (internal_relocs, sec->reloc_count,
- sizeof (Elf_Internal_Rela), internal_reloc_compare);
+ sizeof (Elf_Internal_Rela), internal_reloc_compare);
/* There is a header at the start of the property record section SEC, the
format of this header is:
bfd_vma address;
/* Each entry is a 32-bit address, followed by a single byte type.
- After that is the type specific data. We must take care to
- ensure that we don't read beyond the end of the section data. */
+ After that is the type specific data. We must take care to
+ ensure that we don't read beyond the end of the section data. */
if (size < 5)
- goto load_failed;
+ goto load_failed;
r_list->records [i].section = NULL;
r_list->records [i].offset = 0;
if (rel)
- {
- /* The offset of the address within the .avr.prop section. */
- size_t offset = ptr - contents;
+ {
+ /* The offset of the address within the .avr.prop section. */
+ size_t offset = ptr - contents;
- while (rel < rel_end && rel->r_offset < offset)
- ++rel;
+ while (rel < rel_end && rel->r_offset < offset)
+ ++rel;
- if (rel == rel_end)
- rel = NULL;
- else if (rel->r_offset == offset)
- {
- /* Find section and section offset. */
- unsigned long r_symndx;
+ if (rel == rel_end)
+ rel = NULL;
+ else if (rel->r_offset == offset)
+ {
+ /* Find section and section offset. */
+ unsigned long r_symndx;
- asection * rel_sec;
- bfd_vma sec_offset;
+ asection * rel_sec;
+ bfd_vma sec_offset;
- r_symndx = ELF32_R_SYM (rel->r_info);
- rel_sec = get_elf_r_symndx_section (abfd, r_symndx);
- sec_offset = get_elf_r_symndx_offset (abfd, r_symndx)
- + rel->r_addend;
+ r_symndx = ELF32_R_SYM (rel->r_info);
+ rel_sec = get_elf_r_symndx_section (abfd, r_symndx);
+ sec_offset = get_elf_r_symndx_offset (abfd, r_symndx)
+ + rel->r_addend;
- r_list->records [i].section = rel_sec;
- r_list->records [i].offset = sec_offset;
- }
- }
+ r_list->records [i].section = rel_sec;
+ r_list->records [i].offset = sec_offset;
+ }
+ }
address = *((uint32_t *) ptr);
ptr += 4;
size -= 4;
if (r_list->records [i].section == NULL)
- {
- /* Try to find section and offset from address. */
- if (fs_data.section != NULL
- && !avr_is_section_for_address (abfd, fs_data.section,
- address))
- fs_data.section = NULL;
-
- if (fs_data.section == NULL)
- {
- fs_data.address = address;
- bfd_map_over_sections (abfd, avr_find_section_for_address,
- &fs_data);
- }
-
- if (fs_data.section == NULL)
- {
- fprintf (stderr, "Failed to find matching section.\n");
- goto load_failed;
- }
-
- r_list->records [i].section = fs_data.section;
- r_list->records [i].offset
- = address - bfd_get_section_vma (abfd, fs_data.section);
- }
+ {
+ /* Try to find section and offset from address. */
+ if (fs_data.section != NULL
+ && !avr_is_section_for_address (abfd, fs_data.section,
+ address))
+ fs_data.section = NULL;
+
+ if (fs_data.section == NULL)
+ {
+ fs_data.address = address;
+ bfd_map_over_sections (abfd, avr_find_section_for_address,
+ &fs_data);
+ }
+
+ if (fs_data.section == NULL)
+ {
+ fprintf (stderr, "Failed to find matching section.\n");
+ goto load_failed;
+ }
+
+ r_list->records [i].section = fs_data.section;
+ r_list->records [i].offset
+ = address - bfd_get_section_vma (abfd, fs_data.section);
+ }
r_list->records [i].type = *((bfd_byte *) ptr);
ptr += 1;
size -= 1;
switch (r_list->records [i].type)
- {
- case RECORD_ORG:
- /* Nothing else to load. */
- break;
- case RECORD_ORG_AND_FILL:
- /* Just a 4-byte fill to load. */
- if (size < 4)
- goto load_failed;
- r_list->records [i].data.org.fill = *((uint32_t *) ptr);
- ptr += 4;
- size -= 4;
- break;
- case RECORD_ALIGN:
- /* Just a 4-byte alignment to load. */
- if (size < 4)
- goto load_failed;
- r_list->records [i].data.align.bytes = *((uint32_t *) ptr);
- ptr += 4;
- size -= 4;
- /* Just initialise PRECEDING_DELETED field, this field is
- used during linker relaxation. */
- r_list->records [i].data.align.preceding_deleted = 0;
- break;
- case RECORD_ALIGN_AND_FILL:
- /* A 4-byte alignment, and a 4-byte fill to load. */
- if (size < 8)
- goto load_failed;
- r_list->records [i].data.align.bytes = *((uint32_t *) ptr);
- ptr += 4;
- r_list->records [i].data.align.fill = *((uint32_t *) ptr);
- ptr += 4;
- size -= 8;
- /* Just initialise PRECEDING_DELETED field, this field is
- used during linker relaxation. */
- r_list->records [i].data.align.preceding_deleted = 0;
- break;
- default:
- goto load_failed;
- }
+ {
+ case RECORD_ORG:
+ /* Nothing else to load. */
+ break;
+ case RECORD_ORG_AND_FILL:
+ /* Just a 4-byte fill to load. */
+ if (size < 4)
+ goto load_failed;
+ r_list->records [i].data.org.fill = *((uint32_t *) ptr);
+ ptr += 4;
+ size -= 4;
+ break;
+ case RECORD_ALIGN:
+ /* Just a 4-byte alignment to load. */
+ if (size < 4)
+ goto load_failed;
+ r_list->records [i].data.align.bytes = *((uint32_t *) ptr);
+ ptr += 4;
+ size -= 4;
+ /* Just initialise PRECEDING_DELETED field, this field is
+ used during linker relaxation. */
+ r_list->records [i].data.align.preceding_deleted = 0;
+ break;
+ case RECORD_ALIGN_AND_FILL:
+ /* A 4-byte alignment, and a 4-byte fill to load. */
+ if (size < 8)
+ goto load_failed;
+ r_list->records [i].data.align.bytes = *((uint32_t *) ptr);
+ ptr += 4;
+ r_list->records [i].data.align.fill = *((uint32_t *) ptr);
+ ptr += 4;
+ size -= 8;
+ /* Just initialise PRECEDING_DELETED field, this field is
+ used during linker relaxation. */
+ r_list->records [i].data.align.preceding_deleted = 0;
+ break;
+ default:
+ goto load_failed;
+ }
}
free (contents);
#define ELF_MACHINE_ALT1 EM_AVR_OLD
#define ELF_MAXPAGESIZE 1
-#define TARGET_LITTLE_SYM avr_elf32_vec
+#define TARGET_LITTLE_SYM avr_elf32_vec
#define TARGET_LITTLE_NAME "elf32-avr"
#define bfd_elf32_bfd_link_hash_table_create elf32_avr_link_hash_table_create
-#define elf_info_to_howto avr_info_to_howto_rela
-#define elf_info_to_howto_rel NULL
-#define elf_backend_relocate_section elf32_avr_relocate_section
-#define elf_backend_can_gc_sections 1
+#define elf_info_to_howto avr_info_to_howto_rela
+#define elf_info_to_howto_rel NULL
+#define elf_backend_relocate_section elf32_avr_relocate_section
+#define elf_backend_can_gc_sections 1
#define elf_backend_rela_normal 1
#define elf_backend_final_write_processing \
bfd_elf_avr_final_write_processing
#define bfd_elf32_bfd_relax_section elf32_avr_relax_section
#define bfd_elf32_bfd_get_relocated_section_contents \
- elf32_avr_get_relocated_section_contents
+ elf32_avr_get_relocated_section_contents
#define bfd_elf32_new_section_hook elf_avr_new_section_hook
#include "elf32-target.h"
extern void
elf32_avr_setup_params (struct bfd_link_info *, bfd *, asection *,
- bfd_boolean, bfd_boolean, bfd_boolean,
- bfd_vma, bfd_boolean);
+ bfd_boolean, bfd_boolean, bfd_boolean,
+ bfd_vma, bfd_boolean);
extern int
elf32_avr_setup_section_lists (bfd *, struct bfd_link_info *);
unsigned long fill;
/* This field is used during linker relaxation to track the number of
- bytes that have been opened up before this alignment directive.
- When we have enough bytes available it is possible to move the
- re-align this directive backwards while still maintaining the
- alignment requirement. */
+ bytes that have been opened up before this alignment directive.
+ When we have enough bytes available it is possible to move the
+ re-align this directive backwards while still maintaining the
+ alignment requirement. */
unsigned long preceding_deleted;
} align;
} data;
static bfd_reloc_status_type
bfin_pcrel24_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol,
- void * data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma relocation;
bfd_size_type addr = reloc_entry->address;
static bfd_reloc_status_type
bfin_byte4_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol,
- void * data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma relocation, x;
bfd_size_type addr = reloc_entry->address;
relocation -= input_section->output_section->vma + input_section->output_offset;
if (howto->pcrel_offset)
- relocation -= reloc_entry->address;
+ relocation -= reloc_entry->address;
}
if (relocatable)
bfd_reloc_status_type status;
status = bfd_check_overflow (howto->complain_on_overflow,
- howto->bitsize,
- howto->rightshift,
- bfd_arch_bits_per_address(abfd),
- relocation);
+ howto->bitsize,
+ howto->rightshift,
+ bfd_arch_bits_per_address(abfd),
+ relocation);
if (status != bfd_reloc_ok)
return status;
}
{
case 0:
{
- char x = bfd_get_8 (abfd, (char *) data + addr);
- DOIT (x);
- bfd_put_8 (abfd, x, (unsigned char *) data + addr);
+ char x = bfd_get_8 (abfd, (char *) data + addr);
+ DOIT (x);
+ bfd_put_8 (abfd, x, (unsigned char *) data + addr);
}
break;
case 1:
{
- unsigned short x = bfd_get_16 (abfd, (bfd_byte *) data + addr);
- DOIT (x);
- bfd_put_16 (abfd, (bfd_vma) x, (unsigned char *) data + addr);
+ unsigned short x = bfd_get_16 (abfd, (bfd_byte *) data + addr);
+ DOIT (x);
+ bfd_put_16 (abfd, (bfd_vma) x, (unsigned char *) data + addr);
}
break;
TRUE), /* pcrel_offset. */
HOWTO (R_BFIN_PCREL24_JUMP_X, /* type. */
- 1, /* rightshift. */
- 2, /* size (0 = byte, 1 = short, 2 = long). */
- 24, /* bitsize. */
- TRUE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_signed, /* complain_on_overflow. */
- bfin_pcrel24_reloc, /* special_function. */
+ 1, /* rightshift. */
+ 2, /* size (0 = byte, 1 = short, 2 = long). */
+ 24, /* bitsize. */
+ TRUE, /* pc_relative. */
+ 0, /* bitpos. */
+ complain_overflow_signed, /* complain_on_overflow. */
+ bfin_pcrel24_reloc, /* special_function. */
"R_BFIN_PCREL24_JUMP_X", /* name. */
FALSE, /* partial_inplace. */
0, /* src_mask. */
/* A 18-bit signed operand with the GOT offset for the address of
the symbol. */
- HOWTO (R_BFIN_GOT17M4, /* type */
+ HOWTO (R_BFIN_GOT17M4, /* type */
2, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_BFIN_GOT17M4", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* The upper 16 bits of the GOT offset for the address of the
symbol. */
- HOWTO (R_BFIN_GOTHI, /* type */
+ HOWTO (R_BFIN_GOTHI, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_BFIN_GOTHI", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The lower 16 bits of the GOT offset for the address of the
symbol. */
- HOWTO (R_BFIN_GOTLO, /* type */
+ HOWTO (R_BFIN_GOTLO, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The 32-bit address of the canonical descriptor of a function. */
HOWTO (R_BFIN_FUNCDESC, /* type */
bfd_elf_generic_reloc, /* special_function */
"R_BFIN_FUNCDESC_GOT17M4", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* The upper 16 bits of the GOT offset for the address of the
canonical descriptor of a function. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The lower 16 bits of the GOT offset for the address of the
canonical descriptor of a function. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The 32-bit address of the canonical descriptor of a function. */
HOWTO (R_BFIN_FUNCDESC_VALUE, /* type */
bfd_elf_generic_reloc, /* special_function */
"R_BFIN_FUNCDESC_GOTOFF17M4", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* The upper 16 bits of the GOT offset for the address of the
canonical descriptor of a function. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The lower 16 bits of the GOT offset for the address of the
canonical descriptor of a function. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* A 12-bit signed operand with the GOT offset for the address of
the symbol. */
- HOWTO (R_BFIN_GOTOFF17M4, /* type */
+ HOWTO (R_BFIN_GOTOFF17M4, /* type */
2, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_BFIN_GOTOFF17M4", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* The upper 16 bits of the GOT offset for the address of the
symbol. */
- HOWTO (R_BFIN_GOTOFFHI, /* type */
+ HOWTO (R_BFIN_GOTOFFHI, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The lower 16 bits of the GOT offset for the address of the
symbol. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
};
static reloc_howto_type bfin_gnuext_howto_table [] =
FALSE), /* pcrel_offset. */
/* GNU extension to record C++ vtable hierarchy. */
- HOWTO (R_BFIN_GNU_VTINHERIT, /* type. */
- 0, /* rightshift. */
- 2, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- NULL, /* special_function. */
- "R_BFIN_GNU_VTINHERIT", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE), /* pcrel_offset. */
+ HOWTO (R_BFIN_GNU_VTINHERIT, /* type. */
+ 0, /* rightshift. */
+ 2, /* size (0 = byte, 1 = short, 2 = long). */
+ 0, /* bitsize. */
+ FALSE, /* pc_relative. */
+ 0, /* bitpos. */
+ complain_overflow_dont, /* complain_on_overflow. */
+ NULL, /* special_function. */
+ "R_BFIN_GNU_VTINHERIT", /* name. */
+ FALSE, /* partial_inplace. */
+ 0, /* src_mask. */
+ 0, /* dst_mask. */
+ FALSE), /* pcrel_offset. */
/* GNU extension to record C++ vtable member usage. */
HOWTO (R_BFIN_GNU_VTENTRY, /* type. */
- 0, /* rightshift. */
- 2, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* bitsize. */
- FALSE, /* pc_relative. */
- 0, /* bitpos. */
- complain_overflow_dont, /* complain_on_overflow. */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function. */
- "R_BFIN_GNU_VTENTRY", /* name. */
- FALSE, /* partial_inplace. */
- 0, /* src_mask. */
- 0, /* dst_mask. */
- FALSE) /* pcrel_offset. */
+ 0, /* rightshift. */
+ 2, /* size (0 = byte, 1 = short, 2 = long). */
+ 0, /* bitsize. */
+ FALSE, /* pc_relative. */
+ 0, /* bitpos. */
+ complain_overflow_dont, /* complain_on_overflow. */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function. */
+ "R_BFIN_GNU_VTENTRY", /* name. */
+ FALSE, /* partial_inplace. */
+ 0, /* src_mask. */
+ 0, /* dst_mask. */
+ FALSE) /* pcrel_offset. */
};
struct bfin_reloc_map
{
- bfd_reloc_code_real_type bfd_reloc_val;
+ bfd_reloc_code_real_type bfd_reloc_val;
unsigned int bfin_reloc_val;
};
static void
bfin_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *cache_ptr,
- Elf_Internal_Rela *dst)
+ arelent *cache_ptr,
+ Elf_Internal_Rela *dst)
{
unsigned int r_type;
bfin_check_relocs (bfd * abfd,
struct bfd_link_info *info,
asection *sec,
- const Elf_Internal_Rela *relocs)
+ const Elf_Internal_Rela *relocs)
{
bfd *dynobj;
Elf_Internal_Shdr *symtab_hdr;
switch (ELF32_R_TYPE (rel->r_info))
{
/* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_BFIN_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries
- are actually used. Record for later use during GC. */
- case R_BFIN_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
+ Reconstruct it for later use during GC. */
+ case R_BFIN_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries
+ are actually used. Record for later use during GC. */
+ case R_BFIN_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
case R_BFIN_GOT:
if (h != NULL
if (bfd_link_pic (info))
{
/* If we are generating a shared object, we need to
- output a R_68K_RELATIVE reloc so that the dynamic
- linker can adjust this GOT entry. */
+ output a R_68K_RELATIVE reloc so that the dynamic
+ linker can adjust this GOT entry. */
srelgot->size += sizeof (Elf32_External_Rela);
}
}
}
if (r_type == R_BFIN_GNU_VTENTRY
- || r_type == R_BFIN_GNU_VTINHERIT)
+ || r_type == R_BFIN_GNU_VTINHERIT)
continue;
howto = bfin_reloc_type_lookup (input_bfd, r_type);
relocation = sgot->output_offset + off;
rel->r_addend = 0;
- /* bfin : preg = [preg + 17bitdiv4offset] relocation is div by 4. */
- relocation /= 4;
+ /* bfin : preg = [preg + 17bitdiv4offset] relocation is div by 4. */
+ relocation /= 4;
}
goto do_default;
}
/* Dynamic relocs are not propagated for SEC_DEBUGGING sections
- because such sections are not SEC_ALLOC and thus ld.so will
- not process them. */
+ because such sections are not SEC_ALLOC and thus ld.so will
+ not process them. */
if (unresolved_reloc
&& !((input_section->flags & SEC_DEBUGGING) != 0 && h->def_dynamic)
&& _bfd_elf_section_offset (output_bfd, info, input_section,
struct bfd_link_info *info,
Elf_Internal_Rela * rel,
struct elf_link_hash_entry *h,
- Elf_Internal_Sym * sym)
+ Elf_Internal_Sym * sym)
{
if (h != NULL)
switch (ELF32_R_TYPE (rel->r_info))
for symbol+addend. Should be implied by something like:
(plt || fdgotoff17m4 || fdgotofflohi
|| ((fd || fdgot17m4 || fdgothilo)
- && (symndx != -1 || BFINFDPIC_FUNCDESC_LOCAL (info, d.h)))) */
+ && (symndx != -1 || BFINFDPIC_FUNCDESC_LOCAL (info, d.h)))) */
unsigned privfd:1;
/* Whether a lazy PLT entry is needed for this symbol+addend.
Should be implied by something like:
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
switch (ELF32_R_TYPE (rel->r_info))
{
}
switch (ELF32_R_TYPE (rel->r_info))
- {
+ {
case R_BFIN_PCREL24:
case R_BFIN_PCREL24_JUMP_L:
if (IS_FDPIC (abfd))
picrel->relocsfd++;
break;
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_BFIN_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_BFIN_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_BFIN_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_BFIN_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
case R_BFIN_HUIMM16:
case R_BFIN_LUIMM16:
(_("%B: unsupported relocation type %d"),
abfd, (int) ELF32_R_TYPE (rel->r_info));
return FALSE;
- }
+ }
}
return TRUE;
bfd_byte *loc;
/* This symbol has an entry in the global offset table.
- Set it up. */
+ Set it up. */
sgot = elf_hash_table (info)->sgot;
srela = elf_hash_table (info)->srelgot;
+ (h->got.offset & ~(bfd_vma) 1));
/* If this is a -Bsymbolic link, and the symbol is defined
- locally, we just want to emit a RELATIVE reloc. Likewise if
- the symbol was forced to be local because of a version file.
- The entry in the global offset table will already have been
- initialized in the relocate_section function. */
+ locally, we just want to emit a RELATIVE reloc. Likewise if
+ the symbol was forced to be local because of a version file.
+ The entry in the global offset table will already have been
+ initialized in the relocate_section function. */
if (bfd_link_pic (info)
&& (info->symbolic
|| h->dynindx == -1 || h->forced_local) && h->def_regular)
else
{
/* We may have created entries in the .rela.got section.
- However, if we are not creating the dynamic sections, we will
- not actually use these entries. Reset the size of .rela.got,
- which will cause it to get stripped from the output file
- below. */
+ However, if we are not creating the dynamic sections, we will
+ not actually use these entries. Reset the size of .rela.got,
+ which will cause it to get stripped from the output file
+ below. */
s = elf_hash_table (info)->srelgot;
if (s != NULL)
s->size = 0;
continue;
/* It's OK to base decisions on the section name, because none
- of the dynobj section names depend upon the input files. */
+ of the dynobj section names depend upon the input files. */
name = bfd_get_section_name (dynobj, s);
strip = FALSE;
if (s->size == 0)
{
/* If we don't need this section, strip it from the
- output file. This is mostly to handle .rela.bss and
- .rela.plt. We must create both sections in
- create_dynamic_sections, because they must be created
- before the linker maps input sections to output
- sections. The linker does that before
- adjust_dynamic_symbol is called, and it is that
- function which decides whether anything needs to go
- into these sections. */
+ output file. This is mostly to handle .rela.bss and
+ .rela.plt. We must create both sections in
+ create_dynamic_sections, because they must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
strip = TRUE;
}
else
relocs = TRUE;
/* We use the reloc_count field as a counter if we need
- to copy relocs into the output file. */
+ to copy relocs into the output file. */
s->reloc_count = 0;
}
}
/* Allocate memory for the section contents. */
/* FIXME: This should be a call to bfd_alloc not bfd_zalloc.
- Unused entries should be reclaimed before the section's contents
- are written out, but at the moment this does not happen. Thus in
- order to prevent writing out garbage, we initialise the section's
- contents to zero. */
+ Unused entries should be reclaimed before the section's contents
+ are written out, but at the moment this does not happen. Thus in
+ order to prevent writing out garbage, we initialise the section's
+ contents to zero. */
s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
if (s->contents == NULL && s->size != 0)
return FALSE;
if (elf_hash_table (info)->dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
- values later, in bfin_finish_dynamic_sections, but we
- must add the entries now so that we get the correct size for
- the .dynamic section. The DT_DEBUG entry is filled in by the
- dynamic linker and used by the debugger. */
+ values later, in bfin_finish_dynamic_sections, but we
+ must add the entries now so that we get the correct size for
+ the .dynamic section. The DT_DEBUG entry is filled in by the
+ dynamic linker and used by the debugger. */
#define add_dynamic_entry(TAG, VAL) \
_bfd_elf_add_dynamic_entry (info, TAG, VAL)
{
{ ".l1.text", 8, -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
{ ".l1.data", 8, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
\f
#define elf_backend_object_p elf32_bfin_object_p
#define bfd_elf32_bfd_is_local_label_name \
- bfin_is_local_label_name
+ bfin_is_local_label_name
#define bfin_hash_table(p) \
((struct bfin_link_hash_table *) (p)->hash)
#define elf_backend_create_dynamic_sections \
- _bfd_elf_create_dynamic_sections
+ _bfd_elf_create_dynamic_sections
#define bfd_elf32_bfd_link_hash_table_create \
- bfin_link_hash_table_create
-#define bfd_elf32_bfd_final_link bfd_elf_gc_common_final_link
+ bfin_link_hash_table_create
+#define bfd_elf32_bfd_final_link bfd_elf_gc_common_final_link
-#define elf_backend_check_relocs bfin_check_relocs
+#define elf_backend_check_relocs bfin_check_relocs
#define elf_backend_adjust_dynamic_symbol \
- bfin_adjust_dynamic_symbol
+ bfin_adjust_dynamic_symbol
#define elf_backend_size_dynamic_sections \
- bfin_size_dynamic_sections
-#define elf_backend_relocate_section bfin_relocate_section
+ bfin_size_dynamic_sections
+#define elf_backend_relocate_section bfin_relocate_section
#define elf_backend_finish_dynamic_symbol \
- bfin_finish_dynamic_symbol
+ bfin_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections \
- bfin_finish_dynamic_sections
-#define elf_backend_gc_mark_hook bfin_gc_mark_hook
+ bfin_finish_dynamic_sections
+#define elf_backend_gc_mark_hook bfin_gc_mark_hook
#define bfd_elf32_bfd_merge_private_bfd_data \
- elf32_bfin_merge_private_bfd_data
+ elf32_bfin_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags \
- elf32_bfin_set_private_flags
+ elf32_bfin_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data \
- elf32_bfin_print_private_bfd_data
+ elf32_bfin_print_private_bfd_data
#define elf_backend_final_write_processing \
- elf32_bfin_final_write_processing
-#define elf_backend_reloc_type_class elf32_bfin_reloc_type_class
+ elf32_bfin_final_write_processing
+#define elf_backend_reloc_type_class elf32_bfin_reloc_type_class
#define elf_backend_stack_align 8
#define elf_backend_can_gc_sections 1
#define elf_backend_special_sections elf32_bfin_special_sections
#define elf_backend_want_got_plt 0
#define elf_backend_plt_readonly 1
#define elf_backend_want_plt_sym 0
-#define elf_backend_got_header_size 12
-#define elf_backend_rela_normal 1
+#define elf_backend_got_header_size 12
+#define elf_backend_rela_normal 1
#include "elf32-target.h"
#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM bfin_elf32_fdpic_vec
+#define TARGET_LITTLE_SYM bfin_elf32_fdpic_vec
#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-bfinfdpic"
#undef elf32_bed
-#define elf32_bed elf32_bfinfdpic_bed
+#define elf32_bed elf32_bfinfdpic_bed
#undef elf_backend_got_header_size
-#define elf_backend_got_header_size 0
+#define elf_backend_got_header_size 0
#undef elf_backend_relocate_section
-#define elf_backend_relocate_section bfinfdpic_relocate_section
+#define elf_backend_relocate_section bfinfdpic_relocate_section
#undef elf_backend_check_relocs
-#define elf_backend_check_relocs bfinfdpic_check_relocs
+#define elf_backend_check_relocs bfinfdpic_check_relocs
#undef bfd_elf32_bfd_link_hash_table_create
#define bfd_elf32_bfd_link_hash_table_create \
bfinfdpic_elf_encode_eh_address
#undef elf_backend_may_use_rel_p
-#define elf_backend_may_use_rel_p 1
+#define elf_backend_may_use_rel_p 1
#undef elf_backend_may_use_rela_p
-#define elf_backend_may_use_rela_p 1
+#define elf_backend_may_use_rela_p 1
/* We use REL for dynamic relocations only. */
#undef elf_backend_default_use_rela_p
-#define elf_backend_default_use_rela_p 1
+#define elf_backend_default_use_rela_p 1
#undef elf_backend_omit_section_dynsym
#define elf_backend_omit_section_dynsym _bfinfdpic_link_omit_section_dynsym
struct cr16_reloc_map
{
bfd_reloc_code_real_type bfd_reloc_enum; /* BFD relocation enum. */
- unsigned short cr16_reloc_type; /* CR16 relocation type. */
+ unsigned short cr16_reloc_type; /* CR16 relocation type. */
};
static const struct cr16_reloc_map cr16_reloc_map[R_CR16_MAX] =
{
- {BFD_RELOC_NONE, R_CR16_NONE},
- {BFD_RELOC_CR16_NUM8, R_CR16_NUM8},
+ {BFD_RELOC_NONE, R_CR16_NONE},
+ {BFD_RELOC_CR16_NUM8, R_CR16_NUM8},
{BFD_RELOC_CR16_NUM16, R_CR16_NUM16},
{BFD_RELOC_CR16_NUM32, R_CR16_NUM32},
{BFD_RELOC_CR16_NUM32a, R_CR16_NUM32a},
{BFD_RELOC_CR16_REGREL20a, R_CR16_REGREL20a},
{BFD_RELOC_CR16_ABS20, R_CR16_ABS20},
{BFD_RELOC_CR16_ABS24, R_CR16_ABS24},
- {BFD_RELOC_CR16_IMM4, R_CR16_IMM4},
- {BFD_RELOC_CR16_IMM8, R_CR16_IMM8},
+ {BFD_RELOC_CR16_IMM4, R_CR16_IMM4},
+ {BFD_RELOC_CR16_IMM8, R_CR16_IMM8},
{BFD_RELOC_CR16_IMM16, R_CR16_IMM16},
{BFD_RELOC_CR16_IMM20, R_CR16_IMM20},
{BFD_RELOC_CR16_IMM24, R_CR16_IMM24},
static reloc_howto_type cr16_elf_howto_table[] =
{
- HOWTO (R_CR16_NONE, /* type */
- 0, /* rightshift */
- 3, /* size */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_NONE", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_NUM8, /* type */
- 0, /* rightshift */
- 0, /* size */
- 8, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_NUM8", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_NUM16, /* type */
- 0, /* rightshift */
- 1, /* size */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_NUM16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_NUM32, /* type */
- 0, /* rightshift */
- 2, /* size */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_NUM32", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_NUM32a, /* type */
- 1, /* rightshift */
- 2, /* size */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_NUM32a", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_REGREL4, /* type */
- 0, /* rightshift */
- 0, /* size */
- 4, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_REGREL4", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xf, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_REGREL4a, /* type */
- 0, /* rightshift */
- 0, /* size */
- 4, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_REGREL4a", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xf, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_REGREL14, /* type */
- 0, /* rightshift */
- 1, /* size */
- 14, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_REGREL14", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0x3fff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_REGREL14a, /* type */
- 0, /* rightshift */
- 1, /* size */
- 14, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_REGREL14a", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0x3fff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_REGREL16, /* type */
- 0, /* rightshift */
- 1, /* size */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_REGREL16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_REGREL20, /* type */
- 0, /* rightshift */
- 2, /* size */
- 20, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_REGREL20", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xfffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_REGREL20a, /* type */
- 0, /* rightshift */
- 2, /* size */
- 20, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_REGREL20a", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xfffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_ABS20, /* type */
- 0, /* rightshift */
- 2, /* size */
- 20, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_ABS20", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xfffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_ABS24, /* type */
- 0, /* rightshift */
- 2, /* size */
- 24, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_ABS24", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_IMM4, /* type */
- 0, /* rightshift */
- 0, /* size */
- 4, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_IMM4", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xf, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_IMM8, /* type */
- 0, /* rightshift */
- 0, /* size */
- 8, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_IMM8", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_IMM16, /* type */
- 0, /* rightshift */
- 1, /* size */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_IMM16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_IMM20, /* type */
- 0, /* rightshift */
- 2, /* size */
- 20, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_IMM20", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xfffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_IMM24, /* type */
- 0, /* rightshift */
- 2, /* size */
- 24, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_IMM24", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_IMM32, /* type */
- 0, /* rightshift */
- 2, /* size */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_IMM32", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_IMM32a, /* type */
- 1, /* rightshift */
- 2, /* size */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_IMM32a", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_DISP4, /* type */
- 1, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 4, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_DISP4", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xf, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_DISP8, /* type */
- 1, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_DISP8", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0x1ff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_DISP16, /* type */
- 0, /* rightshift REVIITS: To sync with WinIDEA*/
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_DISP16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0x1ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_CR16_NONE, /* type */
+ 0, /* rightshift */
+ 3, /* size */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_NONE", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_NUM8, /* type */
+ 0, /* rightshift */
+ 0, /* size */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_NUM8", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_NUM16, /* type */
+ 0, /* rightshift */
+ 1, /* size */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_NUM16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_NUM32, /* type */
+ 0, /* rightshift */
+ 2, /* size */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_NUM32", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_NUM32a, /* type */
+ 1, /* rightshift */
+ 2, /* size */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_NUM32a", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_REGREL4, /* type */
+ 0, /* rightshift */
+ 0, /* size */
+ 4, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_REGREL4", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xf, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_REGREL4a, /* type */
+ 0, /* rightshift */
+ 0, /* size */
+ 4, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_REGREL4a", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xf, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_REGREL14, /* type */
+ 0, /* rightshift */
+ 1, /* size */
+ 14, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_REGREL14", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0x3fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_REGREL14a, /* type */
+ 0, /* rightshift */
+ 1, /* size */
+ 14, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_REGREL14a", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0x3fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_REGREL16, /* type */
+ 0, /* rightshift */
+ 1, /* size */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_REGREL16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_REGREL20, /* type */
+ 0, /* rightshift */
+ 2, /* size */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_REGREL20", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xfffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_REGREL20a, /* type */
+ 0, /* rightshift */
+ 2, /* size */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_REGREL20a", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xfffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_ABS20, /* type */
+ 0, /* rightshift */
+ 2, /* size */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_ABS20", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xfffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_ABS24, /* type */
+ 0, /* rightshift */
+ 2, /* size */
+ 24, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_ABS24", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_IMM4, /* type */
+ 0, /* rightshift */
+ 0, /* size */
+ 4, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_IMM4", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xf, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_IMM8, /* type */
+ 0, /* rightshift */
+ 0, /* size */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_IMM8", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_IMM16, /* type */
+ 0, /* rightshift */
+ 1, /* size */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_IMM16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_IMM20, /* type */
+ 0, /* rightshift */
+ 2, /* size */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_IMM20", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xfffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_IMM24, /* type */
+ 0, /* rightshift */
+ 2, /* size */
+ 24, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_IMM24", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_IMM32, /* type */
+ 0, /* rightshift */
+ 2, /* size */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_IMM32", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_IMM32a, /* type */
+ 1, /* rightshift */
+ 2, /* size */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_IMM32a", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_DISP4, /* type */
+ 1, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 4, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_DISP4", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xf, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_DISP8, /* type */
+ 1, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_DISP8", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0x1ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_DISP16, /* type */
+ 0, /* rightshift REVIITS: To sync with WinIDEA*/
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_DISP16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0x1ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* REVISIT: DISP24 should be left-shift by 2 as per ISA doc
but its not done, to sync with WinIDEA and CR16 4.1 tools */
- HOWTO (R_CR16_DISP24, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 24, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_DISP24", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0x1ffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_DISP24a, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 24, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_DISP24a", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_CR16_DISP24, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 24, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_DISP24", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0x1ffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_DISP24a, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 24, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_DISP24a", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* An 8 bit switch table entry. This is generated for an expression
such as ``.byte L1 - L2''. The offset holds the difference
between the reloc address and L2. */
- HOWTO (R_CR16_SWITCH8, /* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_SWITCH8", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOWTO (R_CR16_SWITCH8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_SWITCH8", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xff, /* dst_mask */
+ TRUE), /* pcrel_offset */
/* A 16 bit switch table entry. This is generated for an expression
such as ``.word L1 - L2''. The offset holds the difference
between the reloc address and L2. */
- HOWTO (R_CR16_SWITCH16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_SWITCH16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOWTO (R_CR16_SWITCH16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_SWITCH16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
/* A 32 bit switch table entry. This is generated for an expression
such as ``.long L1 - L2''. The offset holds the difference
between the reloc address and L2. */
- HOWTO (R_CR16_SWITCH32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_SWITCH32", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
-
- HOWTO (R_CR16_GOT_REGREL20, /* type */
- 0, /* rightshift */
- 2, /* size */
- 20, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_GOT_REGREL20", /* name */
- TRUE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xfffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_GOTC_REGREL20, /* type */
- 0, /* rightshift */
- 2, /* size */
- 20, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_GOTC_REGREL20", /* name */
- TRUE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xfffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_CR16_GLOB_DAT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_CR16_GLOB_DAT", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffffffff, /* dst_mask */
- TRUE) /* pcrel_offset */
+ HOWTO (R_CR16_SWITCH32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_SWITCH32", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_CR16_GOT_REGREL20, /* type */
+ 0, /* rightshift */
+ 2, /* size */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_GOT_REGREL20", /* name */
+ TRUE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xfffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_GOTC_REGREL20, /* type */
+ 0, /* rightshift */
+ 2, /* size */
+ 20, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_GOTC_REGREL20", /* name */
+ TRUE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xfffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_CR16_GLOB_DAT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_CR16_GLOB_DAT", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ TRUE) /* pcrel_offset */
};
}
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
- | SEC_LINKER_CREATED);
+ | SEC_LINKER_CREATED);
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
htab->sgot= s;
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
htab->sgotplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
- return FALSE;
+ || ! bfd_set_section_alignment (abfd, s, ptralign))
+ return FALSE;
}
/* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the .got
static reloc_howto_type *
elf_cr16_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
unsigned int i;
static reloc_howto_type *
elf_cr16_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- const char *r_name)
+ const char *r_name)
{
unsigned int i;
for (i = 0; ARRAY_SIZE (cr16_elf_howto_table); i++)
if (cr16_elf_howto_table[i].name != NULL
- && strcasecmp (cr16_elf_howto_table[i].name, r_name) == 0)
+ && strcasecmp (cr16_elf_howto_table[i].name, r_name) == 0)
return cr16_elf_howto_table + i;
return NULL;
static void
elf_cr16_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
- Elf_Internal_Rela *dst)
+ Elf_Internal_Rela *dst)
{
unsigned int r_type = ELF32_R_TYPE (dst->r_info);
static bfd_boolean
cr16_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec,
- const Elf_Internal_Rela *relocs)
+ const Elf_Internal_Rela *relocs)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Sym * isymbuf = NULL;
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- }
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
/* Some relocs require a global offset table. */
if (dynobj == NULL)
- {
- switch (ELF32_R_TYPE (rel->r_info))
- {
- case R_CR16_GOT_REGREL20:
- case R_CR16_GOTC_REGREL20:
- elf_hash_table (info)->dynobj = dynobj = abfd;
- if (! _bfd_cr16_elf_create_got_section (dynobj, info))
- goto fail;
- break;
-
- default:
- break;
- }
- }
+ {
+ switch (ELF32_R_TYPE (rel->r_info))
+ {
+ case R_CR16_GOT_REGREL20:
+ case R_CR16_GOTC_REGREL20:
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ if (! _bfd_cr16_elf_create_got_section (dynobj, info))
+ goto fail;
+ break;
+
+ default:
+ break;
+ }
+ }
switch (ELF32_R_TYPE (rel->r_info))
- {
- case R_CR16_GOT_REGREL20:
- case R_CR16_GOTC_REGREL20:
- /* This symbol requires a global offset table entry. */
+ {
+ case R_CR16_GOT_REGREL20:
+ case R_CR16_GOTC_REGREL20:
+ /* This symbol requires a global offset table entry. */
sgot = elf_hash_table (info)->sgot;
srelgot = elf_hash_table (info)->srelgot;
BFD_ASSERT (sgot != NULL && srelgot != NULL);
- if (h != NULL)
- {
- if (h->got.offset != (bfd_vma) -1)
- /* We have already allocated space in the .got. */
- break;
-
- h->got.offset = sgot->size;
-
- /* Make sure this symbol is output as a dynamic symbol. */
- if (h->dynindx == -1)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- goto fail;
- }
-
- srelgot->size += sizeof (Elf32_External_Rela);
- }
- else
- {
- /* This is a global offset table entry for a local
- symbol. */
- if (local_got_offsets == NULL)
- {
- size_t size;
- unsigned int i;
-
- size = symtab_hdr->sh_info * sizeof (bfd_vma);
- local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size);
-
- if (local_got_offsets == NULL)
- goto fail;
-
- elf_local_got_offsets (abfd) = local_got_offsets;
-
- for (i = 0; i < symtab_hdr->sh_info; i++)
- local_got_offsets[i] = (bfd_vma) -1;
- }
-
- if (local_got_offsets[r_symndx] != (bfd_vma) -1)
- /* We have already allocated space in the .got. */
- break;
-
- local_got_offsets[r_symndx] = sgot->size;
-
- if (bfd_link_executable (info))
- /* If we are generating a shared object, we need to
- output a R_CR16_RELATIVE reloc so that the dynamic
- linker can adjust this GOT entry. */
- srelgot->size += sizeof (Elf32_External_Rela);
- }
-
- sgot->size += 4;
- break;
-
- }
+ if (h != NULL)
+ {
+ if (h->got.offset != (bfd_vma) -1)
+ /* We have already allocated space in the .got. */
+ break;
+
+ h->got.offset = sgot->size;
+
+ /* Make sure this symbol is output as a dynamic symbol. */
+ if (h->dynindx == -1)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ goto fail;
+ }
+
+ srelgot->size += sizeof (Elf32_External_Rela);
+ }
+ else
+ {
+ /* This is a global offset table entry for a local
+ symbol. */
+ if (local_got_offsets == NULL)
+ {
+ size_t size;
+ unsigned int i;
+
+ size = symtab_hdr->sh_info * sizeof (bfd_vma);
+ local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size);
+
+ if (local_got_offsets == NULL)
+ goto fail;
+
+ elf_local_got_offsets (abfd) = local_got_offsets;
+
+ for (i = 0; i < symtab_hdr->sh_info; i++)
+ local_got_offsets[i] = (bfd_vma) -1;
+ }
+
+ if (local_got_offsets[r_symndx] != (bfd_vma) -1)
+ /* We have already allocated space in the .got. */
+ break;
+
+ local_got_offsets[r_symndx] = sgot->size;
+
+ if (bfd_link_executable (info))
+ /* If we are generating a shared object, we need to
+ output a R_CR16_RELATIVE reloc so that the dynamic
+ linker can adjust this GOT entry. */
+ srelgot->size += sizeof (Elf32_External_Rela);
+ }
+
+ sgot->size += 4;
+ break;
+
+ }
}
result = TRUE;
static bfd_reloc_status_type
cr16_elf_final_link_relocate (reloc_howto_type *howto,
- bfd *input_bfd,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- asection *input_section,
- bfd_byte *contents,
- bfd_vma offset,
- bfd_vma Rvalue,
- bfd_vma addend,
- struct elf_link_hash_entry * h,
- unsigned long symndx ATTRIBUTE_UNUSED,
- struct bfd_link_info *info ATTRIBUTE_UNUSED,
- asection *sec ATTRIBUTE_UNUSED,
- int is_local ATTRIBUTE_UNUSED)
+ bfd *input_bfd,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd_byte *contents,
+ bfd_vma offset,
+ bfd_vma Rvalue,
+ bfd_vma addend,
+ struct elf_link_hash_entry * h,
+ unsigned long symndx ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *sec ATTRIBUTE_UNUSED,
+ int is_local ATTRIBUTE_UNUSED)
{
unsigned short r_type = howto->type;
bfd_byte *hit_data = contents + offset;
case R_CR16_DISP16:
case R_CR16_DISP24:
/* 'hit_data' is relative to the start of the instruction, not the
- relocation offset. Advance it to account for the exact offset. */
+ relocation offset. Advance it to account for the exact offset. */
hit_data += 2;
break;
case R_CR16_DISP4:
if (is_local)
- Rvalue += -1;
+ Rvalue += -1;
break;
case R_CR16_DISP8:
case R_CR16_DISP24a:
if (is_local)
- Rvalue -= -1;
+ Rvalue -= -1;
break;
case R_CR16_SWITCH8:
case R_CR16_SWITCH16:
case R_CR16_SWITCH32:
/* We only care about the addend, where the difference between
- expressions is kept. */
+ expressions is kept. */
Rvalue = 0;
default:
{
/* Subtract the address of the section containing the location. */
Rvalue -= (input_section->output_section->vma
- + input_section->output_offset);
+ + input_section->output_offset);
/* Subtract the position of the location within the section. */
Rvalue -= offset;
}
|| (r_type == R_CR16_GOTC_REGREL20)))
{
if (((bfd_vma) check & ~reloc_bits) != 0
- && (((bfd_vma) check & ~reloc_bits)
- != (-(bfd_vma) 1 & ~reloc_bits)))
- {
- /* The above right shift is incorrect for a signed
- value. See if turning on the upper bits fixes the
- overflow. */
- if (howto->rightshift && (bfd_signed_vma) Rvalue < 0)
- {
- check |= ((bfd_vma) - 1
- & ~((bfd_vma) - 1
- >> howto->rightshift));
-
- if (((bfd_vma) check & ~reloc_bits)
- != (-(bfd_vma) 1 & ~reloc_bits))
- return bfd_reloc_overflow;
- }
- else
- return bfd_reloc_overflow;
- }
+ && (((bfd_vma) check & ~reloc_bits)
+ != (-(bfd_vma) 1 & ~reloc_bits)))
+ {
+ /* The above right shift is incorrect for a signed
+ value. See if turning on the upper bits fixes the
+ overflow. */
+ if (howto->rightshift && (bfd_signed_vma) Rvalue < 0)
+ {
+ check |= ((bfd_vma) - 1
+ & ~((bfd_vma) - 1
+ >> howto->rightshift));
+
+ if (((bfd_vma) check & ~reloc_bits)
+ != (-(bfd_vma) 1 & ~reloc_bits))
+ return bfd_reloc_overflow;
+ }
+ else
+ return bfd_reloc_overflow;
+ }
/* Drop unwanted bits from the value we are relocating to. */
Rvalue >>= (bfd_vma) howto->rightshift;
switch (howto->size)
{
case 0:
- if (r_type == R_CR16_DISP8)
- {
- Rvalue1 = bfd_get_16 (input_bfd, hit_data);
- Rvalue = ((Rvalue1 & 0xf000) | ((Rvalue << 4) & 0xf00)
- | (Rvalue1 & 0x00f0) | (Rvalue & 0xf));
- bfd_put_16 (input_bfd, Rvalue, hit_data);
- }
- else if (r_type == R_CR16_IMM4)
- {
- Rvalue1 = bfd_get_16 (input_bfd, hit_data);
- Rvalue = (((Rvalue1 & 0xff) << 8) | ((Rvalue << 4) & 0xf0)
- | ((Rvalue1 & 0x0f00) >> 8));
- bfd_put_16 (input_bfd, Rvalue, hit_data);
- }
- else if (r_type == R_CR16_DISP4)
- {
- Rvalue1 = bfd_get_16 (input_bfd, hit_data);
- Rvalue = (Rvalue1 | ((Rvalue & 0xf) << 4));
- bfd_put_16 (input_bfd, Rvalue, hit_data);
- }
- else
- {
- bfd_put_8 (input_bfd, (unsigned char) Rvalue, hit_data);
- }
- break;
+ if (r_type == R_CR16_DISP8)
+ {
+ Rvalue1 = bfd_get_16 (input_bfd, hit_data);
+ Rvalue = ((Rvalue1 & 0xf000) | ((Rvalue << 4) & 0xf00)
+ | (Rvalue1 & 0x00f0) | (Rvalue & 0xf));
+ bfd_put_16 (input_bfd, Rvalue, hit_data);
+ }
+ else if (r_type == R_CR16_IMM4)
+ {
+ Rvalue1 = bfd_get_16 (input_bfd, hit_data);
+ Rvalue = (((Rvalue1 & 0xff) << 8) | ((Rvalue << 4) & 0xf0)
+ | ((Rvalue1 & 0x0f00) >> 8));
+ bfd_put_16 (input_bfd, Rvalue, hit_data);
+ }
+ else if (r_type == R_CR16_DISP4)
+ {
+ Rvalue1 = bfd_get_16 (input_bfd, hit_data);
+ Rvalue = (Rvalue1 | ((Rvalue & 0xf) << 4));
+ bfd_put_16 (input_bfd, Rvalue, hit_data);
+ }
+ else
+ {
+ bfd_put_8 (input_bfd, (unsigned char) Rvalue, hit_data);
+ }
+ break;
case 1:
- if (r_type == R_CR16_DISP16)
- {
- Rvalue |= (bfd_get_16 (input_bfd, hit_data));
- Rvalue = ((Rvalue & 0xfffe) | ((Rvalue >> 16) & 0x1));
- }
- if (r_type == R_CR16_IMM16)
- {
- Rvalue1 = bfd_get_16 (input_bfd, hit_data);
-
- /* Add or subtract the offset value. */
- if (Rvalue1 & 0x8000)
- Rvalue -= (~Rvalue1 + 1) & 0xffff;
- else
- Rvalue += Rvalue1;
-
- /* Check for range. */
- if ((long) Rvalue > 0xffff || (long) Rvalue < 0x0)
- return bfd_reloc_overflow;
- }
-
- bfd_put_16 (input_bfd, Rvalue, hit_data);
- break;
+ if (r_type == R_CR16_DISP16)
+ {
+ Rvalue |= (bfd_get_16 (input_bfd, hit_data));
+ Rvalue = ((Rvalue & 0xfffe) | ((Rvalue >> 16) & 0x1));
+ }
+ if (r_type == R_CR16_IMM16)
+ {
+ Rvalue1 = bfd_get_16 (input_bfd, hit_data);
+
+ /* Add or subtract the offset value. */
+ if (Rvalue1 & 0x8000)
+ Rvalue -= (~Rvalue1 + 1) & 0xffff;
+ else
+ Rvalue += Rvalue1;
+
+ /* Check for range. */
+ if ((long) Rvalue > 0xffff || (long) Rvalue < 0x0)
+ return bfd_reloc_overflow;
+ }
+
+ bfd_put_16 (input_bfd, Rvalue, hit_data);
+ break;
case 2:
- if ((r_type == R_CR16_ABS20) || (r_type == R_CR16_IMM20))
- {
- Rvalue1 = (bfd_get_16 (input_bfd, hit_data + 2)
- | (((bfd_get_16 (input_bfd, hit_data) & 0xf) <<16)));
-
- /* Add or subtract the offset value. */
- if (Rvalue1 & 0x80000)
- Rvalue -= (~Rvalue1 + 1) & 0xfffff;
- else
- Rvalue += Rvalue1;
-
- /* Check for range. */
- if ((long) Rvalue > 0xfffff || (long) Rvalue < 0x0)
- return bfd_reloc_overflow;
-
- bfd_put_16 (input_bfd, ((bfd_get_16 (input_bfd, hit_data) & 0xfff0)
- | ((Rvalue >> 16) & 0xf)), hit_data);
- bfd_put_16 (input_bfd, (Rvalue) & 0xffff, hit_data + 2);
- }
- else if (r_type == R_CR16_GOT_REGREL20)
- {
- asection *sgot = elf_hash_table (info)->sgot;
-
- if (h != NULL)
- {
- bfd_vma off;
-
- off = h->got.offset;
- BFD_ASSERT (off != (bfd_vma) -1);
-
- if (! elf_hash_table (info)->dynamic_sections_created
- || SYMBOL_REFERENCES_LOCAL (info, h))
- /* This is actually a static link, or it is a
- -Bsymbolic link and the symbol is defined
- locally, or the symbol was forced to be local
- because of a version file. We must initialize
- this entry in the global offset table.
- When doing a dynamic link, we create a .rela.got
- relocation entry to initialize the value. This
- is done in the finish_dynamic_symbol routine. */
- bfd_put_32 (output_bfd, Rvalue, sgot->contents + off);
-
- Rvalue = sgot->output_offset + off;
- }
- else
- {
- bfd_vma off;
-
- off = elf_local_got_offsets (input_bfd)[symndx];
- bfd_put_32 (output_bfd,Rvalue, sgot->contents + off);
-
- Rvalue = sgot->output_offset + off;
- }
-
- Rvalue += addend;
-
- /* REVISIT: if ((long) Rvalue > 0xffffff ||
- (long) Rvalue < -0x800000). */
- if ((long) Rvalue > 0xffffff || (long) Rvalue < 0)
- return bfd_reloc_overflow;
-
-
- bfd_put_16 (input_bfd, (bfd_get_16 (input_bfd, hit_data))
- | (((Rvalue >> 16) & 0xf) << 8), hit_data);
- bfd_put_16 (input_bfd, (Rvalue) & 0xffff, hit_data + 2);
-
- }
- else if (r_type == R_CR16_GOTC_REGREL20)
- {
- asection *sgot = elf_hash_table (info)->sgot;
-
- if (h != NULL)
- {
- bfd_vma off;
-
- off = h->got.offset;
- BFD_ASSERT (off != (bfd_vma) -1);
-
- Rvalue >>=1; /* For code symbols. */
-
- if (! elf_hash_table (info)->dynamic_sections_created
- || SYMBOL_REFERENCES_LOCAL (info, h))
- /* This is actually a static link, or it is a
- -Bsymbolic link and the symbol is defined
- locally, or the symbol was forced to be local
- because of a version file. We must initialize
- this entry in the global offset table.
- When doing a dynamic link, we create a .rela.got
- relocation entry to initialize the value. This
- is done in the finish_dynamic_symbol routine. */
- bfd_put_32 (output_bfd, Rvalue, sgot->contents + off);
-
- Rvalue = sgot->output_offset + off;
- }
- else
- {
- bfd_vma off;
-
- off = elf_local_got_offsets (input_bfd)[symndx];
- Rvalue >>= 1;
- bfd_put_32 (output_bfd,Rvalue, sgot->contents + off);
- Rvalue = sgot->output_offset + off;
- }
-
- Rvalue += addend;
-
- /* Check if any value in DISP. */
- Rvalue1 =((bfd_get_32 (input_bfd, hit_data) >>16)
- | (((bfd_get_32 (input_bfd, hit_data) & 0xfff) >> 8) <<16));
-
- /* Add or subtract the offset value. */
- if (Rvalue1 & 0x80000)
- Rvalue -= (~Rvalue1 + 1) & 0xfffff;
- else
- Rvalue += Rvalue1;
-
- /* Check for range. */
- /* REVISIT: if ((long) Rvalue > 0xffffff
- || (long) Rvalue < -0x800000). */
- if ((long) Rvalue > 0xffffff || (long) Rvalue < 0)
- return bfd_reloc_overflow;
-
- bfd_put_16 (input_bfd, (bfd_get_16 (input_bfd, hit_data))
- | (((Rvalue >> 16) & 0xf) << 8), hit_data);
- bfd_put_16 (input_bfd, (Rvalue) & 0xffff, hit_data + 2);
- }
- else
- {
- if (r_type == R_CR16_ABS24)
- {
- Rvalue1 = ((bfd_get_32 (input_bfd, hit_data) >> 16)
- | (((bfd_get_32 (input_bfd, hit_data) & 0xfff) >> 8) <<16)
- | (((bfd_get_32 (input_bfd, hit_data) & 0xf) <<20)));
-
- /* Add or subtract the offset value. */
- if (Rvalue1 & 0x800000)
- Rvalue -= (~Rvalue1 + 1) & 0xffffff;
- else
- Rvalue += Rvalue1;
-
- /* Check for Range. */
- if ((long) Rvalue > 0xffffff || (long) Rvalue < 0x0)
- return bfd_reloc_overflow;
-
- Rvalue = ((((Rvalue >> 20) & 0xf) | (((Rvalue >> 16) & 0xf)<<8)
- | (bfd_get_32 (input_bfd, hit_data) & 0xf0f0))
- | ((Rvalue & 0xffff) << 16));
- }
- else if (r_type == R_CR16_DISP24)
- {
- Rvalue = ((((Rvalue >> 20)& 0xf) | (((Rvalue >>16) & 0xf)<<8)
- | (bfd_get_16 (input_bfd, hit_data)))
- | (((Rvalue & 0xfffe) | ((Rvalue >> 24) & 0x1)) << 16));
- }
- else if ((r_type == R_CR16_IMM32) || (r_type == R_CR16_IMM32a))
- {
- Rvalue1 =((((bfd_get_32 (input_bfd, hit_data)) >> 16) &0xffff)
- | (((bfd_get_32 (input_bfd, hit_data)) &0xffff)) << 16);
-
- /* Add or subtract the offset value. */
- if (Rvalue1 & 0x80000000)
- Rvalue -= (~Rvalue1 + 1) & 0xffffffff;
- else
- Rvalue += Rvalue1;
-
- /* Check for range. */
- if (Rvalue > 0xffffffff || (long) Rvalue < 0x0)
- return bfd_reloc_overflow;
-
- Rvalue = (((Rvalue >> 16)& 0xffff) | (Rvalue & 0xffff) << 16);
- }
- else if (r_type == R_CR16_DISP24a)
- {
- Rvalue = (((Rvalue & 0xfffffe) | (Rvalue >> 23)));
- Rvalue = ((Rvalue >> 16) & 0xff) | ((Rvalue & 0xffff) << 16)
- | (bfd_get_32 (input_bfd, hit_data));
- }
- else if ((r_type == R_CR16_REGREL20)
- || (r_type == R_CR16_REGREL20a))
- {
- Rvalue1 = ((bfd_get_32 (input_bfd, hit_data) >> 16)
- | (((bfd_get_32 (input_bfd, hit_data) & 0xfff) >> 8) <<16));
- /* Add or subtract the offset value. */
- if (Rvalue1 & 0x80000)
- Rvalue -= (~Rvalue1 + 1) & 0xfffff;
- else
- Rvalue += Rvalue1;
-
- /* Check for range. */
- if ((long) Rvalue > 0xfffff || (long) Rvalue < 0x0)
- return bfd_reloc_overflow;
-
- Rvalue = (((((Rvalue >> 20)& 0xf) | (((Rvalue >>16) & 0xf)<<8)
- | ((Rvalue & 0xffff) << 16)))
- | (bfd_get_32 (input_bfd, hit_data) & 0xf0ff));
-
- }
- else if (r_type == R_CR16_NUM32)
- {
- Rvalue1 = (bfd_get_32 (input_bfd, hit_data));
-
- /* Add or subtract the offset value */
- if (Rvalue1 & 0x80000000)
- Rvalue -= (~Rvalue1 + 1) & 0xffffffff;
- else
- Rvalue += Rvalue1;
-
- /* Check for Ranga */
- if (Rvalue > 0xffffffff)
- return bfd_reloc_overflow;
- }
-
- bfd_put_32 (input_bfd, Rvalue, hit_data);
- }
- break;
+ if ((r_type == R_CR16_ABS20) || (r_type == R_CR16_IMM20))
+ {
+ Rvalue1 = (bfd_get_16 (input_bfd, hit_data + 2)
+ | (((bfd_get_16 (input_bfd, hit_data) & 0xf) <<16)));
+
+ /* Add or subtract the offset value. */
+ if (Rvalue1 & 0x80000)
+ Rvalue -= (~Rvalue1 + 1) & 0xfffff;
+ else
+ Rvalue += Rvalue1;
+
+ /* Check for range. */
+ if ((long) Rvalue > 0xfffff || (long) Rvalue < 0x0)
+ return bfd_reloc_overflow;
+
+ bfd_put_16 (input_bfd, ((bfd_get_16 (input_bfd, hit_data) & 0xfff0)
+ | ((Rvalue >> 16) & 0xf)), hit_data);
+ bfd_put_16 (input_bfd, (Rvalue) & 0xffff, hit_data + 2);
+ }
+ else if (r_type == R_CR16_GOT_REGREL20)
+ {
+ asection *sgot = elf_hash_table (info)->sgot;
+
+ if (h != NULL)
+ {
+ bfd_vma off;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) -1);
+
+ if (! elf_hash_table (info)->dynamic_sections_created
+ || SYMBOL_REFERENCES_LOCAL (info, h))
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. We must initialize
+ this entry in the global offset table.
+ When doing a dynamic link, we create a .rela.got
+ relocation entry to initialize the value. This
+ is done in the finish_dynamic_symbol routine. */
+ bfd_put_32 (output_bfd, Rvalue, sgot->contents + off);
+
+ Rvalue = sgot->output_offset + off;
+ }
+ else
+ {
+ bfd_vma off;
+
+ off = elf_local_got_offsets (input_bfd)[symndx];
+ bfd_put_32 (output_bfd,Rvalue, sgot->contents + off);
+
+ Rvalue = sgot->output_offset + off;
+ }
+
+ Rvalue += addend;
+
+ /* REVISIT: if ((long) Rvalue > 0xffffff ||
+ (long) Rvalue < -0x800000). */
+ if ((long) Rvalue > 0xffffff || (long) Rvalue < 0)
+ return bfd_reloc_overflow;
+
+
+ bfd_put_16 (input_bfd, (bfd_get_16 (input_bfd, hit_data))
+ | (((Rvalue >> 16) & 0xf) << 8), hit_data);
+ bfd_put_16 (input_bfd, (Rvalue) & 0xffff, hit_data + 2);
+
+ }
+ else if (r_type == R_CR16_GOTC_REGREL20)
+ {
+ asection *sgot = elf_hash_table (info)->sgot;
+
+ if (h != NULL)
+ {
+ bfd_vma off;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) -1);
+
+ Rvalue >>=1; /* For code symbols. */
+
+ if (! elf_hash_table (info)->dynamic_sections_created
+ || SYMBOL_REFERENCES_LOCAL (info, h))
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. We must initialize
+ this entry in the global offset table.
+ When doing a dynamic link, we create a .rela.got
+ relocation entry to initialize the value. This
+ is done in the finish_dynamic_symbol routine. */
+ bfd_put_32 (output_bfd, Rvalue, sgot->contents + off);
+
+ Rvalue = sgot->output_offset + off;
+ }
+ else
+ {
+ bfd_vma off;
+
+ off = elf_local_got_offsets (input_bfd)[symndx];
+ Rvalue >>= 1;
+ bfd_put_32 (output_bfd,Rvalue, sgot->contents + off);
+ Rvalue = sgot->output_offset + off;
+ }
+
+ Rvalue += addend;
+
+ /* Check if any value in DISP. */
+ Rvalue1 =((bfd_get_32 (input_bfd, hit_data) >>16)
+ | (((bfd_get_32 (input_bfd, hit_data) & 0xfff) >> 8) <<16));
+
+ /* Add or subtract the offset value. */
+ if (Rvalue1 & 0x80000)
+ Rvalue -= (~Rvalue1 + 1) & 0xfffff;
+ else
+ Rvalue += Rvalue1;
+
+ /* Check for range. */
+ /* REVISIT: if ((long) Rvalue > 0xffffff
+ || (long) Rvalue < -0x800000). */
+ if ((long) Rvalue > 0xffffff || (long) Rvalue < 0)
+ return bfd_reloc_overflow;
+
+ bfd_put_16 (input_bfd, (bfd_get_16 (input_bfd, hit_data))
+ | (((Rvalue >> 16) & 0xf) << 8), hit_data);
+ bfd_put_16 (input_bfd, (Rvalue) & 0xffff, hit_data + 2);
+ }
+ else
+ {
+ if (r_type == R_CR16_ABS24)
+ {
+ Rvalue1 = ((bfd_get_32 (input_bfd, hit_data) >> 16)
+ | (((bfd_get_32 (input_bfd, hit_data) & 0xfff) >> 8) <<16)
+ | (((bfd_get_32 (input_bfd, hit_data) & 0xf) <<20)));
+
+ /* Add or subtract the offset value. */
+ if (Rvalue1 & 0x800000)
+ Rvalue -= (~Rvalue1 + 1) & 0xffffff;
+ else
+ Rvalue += Rvalue1;
+
+ /* Check for Range. */
+ if ((long) Rvalue > 0xffffff || (long) Rvalue < 0x0)
+ return bfd_reloc_overflow;
+
+ Rvalue = ((((Rvalue >> 20) & 0xf) | (((Rvalue >> 16) & 0xf)<<8)
+ | (bfd_get_32 (input_bfd, hit_data) & 0xf0f0))
+ | ((Rvalue & 0xffff) << 16));
+ }
+ else if (r_type == R_CR16_DISP24)
+ {
+ Rvalue = ((((Rvalue >> 20)& 0xf) | (((Rvalue >>16) & 0xf)<<8)
+ | (bfd_get_16 (input_bfd, hit_data)))
+ | (((Rvalue & 0xfffe) | ((Rvalue >> 24) & 0x1)) << 16));
+ }
+ else if ((r_type == R_CR16_IMM32) || (r_type == R_CR16_IMM32a))
+ {
+ Rvalue1 =((((bfd_get_32 (input_bfd, hit_data)) >> 16) &0xffff)
+ | (((bfd_get_32 (input_bfd, hit_data)) &0xffff)) << 16);
+
+ /* Add or subtract the offset value. */
+ if (Rvalue1 & 0x80000000)
+ Rvalue -= (~Rvalue1 + 1) & 0xffffffff;
+ else
+ Rvalue += Rvalue1;
+
+ /* Check for range. */
+ if (Rvalue > 0xffffffff || (long) Rvalue < 0x0)
+ return bfd_reloc_overflow;
+
+ Rvalue = (((Rvalue >> 16)& 0xffff) | (Rvalue & 0xffff) << 16);
+ }
+ else if (r_type == R_CR16_DISP24a)
+ {
+ Rvalue = (((Rvalue & 0xfffffe) | (Rvalue >> 23)));
+ Rvalue = ((Rvalue >> 16) & 0xff) | ((Rvalue & 0xffff) << 16)
+ | (bfd_get_32 (input_bfd, hit_data));
+ }
+ else if ((r_type == R_CR16_REGREL20)
+ || (r_type == R_CR16_REGREL20a))
+ {
+ Rvalue1 = ((bfd_get_32 (input_bfd, hit_data) >> 16)
+ | (((bfd_get_32 (input_bfd, hit_data) & 0xfff) >> 8) <<16));
+ /* Add or subtract the offset value. */
+ if (Rvalue1 & 0x80000)
+ Rvalue -= (~Rvalue1 + 1) & 0xfffff;
+ else
+ Rvalue += Rvalue1;
+
+ /* Check for range. */
+ if ((long) Rvalue > 0xfffff || (long) Rvalue < 0x0)
+ return bfd_reloc_overflow;
+
+ Rvalue = (((((Rvalue >> 20)& 0xf) | (((Rvalue >>16) & 0xf)<<8)
+ | ((Rvalue & 0xffff) << 16)))
+ | (bfd_get_32 (input_bfd, hit_data) & 0xf0ff));
+
+ }
+ else if (r_type == R_CR16_NUM32)
+ {
+ Rvalue1 = (bfd_get_32 (input_bfd, hit_data));
+
+ /* Add or subtract the offset value */
+ if (Rvalue1 & 0x80000000)
+ Rvalue -= (~Rvalue1 + 1) & 0xffffffff;
+ else
+ Rvalue += Rvalue1;
+
+ /* Check for Ranga */
+ if (Rvalue > 0xffffffff)
+ return bfd_reloc_overflow;
+ }
+
+ bfd_put_32 (input_bfd, Rvalue, hit_data);
+ }
+ break;
default:
- return bfd_reloc_notsupported;
+ return bfd_reloc_notsupported;
}
return bfd_reloc_ok;
static bfd_boolean
elf32_cr16_relax_delete_bytes (struct bfd_link_info *link_info, bfd *abfd,
- asection *sec, bfd_vma addr, int count)
+ asection *sec, bfd_vma addr, int count)
{
Elf_Internal_Shdr *symtab_hdr;
unsigned int sec_shndx;
/* Actually delete the bytes. */
memmove (contents + addr, contents + addr + count,
- (size_t) (toaddr - addr - count));
+ (size_t) (toaddr - addr - count));
sec->size -= count;
/* Adjust all the relocs. */
for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
/* Get the new reloc address. */
if ((irel->r_offset > addr && irel->r_offset < toaddr))
- irel->r_offset -= count;
+ irel->r_offset -= count;
/* Adjust the local symbols defined in this section. */
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
{
if (isym->st_shndx == sec_shndx
- && isym->st_value > addr
- && isym->st_value < toaddr)
- {
- /* Adjust the addend of SWITCH relocations in this section,
- which reference this local symbol. */
+ && isym->st_value > addr
+ && isym->st_value < toaddr)
+ {
+ /* Adjust the addend of SWITCH relocations in this section,
+ which reference this local symbol. */
#if 0
- for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
- {
- unsigned long r_symndx;
- Elf_Internal_Sym *rsym;
- bfd_vma addsym, subsym;
-
- /* Skip if not a SWITCH relocation. */
- if (ELF32_R_TYPE (irel->r_info) != (int) R_CR16_SWITCH8
- && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_SWITCH16
- && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_SWITCH32)
- continue;
-
- r_symndx = ELF32_R_SYM (irel->r_info);
- rsym = (Elf_Internal_Sym *) symtab_hdr->contents + r_symndx;
-
- /* Skip if not the local adjusted symbol. */
- if (rsym != isym)
- continue;
-
- addsym = isym->st_value;
- subsym = addsym - irel->r_addend;
-
- /* Fix the addend only when -->> (addsym > addr >= subsym). */
- if (subsym <= addr)
- irel->r_addend -= count;
- else
- continue;
- }
+ for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
+ {
+ unsigned long r_symndx;
+ Elf_Internal_Sym *rsym;
+ bfd_vma addsym, subsym;
+
+ /* Skip if not a SWITCH relocation. */
+ if (ELF32_R_TYPE (irel->r_info) != (int) R_CR16_SWITCH8
+ && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_SWITCH16
+ && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_SWITCH32)
+ continue;
+
+ r_symndx = ELF32_R_SYM (irel->r_info);
+ rsym = (Elf_Internal_Sym *) symtab_hdr->contents + r_symndx;
+
+ /* Skip if not the local adjusted symbol. */
+ if (rsym != isym)
+ continue;
+
+ addsym = isym->st_value;
+ subsym = addsym - irel->r_addend;
+
+ /* Fix the addend only when -->> (addsym > addr >= subsym). */
+ if (subsym <= addr)
+ irel->r_addend -= count;
+ else
+ continue;
+ }
#endif
- isym->st_value -= count;
- }
+ isym->st_value -= count;
+ }
}
/* Now adjust the global symbols defined in this section. */
symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)
- - symtab_hdr->sh_info);
+ - symtab_hdr->sh_info);
sym_hashes = start_hashes = elf_sym_hashes (abfd);
end_hashes = sym_hashes + symcount;
struct elf_link_hash_entry *sym_hash = *sym_hashes;
/* The '--wrap SYMBOL' option is causing a pain when the object file,
- containing the definition of __wrap_SYMBOL, includes a direct
- call to SYMBOL as well. Since both __wrap_SYMBOL and SYMBOL reference
- the same symbol (which is __wrap_SYMBOL), but still exist as two
- different symbols in 'sym_hashes', we don't want to adjust
- the global symbol __wrap_SYMBOL twice.
- This check is only relevant when symbols are being wrapped. */
+ containing the definition of __wrap_SYMBOL, includes a direct
+ call to SYMBOL as well. Since both __wrap_SYMBOL and SYMBOL reference
+ the same symbol (which is __wrap_SYMBOL), but still exist as two
+ different symbols in 'sym_hashes', we don't want to adjust
+ the global symbol __wrap_SYMBOL twice.
+ This check is only relevant when symbols are being wrapped. */
if (link_info->wrap_hash != NULL)
- {
- struct elf_link_hash_entry **cur_sym_hashes;
-
- /* Loop only over the symbols whom been already checked. */
- for (cur_sym_hashes = start_hashes; cur_sym_hashes < sym_hashes;
- cur_sym_hashes++)
- /* If the current symbol is identical to 'sym_hash', that means
- the symbol was already adjusted (or at least checked). */
- if (*cur_sym_hashes == sym_hash)
- break;
-
- /* Don't adjust the symbol again. */
- if (cur_sym_hashes < sym_hashes)
- continue;
- }
+ {
+ struct elf_link_hash_entry **cur_sym_hashes;
+
+ /* Loop only over the symbols whom been already checked. */
+ for (cur_sym_hashes = start_hashes; cur_sym_hashes < sym_hashes;
+ cur_sym_hashes++)
+ /* If the current symbol is identical to 'sym_hash', that means
+ the symbol was already adjusted (or at least checked). */
+ if (*cur_sym_hashes == sym_hash)
+ break;
+
+ /* Don't adjust the symbol again. */
+ if (cur_sym_hashes < sym_hashes)
+ continue;
+ }
if ((sym_hash->root.type == bfd_link_hash_defined
- || sym_hash->root.type == bfd_link_hash_defweak)
- && sym_hash->root.u.def.section == sec
- && sym_hash->root.u.def.value > addr
- && sym_hash->root.u.def.value < toaddr)
- sym_hash->root.u.def.value -= count;
+ || sym_hash->root.type == bfd_link_hash_defweak)
+ && sym_hash->root.u.def.section == sec
+ && sym_hash->root.u.def.value > addr
+ && sym_hash->root.u.def.value < toaddr)
+ sym_hash->root.u.def.value -= count;
}
return TRUE;
static bfd_boolean
elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
- bfd *input_bfd, asection *input_section,
- bfd_byte *contents, Elf_Internal_Rela *relocs,
- Elf_Internal_Sym *local_syms,
- asection **local_sections)
+ bfd *input_bfd, asection *input_section,
+ bfd_byte *contents, Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
sym = NULL;
sec = NULL;
if (r_symndx < symtab_hdr->sh_info)
- {
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
- }
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ }
else
- {
- bfd_boolean unresolved_reloc, warned, ignored;
+ {
+ bfd_boolean unresolved_reloc, warned, ignored;
- RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
- r_symndx, symtab_hdr, sym_hashes,
- h, sec, relocation,
- unresolved_reloc, warned, ignored);
- }
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+ unresolved_reloc, warned, ignored);
+ }
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
rel, 1, relend, howto, 0, contents);
if (bfd_link_relocatable (info))
- continue;
+ continue;
r = cr16_elf_final_link_relocate (howto, input_bfd, output_bfd,
- input_section,
- contents, rel->r_offset,
- relocation, rel->r_addend,
- (struct elf_link_hash_entry *) h,
- r_symndx,
- info, sec, h == NULL);
+ input_section,
+ contents, rel->r_offset,
+ relocation, rel->r_addend,
+ (struct elf_link_hash_entry *) h,
+ r_symndx,
+ info, sec, h == NULL);
if (r != bfd_reloc_ok)
- {
- const char *name;
- const char *msg = NULL;
-
- if (h != NULL)
- name = h->root.root.string;
- else
- {
- name = (bfd_elf_string_from_elf_section
- (input_bfd, symtab_hdr->sh_link, sym->st_name));
- if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
- }
-
- switch (r)
- {
- case bfd_reloc_overflow:
+ {
+ const char *name;
+ const char *msg = NULL;
+
+ if (h != NULL)
+ name = h->root.root.string;
+ else
+ {
+ name = (bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name));
+ if (name == NULL || *name == '\0')
+ name = bfd_section_name (input_bfd, sec);
+ }
+
+ switch (r)
+ {
+ case bfd_reloc_overflow:
(*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset);
- break;
+ break;
- case bfd_reloc_undefined:
+ case bfd_reloc_undefined:
(*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE);
- break;
+ break;
- case bfd_reloc_outofrange:
- msg = _("internal error: out of range error");
- goto common_error;
+ case bfd_reloc_outofrange:
+ msg = _("internal error: out of range error");
+ goto common_error;
- case bfd_reloc_notsupported:
- msg = _("internal error: unsupported relocation error");
- goto common_error;
+ case bfd_reloc_notsupported:
+ msg = _("internal error: unsupported relocation error");
+ goto common_error;
- case bfd_reloc_dangerous:
- msg = _("internal error: dangerous error");
- goto common_error;
+ case bfd_reloc_dangerous:
+ msg = _("internal error: dangerous error");
+ goto common_error;
- default:
- msg = _("internal error: unknown error");
- /* Fall through. */
+ default:
+ msg = _("internal error: unknown error");
+ /* Fall through. */
- common_error:
+ common_error:
(*info->callbacks->warning) (info, msg, name, input_bfd,
input_section, rel->r_offset);
- break;
- }
- }
+ break;
+ }
+ }
}
return TRUE;
static bfd_byte *
elf32_cr16_get_relocated_section_contents (bfd *output_bfd,
- struct bfd_link_info *link_info,
- struct bfd_link_order *link_order,
- bfd_byte *data,
- bfd_boolean relocatable,
- asymbol **symbols)
+ struct bfd_link_info *link_info,
+ struct bfd_link_order *link_order,
+ bfd_byte *data,
+ bfd_boolean relocatable,
+ asymbol **symbols)
{
Elf_Internal_Shdr *symtab_hdr;
asection *input_section = link_order->u.indirect.section;
if (relocatable
|| elf_section_data (input_section)->this_hdr.contents == NULL)
return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
- link_order, data,
- relocatable,
- symbols);
+ link_order, data,
+ relocatable,
+ symbols);
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
memcpy (data, elf_section_data (input_section)->this_hdr.contents,
- (size_t) input_section->size);
+ (size_t) input_section->size);
if ((input_section->flags & SEC_RELOC) != 0
&& input_section->reloc_count > 0)
bfd_size_type amt;
internal_relocs = _bfd_elf_link_read_relocs (input_bfd, input_section,
- NULL, NULL, FALSE);
+ NULL, NULL, FALSE);
if (internal_relocs == NULL)
- goto error_return;
+ goto error_return;
if (symtab_hdr->sh_info != 0)
- {
- isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
- if (isymbuf == NULL)
- isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr,
- symtab_hdr->sh_info, 0,
- NULL, NULL, NULL);
- if (isymbuf == NULL)
- goto error_return;
- }
+ {
+ isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (isymbuf == NULL)
+ isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr,
+ symtab_hdr->sh_info, 0,
+ NULL, NULL, NULL);
+ if (isymbuf == NULL)
+ goto error_return;
+ }
amt = symtab_hdr->sh_info;
amt *= sizeof (asection *);
sections = bfd_malloc (amt);
if (sections == NULL && amt != 0)
- goto error_return;
+ goto error_return;
isymend = isymbuf + symtab_hdr->sh_info;
for (isym = isymbuf, secpp = sections; isym < isymend; ++isym, ++secpp)
- {
- asection *isec;
+ {
+ asection *isec;
- if (isym->st_shndx == SHN_UNDEF)
- isec = bfd_und_section_ptr;
- else if (isym->st_shndx == SHN_ABS)
- isec = bfd_abs_section_ptr;
- else if (isym->st_shndx == SHN_COMMON)
- isec = bfd_com_section_ptr;
- else
- isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx);
+ if (isym->st_shndx == SHN_UNDEF)
+ isec = bfd_und_section_ptr;
+ else if (isym->st_shndx == SHN_ABS)
+ isec = bfd_abs_section_ptr;
+ else if (isym->st_shndx == SHN_COMMON)
+ isec = bfd_com_section_ptr;
+ else
+ isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx);
- *secpp = isec;
- }
+ *secpp = isec;
+ }
if (! elf32_cr16_relocate_section (output_bfd, link_info, input_bfd,
- input_section, data, internal_relocs,
- isymbuf, sections))
- goto error_return;
+ input_section, data, internal_relocs,
+ isymbuf, sections))
+ goto error_return;
if (sections != NULL)
- free (sections);
+ free (sections);
if (isymbuf != NULL
- && symtab_hdr->contents != (unsigned char *) isymbuf)
- free (isymbuf);
+ && symtab_hdr->contents != (unsigned char *) isymbuf)
+ free (isymbuf);
if (elf_section_data (input_section)->relocs != internal_relocs)
- free (internal_relocs);
+ free (internal_relocs);
}
return data;
static struct bfd_hash_entry *
elf32_cr16_link_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table,
- const char *string)
+ struct bfd_hash_table *table,
+ const char *string)
{
struct elf32_cr16_link_hash_entry *ret =
(struct elf32_cr16_link_hash_entry *) entry;
subclass. */
if (ret == (struct elf32_cr16_link_hash_entry *) NULL)
ret = ((struct elf32_cr16_link_hash_entry *)
- bfd_hash_allocate (table,
- sizeof (struct elf32_cr16_link_hash_entry)));
+ bfd_hash_allocate (table,
+ sizeof (struct elf32_cr16_link_hash_entry)));
if (ret == (struct elf32_cr16_link_hash_entry *) NULL)
return (struct bfd_hash_entry *) ret;
/* Call the allocation method of the superclass. */
ret = ((struct elf32_cr16_link_hash_entry *)
- _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
- table, string));
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+ table, string));
if (ret != (struct elf32_cr16_link_hash_entry *) NULL)
{
ret->direct_calls = 0;
return NULL;
if (!_bfd_elf_link_hash_table_init (ret, abfd,
- elf32_cr16_link_hash_newfunc,
- sizeof (struct elf32_cr16_link_hash_entry),
+ elf32_cr16_link_hash_newfunc,
+ sizeof (struct elf32_cr16_link_hash_entry),
GENERIC_ELF_DATA))
{
free (ret);
static void
_bfd_cr16_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+ bfd_boolean linker ATTRIBUTE_UNUSED)
{
unsigned long val;
switch (bfd_get_mach (abfd))
{
default:
case bfd_mach_cr16:
- val = EM_CR16;
- break;
+ val = EM_CR16;
+ break;
}
_bfd_cr16_elf_object_p (bfd *abfd)
{
bfd_default_set_arch_mach (abfd, bfd_arch_cr16,
- elf_cr16_mach (elf_elfheader (abfd)->e_flags));
+ elf_cr16_mach (elf_elfheader (abfd)->e_flags));
return TRUE;
}
&& bfd_get_mach (obfd) < bfd_get_mach (ibfd))
{
if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd),
- bfd_get_mach (ibfd)))
- return FALSE;
+ bfd_get_mach (ibfd)))
+ return FALSE;
}
return TRUE;
There's quite a few relaxing opportunites available on the CR16:
- * bcond:24 -> bcond:16 1 byte
- * bcond:16 -> bcond:8 1 byte
- * arithmetic imm32 -> arithmetic imm20 12 bits
- * arithmetic imm20/imm16 -> arithmetic imm4 12/16 bits
+ * bcond:24 -> bcond:16 1 byte
+ * bcond:16 -> bcond:8 1 byte
+ * arithmetic imm32 -> arithmetic imm20 12 bits
+ * arithmetic imm20/imm16 -> arithmetic imm4 12/16 bits
Symbol- and reloc-reading infrastructure copied from elf-m10200.c. */
static bfd_boolean
elf32_cr16_relax_section (bfd *abfd, asection *sec,
- struct bfd_link_info *link_info, bfd_boolean *again)
+ struct bfd_link_info *link_info, bfd_boolean *again)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *internal_relocs;
/* Get a copy of the native relocations. */
internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
- link_info->keep_memory);
+ link_info->keep_memory);
if (internal_relocs == NULL)
goto error_return;
bfd_vma symval;
/* If this isn't something that can be relaxed, then ignore
- this reloc. */
+ this reloc. */
if (ELF32_R_TYPE (irel->r_info) != (int) R_CR16_DISP16
- && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_DISP24
- && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_IMM32
- && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_IMM20
- && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_IMM16)
- continue;
+ && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_DISP24
+ && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_IMM32
+ && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_IMM20
+ && ELF32_R_TYPE (irel->r_info) != (int) R_CR16_IMM16)
+ continue;
/* Get the section contents if we haven't done so already. */
if (contents == NULL)
- {
- /* Get cached copy if it exists. */
- if (elf_section_data (sec)->this_hdr.contents != NULL)
- contents = elf_section_data (sec)->this_hdr.contents;
- /* Go get them off disk. */
- else if (!bfd_malloc_and_get_section (abfd, sec, &contents))
- goto error_return;
- }
+ {
+ /* Get cached copy if it exists. */
+ if (elf_section_data (sec)->this_hdr.contents != NULL)
+ contents = elf_section_data (sec)->this_hdr.contents;
+ /* Go get them off disk. */
+ else if (!bfd_malloc_and_get_section (abfd, sec, &contents))
+ goto error_return;
+ }
/* Read this BFD's local symbols if we haven't done so already. */
if (isymbuf == NULL && symtab_hdr->sh_info != 0)
- {
- isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
- if (isymbuf == NULL)
- isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
- symtab_hdr->sh_info, 0,
- NULL, NULL, NULL);
- if (isymbuf == NULL)
- goto error_return;
- }
+ {
+ isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (isymbuf == NULL)
+ isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
+ symtab_hdr->sh_info, 0,
+ NULL, NULL, NULL);
+ if (isymbuf == NULL)
+ goto error_return;
+ }
/* Get the value of the symbol referred to by the reloc. */
if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
- {
- /* A local symbol. */
- Elf_Internal_Sym *isym;
- asection *sym_sec;
-
- isym = isymbuf + ELF32_R_SYM (irel->r_info);
- if (isym->st_shndx == SHN_UNDEF)
- sym_sec = bfd_und_section_ptr;
- else if (isym->st_shndx == SHN_ABS)
- sym_sec = bfd_abs_section_ptr;
- else if (isym->st_shndx == SHN_COMMON)
- sym_sec = bfd_com_section_ptr;
- else
- sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
- symval = (isym->st_value
- + sym_sec->output_section->vma
- + sym_sec->output_offset);
- }
+ {
+ /* A local symbol. */
+ Elf_Internal_Sym *isym;
+ asection *sym_sec;
+
+ isym = isymbuf + ELF32_R_SYM (irel->r_info);
+ if (isym->st_shndx == SHN_UNDEF)
+ sym_sec = bfd_und_section_ptr;
+ else if (isym->st_shndx == SHN_ABS)
+ sym_sec = bfd_abs_section_ptr;
+ else if (isym->st_shndx == SHN_COMMON)
+ sym_sec = bfd_com_section_ptr;
+ else
+ sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ symval = (isym->st_value
+ + sym_sec->output_section->vma
+ + sym_sec->output_offset);
+ }
else
- {
- unsigned long indx;
- struct elf_link_hash_entry *h;
-
- /* An external symbol. */
- indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
- h = elf_sym_hashes (abfd)[indx];
- BFD_ASSERT (h != NULL);
-
- if (h->root.type != bfd_link_hash_defined
- && h->root.type != bfd_link_hash_defweak)
- /* This appears to be a reference to an undefined
- symbol. Just ignore it--it will be caught by the
- regular reloc processing. */
- continue;
-
- symval = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
- }
+ {
+ unsigned long indx;
+ struct elf_link_hash_entry *h;
+
+ /* An external symbol. */
+ indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ BFD_ASSERT (h != NULL);
+
+ if (h->root.type != bfd_link_hash_defined
+ && h->root.type != bfd_link_hash_defweak)
+ /* This appears to be a reference to an undefined
+ symbol. Just ignore it--it will be caught by the
+ regular reloc processing. */
+ continue;
+
+ symval = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
/* For simplicity of coding, we are going to modify the section
- contents, the section relocs, and the BFD symbol table. We
- must tell the rest of the code not to free up this
- information. It would be possible to instead create a table
- of changes which have to be made, as is done in coff-mips.c;
- that would be more work, but would require less memory when
- the linker is run. */
+ contents, the section relocs, and the BFD symbol table. We
+ must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
/* Try to turn a 24 branch/call into a 16bit relative
- branch/call. */
+ branch/call. */
if (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_DISP24)
- {
- bfd_vma value = symval;
-
- /* Deal with pc-relative gunk. */
- value -= (sec->output_section->vma + sec->output_offset);
- value -= irel->r_offset;
- value += irel->r_addend;
-
- /* See if the value will fit in 16 bits, note the high value is
- 0xfffe + 2 as the target will be two bytes closer if we are
- able to relax. */
- if ((long) value < 0x10000 && (long) value > -0x10002)
- {
- unsigned int code;
-
- /* Get the opcode. */
- code = (unsigned int) bfd_get_32 (abfd, contents + irel->r_offset);
-
- /* Verify it's a 'bcond' and fix the opcode. */
- if ((code & 0xffff) == 0x0010)
- bfd_put_16 (abfd, 0x1800 | ((0xf & (code >> 20)) << 4), contents + irel->r_offset);
- else
- continue;
-
- /* Note that we've changed the relocs, section contents, etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- elf_section_data (sec)->this_hdr.contents = contents;
- symtab_hdr->contents = (unsigned char *) isymbuf;
-
- /* Fix the relocation's type. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_CR16_DISP16);
-
- /* Delete two bytes of data. */
- if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec,
- irel->r_offset + 2, 2))
- goto error_return;
-
- /* That will change things, so, we should relax again.
- Note that this is not required, and it may be slow. */
- *again = TRUE;
- }
- }
+ {
+ bfd_vma value = symval;
+
+ /* Deal with pc-relative gunk. */
+ value -= (sec->output_section->vma + sec->output_offset);
+ value -= irel->r_offset;
+ value += irel->r_addend;
+
+ /* See if the value will fit in 16 bits, note the high value is
+ 0xfffe + 2 as the target will be two bytes closer if we are
+ able to relax. */
+ if ((long) value < 0x10000 && (long) value > -0x10002)
+ {
+ unsigned int code;
+
+ /* Get the opcode. */
+ code = (unsigned int) bfd_get_32 (abfd, contents + irel->r_offset);
+
+ /* Verify it's a 'bcond' and fix the opcode. */
+ if ((code & 0xffff) == 0x0010)
+ bfd_put_16 (abfd, 0x1800 | ((0xf & (code >> 20)) << 4), contents + irel->r_offset);
+ else
+ continue;
+
+ /* Note that we've changed the relocs, section contents, etc. */
+ elf_section_data (sec)->relocs = internal_relocs;
+ elf_section_data (sec)->this_hdr.contents = contents;
+ symtab_hdr->contents = (unsigned char *) isymbuf;
+
+ /* Fix the relocation's type. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_CR16_DISP16);
+
+ /* Delete two bytes of data. */
+ if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec,
+ irel->r_offset + 2, 2))
+ goto error_return;
+
+ /* That will change things, so, we should relax again.
+ Note that this is not required, and it may be slow. */
+ *again = TRUE;
+ }
+ }
/* Try to turn a 16bit pc-relative branch into an
- 8bit pc-relative branch. */
+ 8bit pc-relative branch. */
if (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_DISP16)
- {
- bfd_vma value = symval;
-
- /* Deal with pc-relative gunk. */
- value -= (sec->output_section->vma + sec->output_offset);
- value -= irel->r_offset;
- value += irel->r_addend;
-
- /* See if the value will fit in 8 bits, note the high value is
- 0xfc + 2 as the target will be two bytes closer if we are
- able to relax. */
- /*if ((long) value < 0x1fa && (long) value > -0x100) REVISIT:range */
- if ((long) value < 0xfa && (long) value > -0x100)
- {
- unsigned short code;
-
- /* Get the opcode. */
- code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
-
- /* Verify it's a 'bcond' and fix the opcode. */
- if ((code & 0xff0f) == 0x1800)
- bfd_put_16 (abfd, (code & 0xf0f0), contents + irel->r_offset);
- else
- continue;
-
- /* Note that we've changed the relocs, section contents, etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- elf_section_data (sec)->this_hdr.contents = contents;
- symtab_hdr->contents = (unsigned char *) isymbuf;
-
- /* Fix the relocation's type. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_CR16_DISP8);
-
- /* Delete two bytes of data. */
- if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec,
- irel->r_offset + 2, 2))
- goto error_return;
-
- /* That will change things, so, we should relax again.
- Note that this is not required, and it may be slow. */
- *again = TRUE;
- }
- }
+ {
+ bfd_vma value = symval;
+
+ /* Deal with pc-relative gunk. */
+ value -= (sec->output_section->vma + sec->output_offset);
+ value -= irel->r_offset;
+ value += irel->r_addend;
+
+ /* See if the value will fit in 8 bits, note the high value is
+ 0xfc + 2 as the target will be two bytes closer if we are
+ able to relax. */
+ /*if ((long) value < 0x1fa && (long) value > -0x100) REVISIT:range */
+ if ((long) value < 0xfa && (long) value > -0x100)
+ {
+ unsigned short code;
+
+ /* Get the opcode. */
+ code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
+
+ /* Verify it's a 'bcond' and fix the opcode. */
+ if ((code & 0xff0f) == 0x1800)
+ bfd_put_16 (abfd, (code & 0xf0f0), contents + irel->r_offset);
+ else
+ continue;
+
+ /* Note that we've changed the relocs, section contents, etc. */
+ elf_section_data (sec)->relocs = internal_relocs;
+ elf_section_data (sec)->this_hdr.contents = contents;
+ symtab_hdr->contents = (unsigned char *) isymbuf;
+
+ /* Fix the relocation's type. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_CR16_DISP8);
+
+ /* Delete two bytes of data. */
+ if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec,
+ irel->r_offset + 2, 2))
+ goto error_return;
+
+ /* That will change things, so, we should relax again.
+ Note that this is not required, and it may be slow. */
+ *again = TRUE;
+ }
+ }
/* Try to turn a 32-bit IMM address into a 20/16-bit IMM address */
if (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM32)
- {
- bfd_vma value = symval;
- unsigned short is_add_mov = 0;
- bfd_vma value1 = 0;
-
- /* Get the existing value from the mcode */
- value1 = ((bfd_get_32 (abfd, contents + irel->r_offset + 2) >> 16)
- |(((bfd_get_32 (abfd, contents + irel->r_offset + 2) & 0xffff) << 16)));
-
- /* See if the value will fit in 20 bits. */
- if ((long) (value + value1) < 0xfffff && (long) (value + value1) > 0)
- {
- unsigned short code;
-
- /* Get the opcode. */
- code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
-
- /* Verify it's a 'arithmetic ADDD or MOVD instruction'.
- For ADDD and MOVD only, convert to IMM32 -> IMM20. */
-
- if (((code & 0xfff0) == 0x0070) || ((code & 0xfff0) == 0x0020))
- is_add_mov = 1;
-
- if (is_add_mov)
- {
- /* Note that we've changed the relocs, section contents,
- etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- elf_section_data (sec)->this_hdr.contents = contents;
- symtab_hdr->contents = (unsigned char *) isymbuf;
-
- /* Fix the opcode. */
- if ((code & 0xfff0) == 0x0070) /* For movd. */
- bfd_put_8 (abfd, 0x05, contents + irel->r_offset + 1);
- else /* code == 0x0020 for addd. */
- bfd_put_8 (abfd, 0x04, contents + irel->r_offset + 1);
-
- bfd_put_8 (abfd, (code & 0xf) << 4, contents + irel->r_offset);
-
- /* If existing value is nagavive adjust approriately
- place the 16-20bits (ie 4 bit) in new opcode,
- as the 0xffffxxxx, the higher 2 byte values removed. */
- if (value1 & 0x80000000)
- bfd_put_8 (abfd, (0x0f | (bfd_get_8(abfd, contents + irel->r_offset))), contents + irel->r_offset);
- else
- bfd_put_8 (abfd, (((value1 >> 16)&0xf) | (bfd_get_8(abfd, contents + irel->r_offset))), contents + irel->r_offset);
-
- /* Fix the relocation's type. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_CR16_IMM20);
-
- /* Delete two bytes of data. */
- if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec,
- irel->r_offset + 2, 2))
- goto error_return;
-
- /* That will change things, so, we should relax again.
- Note that this is not required, and it may be slow. */
- *again = TRUE;
- }
- }
-
- /* See if the value will fit in 16 bits. */
- if ((!is_add_mov)
- && ((long)(value + value1) < 0x7fff && (long)(value + value1) > 0))
- {
- unsigned short code;
-
- /* Get the opcode. */
- code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
-
- /* Note that we've changed the relocs, section contents, etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- elf_section_data (sec)->this_hdr.contents = contents;
- symtab_hdr->contents = (unsigned char *) isymbuf;
-
- /* Fix the opcode. */
- if ((code & 0xf0) == 0x70) /* For movd. */
- bfd_put_8 (abfd, 0x54, contents + irel->r_offset + 1);
- else if ((code & 0xf0) == 0x20) /* For addd. */
- bfd_put_8 (abfd, 0x60, contents + irel->r_offset + 1);
- else if ((code & 0xf0) == 0x90) /* For cmpd. */
- bfd_put_8 (abfd, 0x56, contents + irel->r_offset + 1);
- else
- continue;
-
- bfd_put_8 (abfd, 0xb0 | (code & 0xf), contents + irel->r_offset);
-
- /* If existing value is nagavive adjust approriately
- place the 12-16bits (ie 4 bit) in new opcode,
- as the 0xfffffxxx, the higher 2 byte values removed. */
- if (value1 & 0x80000000)
- bfd_put_8 (abfd, (0x0f | (bfd_get_8(abfd, contents + irel->r_offset))), contents + irel->r_offset);
- else
- bfd_put_16 (abfd, value1, contents + irel->r_offset + 2);
-
-
- /* Fix the relocation's type. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_CR16_IMM16);
-
- /* Delete two bytes of data. */
- if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec,
- irel->r_offset + 2, 2))
- goto error_return;
-
- /* That will change things, so, we should relax again.
- Note that this is not required, and it may be slow. */
- *again = TRUE;
- }
- }
+ {
+ bfd_vma value = symval;
+ unsigned short is_add_mov = 0;
+ bfd_vma value1 = 0;
+
+ /* Get the existing value from the mcode */
+ value1 = ((bfd_get_32 (abfd, contents + irel->r_offset + 2) >> 16)
+ |(((bfd_get_32 (abfd, contents + irel->r_offset + 2) & 0xffff) << 16)));
+
+ /* See if the value will fit in 20 bits. */
+ if ((long) (value + value1) < 0xfffff && (long) (value + value1) > 0)
+ {
+ unsigned short code;
+
+ /* Get the opcode. */
+ code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
+
+ /* Verify it's a 'arithmetic ADDD or MOVD instruction'.
+ For ADDD and MOVD only, convert to IMM32 -> IMM20. */
+
+ if (((code & 0xfff0) == 0x0070) || ((code & 0xfff0) == 0x0020))
+ is_add_mov = 1;
+
+ if (is_add_mov)
+ {
+ /* Note that we've changed the relocs, section contents,
+ etc. */
+ elf_section_data (sec)->relocs = internal_relocs;
+ elf_section_data (sec)->this_hdr.contents = contents;
+ symtab_hdr->contents = (unsigned char *) isymbuf;
+
+ /* Fix the opcode. */
+ if ((code & 0xfff0) == 0x0070) /* For movd. */
+ bfd_put_8 (abfd, 0x05, contents + irel->r_offset + 1);
+ else /* code == 0x0020 for addd. */
+ bfd_put_8 (abfd, 0x04, contents + irel->r_offset + 1);
+
+ bfd_put_8 (abfd, (code & 0xf) << 4, contents + irel->r_offset);
+
+ /* If existing value is nagavive adjust approriately
+ place the 16-20bits (ie 4 bit) in new opcode,
+ as the 0xffffxxxx, the higher 2 byte values removed. */
+ if (value1 & 0x80000000)
+ bfd_put_8 (abfd, (0x0f | (bfd_get_8(abfd, contents + irel->r_offset))), contents + irel->r_offset);
+ else
+ bfd_put_8 (abfd, (((value1 >> 16)&0xf) | (bfd_get_8(abfd, contents + irel->r_offset))), contents + irel->r_offset);
+
+ /* Fix the relocation's type. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_CR16_IMM20);
+
+ /* Delete two bytes of data. */
+ if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec,
+ irel->r_offset + 2, 2))
+ goto error_return;
+
+ /* That will change things, so, we should relax again.
+ Note that this is not required, and it may be slow. */
+ *again = TRUE;
+ }
+ }
+
+ /* See if the value will fit in 16 bits. */
+ if ((!is_add_mov)
+ && ((long)(value + value1) < 0x7fff && (long)(value + value1) > 0))
+ {
+ unsigned short code;
+
+ /* Get the opcode. */
+ code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
+
+ /* Note that we've changed the relocs, section contents, etc. */
+ elf_section_data (sec)->relocs = internal_relocs;
+ elf_section_data (sec)->this_hdr.contents = contents;
+ symtab_hdr->contents = (unsigned char *) isymbuf;
+
+ /* Fix the opcode. */
+ if ((code & 0xf0) == 0x70) /* For movd. */
+ bfd_put_8 (abfd, 0x54, contents + irel->r_offset + 1);
+ else if ((code & 0xf0) == 0x20) /* For addd. */
+ bfd_put_8 (abfd, 0x60, contents + irel->r_offset + 1);
+ else if ((code & 0xf0) == 0x90) /* For cmpd. */
+ bfd_put_8 (abfd, 0x56, contents + irel->r_offset + 1);
+ else
+ continue;
+
+ bfd_put_8 (abfd, 0xb0 | (code & 0xf), contents + irel->r_offset);
+
+ /* If existing value is nagavive adjust approriately
+ place the 12-16bits (ie 4 bit) in new opcode,
+ as the 0xfffffxxx, the higher 2 byte values removed. */
+ if (value1 & 0x80000000)
+ bfd_put_8 (abfd, (0x0f | (bfd_get_8(abfd, contents + irel->r_offset))), contents + irel->r_offset);
+ else
+ bfd_put_16 (abfd, value1, contents + irel->r_offset + 2);
+
+
+ /* Fix the relocation's type. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_CR16_IMM16);
+
+ /* Delete two bytes of data. */
+ if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec,
+ irel->r_offset + 2, 2))
+ goto error_return;
+
+ /* That will change things, so, we should relax again.
+ Note that this is not required, and it may be slow. */
+ *again = TRUE;
+ }
+ }
#if 0
/* Try to turn a 16bit immediate address into a 4bit
- immediate address. */
+ immediate address. */
if ((ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM20)
- || (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM16))
- {
- bfd_vma value = symval;
- bfd_vma value1 = 0;
-
- /* Get the existing value from the mcode */
- value1 = ((bfd_get_16 (abfd, contents + irel->r_offset + 2) & 0xffff));
-
- if (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM20)
- {
- value1 |= ((bfd_get_16 (abfd, contents + irel->r_offset + 1) & 0xf000) << 0x4);
- }
-
- /* See if the value will fit in 4 bits. */
- if ((((long) (value + value1)) < 0xf)
- && (((long) (value + value1)) > 0))
- {
- unsigned short code;
-
- /* Get the opcode. */
- code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
-
- /* Note that we've changed the relocs, section contents, etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- elf_section_data (sec)->this_hdr.contents = contents;
- symtab_hdr->contents = (unsigned char *) isymbuf;
-
- /* Fix the opcode. */
- if (((code & 0x0f00) == 0x0400) || ((code & 0x0f00) == 0x0500))
- {
- if ((code & 0x0f00) == 0x0400) /* For movd imm20. */
- bfd_put_8 (abfd, 0x60, contents + irel->r_offset);
- else /* For addd imm20. */
- bfd_put_8 (abfd, 0x54, contents + irel->r_offset);
- bfd_put_8 (abfd, (code & 0xf0) >> 4, contents + irel->r_offset + 1);
- }
- else
- {
- if ((code & 0xfff0) == 0x56b0) /* For cmpd imm16. */
- bfd_put_8 (abfd, 0x56, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x54b0) /* For movd imm16. */
- bfd_put_8 (abfd, 0x54, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x58b0) /* For movb imm16. */
- bfd_put_8 (abfd, 0x58, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x5Ab0) /* For movw imm16. */
- bfd_put_8 (abfd, 0x5A, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x60b0) /* For addd imm16. */
- bfd_put_8 (abfd, 0x60, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x30b0) /* For addb imm16. */
- bfd_put_8 (abfd, 0x30, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x2Cb0) /* For addub imm16. */
- bfd_put_8 (abfd, 0x2C, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x32b0) /* For adduw imm16. */
- bfd_put_8 (abfd, 0x32, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x38b0) /* For subb imm16. */
- bfd_put_8 (abfd, 0x38, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x3Cb0) /* For subcb imm16. */
- bfd_put_8 (abfd, 0x3C, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x3Fb0) /* For subcw imm16. */
- bfd_put_8 (abfd, 0x3F, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x3Ab0) /* For subw imm16. */
- bfd_put_8 (abfd, 0x3A, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x50b0) /* For cmpb imm16. */
- bfd_put_8 (abfd, 0x50, contents + irel->r_offset);
- else if ((code & 0xfff0) == 0x52b0) /* For cmpw imm16. */
- bfd_put_8 (abfd, 0x52, contents + irel->r_offset);
- else
- continue;
-
- bfd_put_8 (abfd, (code & 0xf), contents + irel->r_offset + 1);
- }
-
- /* Fix the relocation's type. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_CR16_IMM4);
-
- /* Delete two bytes of data. */
- if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec,
- irel->r_offset + 2, 2))
- goto error_return;
-
- /* That will change things, so, we should relax again.
- Note that this is not required, and it may be slow. */
- *again = TRUE;
- }
- }
+ || (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM16))
+ {
+ bfd_vma value = symval;
+ bfd_vma value1 = 0;
+
+ /* Get the existing value from the mcode */
+ value1 = ((bfd_get_16 (abfd, contents + irel->r_offset + 2) & 0xffff));
+
+ if (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_IMM20)
+ {
+ value1 |= ((bfd_get_16 (abfd, contents + irel->r_offset + 1) & 0xf000) << 0x4);
+ }
+
+ /* See if the value will fit in 4 bits. */
+ if ((((long) (value + value1)) < 0xf)
+ && (((long) (value + value1)) > 0))
+ {
+ unsigned short code;
+
+ /* Get the opcode. */
+ code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
+
+ /* Note that we've changed the relocs, section contents, etc. */
+ elf_section_data (sec)->relocs = internal_relocs;
+ elf_section_data (sec)->this_hdr.contents = contents;
+ symtab_hdr->contents = (unsigned char *) isymbuf;
+
+ /* Fix the opcode. */
+ if (((code & 0x0f00) == 0x0400) || ((code & 0x0f00) == 0x0500))
+ {
+ if ((code & 0x0f00) == 0x0400) /* For movd imm20. */
+ bfd_put_8 (abfd, 0x60, contents + irel->r_offset);
+ else /* For addd imm20. */
+ bfd_put_8 (abfd, 0x54, contents + irel->r_offset);
+ bfd_put_8 (abfd, (code & 0xf0) >> 4, contents + irel->r_offset + 1);
+ }
+ else
+ {
+ if ((code & 0xfff0) == 0x56b0) /* For cmpd imm16. */
+ bfd_put_8 (abfd, 0x56, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x54b0) /* For movd imm16. */
+ bfd_put_8 (abfd, 0x54, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x58b0) /* For movb imm16. */
+ bfd_put_8 (abfd, 0x58, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x5Ab0) /* For movw imm16. */
+ bfd_put_8 (abfd, 0x5A, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x60b0) /* For addd imm16. */
+ bfd_put_8 (abfd, 0x60, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x30b0) /* For addb imm16. */
+ bfd_put_8 (abfd, 0x30, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x2Cb0) /* For addub imm16. */
+ bfd_put_8 (abfd, 0x2C, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x32b0) /* For adduw imm16. */
+ bfd_put_8 (abfd, 0x32, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x38b0) /* For subb imm16. */
+ bfd_put_8 (abfd, 0x38, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x3Cb0) /* For subcb imm16. */
+ bfd_put_8 (abfd, 0x3C, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x3Fb0) /* For subcw imm16. */
+ bfd_put_8 (abfd, 0x3F, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x3Ab0) /* For subw imm16. */
+ bfd_put_8 (abfd, 0x3A, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x50b0) /* For cmpb imm16. */
+ bfd_put_8 (abfd, 0x50, contents + irel->r_offset);
+ else if ((code & 0xfff0) == 0x52b0) /* For cmpw imm16. */
+ bfd_put_8 (abfd, 0x52, contents + irel->r_offset);
+ else
+ continue;
+
+ bfd_put_8 (abfd, (code & 0xf), contents + irel->r_offset + 1);
+ }
+
+ /* Fix the relocation's type. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_CR16_IMM4);
+
+ /* Delete two bytes of data. */
+ if (!elf32_cr16_relax_delete_bytes (link_info, abfd, sec,
+ irel->r_offset + 2, 2))
+ goto error_return;
+
+ /* That will change things, so, we should relax again.
+ Note that this is not required, and it may be slow. */
+ *again = TRUE;
+ }
+ }
#endif
}
&& symtab_hdr->contents != (unsigned char *) isymbuf)
{
if (! link_info->keep_memory)
- free (isymbuf);
+ free (isymbuf);
else
/* Cache the symbols for elf_link_input_bfd. */
symtab_hdr->contents = (unsigned char *) isymbuf;
&& elf_section_data (sec)->this_hdr.contents != contents)
{
if (! link_info->keep_memory)
- free (contents);
+ free (contents);
else
/* Cache the section contents for elf_link_input_bfd. */
elf_section_data (sec)->this_hdr.contents = contents;
static asection *
elf32_cr16_gc_mark_hook (asection *sec,
- struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct bfd_link_info *info,
+ Elf_Internal_Rela *rel,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
}
.rel[a].bss sections. */
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
- | SEC_LINKER_CREATED);
+ | SEC_LINKER_CREATED);
s = bfd_make_section_anyway_with_flags (abfd,
(bed->default_use_rela_p
if (bed->want_dynbss)
{
/* The .dynbss section is a place to put symbols which are defined
- by dynamic objects, are referenced by regular objects, and are
- not functions. We must allocate space for them in the process
- image and use a R_*_COPY reloc to tell the dynamic linker to
- initialize them at run time. The linker script puts the .dynbss
- section into the .bss section of the final image. */
+ by dynamic objects, are referenced by regular objects, and are
+ not functions. We must allocate space for them in the process
+ image and use a R_*_COPY reloc to tell the dynamic linker to
+ initialize them at run time. The linker script puts the .dynbss
+ section into the .bss section of the final image. */
s = bfd_make_section_anyway_with_flags (abfd, ".dynbss",
SEC_ALLOC | SEC_LINKER_CREATED);
if (s == NULL)
- return FALSE;
+ return FALSE;
/* The .rel[a].bss section holds copy relocs. This section is not
- normally needed. We need to create it here, though, so that the
- linker will map it to an output section. We can't just create it
- only if we need it, because we will not know whether we need it
- until we have seen all the input files, and the first time the
- main linker code calls BFD after examining all the input files
- (size_dynamic_sections) the input sections have already been
- mapped to the output sections. If the section turns out not to
- be needed, we can discard it later. We will never need this
- section when generating a shared object, since they do not use
- copy relocs. */
+ normally needed. We need to create it here, though, so that the
+ linker will map it to an output section. We can't just create it
+ only if we need it, because we will not know whether we need it
+ until we have seen all the input files, and the first time the
+ main linker code calls BFD after examining all the input files
+ (size_dynamic_sections) the input sections have already been
+ mapped to the output sections. If the section turns out not to
+ be needed, we can discard it later. We will never need this
+ section when generating a shared object, since they do not use
+ copy relocs. */
if (! bfd_link_executable (info))
- {
- s = bfd_make_section_anyway_with_flags (abfd,
+ {
+ s = bfd_make_section_anyway_with_flags (abfd,
(bed->default_use_rela_p
? ".rela.bss" : ".rel.bss"),
flags | SEC_READONLY);
- if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
- return FALSE;
- }
+ if (s == NULL
+ || ! bfd_set_section_alignment (abfd, s, ptralign))
+ return FALSE;
+ }
}
return TRUE;
static bfd_boolean
_bfd_cr16_elf_adjust_dynamic_symbol (struct bfd_link_info * info,
- struct elf_link_hash_entry * h)
+ struct elf_link_hash_entry * h)
{
bfd * dynobj;
asection * s;
/* Make sure we know what is going on here. */
BFD_ASSERT (dynobj != NULL
- && (h->needs_plt
- || h->is_weakalias
- || (h->def_dynamic
- && h->ref_regular
- && !h->def_regular)));
+ && (h->needs_plt
+ || h->is_weakalias
+ || (h->def_dynamic
+ && h->ref_regular
+ && !h->def_regular)));
/* If this is a function, put it in the procedure linkage table. We
will fill in the contents of the procedure linkage table later,
|| h->needs_plt)
{
if (! bfd_link_executable (info)
- && !h->def_dynamic
- && !h->ref_dynamic)
- {
- /* This case can occur if we saw a PLT reloc in an input
- file, but the symbol was never referred to by a dynamic
- object. In such a case, we don't actually need to build
- a procedure linkage table, and we can just do a REL32
- reloc instead. */
- BFD_ASSERT (h->needs_plt);
- return TRUE;
- }
+ && !h->def_dynamic
+ && !h->ref_dynamic)
+ {
+ /* This case can occur if we saw a PLT reloc in an input
+ file, but the symbol was never referred to by a dynamic
+ object. In such a case, we don't actually need to build
+ a procedure linkage table, and we can just do a REL32
+ reloc instead. */
+ BFD_ASSERT (h->needs_plt);
+ return TRUE;
+ }
/* Make sure this symbol is output as a dynamic symbol. */
if (h->dynindx == -1)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
/* We also need to make an entry in the .got.plt section, which
- will be placed in the .got section by the linker script. */
+ will be placed in the .got section by the linker script. */
s = elf_hash_table (info)->sgotplt;
BFD_ASSERT (s != NULL);
static bfd_boolean
_bfd_cr16_elf_size_dynamic_sections (bfd * output_bfd,
- struct bfd_link_info * info)
+ struct bfd_link_info * info)
{
bfd * dynobj;
asection * s;
{
/* Set the contents of the .interp section to the interpreter. */
if (bfd_link_executable (info) && !info->nointerp)
- {
+ {
#if 0
- s = bfd_get_linker_section (dynobj, ".interp");
- BFD_ASSERT (s != NULL);
- s->size = sizeof ELF_DYNAMIC_INTERPRETER;
- s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+ s = bfd_get_linker_section (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->size = sizeof ELF_DYNAMIC_INTERPRETER;
+ s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
#endif
- }
+ }
}
else
{
/* We may have created entries in the .rela.got section.
- However, if we are not creating the dynamic sections, we will
- not actually use these entries. Reset the size of .rela.got,
- which will cause it to get stripped from the output file
- below. */
+ However, if we are not creating the dynamic sections, we will
+ not actually use these entries. Reset the size of .rela.got,
+ which will cause it to get stripped from the output file
+ below. */
s = elf_hash_table (info)->srelgot;
if (s != NULL)
- s->size = 0;
+ s->size = 0;
}
/* The check_relocs and adjust_dynamic_symbol entry points have
const char * name;
if ((s->flags & SEC_LINKER_CREATED) == 0)
- continue;
+ continue;
/* It's OK to base decisions on the section name, because none
- of the dynobj section names depend upon the input files. */
+ of the dynobj section names depend upon the input files. */
name = bfd_get_section_name (dynobj, s);
if (strcmp (name, ".plt") == 0)
- {
- /* Remember whether there is a PLT. */
- plt = s->size != 0;
- }
+ {
+ /* Remember whether there is a PLT. */
+ plt = s->size != 0;
+ }
else if (CONST_STRNEQ (name, ".rela"))
- {
- if (s->size != 0)
- {
- asection * target;
-
- /* Remember whether there are any reloc sections other
- than .rela.plt. */
- if (strcmp (name, ".rela.plt") != 0)
- {
- const char * outname;
-
- relocs = TRUE;
-
- /* If this relocation section applies to a read only
- section, then we probably need a DT_TEXTREL
- entry. The entries in the .rela.plt section
- really apply to the .got section, which we
- created ourselves and so know is not readonly. */
- outname = bfd_get_section_name (output_bfd,
- s->output_section);
- target = bfd_get_section_by_name (output_bfd, outname + 5);
- if (target != NULL
- && (target->flags & SEC_READONLY) != 0
- && (target->flags & SEC_ALLOC) != 0)
- reltext = TRUE;
- }
-
- /* We use the reloc_count field as a counter if we need
- to copy relocs into the output file. */
- s->reloc_count = 0;
- }
- }
+ {
+ if (s->size != 0)
+ {
+ asection * target;
+
+ /* Remember whether there are any reloc sections other
+ than .rela.plt. */
+ if (strcmp (name, ".rela.plt") != 0)
+ {
+ const char * outname;
+
+ relocs = TRUE;
+
+ /* If this relocation section applies to a read only
+ section, then we probably need a DT_TEXTREL
+ entry. The entries in the .rela.plt section
+ really apply to the .got section, which we
+ created ourselves and so know is not readonly. */
+ outname = bfd_get_section_name (output_bfd,
+ s->output_section);
+ target = bfd_get_section_by_name (output_bfd, outname + 5);
+ if (target != NULL
+ && (target->flags & SEC_READONLY) != 0
+ && (target->flags & SEC_ALLOC) != 0)
+ reltext = TRUE;
+ }
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ s->reloc_count = 0;
+ }
+ }
else if (! CONST_STRNEQ (name, ".got")
- && strcmp (name, ".dynbss") != 0)
- /* It's not one of our sections, so don't allocate space. */
- continue;
+ && strcmp (name, ".dynbss") != 0)
+ /* It's not one of our sections, so don't allocate space. */
+ continue;
if (s->size == 0)
- {
- /* If we don't need this section, strip it from the
- output file. This is mostly to handle .rela.bss and
- .rela.plt. We must create both sections in
- create_dynamic_sections, because they must be created
- before the linker maps input sections to output
- sections. The linker does that before
- adjust_dynamic_symbol is called, and it is that
- function which decides whether anything needs to go
- into these sections. */
- s->flags |= SEC_EXCLUDE;
- continue;
- }
-
- if ((s->flags & SEC_HAS_CONTENTS) == 0)
- continue;
+ {
+ /* If we don't need this section, strip it from the
+ output file. This is mostly to handle .rela.bss and
+ .rela.plt. We must create both sections in
+ create_dynamic_sections, because they must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
+ s->flags |= SEC_EXCLUDE;
+ continue;
+ }
+
+ if ((s->flags & SEC_HAS_CONTENTS) == 0)
+ continue;
/* Allocate memory for the section contents. We use bfd_zalloc
- here in case unused entries are not reclaimed before the
- section's contents are written out. This should not happen,
- but this way if it does, we get a R_CR16_NONE reloc
- instead of garbage. */
+ here in case unused entries are not reclaimed before the
+ section's contents are written out. This should not happen,
+ but this way if it does, we get a R_CR16_NONE reloc
+ instead of garbage. */
s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
if (s->contents == NULL)
- return FALSE;
+ return FALSE;
}
if (elf_hash_table (info)->dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
- values later, in _bfd_cr16_elf_finish_dynamic_sections,
- but we must add the entries now so that we get the correct
- size for the .dynamic section. The DT_DEBUG entry is filled
- in by the dynamic linker and used by the debugger. */
+ values later, in _bfd_cr16_elf_finish_dynamic_sections,
+ but we must add the entries now so that we get the correct
+ size for the .dynamic section. The DT_DEBUG entry is filled
+ in by the dynamic linker and used by the debugger. */
if (! bfd_link_executable (info))
- {
- if (!_bfd_elf_add_dynamic_entry (info, DT_DEBUG, 0))
- return FALSE;
- }
+ {
+ if (!_bfd_elf_add_dynamic_entry (info, DT_DEBUG, 0))
+ return FALSE;
+ }
if (plt)
- {
- if (!_bfd_elf_add_dynamic_entry (info, DT_PLTGOT, 0)
- || !_bfd_elf_add_dynamic_entry (info, DT_PLTRELSZ, 0)
- || !_bfd_elf_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
- || !_bfd_elf_add_dynamic_entry (info, DT_JMPREL, 0))
- return FALSE;
- }
+ {
+ if (!_bfd_elf_add_dynamic_entry (info, DT_PLTGOT, 0)
+ || !_bfd_elf_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+ || !_bfd_elf_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
+ || !_bfd_elf_add_dynamic_entry (info, DT_JMPREL, 0))
+ return FALSE;
+ }
if (relocs)
- {
- if (!_bfd_elf_add_dynamic_entry (info, DT_RELA, 0)
- || !_bfd_elf_add_dynamic_entry (info, DT_RELASZ, 0)
- || !_bfd_elf_add_dynamic_entry (info, DT_RELAENT,
- sizeof (Elf32_External_Rela)))
- return FALSE;
- }
+ {
+ if (!_bfd_elf_add_dynamic_entry (info, DT_RELA, 0)
+ || !_bfd_elf_add_dynamic_entry (info, DT_RELASZ, 0)
+ || !_bfd_elf_add_dynamic_entry (info, DT_RELAENT,
+ sizeof (Elf32_External_Rela)))
+ return FALSE;
+ }
if (reltext)
- {
- if (!_bfd_elf_add_dynamic_entry (info, DT_TEXTREL, 0))
- return FALSE;
- }
+ {
+ if (!_bfd_elf_add_dynamic_entry (info, DT_TEXTREL, 0))
+ return FALSE;
+ }
}
return TRUE;
static bfd_boolean
_bfd_cr16_elf_finish_dynamic_symbol (bfd * output_bfd,
- struct bfd_link_info * info,
- struct elf_link_hash_entry * h,
- Elf_Internal_Sym * sym)
+ struct bfd_link_info * info,
+ struct elf_link_hash_entry * h,
+ Elf_Internal_Sym * sym)
{
bfd * dynobj;
if (h->got.offset != (bfd_vma) -1)
{
- asection * sgot;
- asection * srel;
+ asection * sgot;
+ asection * srel;
Elf_Internal_Rela rel;
/* This symbol has an entry in the global offset table. Set it up. */
BFD_ASSERT (sgot != NULL && srel != NULL);
rel.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + (h->got.offset & ~1));
+ + sgot->output_offset
+ + (h->got.offset & ~1));
/* If this is a -Bsymbolic link, and the symbol is defined
- locally, we just want to emit a RELATIVE reloc. Likewise if
- the symbol was forced to be local because of a version file.
- The entry in the global offset table will already have been
- initialized in the relocate_section function. */
+ locally, we just want to emit a RELATIVE reloc. Likewise if
+ the symbol was forced to be local because of a version file.
+ The entry in the global offset table will already have been
+ initialized in the relocate_section function. */
if (bfd_link_executable (info)
- && (info->symbolic || h->dynindx == -1)
- && h->def_regular)
- {
- rel.r_info = ELF32_R_INFO (0, R_CR16_GOT_REGREL20);
- rel.r_addend = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
- }
+ && (info->symbolic || h->dynindx == -1)
+ && h->def_regular)
+ {
+ rel.r_info = ELF32_R_INFO (0, R_CR16_GOT_REGREL20);
+ rel.r_addend = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
else
- {
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
- rel.r_info = ELF32_R_INFO (h->dynindx, R_CR16_GOT_REGREL20);
- rel.r_addend = 0;
- }
+ {
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
+ rel.r_info = ELF32_R_INFO (h->dynindx, R_CR16_GOT_REGREL20);
+ rel.r_addend = 0;
+ }
bfd_elf32_swap_reloca_out (output_bfd, &rel,
- (bfd_byte *) ((Elf32_External_Rela *) srel->contents
- + srel->reloc_count));
+ (bfd_byte *) ((Elf32_External_Rela *) srel->contents
+ + srel->reloc_count));
++ srel->reloc_count;
}
if (h->needs_copy)
{
- asection * s;
+ asection * s;
Elf_Internal_Rela rel;
/* This symbol needs a copy reloc. Set it up. */
BFD_ASSERT (h->dynindx != -1
- && (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak));
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak));
s = bfd_get_linker_section (dynobj, ".rela.bss");
BFD_ASSERT (s != NULL);
rel.r_offset = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
rel.r_info = ELF32_R_INFO (h->dynindx, R_CR16_GOT_REGREL20);
rel.r_addend = 0;
bfd_elf32_swap_reloca_out (output_bfd, &rel,
- (bfd_byte *) ((Elf32_External_Rela *) s->contents
- + s->reloc_count));
+ (bfd_byte *) ((Elf32_External_Rela *) s->contents
+ + s->reloc_count));
++ s->reloc_count;
}
static bfd_boolean
_bfd_cr16_elf_finish_dynamic_sections (bfd * output_bfd,
- struct bfd_link_info * info)
+ struct bfd_link_info * info)
{
bfd * dynobj;
asection * sgot;
dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
for (; dyncon < dynconend; dyncon++)
- {
- Elf_Internal_Dyn dyn;
- asection * s;
-
- bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
-
- switch (dyn.d_tag)
- {
- default:
- break;
-
- case DT_PLTGOT:
- s = elf_hash_table (info)->sgotplt;
- goto get_vma;
-
- case DT_JMPREL:
- s = elf_hash_table (info)->srelplt;
- get_vma:
- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- break;
-
- case DT_PLTRELSZ:
- s = elf_hash_table (info)->srelplt;
- dyn.d_un.d_val = s->size;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- break;
- }
- }
+ {
+ Elf_Internal_Dyn dyn;
+ asection * s;
+
+ bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+
+ switch (dyn.d_tag)
+ {
+ default:
+ break;
+
+ case DT_PLTGOT:
+ s = elf_hash_table (info)->sgotplt;
+ goto get_vma;
+
+ case DT_JMPREL:
+ s = elf_hash_table (info)->srelplt;
+ get_vma:
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_PLTRELSZ:
+ s = elf_hash_table (info)->srelplt;
+ dyn.d_un.d_val = s->size;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+ }
+ }
}
if (sgot->size > 0)
{
if (sdyn == NULL)
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
else
- bfd_put_32 (output_bfd,
- sdyn->output_section->vma + sdyn->output_offset,
- sgot->contents);
+ bfd_put_32 (output_bfd,
+ sdyn->output_section->vma + sdyn->output_offset,
+ sgot->contents);
}
elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
bfd_boolean
bfd_cr16_elf32_create_embedded_relocs (bfd *abfd,
- struct bfd_link_info *info,
- asection *datasec,
- asection *relsec,
- char **errmsg)
+ struct bfd_link_info *info,
+ asection *datasec,
+ asection *relsec,
+ char **errmsg)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Sym *isymbuf = NULL;
/* Get a copy of the native relocations. */
internal_relocs = (_bfd_elf_link_read_relocs
- (abfd, datasec, NULL, NULL, info->keep_memory));
+ (abfd, datasec, NULL, NULL, info->keep_memory));
if (internal_relocs == NULL)
goto error_return;
/* We can only relocate absolute longword relocs at run time. */
if (!((ELF32_R_TYPE (irel->r_info) == (int) R_CR16_NUM32a)
- || (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_NUM32)))
- {
- *errmsg = _("unsupported reloc type");
- bfd_set_error (bfd_error_bad_value);
- goto error_return;
- }
+ || (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_NUM32)))
+ {
+ *errmsg = _("unsupported reloc type");
+ bfd_set_error (bfd_error_bad_value);
+ goto error_return;
+ }
/* Get the target section referred to by the reloc. */
if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
- {
- /* A local symbol. */
- Elf_Internal_Sym *isym;
-
- /* Read this BFD's local symbols if we haven't done so already. */
- if (isymbuf == NULL)
- {
- isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
- if (isymbuf == NULL)
- isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
- symtab_hdr->sh_info, 0,
- NULL, NULL, NULL);
- if (isymbuf == NULL)
- goto error_return;
- }
-
- isym = isymbuf + ELF32_R_SYM (irel->r_info);
- targetsec = bfd_section_from_elf_index (abfd, isym->st_shndx);
- }
+ {
+ /* A local symbol. */
+ Elf_Internal_Sym *isym;
+
+ /* Read this BFD's local symbols if we haven't done so already. */
+ if (isymbuf == NULL)
+ {
+ isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+ if (isymbuf == NULL)
+ isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
+ symtab_hdr->sh_info, 0,
+ NULL, NULL, NULL);
+ if (isymbuf == NULL)
+ goto error_return;
+ }
+
+ isym = isymbuf + ELF32_R_SYM (irel->r_info);
+ targetsec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ }
else
- {
- unsigned long indx;
- struct elf_link_hash_entry *h;
-
- /* An external symbol. */
- indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
- h = elf_sym_hashes (abfd)[indx];
- BFD_ASSERT (h != NULL);
- if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
- targetsec = h->root.u.def.section;
- else
- targetsec = NULL;
- }
+ {
+ unsigned long indx;
+ struct elf_link_hash_entry *h;
+
+ /* An external symbol. */
+ indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+ h = elf_sym_hashes (abfd)[indx];
+ BFD_ASSERT (h != NULL);
+ if (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ targetsec = h->root.u.def.section;
+ else
+ targetsec = NULL;
+ }
bfd_put_32 (abfd, irel->r_offset + datasec->output_offset, p);
memset (p + 4, 0, 4);
if ((ELF32_R_TYPE (irel->r_info) == (int) R_CR16_NUM32a)
- && (targetsec != NULL) )
- strncpy ((char *) p + 4, targetsec->output_section->name, 4);
+ && (targetsec != NULL) )
+ strncpy ((char *) p + 4, targetsec->output_section->name, 4);
}
if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf)
}
/* Definitions for setting CR16 target vector. */
-#define TARGET_LITTLE_SYM cr16_elf32_vec
-#define TARGET_LITTLE_NAME "elf32-cr16"
-#define ELF_ARCH bfd_arch_cr16
-#define ELF_MACHINE_CODE EM_CR16
-#define ELF_MACHINE_ALT1 EM_CR16_OLD
-#define ELF_MAXPAGESIZE 0x1
-#define elf_symbol_leading_char '_'
-
-#define bfd_elf32_bfd_reloc_type_lookup elf_cr16_reloc_type_lookup
-#define bfd_elf32_bfd_reloc_name_lookup elf_cr16_reloc_name_lookup
-#define elf_info_to_howto elf_cr16_info_to_howto
-#define elf_info_to_howto_rel 0
-#define elf_backend_relocate_section elf32_cr16_relocate_section
-#define bfd_elf32_bfd_relax_section elf32_cr16_relax_section
+#define TARGET_LITTLE_SYM cr16_elf32_vec
+#define TARGET_LITTLE_NAME "elf32-cr16"
+#define ELF_ARCH bfd_arch_cr16
+#define ELF_MACHINE_CODE EM_CR16
+#define ELF_MACHINE_ALT1 EM_CR16_OLD
+#define ELF_MAXPAGESIZE 0x1
+#define elf_symbol_leading_char '_'
+
+#define bfd_elf32_bfd_reloc_type_lookup elf_cr16_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup elf_cr16_reloc_name_lookup
+#define elf_info_to_howto elf_cr16_info_to_howto
+#define elf_info_to_howto_rel 0
+#define elf_backend_relocate_section elf32_cr16_relocate_section
+#define bfd_elf32_bfd_relax_section elf32_cr16_relax_section
#define bfd_elf32_bfd_get_relocated_section_contents \
- elf32_cr16_get_relocated_section_contents
-#define elf_backend_gc_mark_hook elf32_cr16_gc_mark_hook
-#define elf_backend_can_gc_sections 1
-#define elf_backend_rela_normal 1
-#define elf_backend_check_relocs cr16_elf_check_relocs
+ elf32_cr16_get_relocated_section_contents
+#define elf_backend_gc_mark_hook elf32_cr16_gc_mark_hook
+#define elf_backend_can_gc_sections 1
+#define elf_backend_rela_normal 1
+#define elf_backend_check_relocs cr16_elf_check_relocs
/* So we can set bits in e_flags. */
#define elf_backend_final_write_processing \
- _bfd_cr16_elf_final_write_processing
-#define elf_backend_object_p _bfd_cr16_elf_object_p
+ _bfd_cr16_elf_final_write_processing
+#define elf_backend_object_p _bfd_cr16_elf_object_p
#define bfd_elf32_bfd_merge_private_bfd_data \
- _bfd_cr16_elf_merge_private_bfd_data
+ _bfd_cr16_elf_merge_private_bfd_data
#define bfd_elf32_bfd_link_hash_table_create \
- elf32_cr16_link_hash_table_create
+ elf32_cr16_link_hash_table_create
#define elf_backend_create_dynamic_sections \
- _bfd_cr16_elf_create_dynamic_sections
+ _bfd_cr16_elf_create_dynamic_sections
#define elf_backend_adjust_dynamic_symbol \
- _bfd_cr16_elf_adjust_dynamic_symbol
+ _bfd_cr16_elf_adjust_dynamic_symbol
#define elf_backend_size_dynamic_sections \
- _bfd_cr16_elf_size_dynamic_sections
+ _bfd_cr16_elf_size_dynamic_sections
#define elf_backend_omit_section_dynsym \
((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true)
#define elf_backend_finish_dynamic_symbol \
- _bfd_cr16_elf_finish_dynamic_symbol
+ _bfd_cr16_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections \
- _bfd_cr16_elf_finish_dynamic_sections
+ _bfd_cr16_elf_finish_dynamic_sections
#define elf_backend_reloc_type_class _bfd_cr16_elf_reloc_type_class
-#define elf_backend_want_got_plt 1
-#define elf_backend_plt_readonly 1
-#define elf_backend_want_plt_sym 0
-#define elf_backend_got_header_size 12
+#define elf_backend_want_got_plt 1
+#define elf_backend_plt_readonly 1
+#define elf_backend_want_plt_sym 0
+#define elf_backend_got_header_size 12
#define elf_backend_dtrel_excludes_plt 1
#include "elf32-target.h"
case R_NUMBER:
switch (size)
{
- case R_S_16C_08: /* One byte. */
+ case R_S_16C_08: /* One byte. */
value = bfd_get_8 (abfd, (char *) data + octets);
break;
- case R_S_16C_16: /* Two bytes. */
+ case R_S_16C_16: /* Two bytes. */
sword = bfd_get_16 (abfd, (bfd_byte *) data + octets);
value = sword;
break;
case R_NUMBER:
switch (size)
{
- case R_S_16C_08: /* One byte. */
+ case R_S_16C_08: /* One byte. */
if (value > (int) MAX_UBYTE || value < MIN_BYTE)
return bfd_reloc_overflow;
value &= 0xFF;
if (neg2pos)
{
/* Change load/stor negative displ opcode
- to load/stor positive displ opcode. */
+ to load/stor positive displ opcode. */
value = bfd_get_8 (abfd, (char *) data + octets - 3);
value &= 0xF7;
value |= 0x2;
#define elf_info_to_howto_rel elf_cr16c_info_to_howto_rel
#define elf_backend_relocate_section elf32_cr16c_relocate_section
#define elf_backend_symbol_processing elf32_cr16c_symbol_processing
-#define elf_backend_section_from_bfd_section elf32_cr16c_section_from_bfd_section
+#define elf_backend_section_from_bfd_section elf32_cr16c_section_from_bfd_section
#define elf_backend_add_symbol_hook elf32_cr16c_add_symbol_hook
-#define elf_backend_link_output_symbol_hook elf32_cr16c_link_output_symbol_hook
+#define elf_backend_link_output_symbol_hook elf32_cr16c_link_output_symbol_hook
#define elf_backend_can_gc_sections 1
relocs for cross-format linking. */
#define TLSHOWTO32(name) \
HOWTO (name, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, \
- bfd_elf_generic_reloc, #name, FALSE, 0, 0xffffffff, FALSE)
+ bfd_elf_generic_reloc, #name, FALSE, 0, 0xffffffff, FALSE)
#define TLSHOWTO16X(name, X) \
HOWTO (name, 0, 1, 16, FALSE, 0, complain_overflow_ ## X, \
- bfd_elf_generic_reloc, #name, FALSE, 0, 0xffff, FALSE)
+ bfd_elf_generic_reloc, #name, FALSE, 0, 0xffff, FALSE)
#define TLSHOWTO16(name) TLSHOWTO16X(name, unsigned)
#define TLSHOWTO16S(name) TLSHOWTO16X(name, signed)
static bfd_reloc_status_type
cris_final_link_relocate (reloc_howto_type * howto,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * rel,
- bfd_vma relocation)
+ bfd_vma relocation)
{
bfd_reloc_status_type r;
enum elf_cris_reloc_type r_type = ELF32_R_TYPE (rel->r_info);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
/* This reloc will be computed at runtime, so there's no
- need to do anything now, except for R_CRIS_32 relocations
- that have been turned into R_CRIS_RELATIVE. */
+ need to do anything now, except for R_CRIS_32 relocations
+ that have been turned into R_CRIS_RELATIVE. */
if (!relocate)
continue;
}
elf_section_data (splt->output_section)->this_hdr.sh_entsize
= PLT_ENTRY_SIZE;
}
- }
+ }
}
}
}
switch (r_type)
- {
+ {
case R_CRIS_16_GOTPLT:
case R_CRIS_32_GOTPLT:
/* Mark that we need a GOT entry if the PLT entry (and its GOT
case R_CRIS_32_PLT_PCREL:
/* This symbol requires a procedure linkage table entry. We
actually build the entry in adjust_dynamic_symbol,
- because this might be a case of linking PIC code which is
- never referenced by a dynamic object, in which case we
- don't need to generate a procedure linkage table entry
- after all. */
+ because this might be a case of linking PIC code which is
+ never referenced by a dynamic object, in which case we
+ don't need to generate a procedure linkage table entry
+ after all. */
/* Beware: if we'd check for visibility of the symbol here
(and not marking the need for a PLT when non-visible), we'd
}
break;
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_CRIS_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_CRIS_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_CRIS_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_CRIS_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
case R_CRIS_16_TPREL:
case R_CRIS_32_TPREL:
/* Other relocs do not appear here. */
bfd_set_error (bfd_error_bad_value);
return FALSE;
- }
+ }
}
return TRUE;
if (s->size != 0)
{
/* Remember whether there are any reloc sections other
- than .rela.plt. */
+ than .rela.plt. */
if (strcmp (name, ".rela.plt") != 0)
relocs = TRUE;
#define elf_backend_relocate_section cris_elf_relocate_section
#define elf_backend_gc_mark_hook cris_elf_gc_mark_hook
#define elf_backend_plt_sym_val cris_elf_plt_sym_val
-#define elf_backend_check_relocs cris_elf_check_relocs
+#define elf_backend_check_relocs cris_elf_check_relocs
#define elf_backend_grok_prstatus cris_elf_grok_prstatus
#define elf_backend_grok_psinfo cris_elf_grok_psinfo
bfd_elf_generic_reloc, /* special_function */
"R_CRX_NUM8", /* name */
FALSE, /* partial_inplace */
- 0x0, /* src_mask */
+ 0x0, /* src_mask */
0xff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CRX_NUM16", /* name */
FALSE, /* partial_inplace */
- 0x0, /* src_mask */
+ 0x0, /* src_mask */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CRX_NUM32", /* name */
FALSE, /* partial_inplace */
- 0x0, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CRX_IMM16", /* name */
FALSE, /* partial_inplace */
- 0x0, /* src_mask */
+ 0x0, /* src_mask */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
bfd_elf_generic_reloc, /* special_function */
"R_CRX_IMM32", /* name */
FALSE, /* partial_inplace */
- 0x0, /* src_mask */
+ 0x0, /* src_mask */
0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* An PC Relative 10-bit relocation, shifted by 2, right container. */
HOWTO (R_D10V_10_PCREL_R, /* Type. */
- 2, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 8, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
+ 2, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 8, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
bfd_elf_generic_reloc, /* Special_function. */
"R_D10V_10_PCREL_R", /* Name. */
- FALSE, /* Partial_inplace. */
+ FALSE, /* Partial_inplace. */
0xff, /* Src_mask. */
- 0xff, /* Dst_mask. */
+ 0xff, /* Dst_mask. */
TRUE), /* PCrel_offset. */
/* An PC Relative 10-bit relocation, shifted by 2, left container. */
HOWTO (R_D10V_10_PCREL_L, /* Type. */
- 2, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 8, /* Bitsize. */
- TRUE, /* PC_relative. */
- 15, /* Bitpos. */
+ 2, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 8, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 15, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
bfd_elf_generic_reloc, /* Special_function. */
"R_D10V_10_PCREL_L", /* Name. */
- FALSE, /* Partial_inplace. */
+ FALSE, /* Partial_inplace. */
0x07f8000, /* Src_mask. */
- 0x07f8000, /* Dst_mask. */
+ 0x07f8000, /* Dst_mask. */
TRUE), /* PCrel_offset. */
/* A 16 bit absolute relocation. */
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_D10V_GNU_VTINHERIT, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 0, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 0, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_dont,/* Complain_on_overflow. */
- NULL, /* Special_function. */
+ NULL, /* Special_function. */
"R_D10V_GNU_VTINHERIT",/* Name. */
- FALSE, /* Partial_inplace. */
- 0, /* Src_mask. */
- 0, /* Dst_mask. */
- FALSE), /* PCrel_offset. */
+ FALSE, /* Partial_inplace. */
+ 0, /* Src_mask. */
+ 0, /* Dst_mask. */
+ FALSE), /* PCrel_offset. */
/* GNU extension to record C++ vtable member usage. */
- HOWTO (R_D10V_GNU_VTENTRY, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 0, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (R_D10V_GNU_VTENTRY, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 0, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_dont,/* Complain_on_overflow. */
_bfd_elf_rel_vtable_reloc_fn, /* Special_function. */
- "R_D10V_GNU_VTENTRY", /* Name. */
- FALSE, /* Partial_inplace. */
- 0, /* Src_mask. */
- 0, /* Dst_mask. */
- FALSE), /* PCrel_offset. */
+ "R_D10V_GNU_VTENTRY", /* Name. */
+ FALSE, /* Partial_inplace. */
+ 0, /* Src_mask. */
+ 0, /* Dst_mask. */
+ FALSE), /* PCrel_offset. */
};
/* Map BFD reloc types to D10V ELF reloc types. */
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
}
switch (ELF32_R_TYPE (rel->r_info))
- {
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_D10V_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_D10V_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
- }
+ {
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_D10V_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_D10V_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+ }
}
return TRUE;
r_type = ELF32_R_TYPE (rel->r_info);
if (r_type == R_D10V_GNU_VTENTRY
- || r_type == R_D10V_GNU_VTINHERIT)
- continue;
+ || r_type == R_D10V_GNU_VTINHERIT)
+ continue;
howto = elf_d10v_howto_table + r_type;
h = NULL;
}
r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, (bfd_vma) 0);
+ contents, rel->r_offset,
+ relocation, (bfd_vma) 0);
if (r != bfd_reloc_ok)
{
#define ELF_MACHINE_ALT1 EM_CYGNUS_D10V
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM d10v_elf32_vec
+#define TARGET_BIG_SYM d10v_elf32_vec
#define TARGET_BIG_NAME "elf32-d10v"
-#define elf_info_to_howto 0
-#define elf_info_to_howto_rel d10v_info_to_howto_rel
-#define elf_backend_object_p 0
+#define elf_info_to_howto 0
+#define elf_info_to_howto_rel d10v_info_to_howto_rel
+#define elf_backend_object_p 0
#define elf_backend_final_write_processing 0
-#define elf_backend_gc_mark_hook elf32_d10v_gc_mark_hook
-#define elf_backend_check_relocs elf32_d10v_check_relocs
-#define elf_backend_relocate_section elf32_d10v_relocate_section
-#define elf_backend_can_gc_sections 1
+#define elf_backend_gc_mark_hook elf32_d10v_gc_mark_hook
+#define elf_backend_check_relocs elf32_d10v_check_relocs
+#define elf_backend_relocate_section elf32_d10v_relocate_section
+#define elf_backend_can_gc_sections 1
#include "elf32-target.h"
}
r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message);
+ input_section, output_bfd, error_message);
if (r != bfd_reloc_continue)
return r;
}
in1 |= (relocation >> 26) & 0x3F; /* Top 6 bits. */
- in2 |= ((relocation & 0x03FC0000) << 2); /* Next 8 bits. */
+ in2 |= ((relocation & 0x03FC0000) << 2); /* Next 8 bits. */
in2 |= relocation & 0x0003FFFF; /* Bottom 18 bits. */
/* Change a PC-relative instruction to its
}
r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message);
+ input_section, output_bfd, error_message);
if (r != bfd_reloc_continue)
return r;
#define ELF_MACHINE_ALT1 EM_CYGNUS_D30V
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM d30v_elf32_vec
+#define TARGET_BIG_SYM d30v_elf32_vec
#define TARGET_BIG_NAME "elf32-d30v"
#define elf_info_to_howto d30v_info_to_howto_rela
#define bfd_elf32_bfd_reloc_type_lookup elf32_dlx_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup elf32_dlx_reloc_name_lookup
-#define elf_info_to_howto elf32_dlx_info_to_howto
-#define elf_info_to_howto_rel elf32_dlx_info_to_howto_rel
-#define elf_backend_check_relocs elf32_dlx_check_relocs
+#define elf_info_to_howto elf32_dlx_info_to_howto
+#define elf_info_to_howto_rel elf32_dlx_info_to_howto_rel
+#define elf_backend_check_relocs elf32_dlx_check_relocs
/* The gas default behavior is not to preform the %hi modifier so that the
GNU assembler can have the lower 16 bits offset placed in the insn, BUT
fixup like mips gld did. */
if (skip_dlx_elf_hi16_reloc)
return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message);
+ input_section, output_bfd, error_message);
/* If we're relocating, and this an external symbol, we don't want
to change anything. */
return bfd_reloc_outofrange;
bfd_put_16 (abfd, (short)((relocation >> 16) & 0xFFFF),
- (bfd_byte *)data + reloc_entry->address);
+ (bfd_byte *)data + reloc_entry->address);
return ret;
}
char **error_message ATTRIBUTE_UNUSED)
{
unsigned long insn, vallo, allignment;
- int val;
+ int val;
/* HACK: I think this first condition is necessary when producing
relocatable output. After the end of HACK, the code is identical
if (skip_dlx_elf_hi16_reloc)
return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message);
+ input_section, output_bfd, error_message);
/* Check undefined section and undefined symbols. */
if (bfd_is_und_section (symbol->section)
/* vallo points to the vma of next instruction. */
vallo += (((unsigned long)(input_section->output_section->vma +
- input_section->output_offset) +
- allignment) & ~allignment);
+ input_section->output_offset) +
+ allignment) & ~allignment);
/* val is the displacement (PC relative to next instruction). */
val = (symbol->section->output_offset +
insn = (insn & 0xFFFF0000) | (val & 0x0000FFFF);
bfd_put_32 (abfd, insn,
- (bfd_byte *) data + reloc_entry->address);
+ (bfd_byte *) data + reloc_entry->address);
return bfd_reloc_ok;
}
char **error_message ATTRIBUTE_UNUSED)
{
unsigned long insn, vallo, allignment;
- int val;
+ int val;
/* HACK: I think this first condition is necessary when producing
relocatable output. After the end of HACK, the code is identical
if (skip_dlx_elf_hi16_reloc)
return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message);
+ input_section, output_bfd, error_message);
/* Check undefined section and undefined symbols. */
if (bfd_is_und_section (symbol->section)
insn = (insn & 0xFC000000) | (val & 0x03FFFFFF);
bfd_put_32 (abfd, insn,
- (bfd_byte *) data + reloc_entry->address);
+ (bfd_byte *) data + reloc_entry->address);
return bfd_reloc_ok;
}
static reloc_howto_type dlx_elf_howto_table[]=
{
/* No relocation. */
- HOWTO (R_DLX_NONE, /* Type. */
- 0, /* Rightshift. */
- 3, /* size (0 = byte, 1 = short, 2 = long). */
- 0, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (R_DLX_NONE, /* Type. */
+ 0, /* Rightshift. */
+ 3, /* size (0 = byte, 1 = short, 2 = long). */
+ 0, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_dont,/* Complain_on_overflow. */
bfd_elf_generic_reloc, /* Special_function. */
- "R_DLX_NONE", /* Name. */
- FALSE, /* Partial_inplace. */
- 0, /* Src_mask. */
- 0, /* Dst_mask. */
- FALSE), /* PCrel_offset. */
+ "R_DLX_NONE", /* Name. */
+ FALSE, /* Partial_inplace. */
+ 0, /* Src_mask. */
+ 0, /* Dst_mask. */
+ FALSE), /* PCrel_offset. */
/* 8 bit relocation. */
- HOWTO (R_DLX_RELOC_8, /* Type. */
- 0, /* Rightshift. */
- 0, /* Size (0 = byte, 1 = short, 2 = long). */
- 8, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (R_DLX_RELOC_8, /* Type. */
+ 0, /* Rightshift. */
+ 0, /* Size (0 = byte, 1 = short, 2 = long). */
+ 8, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_dont,/* Complain_on_overflow. */
bfd_elf_generic_reloc, /* Special_function. */
- "R_DLX_RELOC_8", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xff, /* Src_mask. */
- 0xff, /* Dst_mask. */
- FALSE), /* PCrel_offset. */
+ "R_DLX_RELOC_8", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xff, /* Src_mask. */
+ 0xff, /* Dst_mask. */
+ FALSE), /* PCrel_offset. */
/* 16 bit relocation. */
- HOWTO (R_DLX_RELOC_16, /* Type. */
- 0, /* Rightshift. */
- 1, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (R_DLX_RELOC_16, /* Type. */
+ 0, /* Rightshift. */
+ 1, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_dont,/* Complain_on_overflow. */
bfd_elf_generic_reloc, /* Special_function. */
- "R_DLX_RELOC_16", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Src_mask. */
- 0xffff, /* Dst_mask. */
- FALSE), /* PCrel_offset. */
+ "R_DLX_RELOC_16", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Src_mask. */
+ 0xffff, /* Dst_mask. */
+ FALSE), /* PCrel_offset. */
/* 32 bit relocation. */
- HOWTO (R_DLX_RELOC_32, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (R_DLX_RELOC_32, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_dont,/* Complain_on_overflow. */
bfd_elf_generic_reloc, /* Special_function. */
- "R_DLX_RELOC_32", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffffffff, /* Src_mask. */
- 0xffffffff, /* Dst_mask. */
- FALSE), /* PCrel_offset. */
+ "R_DLX_RELOC_32", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffffffff, /* Src_mask. */
+ 0xffffffff, /* Dst_mask. */
+ FALSE), /* PCrel_offset. */
/* GNU extension to record C++ vtable hierarchy. */
- HOWTO (R_DLX_GNU_VTINHERIT, /* Type. */
+ HOWTO (R_DLX_GNU_VTINHERIT, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
0, /* Bitsize. */
FALSE), /* PCrel_offset. */
/* GNU extension to record C++ vtable member usage. */
- HOWTO (R_DLX_GNU_VTENTRY, /* Type. */
+ HOWTO (R_DLX_GNU_VTENTRY, /* Type. */
0, /* Rightshift. */
2, /* Size (0 = byte, 1 = short, 2 = long). */
0, /* Bitsize. */
complain_overflow_dont,/* Complain_on_overflow. */
_bfd_elf_rel_vtable_reloc_fn,/* Special_function. */
"R_DLX_GNU_VTENTRY", /* Name. */
- FALSE, /* Partial_inplace. */
+ FALSE, /* Partial_inplace. */
0, /* Src_mask. */
0, /* Dst_mask. */
- FALSE) /* PCrel_offset. */
+ FALSE) /* PCrel_offset. */
};
/* 16 bit offset for pc-relative branches. */
static reloc_howto_type elf_dlx_gnu_rel16_s2 =
- HOWTO (R_DLX_RELOC_16_PCREL, /* Type. */
- 0, /* Rightshift. */
- 1, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (R_DLX_RELOC_16_PCREL, /* Type. */
+ 0, /* Rightshift. */
+ 1, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
- elf32_dlx_relocate16, /* Special_function. */
+ elf32_dlx_relocate16, /* Special_function. */
"R_DLX_RELOC_16_PCREL",/* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Src_mask. */
- 0xffff, /* Dst_mask. */
- TRUE); /* PCrel_offset. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Src_mask. */
+ 0xffff, /* Dst_mask. */
+ TRUE); /* PCrel_offset. */
/* 26 bit offset for pc-relative branches. */
static reloc_howto_type elf_dlx_gnu_rel26_s2 =
- HOWTO (R_DLX_RELOC_26_PCREL, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 26, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (R_DLX_RELOC_26_PCREL, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 26, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_dont,/* Complain_on_overflow. */
- elf32_dlx_relocate26, /* Special_function. */
+ elf32_dlx_relocate26, /* Special_function. */
"R_DLX_RELOC_26_PCREL",/* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Src_mask. */
- 0xffff, /* Dst_mask. */
- TRUE); /* PCrel_offset. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Src_mask. */
+ 0xffff, /* Dst_mask. */
+ TRUE); /* PCrel_offset. */
/* High 16 bits of symbol value. */
static reloc_howto_type elf_dlx_reloc_16_hi =
- HOWTO (R_DLX_RELOC_16_HI, /* Type. */
- 16, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (R_DLX_RELOC_16_HI, /* Type. */
+ 16, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_dont,/* Complain_on_overflow. */
_bfd_dlx_elf_hi16_reloc,/* Special_function. */
- "R_DLX_RELOC_16_HI", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xFFFF, /* Src_mask. */
- 0xffff, /* Dst_mask. */
- FALSE); /* PCrel_offset. */
+ "R_DLX_RELOC_16_HI", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xFFFF, /* Src_mask. */
+ 0xffff, /* Dst_mask. */
+ FALSE); /* PCrel_offset. */
/* Low 16 bits of symbol value. */
static reloc_howto_type elf_dlx_reloc_16_lo =
- HOWTO (R_DLX_RELOC_16_LO, /* Type. */
- 0, /* Rightshift. */
- 1, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (R_DLX_RELOC_16_LO, /* Type. */
+ 0, /* Rightshift. */
+ 1, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_dont,/* Complain_on_overflow. */
bfd_elf_generic_reloc, /* Special_function. */
- "R_DLX_RELOC_16_LO", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Src_mask. */
- 0xffff, /* Dst_mask. */
- FALSE); /* PCrel_offset. */
+ "R_DLX_RELOC_16_LO", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Src_mask. */
+ 0xffff, /* Dst_mask. */
+ FALSE); /* PCrel_offset. */
/* A mapping from BFD reloc types to DLX ELF reloc types.
Stolen from elf32-mips.c.
static const struct elf_reloc_map dlx_reloc_map[] =
{
- { BFD_RELOC_NONE, R_DLX_NONE },
- { BFD_RELOC_16, R_DLX_RELOC_16 },
- { BFD_RELOC_32, R_DLX_RELOC_32 },
+ { BFD_RELOC_NONE, R_DLX_NONE },
+ { BFD_RELOC_16, R_DLX_RELOC_16 },
+ { BFD_RELOC_32, R_DLX_RELOC_32 },
{ BFD_RELOC_DLX_HI16_S, R_DLX_RELOC_16_HI },
- { BFD_RELOC_DLX_LO16, R_DLX_RELOC_16_LO },
+ { BFD_RELOC_DLX_LO16, R_DLX_RELOC_16_LO },
{ BFD_RELOC_VTABLE_INHERIT, R_DLX_GNU_VTINHERIT },
{ BFD_RELOC_VTABLE_ENTRY, R_DLX_GNU_VTENTRY }
};
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
}
switch (ELF32_R_TYPE (rel->r_info))
- {
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_DLX_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_DLX_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
- }
+ {
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_DLX_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_DLX_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
+ }
}
return TRUE;
return;
}
-#define TARGET_BIG_SYM dlx_elf32_be_vec
-#define TARGET_BIG_NAME "elf32-dlx"
-#define ELF_ARCH bfd_arch_dlx
-#define ELF_MACHINE_CODE EM_DLX
-#define ELF_MAXPAGESIZE 1 /* FIXME: This number is wrong, It should be the page size in bytes. */
+#define TARGET_BIG_SYM dlx_elf32_be_vec
+#define TARGET_BIG_NAME "elf32-dlx"
+#define ELF_ARCH bfd_arch_dlx
+#define ELF_MACHINE_CODE EM_DLX
+#define ELF_MAXPAGESIZE 1 /* FIXME: This number is wrong, It should be the page size in bytes. */
#include "elf32-target.h"
{
Elf_Internal_Shdr * symtab_hdr;
Elf_Internal_Rela * irelbase;
- bfd_byte * contents;
+ bfd_byte * contents;
Elf_Internal_Sym * isymbuf;
};
static reloc_howto_type epiphany_elf_howto_table [] =
{
#define AHOW(t,rs,s,bs,pr,bp,co,name,sm,dm) \
- HOWTO(t, /* type */ \
- rs, /* rightshift */ \
- s, /* size (0 = byte, 1 = short, 2 = long) */ \
- bs, /* bitsize */ \
- pr, /* pc_relative */ \
- bp, /* bitpos */ \
+ HOWTO(t, /* type */ \
+ rs, /* rightshift */ \
+ s, /* size (0 = byte, 1 = short, 2 = long) */ \
+ bs, /* bitsize */ \
+ pr, /* pc_relative */ \
+ bp, /* bitpos */ \
co, /* complain_on_overflow */ \
bfd_elf_generic_reloc,/* special_function */ \
- name, /* name */ \
- FALSE, /* partial_inplace */ \
- sm, /* src_mask */ \
- dm, /* dst_mask */ \
- pr) /* pcrel_offset */
+ name, /* name */ \
+ FALSE, /* partial_inplace */ \
+ sm, /* src_mask */ \
+ dm, /* dst_mask */ \
+ pr) /* pcrel_offset */
/* This reloc does nothing. */
- AHOW (R_EPIPHANY_NONE, 0, 3,0, FALSE, 0, complain_overflow_dont, "R_EPIPHANY_NONE", 0, 0),
+ AHOW (R_EPIPHANY_NONE, 0, 3,0, FALSE, 0, complain_overflow_dont, "R_EPIPHANY_NONE", 0, 0),
/* 8 bit absolute (not likely) */
- AHOW (R_EPIPHANY_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_8", 0x000000ff, 0x000000ff),
+ AHOW (R_EPIPHANY_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_8", 0x000000ff, 0x000000ff),
/* 16 bit absolute */
- AHOW (R_EPIPHANY_16, 0, 1,16, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_16", 0x0000ffff, 0x00ff1fe0),
+ AHOW (R_EPIPHANY_16, 0, 1,16, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_16", 0x0000ffff, 0x00ff1fe0),
/* A 32 bit absolute relocation. */
- AHOW (R_EPIPHANY_32, 0, 2,32, FALSE, 0, complain_overflow_dont, "R_EPIPHANY_32", 0xffffffff, 0xffffffff),
+ AHOW (R_EPIPHANY_32, 0, 2,32, FALSE, 0, complain_overflow_dont, "R_EPIPHANY_32", 0xffffffff, 0xffffffff),
/* 8 bit relative relocation */
HOWTO ( R_EPIPHANY_8_PCREL, 0, 0, 8, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_EPIPHANY_8_PCREL", FALSE, 0x000000ff, 0x000000ff, FALSE),
HOWTO ( R_EPIPHANY_32_PCREL, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_EPIPHANY_8_PCREL", FALSE, 0x000000ff, 0x000000ff, FALSE),
/* 8 bit pc-relative relocation */
- AHOW (R_EPIPHANY_SIMM8, 1, 0, 8, TRUE, 8, complain_overflow_signed, "R_EPIPHANY_SIMM8", 0x000000ff, 0x0000ff00),
+ AHOW (R_EPIPHANY_SIMM8, 1, 0, 8, TRUE, 8, complain_overflow_signed, "R_EPIPHANY_SIMM8", 0x000000ff, 0x0000ff00),
/* 24 bit pc-relative relocation */
- AHOW (R_EPIPHANY_SIMM24, 1, 2,24, TRUE, 8, complain_overflow_signed, "R_EPIPHANY_SIMM24", 0x00ffffff, 0xffffff00),
+ AHOW (R_EPIPHANY_SIMM24, 1, 2,24, TRUE, 8, complain_overflow_signed, "R_EPIPHANY_SIMM24", 0x00ffffff, 0xffffff00),
/* %HIGH(EA) */
- AHOW (R_EPIPHANY_HIGH, 0, 2,16, FALSE, 0, complain_overflow_dont, "R_EPIPHANY_HIGH", 0x0ff01fe0, 0x0ff01fe0),
+ AHOW (R_EPIPHANY_HIGH, 0, 2,16, FALSE, 0, complain_overflow_dont, "R_EPIPHANY_HIGH", 0x0ff01fe0, 0x0ff01fe0),
/* %LOW(EA) */
- AHOW (R_EPIPHANY_LOW, 0, 2,16, FALSE, 0, complain_overflow_dont, "R_EPIPHANY_LOW", 0x0ff01fe0, 0x0ff01fe0),
+ AHOW (R_EPIPHANY_LOW, 0, 2,16, FALSE, 0, complain_overflow_dont, "R_EPIPHANY_LOW", 0x0ff01fe0, 0x0ff01fe0),
/* simm11 */
- AHOW (R_EPIPHANY_SIMM11, 0, 2,11, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_SIMM11", 0x00ff0380, 0x00ff0380),
+ AHOW (R_EPIPHANY_SIMM11, 0, 2,11, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_SIMM11", 0x00ff0380, 0x00ff0380),
/* imm12 - sign-magnitude */
- AHOW (R_EPIPHANY_IMM11, 0, 2,11, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_IMM12", 0x00ff0380, 0x00ff0380),
+ AHOW (R_EPIPHANY_IMM11, 0, 2,11, FALSE, 0, complain_overflow_bitfield, "R_EPIPHANY_IMM12", 0x00ff0380, 0x00ff0380),
/* imm8 */
- AHOW (R_EPIPHANY_IMM8, 0, 1, 8, FALSE, 8, complain_overflow_signed, "R_EPIPHANY_IMM8", 0x0000ff00, 0x0000ff00)
+ AHOW (R_EPIPHANY_IMM8, 0, 1, 8, FALSE, 8, complain_overflow_signed, "R_EPIPHANY_IMM8", 0x0000ff00, 0x0000ff00)
};
static bfd_reloc_status_type
epiphany_final_link_relocate (reloc_howto_type * howto,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * rel,
- bfd_vma relocation)
+ bfd_vma relocation)
{
switch (howto->type)
{
for (rel = relocs; rel < relend; rel ++)
{
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- const char * name = NULL;
- int r_type ATTRIBUTE_UNUSED;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char * name = NULL;
+ int r_type ATTRIBUTE_UNUSED;
r_type = ELF32_R_TYPE (rel->r_info);
r_symndx = ELF32_R_SYM (rel->r_info);
#define elf_info_to_howto_rel NULL
#define elf_info_to_howto epiphany_info_to_howto_rela
-#define elf_backend_can_gc_sections 1
+#define elf_backend_can_gc_sections 1
#define elf_backend_rela_normal 1
#define elf_backend_relocate_section epiphany_elf_relocate_section
FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_FR30_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_FR30_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_FR30_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage */
- HOWTO (R_FR30_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_FR30_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_FR30_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_FR30_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
\f
/* Utility to actually perform an R_FR30_20 reloc. */
static const struct fr30_reloc_map fr30_reloc_map [] =
{
- { BFD_RELOC_NONE, R_FR30_NONE },
- { BFD_RELOC_8, R_FR30_8 },
- { BFD_RELOC_FR30_20, R_FR30_20 },
- { BFD_RELOC_32, R_FR30_32 },
- { BFD_RELOC_FR30_48, R_FR30_48 },
+ { BFD_RELOC_NONE, R_FR30_NONE },
+ { BFD_RELOC_8, R_FR30_8 },
+ { BFD_RELOC_FR30_20, R_FR30_20 },
+ { BFD_RELOC_32, R_FR30_32 },
+ { BFD_RELOC_FR30_48, R_FR30_48 },
{ BFD_RELOC_FR30_6_IN_4, R_FR30_6_IN_4 },
{ BFD_RELOC_FR30_8_IN_8, R_FR30_8_IN_8 },
{ BFD_RELOC_FR30_9_IN_8, R_FR30_9_IN_8 },
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
}
switch (ELF32_R_TYPE (rel->r_info))
- {
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_FR30_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_FR30_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
- }
+ {
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_FR30_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_FR30_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
+ }
}
return TRUE;
#define ELF_MACHINE_ALT1 EM_CYGNUS_FR30
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM fr30_elf32_vec
+#define TARGET_BIG_SYM fr30_elf32_vec
#define TARGET_BIG_NAME "elf32-fr30"
#define elf_info_to_howto_rel NULL
#define elf_info_to_howto fr30_info_to_howto_rela
#define elf_backend_relocate_section fr30_elf_relocate_section
#define elf_backend_gc_mark_hook fr30_elf_gc_mark_hook
-#define elf_backend_check_relocs fr30_elf_check_relocs
+#define elf_backend_check_relocs fr30_elf_check_relocs
#define elf_backend_can_gc_sections 1
#define elf_backend_rela_normal 1
#define bfd_elf32_bfd_reloc_type_lookup fr30_reloc_type_lookup
-#define bfd_elf32_bfd_reloc_name_lookup fr30_reloc_name_lookup
+#define bfd_elf32_bfd_reloc_name_lookup fr30_reloc_name_lookup
#include "elf32-target.h"
for symbol+addend. Should be implied by something like:
(plt || fdgotoff12 || fdgotofflos || fdgotofflohi
|| ((fd || fdgot12 || fdgotlos || fdgothilo)
- && (symndx != -1 || FRVFDPIC_FUNCDESC_LOCAL (info, d.h)))) */
+ && (symndx != -1 || FRVFDPIC_FUNCDESC_LOCAL (info, d.h)))) */
unsigned privfd:1;
/* Whether a lazy PLT entry is needed for this symbol+addend.
Should be implied by something like:
h = bfd_link_hash_lookup (info->hash, "_gp", FALSE, FALSE, TRUE);
gp = (h->u.def.value
- + h->u.def.section->output_section->vma
- + h->u.def.section->output_offset);
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
value -= input_section->output_section->vma;
value -= (gp - input_section->output_section->vma);
h = bfd_link_hash_lookup (info->hash, "_gp", FALSE, FALSE, TRUE);
gp = (h->u.def.value
- + h->u.def.section->output_section->vma
- + h->u.def.section->output_offset);
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
value -= input_section->output_section->vma;
value -= (gp - input_section->output_section->vma);
bfd_put_32 (input_bfd, insn, contents + rel->r_offset);
/* #tlsoff(symbol+offset) is just a relaxation
- annotation, so there's nothing left to
- relocate. */
+ annotation, so there's nothing left to
+ relocate. */
continue;
}
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
}
switch (ELF32_R_TYPE (rel->r_info))
- {
+ {
case R_FRV_LABEL24:
if (IS_FDPIC (abfd))
picrel->call = 1;
info->flags |= DF_STATIC_TLS;
goto bad_reloc;
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_FRV_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_FRV_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_FRV_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_FRV_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
case R_FRV_LABEL16:
case R_FRV_LO16:
(_("%B: unsupported relocation type %i\n"),
abfd, ELF32_R_TYPE (rel->r_info));
return FALSE;
- }
+ }
}
return TRUE;
else /* Possibly incompatible flags. */
{
/* Warn if different # of gprs are used. Note, 0 means nothing is
- said about the size of gprs. */
+ said about the size of gprs. */
new_partial = (new_flags & EF_FRV_GPR_MASK);
old_partial = (old_flags & EF_FRV_GPR_MASK);
if (new_partial == old_partial)
}
/* Warn if different # of fprs are used. Note, 0 means nothing is
- said about the size of fprs. */
+ said about the size of fprs. */
new_partial = (new_flags & EF_FRV_FPR_MASK);
old_partial = (old_flags & EF_FRV_FPR_MASK);
if (new_partial == old_partial)
}
/* Warn if different dword support was used. Note, 0 means nothing is
- said about the dword support. */
+ said about the dword support. */
new_partial = (new_flags & EF_FRV_DWORD_MASK);
old_partial = (old_flags & EF_FRV_DWORD_MASK);
if (new_partial == old_partial)
| (old_flags & new_flags & EF_FRV_NOPACK));
/* We don't have to do anything if the pic flags are the same, or the new
- module(s) were compiled with -mlibrary-pic. */
+ module(s) were compiled with -mlibrary-pic. */
new_partial = (new_flags & EF_FRV_PIC_FLAGS);
old_partial = (old_flags & EF_FRV_PIC_FLAGS);
if ((new_partial == old_partial) || ((new_partial & EF_FRV_LIBPIC) != 0))
;
/* If the old module(s) were compiled with -mlibrary-pic, copy in the pic
- flags if any from the new module. */
+ flags if any from the new module. */
else if ((old_partial & EF_FRV_LIBPIC) != 0)
old_flags = (old_flags & ~ EF_FRV_PIC_FLAGS) | new_partial;
old_flags |= new_partial;
/* One module was compiled for pic and the other was not, see if we have
- had any relocations that are not pic-safe. */
+ had any relocations that are not pic-safe. */
else
{
if ((old_flags & EF_FRV_NON_PIC_RELOCS) == 0)
return FALSE;
/* The Linux/FRV elf_prstatus struct is 268 bytes long. The other
- hardcoded offsets and sizes listed below (and contained within
+ hardcoded offsets and sizes listed below (and contained within
this lexical block) refer to fields in the target's elf_prstatus
struct. */
case 268:
#define ELF_MACHINE_CODE EM_CYGNUS_FRV
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM frv_elf32_vec
+#define TARGET_BIG_SYM frv_elf32_vec
#define TARGET_BIG_NAME "elf32-frv"
#define elf_info_to_howto frv_info_to_howto_rela
#define elf_backend_relocate_section elf32_frv_relocate_section
#define elf_backend_gc_mark_hook elf32_frv_gc_mark_hook
-#define elf_backend_check_relocs elf32_frv_check_relocs
+#define elf_backend_check_relocs elf32_frv_check_relocs
#define elf_backend_object_p elf32_frv_object_p
-#define elf_backend_add_symbol_hook elf32_frv_add_symbol_hook
+#define elf_backend_add_symbol_hook elf32_frv_add_symbol_hook
#define elf_backend_stack_align 8
#define elf_backend_can_gc_sections 1
#define ELF_MAXPAGESIZE 0x4000
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM frv_elf32_fdpic_vec
+#define TARGET_BIG_SYM frv_elf32_fdpic_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-frvfdpic"
#undef elf32_bed
frvfdpic_elf_encode_eh_address
#undef elf_backend_may_use_rel_p
-#define elf_backend_may_use_rel_p 1
+#define elf_backend_may_use_rel_p 1
#undef elf_backend_may_use_rela_p
-#define elf_backend_may_use_rela_p 1
+#define elf_backend_may_use_rela_p 1
/* We use REL for dynamic relocations only. */
#undef elf_backend_default_use_rela_p
-#define elf_backend_default_use_rela_p 1
+#define elf_backend_default_use_rela_p 1
#undef elf_backend_omit_section_dynsym
#define elf_backend_omit_section_dynsym _frvfdpic_link_omit_section_dynsym
4, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_FT32_SC0", /* name */
+ "R_FT32_SC0", /* name */
FALSE, /* partial_inplace */
0x00000000, /* src_mask */
0x00000000, /* dst_mask */
7, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_FT32_SC1", /* name */
+ "R_FT32_SC1", /* name */
TRUE, /* partial_inplace */
0x07ffff80, /* src_mask */
0x07ffff80, /* dst_mask */
0x00000000, /* src_mask */
0x00007fff, /* dst_mask */
FALSE), /* pcrel_offset */
- HOWTO (R_FT32_DIFF32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
+ HOWTO (R_FT32_DIFF32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_ft32_diff_reloc, /* special_function */
- "R_FT32_DIFF32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ "R_FT32_DIFF32", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
\f
\f
static const struct ft32_reloc_map ft32_reloc_map [] =
{
- { BFD_RELOC_NONE, R_FT32_NONE },
- { BFD_RELOC_32, R_FT32_32 },
- { BFD_RELOC_16, R_FT32_16 },
- { BFD_RELOC_8, R_FT32_8 },
- { BFD_RELOC_FT32_10, R_FT32_10 },
- { BFD_RELOC_FT32_20, R_FT32_20 },
- { BFD_RELOC_FT32_17, R_FT32_17 },
- { BFD_RELOC_FT32_18, R_FT32_18 },
- { BFD_RELOC_FT32_RELAX, R_FT32_RELAX },
- { BFD_RELOC_FT32_SC0, R_FT32_SC0 },
- { BFD_RELOC_FT32_SC1, R_FT32_SC1 },
- { BFD_RELOC_FT32_15, R_FT32_15 },
- { BFD_RELOC_FT32_DIFF32, R_FT32_DIFF32 },
+ { BFD_RELOC_NONE, R_FT32_NONE },
+ { BFD_RELOC_32, R_FT32_32 },
+ { BFD_RELOC_16, R_FT32_16 },
+ { BFD_RELOC_8, R_FT32_8 },
+ { BFD_RELOC_FT32_10, R_FT32_10 },
+ { BFD_RELOC_FT32_20, R_FT32_20 },
+ { BFD_RELOC_FT32_17, R_FT32_17 },
+ { BFD_RELOC_FT32_18, R_FT32_18 },
+ { BFD_RELOC_FT32_RELAX, R_FT32_RELAX },
+ { BFD_RELOC_FT32_SC0, R_FT32_SC0 },
+ { BFD_RELOC_FT32_SC1, R_FT32_SC1 },
+ { BFD_RELOC_FT32_15, R_FT32_15 },
+ { BFD_RELOC_FT32_DIFF32, R_FT32_DIFF32 },
};
/* Perform a diff relocation. Nothing to do, as the difference value is
static bfd_boolean
ft32_reloc_shortable
- (bfd * abfd,
- asection * sec,
- Elf_Internal_Sym * isymbuf ATTRIBUTE_UNUSED,
- bfd_byte * contents,
- bfd_vma pc ATTRIBUTE_UNUSED,
+ (bfd * abfd,
+ asection * sec,
+ Elf_Internal_Sym * isymbuf ATTRIBUTE_UNUSED,
+ bfd_byte * contents,
+ bfd_vma pc ATTRIBUTE_UNUSED,
Elf_Internal_Rela * irel,
- unsigned int * sc)
+ unsigned int * sc)
{
Elf_Internal_Shdr *symtab_hdr ATTRIBUTE_UNUSED;
bfd_vma symval;
if (elf32_ft32_is_diff_reloc (irel))
{
if (!elf32_ft32_adjust_diff_reloc_value (abfd, isec, irel,
- symval,
- shrinked_insn_address,
- count))
- return FALSE;
+ symval,
+ shrinked_insn_address,
+ count))
+ return FALSE;
}
else
{
printf
("Relocation's addend needed to be fixed \n");
- if (!elf32_ft32_adjust_reloc_if_spans_insn (abfd, isec,
- irel, symval,
- shrinked_insn_address,
- shrink_boundary,
- count))
- return FALSE;
+ if (!elf32_ft32_adjust_reloc_if_spans_insn (abfd, isec,
+ irel, symval,
+ shrinked_insn_address,
+ shrink_boundary,
+ count))
+ return FALSE;
}
}
/* else reference symbol is absolute. No adjustment needed. */
struct elf_link_hash_entry *sym_hash = *sym_hashes;
/* The '--wrap SYMBOL' option is causing a pain when the object file,
- containing the definition of __wrap_SYMBOL, includes a direct
- call to SYMBOL as well. Since both __wrap_SYMBOL and SYMBOL reference
- the same symbol (which is __wrap_SYMBOL), but still exist as two
- different symbols in 'sym_hashes', we don't want to adjust
- the global symbol __wrap_SYMBOL twice.
- This check is only relevant when symbols are being wrapped. */
+ containing the definition of __wrap_SYMBOL, includes a direct
+ call to SYMBOL as well. Since both __wrap_SYMBOL and SYMBOL reference
+ the same symbol (which is __wrap_SYMBOL), but still exist as two
+ different symbols in 'sym_hashes', we don't want to adjust
+ the global symbol __wrap_SYMBOL twice.
+ This check is only relevant when symbols are being wrapped. */
if (link_info->wrap_hash != NULL)
{
struct elf_link_hash_entry **cur_sym_hashes;
if (sym_sec == sec)
{
symval += sym_sec->output_section->vma
- + sym_sec->output_offset;
+ + sym_sec->output_offset;
if (debug_relax)
printf ("0x%x: Address of anchor symbol: 0x%x "
static bfd_boolean
ft32_elf_relax_section
- (bfd * abfd,
- asection * sec,
+ (bfd * abfd,
+ asection * sec,
struct bfd_link_info * link_info,
- bfd_boolean * again)
+ bfd_boolean * again)
{
Elf_Internal_Rela * free_relocs = NULL;
Elf_Internal_Rela * internal_relocs;
Elf_Internal_Rela * irelend;
Elf_Internal_Rela * irel;
- bfd_byte * contents = NULL;
+ bfd_byte * contents = NULL;
Elf_Internal_Shdr * symtab_hdr;
Elf_Internal_Sym * isymbuf = NULL;
if (ELF32_R_TYPE (irel->r_info) == R_FT32_18)
{
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_FT32_SC0);
+ R_FT32_SC0);
}
else
{
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_FT32_NONE);
+ R_FT32_NONE);
}
if (ELF32_R_TYPE (irel_next->r_info) == R_FT32_18)
There are a few relaxing opportunities available on the H8:
- jmp/jsr:24 -> bra/bsr:8 2 bytes
+ jmp/jsr:24 -> bra/bsr:8 2 bytes
The jmp may be completely eliminated if the previous insn is a
conditional branch to the insn after the jump. In that case
we invert the branch and delete the jump and save 4 bytes.
- bCC:16 -> bCC:8 2 bytes
- bsr:16 -> bsr:8 2 bytes
+ bCC:16 -> bCC:8 2 bytes
+ bsr:16 -> bsr:8 2 bytes
- bset:16 -> bset:8 2 bytes
- bset:24/32 -> bset:8 4 bytes
+ bset:16 -> bset:8 2 bytes
+ bset:24/32 -> bset:8 4 bytes
(also applicable to other bit manipulation instructions)
- mov.b:16 -> mov.b:8 2 bytes
- mov.b:24/32 -> mov.b:8 4 bytes
+ mov.b:16 -> mov.b:8 2 bytes
+ mov.b:24/32 -> mov.b:8 4 bytes
- bset:24/32 -> bset:16 2 bytes
+ bset:24/32 -> bset:16 2 bytes
(also applicable to other bit manipulation instructions)
- mov.[bwl]:24/32 -> mov.[bwl]:16 2 bytes
+ mov.[bwl]:24/32 -> mov.[bwl]:16 2 bytes
- mov.[bwl] @(displ:24/32+ERx) -> mov.[bwl] @(displ:16+ERx) 4 bytes. */
+ mov.[bwl] @(displ:24/32+ERx) -> mov.[bwl] @(displ:16+ERx) 4 bytes. */
static bfd_boolean
elf32_h8_relax_section (bfd *abfd, asection *sec,
&& h->root.type != bfd_link_hash_defweak)
{
/* This appears to be a reference to an undefined
- symbol. Just ignore it--it will be caught by the
- regular reloc processing. */
+ symbol. Just ignore it--it will be caught by the
+ regular reloc processing. */
continue;
}
/* And relaxing stuff. */
#define bfd_elf32_bfd_relax_section elf32_h8_relax_section
#define bfd_elf32_bfd_get_relocated_section_contents \
- elf32_h8_get_relocated_section_contents
+ elf32_h8_get_relocated_section_contents
#define elf_symbol_leading_char '_'
/* Variable names follow a coding style.
Please follow this (Apps Hungarian) style:
- Structure/Variable Prefix
+ Structure/Variable Prefix
elf_link_hash_table "etab"
elf_link_hash_entry "eh"
insn = hppa_rebuild_insn ((int) BL22_RP, val, 22);
bfd_put_32 (stub_bfd, insn, loc);
- bfd_put_32 (stub_bfd, (bfd_vma) NOP, loc + 4);
+ bfd_put_32 (stub_bfd, (bfd_vma) NOP, loc + 4);
bfd_put_32 (stub_bfd, (bfd_vma) LDW_RP, loc + 8);
bfd_put_32 (stub_bfd, (bfd_vma) LDSID_RP_R1, loc + 12);
bfd_put_32 (stub_bfd, (bfd_vma) MTSP_R1, loc + 16);
case R_PARISC_TLS_IE21L:
case R_PARISC_TLS_IE14R:
if (bfd_link_dll (info))
- info->flags |= DF_STATIC_TLS;
+ info->flags |= DF_STATIC_TLS;
need_entry = NEED_GOT;
break;
if (htab->tls_ldm_got.refcount > 0)
{
/* Allocate 2 got entries and 1 dynamic reloc for
- R_PARISC_TLS_DTPMOD32 relocs. */
+ R_PARISC_TLS_DTPMOD32 relocs. */
htab->tls_ldm_got.offset = htab->etab.sgot->size;
htab->etab.sgot->size += (GOT_ENTRY_SIZE * 2);
htab->etab.srelgot->size += sizeof (Elf32_External_Rela);
{
if (strcmp (bfd_get_target (abfd), "elf32-hppa-netbsd") != 0)
{
- /* We know we don't have a .plt. If .got is large,
+ /* We know we don't have a .plt. If .got is large,
offset our LTP. */
- if (sec->size > 0x2000)
+ if (sec->size > 0x2000)
gp_val = 0x2000;
}
}
bfd_byte *loc = NULL;
int cur_off = off;
- /* The GOT entries have not been initialized yet. Do it
- now, and emit any relocations. If both an IE GOT and a
- GD GOT are necessary, we emit the GD first. */
+ /* The GOT entries have not been initialized yet. Do it
+ now, and emit any relocations. If both an IE GOT and a
+ GD GOT are necessary, we emit the GD first. */
if (indx != 0
|| (bfd_link_pic (info)
}
else
{
- /* If we are not emitting relocations for a
- general dynamic reference, then we must be in a
- static link or an executable link with the
- symbol binding locally. Mark it as belonging
- to module 1, the executable. */
- bfd_put_32 (output_bfd, 1,
+ /* If we are not emitting relocations for a
+ general dynamic reference, then we must be in a
+ static link or an executable link with the
+ symbol binding locally. Mark it as belonging
+ to module 1, the executable. */
+ bfd_put_32 (output_bfd, 1,
htab->etab.sgot->contents + cur_off);
bfd_put_32 (output_bfd, relocation - dtpoff_base (info),
htab->etab.sgot->contents + cur_off + 4);
}
if ((tls_type & GOT_TLS_GD)
- && r_type != R_PARISC_TLS_GD21L
- && r_type != R_PARISC_TLS_GD14R)
+ && r_type != R_PARISC_TLS_GD21L
+ && r_type != R_PARISC_TLS_GD14R)
off += 2 * GOT_ENTRY_SIZE;
/* Add the base of the GOT to the relocation value. */
case R_PARISC_TLS_DTPMOD32:
case R_PARISC_TLS_DTPOFF32:
case R_PARISC_TLS_TPREL32:
- return reloc_class_normal;
+ return reloc_class_normal;
}
if (ELF32_R_SYM (rela->r_info) == STN_UNDEF)
int pr_version = bfd_get_32 (abfd, note->descdata);
if (pr_version != 1)
- return FALSE;
+ return FALSE;
/* pr_cursig */
elf_tdata (abfd)->core->signal = bfd_get_32 (abfd, note->descdata + 20);
static const bfd_byte elf_i386_lazy_ibt_plt0_entry[LAZY_PLT_ENTRY_SIZE] =
{
- 0xff, 0x35, 0, 0, 0, 0, /* pushl GOT[1] */
- 0xff, 0x25, 0, 0, 0, 0, /* jmp *GOT[2] */
- 0x0f, 0x1f, 0x40, 0x00 /* nopl 0(%rax) */
+ 0xff, 0x35, 0, 0, 0, 0, /* pushl GOT[1] */
+ 0xff, 0x25, 0, 0, 0, 0, /* jmp *GOT[2] */
+ 0x0f, 0x1f, 0x40, 0x00 /* nopl 0(%rax) */
};
/* Subsequent entries for an absolute IBT-enabled lazy procedure linkage
static const bfd_byte elf_i386_lazy_ibt_plt_entry[LAZY_PLT_ENTRY_SIZE] =
{
- 0xf3, 0x0f, 0x1e, 0xfb, /* endbr32 */
- 0x68, 0, 0, 0, 0, /* pushl immediate */
- 0xe9, 0, 0, 0, 0, /* jmp relative */
- 0x66, 0x90 /* xchg %ax,%ax */
+ 0xf3, 0x0f, 0x1e, 0xfb, /* endbr32 */
+ 0x68, 0, 0, 0, 0, /* pushl immediate */
+ 0xe9, 0, 0, 0, 0, /* jmp relative */
+ 0x66, 0x90 /* xchg %ax,%ax */
};
/* The first entry in a PIC IBT-enabled lazy procedure linkage table
static const bfd_byte elf_i386_pic_lazy_ibt_plt0_entry[LAZY_PLT_ENTRY_SIZE] =
{
0xff, 0xb3, 4, 0, 0, 0, /* pushl 4(%ebx) */
- 0xff, 0xa3, 8, 0, 0, 0, /* jmp *8(%ebx) */
- 0x0f, 0x1f, 0x40, 0x00 /* nopl 0(%rax) */
+ 0xff, 0xa3, 8, 0, 0, 0, /* jmp *8(%ebx) */
+ 0x0f, 0x1f, 0x40, 0x00 /* nopl 0(%rax) */
};
/* Entries for branches with IBT-enabled in the absolute non-lazey
static const bfd_byte elf_i386_non_lazy_ibt_plt_entry[LAZY_PLT_ENTRY_SIZE] =
{
- 0xf3, 0x0f, 0x1e, 0xfb, /* endbr32 */
+ 0xf3, 0x0f, 0x1e, 0xfb, /* endbr32 */
0xff, 0x25, 0, 0, 0, 0, /* jmp *name@GOT */
0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00 /* nopw 0x0(%rax,%rax,1) */
};
static const bfd_byte elf_i386_pic_non_lazy_ibt_plt_entry[LAZY_PLT_ENTRY_SIZE] =
{
- 0xf3, 0x0f, 0x1e, 0xfb, /* endbr32 */
+ 0xf3, 0x0f, 0x1e, 0xfb, /* endbr32 */
0xff, 0xa3, 0, 0, 0, 0, /* jmp *name@GOT(%ebx) */
0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00 /* nopw 0x0(%rax,%rax,1) */
};
/* These are the standard parameters. */
static const struct elf_x86_lazy_plt_layout elf_i386_lazy_plt =
{
- elf_i386_lazy_plt0_entry, /* plt0_entry */
- sizeof (elf_i386_lazy_plt0_entry), /* plt0_entry_size */
- elf_i386_lazy_plt_entry, /* plt_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 2, /* plt0_got1_offset */
- 8, /* plt0_got2_offset */
- 0, /* plt0_got2_insn_end */
- 2, /* plt_got_offset */
- 7, /* plt_reloc_offset */
- 12, /* plt_plt_offset */
- 0, /* plt_got_insn_size */
- 0, /* plt_plt_insn_end */
- 6, /* plt_lazy_offset */
- elf_i386_pic_lazy_plt0_entry, /* pic_plt0_entry */
- elf_i386_pic_lazy_plt_entry, /* pic_plt_entry */
- elf_i386_eh_frame_lazy_plt, /* eh_frame_plt */
+ elf_i386_lazy_plt0_entry, /* plt0_entry */
+ sizeof (elf_i386_lazy_plt0_entry), /* plt0_entry_size */
+ elf_i386_lazy_plt_entry, /* plt_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 2, /* plt0_got1_offset */
+ 8, /* plt0_got2_offset */
+ 0, /* plt0_got2_insn_end */
+ 2, /* plt_got_offset */
+ 7, /* plt_reloc_offset */
+ 12, /* plt_plt_offset */
+ 0, /* plt_got_insn_size */
+ 0, /* plt_plt_insn_end */
+ 6, /* plt_lazy_offset */
+ elf_i386_pic_lazy_plt0_entry, /* pic_plt0_entry */
+ elf_i386_pic_lazy_plt_entry, /* pic_plt_entry */
+ elf_i386_eh_frame_lazy_plt, /* eh_frame_plt */
sizeof (elf_i386_eh_frame_lazy_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_non_lazy_plt_layout elf_i386_non_lazy_plt =
{
- elf_i386_non_lazy_plt_entry, /* plt_entry */
- elf_i386_pic_non_lazy_plt_entry, /* pic_plt_entry */
- NON_LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 2, /* plt_got_offset */
- 0, /* plt_got_insn_size */
- elf_i386_eh_frame_non_lazy_plt, /* eh_frame_plt */
+ elf_i386_non_lazy_plt_entry, /* plt_entry */
+ elf_i386_pic_non_lazy_plt_entry, /* pic_plt_entry */
+ NON_LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 2, /* plt_got_offset */
+ 0, /* plt_got_insn_size */
+ elf_i386_eh_frame_non_lazy_plt, /* eh_frame_plt */
sizeof (elf_i386_eh_frame_non_lazy_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_lazy_plt_layout elf_i386_lazy_ibt_plt =
{
- elf_i386_lazy_ibt_plt0_entry, /* plt0_entry */
+ elf_i386_lazy_ibt_plt0_entry, /* plt0_entry */
sizeof (elf_i386_lazy_ibt_plt0_entry), /* plt0_entry_size */
- elf_i386_lazy_ibt_plt_entry, /* plt_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 2, /* plt0_got1_offset */
- 8, /* plt0_got2_offset */
- 0, /* plt0_got2_insn_end */
- 4+2, /* plt_got_offset */
- 4+1, /* plt_reloc_offset */
- 4+6, /* plt_plt_offset */
- 0, /* plt_got_insn_size */
- 0, /* plt_plt_insn_end */
- 0, /* plt_lazy_offset */
- elf_i386_pic_lazy_ibt_plt0_entry, /* pic_plt0_entry */
- elf_i386_lazy_ibt_plt_entry, /* pic_plt_entry */
- elf_i386_eh_frame_lazy_ibt_plt, /* eh_frame_plt */
+ elf_i386_lazy_ibt_plt_entry, /* plt_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 2, /* plt0_got1_offset */
+ 8, /* plt0_got2_offset */
+ 0, /* plt0_got2_insn_end */
+ 4+2, /* plt_got_offset */
+ 4+1, /* plt_reloc_offset */
+ 4+6, /* plt_plt_offset */
+ 0, /* plt_got_insn_size */
+ 0, /* plt_plt_insn_end */
+ 0, /* plt_lazy_offset */
+ elf_i386_pic_lazy_ibt_plt0_entry, /* pic_plt0_entry */
+ elf_i386_lazy_ibt_plt_entry, /* pic_plt_entry */
+ elf_i386_eh_frame_lazy_ibt_plt, /* eh_frame_plt */
sizeof (elf_i386_eh_frame_lazy_ibt_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_non_lazy_plt_layout elf_i386_non_lazy_ibt_plt =
{
- elf_i386_non_lazy_ibt_plt_entry, /* plt_entry */
+ elf_i386_non_lazy_ibt_plt_entry, /* plt_entry */
elf_i386_pic_non_lazy_ibt_plt_entry,/* pic_plt_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 4+2, /* plt_got_offset */
- 0, /* plt_got_insn_size */
- elf_i386_eh_frame_non_lazy_plt, /* eh_frame_plt */
+ LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 4+2, /* plt_got_offset */
+ 0, /* plt_got_insn_size */
+ elf_i386_eh_frame_non_lazy_plt, /* eh_frame_plt */
sizeof (elf_i386_eh_frame_non_lazy_plt) /* eh_frame_plt_size */
};
\f
/* These are the standard parameters. */
static const struct elf_x86_backend_data elf_i386_arch_bed =
{
- is_normal /* os */
+ is_normal /* os */
};
#define elf_backend_arch_data &elf_i386_arch_bed
size *= (sizeof (bfd_signed_vma)
+ sizeof (bfd_vma) + sizeof(char));
local_got_refcounts = (bfd_signed_vma *)
- bfd_zalloc (abfd, size);
+ bfd_zalloc (abfd, size);
if (local_got_refcounts == NULL)
goto error_return;
elf_local_got_refcounts (abfd) = local_got_refcounts;
{
bfd_size_type amt = sizeof *p;
p = (struct elf_dyn_relocs *) bfd_alloc (htab->elf.dynobj,
- amt);
+ amt);
if (p == NULL)
goto error_return;
p->next = *head;
/* We have to handle relocations in vxworks .tls_vars sections
specially, because the dynamic loader is 'weird'. */
is_vxworks_tls = (htab->target_os == is_vxworks
- && bfd_link_pic (info)
+ && bfd_link_pic (info)
&& !strcmp (input_section->output_section->name,
".tls_vars"));
{
if (indx == 0)
{
- BFD_ASSERT (! unresolved_reloc);
+ BFD_ASSERT (! unresolved_reloc);
bfd_put_32 (output_bfd,
relocation - _bfd_x86_elf_dtpoff_base (info),
htab->elf.sgot->contents + off + 4);
+ gotplt->output_offset
+ got_offset),
resolved_plt->contents + plt_offset
- + htab->plt.plt_got_offset);
+ + htab->plt.plt_got_offset);
if (htab->target_os == is_vxworks)
{
/* S: Current slot number (zero-based). */
s = ((h->plt.offset - htab->plt.plt_entry_size)
- / htab->plt.plt_entry_size);
+ / htab->plt.plt_entry_size);
/* K: Number of relocations for PLTResolve. */
if (bfd_link_pic (info))
k = PLTRESOLVE_RELOCS_SHLIB;
{
bfd_put_32 (output_bfd, got_offset,
resolved_plt->contents + plt_offset
- + htab->plt.plt_got_offset);
+ + htab->plt.plt_got_offset);
}
/* Fill in the entry in the global offset table. Leave the entry
&& htab->dynsym->contents != NULL)
{
/* Check relocation against STT_GNU_IFUNC symbol if there are
- dynamic symbols. */
+ dynamic symbols. */
unsigned long r_symndx = ELF32_R_SYM (rela->r_info);
if (r_symndx != STN_UNDEF)
{
#define elf_backend_strtab_flags SHF_STRINGS
/* Called to set the sh_flags, sh_link and sh_info fields of OSECTION which
- has a type >= SHT_LOOS. Returns TRUE if these fields were initialised
+ has a type >= SHT_LOOS. Returns TRUE if these fields were initialised
FALSE otherwise. ISECTION is the best guess matching section from the
input bfd IBFD, but it might be NULL. */
http://docs.oracle.com/cd/E53394_01/html/E54813/chapter6-94076.html#scrolltoc
The following values should be set:
-
-Type Link Info
+
+Type Link Info
-----------------------------------------------------------------------------
SHT_SUNW_ancillary The section header index of 0
- [0x6fffffee] the associated string table.
-
+ [0x6fffffee] the associated string table.
+
SHT_SUNW_capinfo The section header index of For a dynamic object, the
- [0x6ffffff0] the associated symbol table. section header index of
- the associated
+ [0x6ffffff0] the associated symbol table. section header index of
+ the associated
SHT_SUNW_capchain table,
otherwise 0.
SHT_SUNW_symsort The section header index of 0
- [0x6ffffff1] the associated symbol table.
+ [0x6ffffff1] the associated symbol table.
SHT_SUNW_tlssort The section header index of 0
- [0x6ffffff2] the associated symbol table.
-
-SHT_SUNW_LDYNSYM The section header index of One greater than the
- [0x6ffffff3] the associated string table. symbol table index of the
- This index is the same string last local symbol,
+ [0x6ffffff2] the associated symbol table.
+
+SHT_SUNW_LDYNSYM The section header index of One greater than the
+ [0x6ffffff3] the associated string table. symbol table index of the
+ This index is the same string last local symbol,
table used by the SHT_DYNSYM STB_LOCAL. Since
- section. SHT_SUNW_LDYNSYM only
- contains local symbols,
+ section. SHT_SUNW_LDYNSYM only
+ contains local symbols,
sh_info is equivalent to
the number of symbols in
the table.
-SHT_SUNW_cap If symbol capabilities exist, If any capabilities refer
- [0x6ffffff5] the section header index of to named strings, the
- the associated section header index of
- SHT_SUNW_capinfo table, the associated string
- otherwise 0. table, otherwise 0.
+SHT_SUNW_cap If symbol capabilities exist, If any capabilities refer
+ [0x6ffffff5] the section header index of to named strings, the
+ the associated section header index of
+ SHT_SUNW_capinfo table, the associated string
+ otherwise 0. table, otherwise 0.
-SHT_SUNW_move The section header index of 0
- [0x6ffffffa] the associated symbol table.
-
-SHT_SUNW_COMDAT 0 0
+SHT_SUNW_move The section header index of 0
+ [0x6ffffffa] the associated symbol table.
+
+SHT_SUNW_COMDAT 0 0
[0x6ffffffb]
SHT_SUNW_syminfo The section header index of The section header index
- [0x6ffffffc] the associated symbol table. of the associated
- .dynamic section.
+ [0x6ffffffc] the associated symbol table. of the associated
+ .dynamic section.
-SHT_SUNW_verdef The section header index of The number of version
- [0x6ffffffd] the associated string table. definitions within the
- section.
+SHT_SUNW_verdef The section header index of The number of version
+ [0x6ffffffd] the associated string table. definitions within the
+ section.
SHT_SUNW_verneed The section header index of The number of version
- [0x6ffffffe] the associated string table. dependencies within the
- section.
+ [0x6ffffffe] the associated string table. dependencies within the
+ section.
-SHT_SUNW_versym The section header index of 0
- [0x6fffffff] the associated symbol table. */
+SHT_SUNW_versym The section header index of 0
+ [0x6fffffff] the associated symbol table. */
}
#undef elf_backend_copy_special_section_fields
#undef elf_backend_static_tls_alignment
#undef elf_backend_want_plt_sym
-#define elf_backend_want_plt_sym 0
+#define elf_backend_want_plt_sym 0
#undef elf_backend_strtab_flags
#undef elf_backend_copy_special_section_fields
static const bfd_byte elf_i386_nacl_plt0_entry[] =
{
0xff, 0x35, /* pushl contents of address */
- 0, 0, 0, 0, /* replaced with address of .got + 4. */
- 0x8b, 0x0d, /* movl contents of address, %ecx */
- 0, 0, 0, 0, /* replaced with address of .got + 8. */
+ 0, 0, 0, 0, /* replaced with address of .got + 4. */
+ 0x8b, 0x0d, /* movl contents of address, %ecx */
+ 0, 0, 0, 0, /* replaced with address of .got + 8. */
0x83, 0xe1, NACLMASK, /* andl $NACLMASK, %ecx */
0xff, 0xe1 /* jmp *%ecx */
};
0x83, 0xe1, NACLMASK, /* andl $NACLMASK, %ecx */
0xff, 0xe1, /* jmp *%ecx */
- /* Pad to the next 32-byte boundary with nop instructions. */
+ /* Pad to the next 32-byte boundary with nop instructions. */
0x90,
0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
0x68, /* pushl immediate */
0, 0, 0, 0, /* replaced with reloc offset. */
0xe9, /* jmp relative */
- 0, 0, 0, 0, /* replaced with offset to .plt. */
+ 0, 0, 0, 0, /* replaced with offset to .plt. */
- /* Pad to the next 32-byte boundary with nop instructions. */
+ /* Pad to the next 32-byte boundary with nop instructions. */
0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
0x90, 0x90
static const bfd_byte elf_i386_nacl_pic_plt_entry[NACL_PLT_ENTRY_SIZE] =
{
- 0x8b, 0x8b, /* movl offset(%ebx), %ecx */
- 0, 0, 0, 0, /* replaced with offset of this symbol in .got. */
- 0x83, 0xe1, 0xe0, /* andl $NACLMASK, %ecx */
- 0xff, 0xe1, /* jmp *%ecx */
+ 0x8b, 0x8b, /* movl offset(%ebx), %ecx */
+ 0, 0, 0, 0, /* replaced with offset of this symbol in .got. */
+ 0x83, 0xe1, 0xe0, /* andl $NACLMASK, %ecx */
+ 0xff, 0xe1, /* jmp *%ecx */
- /* Pad to the next 32-byte boundary with nop instructions. */
+ /* Pad to the next 32-byte boundary with nop instructions. */
0x90,
0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
/* Lazy GOT entries point here (32-byte aligned). */
- 0x68, /* pushl immediate */
- 0, 0, 0, 0, /* replaced with offset into relocation table. */
- 0xe9, /* jmp relative */
- 0, 0, 0, 0, /* replaced with offset to start of .plt. */
+ 0x68, /* pushl immediate */
+ 0, 0, 0, 0, /* replaced with offset into relocation table. */
+ 0xe9, /* jmp relative */
+ 0, 0, 0, 0, /* replaced with offset to start of .plt. */
- /* Pad to the next 32-byte boundary with nop instructions. */
+ /* Pad to the next 32-byte boundary with nop instructions. */
0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90,
0x90, 0x90
static const bfd_byte elf_i386_nacl_eh_frame_plt[] =
{
-#if (PLT_CIE_LENGTH != 20 \
- || PLT_FDE_LENGTH != 36 \
- || PLT_FDE_START_OFFSET != 4 + PLT_CIE_LENGTH + 8 \
+#if (PLT_CIE_LENGTH != 20 \
+ || PLT_FDE_LENGTH != 36 \
+ || PLT_FDE_START_OFFSET != 4 + PLT_CIE_LENGTH + 8 \
|| PLT_FDE_LEN_OFFSET != 4 + PLT_CIE_LENGTH + 12)
# error "Need elf_x86_backend_data parameters for eh_frame_plt offsets!"
#endif
PLT_CIE_LENGTH, 0, 0, 0, /* CIE length */
- 0, 0, 0, 0, /* CIE ID */
- 1, /* CIE version */
- 'z', 'R', 0, /* Augmentation string */
- 1, /* Code alignment factor */
- 0x7c, /* Data alignment factor: -4 */
- 8, /* Return address column */
+ 0, 0, 0, 0, /* CIE ID */
+ 1, /* CIE version */
+ 'z', 'R', 0, /* Augmentation string */
+ 1, /* Code alignment factor */
+ 0x7c, /* Data alignment factor: -4 */
+ 8, /* Return address column */
1, /* Augmentation size */
DW_EH_PE_pcrel | DW_EH_PE_sdata4, /* FDE encoding */
DW_CFA_def_cfa, 4, 4, /* DW_CFA_def_cfa: r4 (esp) ofs 4 */
DW_CFA_offset + 8, 1, /* DW_CFA_offset: r8 (eip) at cfa-4 */
DW_CFA_nop, DW_CFA_nop,
- PLT_FDE_LENGTH, 0, 0, 0, /* FDE length */
+ PLT_FDE_LENGTH, 0, 0, 0, /* FDE length */
PLT_CIE_LENGTH + 8, 0, 0, 0, /* CIE pointer */
- 0, 0, 0, 0, /* R_386_PC32 .plt goes here */
- 0, 0, 0, 0, /* .plt size goes here */
- 0, /* Augmentation size */
- DW_CFA_def_cfa_offset, 8, /* DW_CFA_def_cfa_offset: 8 */
- DW_CFA_advance_loc + 6, /* DW_CFA_advance_loc: 6 to __PLT__+6 */
- DW_CFA_def_cfa_offset, 12, /* DW_CFA_def_cfa_offset: 12 */
- DW_CFA_advance_loc + 58, /* DW_CFA_advance_loc: 58 to __PLT__+64 */
- DW_CFA_def_cfa_expression, /* DW_CFA_def_cfa_expression */
- 13, /* Block length */
- DW_OP_breg4, 4, /* DW_OP_breg4 (esp): 4 */
- DW_OP_breg8, 0, /* DW_OP_breg8 (eip): 0 */
+ 0, 0, 0, 0, /* R_386_PC32 .plt goes here */
+ 0, 0, 0, 0, /* .plt size goes here */
+ 0, /* Augmentation size */
+ DW_CFA_def_cfa_offset, 8, /* DW_CFA_def_cfa_offset: 8 */
+ DW_CFA_advance_loc + 6, /* DW_CFA_advance_loc: 6 to __PLT__+6 */
+ DW_CFA_def_cfa_offset, 12, /* DW_CFA_def_cfa_offset: 12 */
+ DW_CFA_advance_loc + 58, /* DW_CFA_advance_loc: 58 to __PLT__+64 */
+ DW_CFA_def_cfa_expression, /* DW_CFA_def_cfa_expression */
+ 13, /* Block length */
+ DW_OP_breg4, 4, /* DW_OP_breg4 (esp): 4 */
+ DW_OP_breg8, 0, /* DW_OP_breg8 (eip): 0 */
DW_OP_const1u, 63, DW_OP_and, DW_OP_const1u, 37, DW_OP_ge,
DW_OP_lit2, DW_OP_shl, DW_OP_plus,
DW_CFA_nop, DW_CFA_nop
static const struct elf_x86_backend_data elf_i386_nacl_arch_bed =
{
- is_nacl /* os */
+ is_nacl /* os */
};
static bfd_boolean
static const struct elf_x86_backend_data elf_i386_vxworks_arch_bed =
{
- is_vxworks /* os */
+ is_vxworks /* os */
};
#undef elf_backend_arch_data
/* special_function for R_860_PC26 relocation. */
static bfd_reloc_status_type
i860_howto_pc26_reloc (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *reloc_entry,
- asymbol *symbol,
- void *data ATTRIBUTE_UNUSED,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void *data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma insn;
bfd_vma relocation;
/* Adjust for PC-relative relocation. */
relocation -= (input_section->output_section->vma
- + input_section->output_offset
- + reloc_entry->address
- + 4);
+ + input_section->output_offset
+ + reloc_entry->address
+ + 4);
/* Check for target out of range. */
if ((bfd_signed_vma)relocation > (0x3ffffff << 2)
relocation >>= reloc_entry->howto->rightshift;
insn = (insn & ~reloc_entry->howto->dst_mask)
- | (relocation & reloc_entry->howto->dst_mask);
+ | (relocation & reloc_entry->howto->dst_mask);
bfd_put_32 (abfd, (bfd_vma) insn, addr);
/* special_function for R_860_PC16 relocation. */
static bfd_reloc_status_type
i860_howto_pc16_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol,
- void *data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void *data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma insn;
bfd_vma relocation;
/* Adjust for PC-relative relocation. */
relocation -= (input_section->output_section->vma
- + input_section->output_offset
- + reloc_entry->address
- + 4);
+ + input_section->output_offset
+ + reloc_entry->address
+ + 4);
/* Check for target out of range. */
if ((bfd_signed_vma)relocation > (0x7fff << 2)
relocation >>= reloc_entry->howto->rightshift;
relocation = (((relocation & 0xf800) << 5) | (relocation & 0x7ff))
- & reloc_entry->howto->dst_mask;
+ & reloc_entry->howto->dst_mask;
insn = (insn & ~reloc_entry->howto->dst_mask) | relocation;
bfd_put_32 (abfd, (bfd_vma) insn, addr);
/* special_function for R_860_HIGHADJ relocation. */
static bfd_reloc_status_type
i860_howto_highadj_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol,
- void *data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void *data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma insn;
bfd_vma relocation;
/* special_function for R_860_SPLITn relocations. */
static bfd_reloc_status_type
i860_howto_splitn_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol,
- void *data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void *data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma insn;
bfd_vma relocation;
insn = bfd_get_32 (abfd, addr);
relocation = (((relocation & 0xf800) << 5) | (relocation & 0x7ff))
- & reloc_entry->howto->dst_mask;
+ & reloc_entry->howto->dst_mask;
insn = (insn & ~reloc_entry->howto->dst_mask) | relocation;
bfd_put_32 (abfd, (bfd_vma) insn, addr);
FALSE), /* pcrel_offset */
/* A 26-bit PC-relative relocation. */
- HOWTO (R_860_PC26, /* type */
+ HOWTO (R_860_PC26, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
26, /* bitsize */
FALSE, /* partial_inplace */
0x3ffffff, /* src_mask */
0x3ffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
- HOWTO (R_860_PLT26, /* type */
+ HOWTO (R_860_PLT26, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
26, /* bitsize */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* A 16-bit PC-relative relocation. */
- HOWTO (R_860_PC16, /* type */
+ HOWTO (R_860_PC16, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0x1f07ff, /* src_mask */
0x1f07ff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
- HOWTO (R_860_LOW0, /* type */
+ HOWTO (R_860_LOW0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_SPLIT0, /* type */
+ HOWTO (R_860_SPLIT0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0x1f07ff, /* src_mask */
0x1f07ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_LOW1, /* type */
+ HOWTO (R_860_LOW1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xfffe, /* src_mask */
0xfffe, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_SPLIT1, /* type */
+ HOWTO (R_860_SPLIT1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0x1f07fe, /* src_mask */
0x1f07fe, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_LOW2, /* type */
+ HOWTO (R_860_LOW2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xfffc, /* src_mask */
0xfffc, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_SPLIT2, /* type */
+ HOWTO (R_860_SPLIT2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0x1f07fc, /* src_mask */
0x1f07fc, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_LOW3, /* type */
+ HOWTO (R_860_LOW3, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xfff8, /* src_mask */
0xfff8, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_LOGOT0, /* type */
+ HOWTO (R_860_LOGOT0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
- HOWTO (R_860_SPGOT0, /* type */
+ HOWTO (R_860_SPGOT0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
- HOWTO (R_860_LOGOT1, /* type */
+ HOWTO (R_860_LOGOT1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
- HOWTO (R_860_SPGOT1, /* type */
+ HOWTO (R_860_SPGOT1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
- HOWTO (R_860_LOGOTOFF0, /* type */
+ HOWTO (R_860_LOGOTOFF0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_SPGOTOFF0, /* type */
+ HOWTO (R_860_SPGOTOFF0, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_LOGOTOFF1, /* type */
+ HOWTO (R_860_LOGOTOFF1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_860_SPGOTOFF1, /* type */
0, /* rightshift */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_LOGOTOFF2, /* type */
+ HOWTO (R_860_LOGOTOFF2, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_LOGOTOFF3, /* type */
+ HOWTO (R_860_LOGOTOFF3, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_LOPC, /* type */
+ HOWTO (R_860_LOPC, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
- HOWTO (R_860_HIGHADJ, /* type */
+ HOWTO (R_860_HIGHADJ, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_HAGOT, /* type */
+ HOWTO (R_860_HAGOT, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
- HOWTO (R_860_HAGOTOFF, /* type */
+ HOWTO (R_860_HAGOTOFF, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_HAPC, /* type */
+ HOWTO (R_860_HAPC, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
- HOWTO (R_860_HIGH, /* type */
+ HOWTO (R_860_HIGH, /* type */
16, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_860_HIGOT, /* type */
+ HOWTO (R_860_HIGOT, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
- HOWTO (R_860_HIGOTOFF, /* type */
+ HOWTO (R_860_HIGOTOFF, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
};
\f
static unsigned char elf_code_to_howto_index[R_860_max + 1];
memset (elf_code_to_howto_index, 0xff,
sizeof (elf_code_to_howto_index));
for (i = 0; i < howto_tbl_size; i++)
- elf_code_to_howto_index[elf32_i860_howto_table[i].type] = i;
+ elf_code_to_howto_index[elf32_i860_howto_table[i].type] = i;
}
BFD_ASSERT (rtype <= R_860_max);
for (rel = relocs; rel < relend; rel ++)
{
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- const char * name = NULL;
- int r_type;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char * name = NULL;
+ int r_type;
r_type = ELF32_R_TYPE (rel->r_info);
r_symndx = ELF32_R_SYM (rel->r_info);
#define ELF_MAXPAGESIZE 4096
#define elf_backend_rela_normal 1
-#define elf_info_to_howto_rel NULL
+#define elf_info_to_howto_rel NULL
#define elf_info_to_howto elf32_i860_info_to_howto_rela
#define elf_backend_relocate_section elf32_i860_relocate_section
#define bfd_elf32_bfd_reloc_type_lookup elf32_i860_reloc_type_lookup
}
static void
-elf32_i960_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
- arelent * cache_ptr ATTRIBUTE_UNUSED,
+elf32_i960_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
+ arelent * cache_ptr ATTRIBUTE_UNUSED,
Elf_Internal_Rela * dst ATTRIBUTE_UNUSED)
{
abort ();
#define TARGET_LITTLE_NAME "elf32-i960"
#define ELF_ARCH bfd_arch_i960
#define ELF_MACHINE_CODE EM_960
-#define ELF_MAXPAGESIZE 1 /* FIXME: This number is wrong, It should be the page size in bytes. */
+#define ELF_MAXPAGESIZE 1 /* FIXME: This number is wrong, It should be the page size in bytes. */
#include "elf32-target.h"
{
Elf_Internal_Shdr * symtab_hdr;
Elf_Internal_Rela * irelbase;
- bfd_byte * contents;
+ bfd_byte * contents;
Elf_Internal_Sym * isymbuf;
};
static reloc_howto_type ip2k_elf_howto_table [] =
{
#define IP2K_HOWTO(t,rs,s,bs,pr,bp,name,sm,dm) \
- HOWTO(t, /* type */ \
- rs, /* rightshift */ \
- s, /* size (0 = byte, 1 = short, 2 = long) */ \
- bs, /* bitsize */ \
- pr, /* pc_relative */ \
- bp, /* bitpos */ \
- complain_overflow_dont,/* complain_on_overflow */ \
- bfd_elf_generic_reloc,/* special_function */ \
- name, /* name */ \
- FALSE, /* partial_inplace */ \
- sm, /* src_mask */ \
- dm, /* dst_mask */ \
- pr) /* pcrel_offset */
+ HOWTO(t, /* type */ \
+ rs, /* rightshift */ \
+ s, /* size (0 = byte, 1 = short, 2 = long) */ \
+ bs, /* bitsize */ \
+ pr, /* pc_relative */ \
+ bp, /* bitpos */ \
+ complain_overflow_dont,/* complain_on_overflow */ \
+ bfd_elf_generic_reloc,/* special_function */ \
+ name, /* name */ \
+ FALSE, /* partial_inplace */ \
+ sm, /* src_mask */ \
+ dm, /* dst_mask */ \
+ pr) /* pcrel_offset */
/* This reloc does nothing. */
IP2K_HOWTO (R_IP2K_NONE, 0,3,0, FALSE, 0, "R_IP2K_NONE", 0, 0),
the prologue of a switch dispatch table with fewer than
128 entries.
- sc
- page $nnn0
- jmp $nnn0
- add w,wreg
- add pcl,w
+ sc
+ page $nnn0
+ jmp $nnn0
+ add w,wreg
+ add pcl,w
addr=>
- page $nnn1
- jmp $nnn1
- page $nnn2
- jmp $nnn2
- ...
- page $nnnN
- jmp $nnnN
+ page $nnn1
+ jmp $nnn1
+ page $nnn2
+ jmp $nnn2
+ ...
+ page $nnnN
+ jmp $nnnN
After relaxation.
- sc
- page $nnn0
- jmp $nnn0
- add pcl,w
+ sc
+ page $nnn0
+ jmp $nnn0
+ add pcl,w
addr=>
- jmp $nnn1
- jmp $nnn2
- ...
- jmp $nnnN */
+ jmp $nnn1
+ jmp $nnn2
+ ...
+ jmp $nnnN */
static int
ip2k_is_switch_table_128 (bfd *abfd ATTRIBUTE_UNUSED,
256 entries but more than 127.
Before relaxation.
- push %lo8insn(label) ; Push address of table
- push %hi8insn(label)
- add w,wreg ; index*2 => offset
- snc ; CARRY SET?
- inc 1(sp) ; Propagate MSB into table address
- add 2(sp),w ; Add low bits of offset to table address
- snc ; and handle any carry-out
- inc 1(sp)
+ push %lo8insn(label) ; Push address of table
+ push %hi8insn(label)
+ add w,wreg ; index*2 => offset
+ snc ; CARRY SET?
+ inc 1(sp) ; Propagate MSB into table address
+ add 2(sp),w ; Add low bits of offset to table address
+ snc ; and handle any carry-out
+ inc 1(sp)
addr=>
- page __indjmp ; Do an indirect jump to that location
- jmp __indjmp
- label: ; case dispatch table starts here
- page $nnn1
- jmp $nnn1
- page $nnn2
- jmp $nnn2
- ...
- page $nnnN
- jmp $nnnN
+ page __indjmp ; Do an indirect jump to that location
+ jmp __indjmp
+ label: ; case dispatch table starts here
+ page $nnn1
+ jmp $nnn1
+ page $nnn2
+ jmp $nnn2
+ ...
+ page $nnnN
+ jmp $nnnN
After relaxation.
- push %lo8insn(label) ; Push address of table
- push %hi8insn(label)
- add 2(sp),w ; Add low bits of offset to table address
- snc ; and handle any carry-out
- inc 1(sp)
+ push %lo8insn(label) ; Push address of table
+ push %hi8insn(label)
+ add 2(sp),w ; Add low bits of offset to table address
+ snc ; and handle any carry-out
+ inc 1(sp)
addr=>
- page __indjmp ; Do an indirect jump to that location
- jmp __indjmp
- label: ; case dispatch table starts here
- jmp $nnn1
- jmp $nnn2
- ...
- jmp $nnnN */
+ page __indjmp ; Do an indirect jump to that location
+ jmp __indjmp
+ label: ; case dispatch table starts here
+ jmp $nnn1
+ jmp $nnn2
+ ...
+ jmp $nnnN */
static int
ip2k_is_switch_table_256 (bfd *abfd ATTRIBUTE_UNUSED,
/* Found a page instruction, check if conditional. */
if (addr >= 2)
- {
+ {
ip2k_get_mem (abfd, contents + addr - 2, 2, code);
- if (IS_SKIP_OPCODE (code))
+ if (IS_SKIP_OPCODE (code))
/* Page is conditional. */
continue;
- }
+ }
/* Unconditional page instruction => page bits should be correct. */
return page;
for (irel = irelbase; irel < irelend; irel++)
{
if (ELF32_R_TYPE (irel->r_info) != R_IP2K_NONE)
- {
- /* Get the value of the symbol referred to by the reloc. */
- if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
- {
- asection *sym_sec;
+ {
+ /* Get the value of the symbol referred to by the reloc. */
+ if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
+ {
+ asection *sym_sec;
- /* A local symbol. */
+ /* A local symbol. */
isym = isymbuf + ELF32_R_SYM (irel->r_info);
- sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
- if (isym->st_shndx == shndx)
- {
- bfd_vma baseaddr = BASEADDR (sec);
- bfd_vma symval = BASEADDR (sym_sec) + isym->st_value
- + irel->r_addend;
+ if (isym->st_shndx == shndx)
+ {
+ bfd_vma baseaddr = BASEADDR (sec);
+ bfd_vma symval = BASEADDR (sym_sec) + isym->st_value
+ + irel->r_addend;
- if ((baseaddr + addr + noadj) <= symval
- && symval < (baseaddr + endaddr))
- irel->r_addend += count;
- }
- }
- }
+ if ((baseaddr + addr + noadj) <= symval
+ && symval < (baseaddr + endaddr))
+ irel->r_addend += count;
+ }
+ }
+ }
/* Do this only for PC space relocations. */
if (addr <= irel->r_offset && irel->r_offset < endaddr)
- irel->r_offset += count;
+ irel->r_offset += count;
}
/* Now fix the stab relocations. */
|| sym_hash->root.type == bfd_link_hash_defweak)
&& sym_hash->root.u.def.section == sec)
{
- if (addr <= sym_hash->root.u.def.value
- && sym_hash->root.u.def.value < endaddr)
+ if (addr <= sym_hash->root.u.def.value
+ && sym_hash->root.u.def.value < endaddr)
sym_hash->root.u.def.value += count;
}
}
break;
/* Validate relocation entry (every entry should have a matching
- relocation entry). */
+ relocation entry). */
if (ireltest >= irelend)
- {
+ {
_bfd_error_handler (_("ip2k relaxer: switch table without complete matching relocation information."));
- return FALSE;
- }
+ return FALSE;
+ }
if (ireltest->r_offset != addr)
- {
+ {
_bfd_error_handler (_("ip2k relaxer: switch table without complete matching relocation information."));
- return FALSE;
- }
+ return FALSE;
+ }
if (! ip2k_test_page_insn (abfd, sec, ireltest, misc))
/* Un-removable page insn => nothing can be done. */
break;
/* Validate relocation entry (every entry should have a matching
- relocation entry). */
+ relocation entry). */
if (ireltest >= irelend)
- {
- _bfd_error_handler (_("ip2k relaxer: switch table without complete matching relocation information."));
- return FALSE;
- }
+ {
+ _bfd_error_handler (_("ip2k relaxer: switch table without complete matching relocation information."));
+ return FALSE;
+ }
if (ireltest->r_offset != addr)
- {
- _bfd_error_handler (_("ip2k relaxer: switch table without complete matching relocation information."));
- return FALSE;
- }
+ {
+ _bfd_error_handler (_("ip2k relaxer: switch table without complete matching relocation information."));
+ return FALSE;
+ }
if (!ip2k_test_page_insn (abfd, sec, ireltest, misc))
/* Un-removable page insn => nothing can be done. */
if ((pass == 1) || (new_pass && !changed))
{
/* On the first pass we simply search for the lowest page that
- we havn't relaxed yet. Note that the pass count is reset
- each time a page is complete in order to move on to the next page.
- If we can't find any more pages then we are finished. */
+ we havn't relaxed yet. Note that the pass count is reset
+ each time a page is complete in order to move on to the next page.
+ If we can't find any more pages then we are finished. */
if (new_pass)
{
pass = 1;
if ((BASEADDR (sec) + sec->size >= page_start)
&& (BASEADDR (sec) <= page_end))
{
- if (!ip2k_elf_relax_section_page (abfd, sec, &changed, &misc, page_start, page_end))
+ if (!ip2k_elf_relax_section_page (abfd, sec, &changed, &misc, page_start, page_end))
return FALSE;
}
*again = TRUE;
static bfd_reloc_status_type
ip2k_final_link_relocate (reloc_howto_type * howto,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * rel,
- bfd_vma relocation)
+ bfd_vma relocation)
{
static bfd_vma page_addr = 0;
/* No preceding page instruction, verify that it isn't needed. */
if (PAGENO (relocation + rel->r_addend) !=
ip2k_nominal_page_bits (input_bfd, input_section,
- rel->r_offset, contents))
+ rel->r_offset, contents))
/* xgettext:c-format */
_bfd_error_handler (_("ip2k linker: missing page instruction at %#Lx (dest = %#Lx)"),
BASEADDR (input_section) + rel->r_offset,
relocation + rel->r_addend);
- }
+ }
else if (ip2k_relaxed)
- {
- /* Preceding page instruction. Verify that the page instruction is
- really needed. One reason for the relaxation to miss a page is if
- the section is not marked as executable. */
+ {
+ /* Preceding page instruction. Verify that the page instruction is
+ really needed. One reason for the relaxation to miss a page is if
+ the section is not marked as executable. */
if (!ip2k_is_switch_table_128 (input_bfd, input_section,
rel->r_offset - 2, contents)
&& !ip2k_is_switch_table_256 (input_bfd, input_section,
_bfd_error_handler (_("ip2k linker: redundant page instruction at %#Lx (dest = %#Lx)"),
page_addr,
relocation + rel->r_addend);
- }
+ }
if ((relocation & IP2K_INSN_MASK) == IP2K_INSN_VALUE)
relocation &= ~IP2K_INSN_MASK;
else
for (rel = relocs; rel < relend; rel ++)
{
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- const char * name = NULL;
- int r_type;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char * name = NULL;
+ int r_type;
r_type = ELF32_R_TYPE (rel->r_info);
r_symndx = ELF32_R_SYM (rel->r_info);
break;
/* This is how ip2k_final_link_relocate tells us of a non-kosher
- reference between insn & data address spaces. */
+ reference between insn & data address spaces. */
case bfd_reloc_notsupported:
- if (sym != NULL) /* Only if it's not an unresolved symbol. */
- msg = _("unsupported relocation between data/insn address spaces");
+ if (sym != NULL) /* Only if it's not an unresolved symbol. */
+ msg = _("unsupported relocation between data/insn address spaces");
break;
case bfd_reloc_dangerous:
#define elf_info_to_howto_rel NULL
#define elf_info_to_howto ip2k_info_to_howto_rela
-#define elf_backend_can_gc_sections 1
+#define elf_backend_can_gc_sections 1
#define elf_backend_rela_normal 1
#define elf_backend_relocate_section ip2k_elf_relocate_section
/* Call the allocation method of the superclass. */
ret = ((struct elf_lm32_link_hash_entry *)
- _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
- table, string));
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+ table, string));
if (ret != NULL)
{
struct elf_lm32_link_hash_entry *eh;
static reloc_howto_type lm32_elf_howto_table [] =
{
/* This reloc does nothing. */
- HOWTO (R_LM32_NONE, /* type */
- 0, /* rightshift */
- 3, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_LM32_NONE", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_LM32_NONE, /* type */
+ 0, /* rightshift */
+ 3, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_LM32_NONE", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* An 8 bit absolute relocation. */
- HOWTO (R_LM32_8, /* type */
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_LM32_8", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_LM32_8, /* type */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_LM32_8", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* A 16 bit absolute relocation. */
- HOWTO (R_LM32_16, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_LM32_16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_LM32_16, /* type */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_LM32_16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* A 32 bit absolute relocation. */
- HOWTO (R_LM32_32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_LM32_32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_LM32_HI16, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_LM32_HI16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_LM32_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_LM32_LO16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_LM32_GPREL16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- lm32_elf_gprel_reloc, /* special_function */
- "R_LM32_GPREL16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_LM32_CALL, /* type */
- 2, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 26, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_LM32_CALL", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x3ffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
-
- HOWTO (R_LM32_BRANCH, /* type */
- 2, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_LM32_BRANCH", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOWTO (R_LM32_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_LM32_32", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_LM32_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_LM32_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_LM32_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_LM32_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_LM32_GPREL16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ lm32_elf_gprel_reloc, /* special_function */
+ "R_LM32_GPREL16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_LM32_CALL, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_LM32_CALL", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x3ffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_LM32_BRANCH, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_LM32_BRANCH", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy. */
- HOWTO (R_LM32_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_LM32_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_LM32_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_LM32_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage. */
- HOWTO (R_LM32_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn,/* special_function */
- "R_LM32_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_LM32_16_GOT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_LM32_16_GOT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_LM32_GOTOFF_HI16, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_LM32_GOTOFF_HI16", /* name */
- FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_LM32_GOTOFF_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_LM32_GOTOFF_LO16", /* name */
- FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_LM32_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn,/* special_function */
+ "R_LM32_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_LM32_16_GOT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_LM32_16_GOT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_LM32_GOTOFF_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_LM32_GOTOFF_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_LM32_GOTOFF_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_LM32_GOTOFF_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (R_LM32_COPY, /* type */
0, /* rightshift */
static const struct lm32_reloc_map lm32_reloc_map[] =
{
- { BFD_RELOC_NONE, R_LM32_NONE },
- { BFD_RELOC_8, R_LM32_8 },
- { BFD_RELOC_16, R_LM32_16 },
- { BFD_RELOC_32, R_LM32_32 },
- { BFD_RELOC_HI16, R_LM32_HI16 },
- { BFD_RELOC_LO16, R_LM32_LO16 },
- { BFD_RELOC_GPREL16, R_LM32_GPREL16 },
- { BFD_RELOC_LM32_CALL, R_LM32_CALL },
- { BFD_RELOC_LM32_BRANCH, R_LM32_BRANCH },
- { BFD_RELOC_VTABLE_INHERIT, R_LM32_GNU_VTINHERIT },
- { BFD_RELOC_VTABLE_ENTRY, R_LM32_GNU_VTENTRY },
- { BFD_RELOC_LM32_16_GOT, R_LM32_16_GOT },
+ { BFD_RELOC_NONE, R_LM32_NONE },
+ { BFD_RELOC_8, R_LM32_8 },
+ { BFD_RELOC_16, R_LM32_16 },
+ { BFD_RELOC_32, R_LM32_32 },
+ { BFD_RELOC_HI16, R_LM32_HI16 },
+ { BFD_RELOC_LO16, R_LM32_LO16 },
+ { BFD_RELOC_GPREL16, R_LM32_GPREL16 },
+ { BFD_RELOC_LM32_CALL, R_LM32_CALL },
+ { BFD_RELOC_LM32_BRANCH, R_LM32_BRANCH },
+ { BFD_RELOC_VTABLE_INHERIT, R_LM32_GNU_VTINHERIT },
+ { BFD_RELOC_VTABLE_ENTRY, R_LM32_GNU_VTENTRY },
+ { BFD_RELOC_LM32_16_GOT, R_LM32_16_GOT },
{ BFD_RELOC_LM32_GOTOFF_HI16, R_LM32_GOTOFF_HI16 },
{ BFD_RELOC_LM32_GOTOFF_LO16, R_LM32_GOTOFF_LO16 },
- { BFD_RELOC_LM32_COPY, R_LM32_COPY },
- { BFD_RELOC_LM32_GLOB_DAT, R_LM32_GLOB_DAT },
- { BFD_RELOC_LM32_JMP_SLOT, R_LM32_JMP_SLOT },
- { BFD_RELOC_LM32_RELATIVE, R_LM32_RELATIVE },
+ { BFD_RELOC_LM32_COPY, R_LM32_COPY },
+ { BFD_RELOC_LM32_GLOB_DAT, R_LM32_GLOB_DAT },
+ { BFD_RELOC_LM32_JMP_SLOT, R_LM32_JMP_SLOT },
+ { BFD_RELOC_LM32_RELATIVE, R_LM32_RELATIVE },
};
static reloc_howto_type *
lm32_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
unsigned int i;
static void
lm32_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *cache_ptr,
- Elf_Internal_Rela *dst)
+ arelent *cache_ptr,
+ Elf_Internal_Rela *dst)
{
unsigned int r_type;
switch (bfd_get_mach (abfd))
{
case bfd_mach_lm32:
- elf_elfheader (abfd)->e_flags |= E_LM32_MACH;
- break;
+ elf_elfheader (abfd)->e_flags |= E_LM32_MACH;
+ break;
default:
- abort ();
+ abort ();
}
}
static bfd_reloc_status_type
lm32_elf_final_gp (bfd *output_bfd, asymbol *symbol, bfd_boolean relocatable,
- char **error_message, bfd_vma *pgp)
+ char **error_message, bfd_vma *pgp)
{
if (bfd_is_und_section (symbol->section) && !relocatable)
{
static bfd_boolean
lm32_elf_relocate_section (bfd *output_bfd,
- struct bfd_link_info *info,
- bfd *input_bfd,
- asection *input_section,
- bfd_byte *contents,
- Elf_Internal_Rela *relocs,
- Elf_Internal_Sym *local_syms,
- asection **local_sections)
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
Elf_Internal_Shdr *symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd);
r_type = ELF32_R_TYPE (rel->r_info);
if (r_type == R_LM32_GNU_VTENTRY
- || r_type == R_LM32_GNU_VTINHERIT )
- continue;
+ || r_type == R_LM32_GNU_VTINHERIT )
+ continue;
h = NULL;
sym = NULL;
howto = lm32_elf_howto_table + r_type;
if (r_symndx < symtab_hdr->sh_info)
- {
- /* It's a local symbol. */
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
- name = bfd_elf_string_from_elf_section
+ {
+ /* It's a local symbol. */
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+ name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
- }
+ }
else
- {
- /* It's a global symbol. */
- bfd_boolean unresolved_reloc;
+ {
+ /* It's a global symbol. */
+ bfd_boolean unresolved_reloc;
bfd_boolean warned, ignored;
RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
h, sec, relocation,
unresolved_reloc, warned, ignored);
name = h->root.root.string;
- }
+ }
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
rel, 1, relend, howto, 0, contents);
if (bfd_link_relocatable (info))
- {
+ {
/* This is a relocatable link. We don't have to change
anything, unless the reloc is against a section symbol,
in which case we have to adjust according to where the
if (! howto->partial_inplace)
continue;
- /* Shouldn't reach here. */
+ /* Shouldn't reach here. */
abort ();
r = bfd_reloc_ok;
- }
+ }
else
- {
- switch (howto->type)
- {
- case R_LM32_GPREL16:
- if (!lm32_elf_assign_gp (output_bfd, &gp))
- r = bfd_reloc_dangerous;
- else
- {
- relocation = relocation + rel->r_addend - gp;
- rel->r_addend = 0;
- if ((signed)relocation < -32768 || (signed)relocation > 32767)
- r = bfd_reloc_outofrange;
- else
- {
- r = _bfd_final_link_relocate (howto, input_bfd,
- input_section, contents,
- rel->r_offset, relocation,
- rel->r_addend);
- }
- }
- break;
- case R_LM32_16_GOT:
- /* Relocation is to the entry for this symbol in the global
- offset table. */
- BFD_ASSERT (sgot != NULL);
- if (h != NULL)
- {
- bfd_boolean dyn;
- bfd_vma off;
-
- off = h->got.offset;
- BFD_ASSERT (off != (bfd_vma) -1);
-
- dyn = htab->root.dynamic_sections_created;
- if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
+ {
+ switch (howto->type)
+ {
+ case R_LM32_GPREL16:
+ if (!lm32_elf_assign_gp (output_bfd, &gp))
+ r = bfd_reloc_dangerous;
+ else
+ {
+ relocation = relocation + rel->r_addend - gp;
+ rel->r_addend = 0;
+ if ((signed)relocation < -32768 || (signed)relocation > 32767)
+ r = bfd_reloc_outofrange;
+ else
+ {
+ r = _bfd_final_link_relocate (howto, input_bfd,
+ input_section, contents,
+ rel->r_offset, relocation,
+ rel->r_addend);
+ }
+ }
+ break;
+ case R_LM32_16_GOT:
+ /* Relocation is to the entry for this symbol in the global
+ offset table. */
+ BFD_ASSERT (sgot != NULL);
+ if (h != NULL)
+ {
+ bfd_boolean dyn;
+ bfd_vma off;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) -1);
+
+ dyn = htab->root.dynamic_sections_created;
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
bfd_link_pic (info),
h)
- || (bfd_link_pic (info)
- && (info->symbolic
- || h->dynindx == -1
- || h->forced_local)
- && h->def_regular))
- {
- /* This is actually a static link, or it is a
- -Bsymbolic link and the symbol is defined
- locally, or the symbol was forced to be local
- because of a version file. We must initialize
- this entry in the global offset table. Since the
- offset must always be a multiple of 4, we use the
- least significant bit to record whether we have
- initialized it already.
-
- When doing a dynamic link, we create a .rela.got
- relocation entry to initialize the value. This
- is done in the finish_dynamic_symbol routine. */
- if ((off & 1) != 0)
- off &= ~1;
- else
- {
- /* Write entry in GOT */
- bfd_put_32 (output_bfd, relocation,
- sgot->contents + off);
- /* Create entry in .rofixup pointing to GOT entry. */
- if (IS_FDPIC (output_bfd) && h->root.type != bfd_link_hash_undefweak)
- {
- _lm32fdpic_add_rofixup (output_bfd,
- lm32fdpic_fixup32_section
- (info),
- sgot->output_section->vma
- + sgot->output_offset
- + off);
- }
- /* Mark GOT entry as having been written. */
- h->got.offset |= 1;
- }
- }
-
- relocation = sgot->output_offset + off;
- }
- else
- {
- bfd_vma off;
- bfd_byte *loc;
-
- BFD_ASSERT (local_got_offsets != NULL
- && local_got_offsets[r_symndx] != (bfd_vma) -1);
-
- /* Get offset into GOT table. */
- off = local_got_offsets[r_symndx];
-
- /* The offset must always be a multiple of 4. We use
- the least significant bit to record whether we have
- already processed this entry. */
- if ((off & 1) != 0)
- off &= ~1;
- else
- {
- /* Write entry in GOT. */
- bfd_put_32 (output_bfd, relocation, sgot->contents + off);
- /* Create entry in .rofixup pointing to GOT entry. */
- if (IS_FDPIC (output_bfd))
- {
- _lm32fdpic_add_rofixup (output_bfd,
- lm32fdpic_fixup32_section
- (info),
- sgot->output_section->vma
- + sgot->output_offset
- + off);
- }
-
- if (bfd_link_pic (info))
- {
- asection *srelgot;
- Elf_Internal_Rela outrel;
-
- /* We need to generate a R_LM32_RELATIVE reloc
- for the dynamic linker. */
- srelgot = htab->root.srelgot;
- BFD_ASSERT (srelgot != NULL);
-
- outrel.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + off);
- outrel.r_info = ELF32_R_INFO (0, R_LM32_RELATIVE);
- outrel.r_addend = relocation;
- loc = srelgot->contents;
- loc += srelgot->reloc_count * sizeof (Elf32_External_Rela);
- bfd_elf32_swap_reloca_out (output_bfd, &outrel,loc);
- ++srelgot->reloc_count;
- }
-
- local_got_offsets[r_symndx] |= 1;
- }
-
-
- relocation = sgot->output_offset + off;
- }
-
- /* Addend should be zero. */
- if (rel->r_addend != 0)
+ || (bfd_link_pic (info)
+ && (info->symbolic
+ || h->dynindx == -1
+ || h->forced_local)
+ && h->def_regular))
+ {
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. We must initialize
+ this entry in the global offset table. Since the
+ offset must always be a multiple of 4, we use the
+ least significant bit to record whether we have
+ initialized it already.
+
+ When doing a dynamic link, we create a .rela.got
+ relocation entry to initialize the value. This
+ is done in the finish_dynamic_symbol routine. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ /* Write entry in GOT */
+ bfd_put_32 (output_bfd, relocation,
+ sgot->contents + off);
+ /* Create entry in .rofixup pointing to GOT entry. */
+ if (IS_FDPIC (output_bfd) && h->root.type != bfd_link_hash_undefweak)
+ {
+ _lm32fdpic_add_rofixup (output_bfd,
+ lm32fdpic_fixup32_section
+ (info),
+ sgot->output_section->vma
+ + sgot->output_offset
+ + off);
+ }
+ /* Mark GOT entry as having been written. */
+ h->got.offset |= 1;
+ }
+ }
+
+ relocation = sgot->output_offset + off;
+ }
+ else
+ {
+ bfd_vma off;
+ bfd_byte *loc;
+
+ BFD_ASSERT (local_got_offsets != NULL
+ && local_got_offsets[r_symndx] != (bfd_vma) -1);
+
+ /* Get offset into GOT table. */
+ off = local_got_offsets[r_symndx];
+
+ /* The offset must always be a multiple of 4. We use
+ the least significant bit to record whether we have
+ already processed this entry. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ /* Write entry in GOT. */
+ bfd_put_32 (output_bfd, relocation, sgot->contents + off);
+ /* Create entry in .rofixup pointing to GOT entry. */
+ if (IS_FDPIC (output_bfd))
+ {
+ _lm32fdpic_add_rofixup (output_bfd,
+ lm32fdpic_fixup32_section
+ (info),
+ sgot->output_section->vma
+ + sgot->output_offset
+ + off);
+ }
+
+ if (bfd_link_pic (info))
+ {
+ asection *srelgot;
+ Elf_Internal_Rela outrel;
+
+ /* We need to generate a R_LM32_RELATIVE reloc
+ for the dynamic linker. */
+ srelgot = htab->root.srelgot;
+ BFD_ASSERT (srelgot != NULL);
+
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + off);
+ outrel.r_info = ELF32_R_INFO (0, R_LM32_RELATIVE);
+ outrel.r_addend = relocation;
+ loc = srelgot->contents;
+ loc += srelgot->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel,loc);
+ ++srelgot->reloc_count;
+ }
+
+ local_got_offsets[r_symndx] |= 1;
+ }
+
+
+ relocation = sgot->output_offset + off;
+ }
+
+ /* Addend should be zero. */
+ if (rel->r_addend != 0)
_bfd_error_handler (_("internal error: addend should be zero for R_LM32_16_GOT"));
- r = _bfd_final_link_relocate (howto,
- input_bfd,
- input_section,
- contents,
- rel->r_offset,
- relocation,
- rel->r_addend);
- break;
-
- case R_LM32_GOTOFF_LO16:
- case R_LM32_GOTOFF_HI16:
- /* Relocation is offset from GOT. */
+ r = _bfd_final_link_relocate (howto,
+ input_bfd,
+ input_section,
+ contents,
+ rel->r_offset,
+ relocation,
+ rel->r_addend);
+ break;
+
+ case R_LM32_GOTOFF_LO16:
+ case R_LM32_GOTOFF_HI16:
+ /* Relocation is offset from GOT. */
BFD_ASSERT (sgot != NULL);
relocation -= sgot->output_section->vma;
/* Account for sign-extension. */
- if ((r_type == R_LM32_GOTOFF_HI16)
- && ((relocation + rel->r_addend) & 0x8000))
- rel->r_addend += 0x10000;
- r = _bfd_final_link_relocate (howto,
- input_bfd,
- input_section,
- contents,
- rel->r_offset,
- relocation,
- rel->r_addend);
- break;
-
- case R_LM32_32:
- if (IS_FDPIC (output_bfd))
- {
- if ((!h) || (h && h->root.type != bfd_link_hash_undefweak))
- {
- /* Only create .rofixup entries for relocs in loadable sections. */
- if ((bfd_get_section_flags (output_bfd, input_section->output_section)
- & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
-
- {
- /* Check address to be modified is writable. */
- if (_lm32fdpic_osec_readonly_p (output_bfd,
- input_section
- ->output_section))
- {
- info->callbacks->warning
- (info,
- _("cannot emit dynamic relocations in read-only section"),
- name, input_bfd, input_section, rel->r_offset);
- return FALSE;
- }
- /* Create entry in .rofixup section. */
- _lm32fdpic_add_rofixup (output_bfd,
- lm32fdpic_fixup32_section (info),
- input_section->output_section->vma
- + input_section->output_offset
- + rel->r_offset);
- }
- }
- }
- /* Fall through. */
-
- default:
- r = _bfd_final_link_relocate (howto,
- input_bfd,
- input_section,
- contents,
- rel->r_offset,
- relocation,
- rel->r_addend);
- break;
- }
- }
+ if ((r_type == R_LM32_GOTOFF_HI16)
+ && ((relocation + rel->r_addend) & 0x8000))
+ rel->r_addend += 0x10000;
+ r = _bfd_final_link_relocate (howto,
+ input_bfd,
+ input_section,
+ contents,
+ rel->r_offset,
+ relocation,
+ rel->r_addend);
+ break;
+
+ case R_LM32_32:
+ if (IS_FDPIC (output_bfd))
+ {
+ if ((!h) || (h && h->root.type != bfd_link_hash_undefweak))
+ {
+ /* Only create .rofixup entries for relocs in loadable sections. */
+ if ((bfd_get_section_flags (output_bfd, input_section->output_section)
+ & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+
+ {
+ /* Check address to be modified is writable. */
+ if (_lm32fdpic_osec_readonly_p (output_bfd,
+ input_section
+ ->output_section))
+ {
+ info->callbacks->warning
+ (info,
+ _("cannot emit dynamic relocations in read-only section"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ /* Create entry in .rofixup section. */
+ _lm32fdpic_add_rofixup (output_bfd,
+ lm32fdpic_fixup32_section (info),
+ input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
+ }
+ }
+ }
+ /* Fall through. */
+
+ default:
+ r = _bfd_final_link_relocate (howto,
+ input_bfd,
+ input_section,
+ contents,
+ rel->r_offset,
+ relocation,
+ rel->r_addend);
+ break;
+ }
+ }
if (r != bfd_reloc_ok)
- {
- const char *msg = NULL;
- arelent bfd_reloc;
-
- lm32_info_to_howto_rela (input_bfd, &bfd_reloc, rel);
- howto = bfd_reloc.howto;
-
- if (h != NULL)
- name = h->root.root.string;
- else
- {
- name = (bfd_elf_string_from_elf_section
- (input_bfd, symtab_hdr->sh_link, sym->st_name));
- if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
- }
-
- switch (r)
- {
+ {
+ const char *msg = NULL;
+ arelent bfd_reloc;
+
+ lm32_info_to_howto_rela (input_bfd, &bfd_reloc, rel);
+ howto = bfd_reloc.howto;
+
+ if (h != NULL)
+ name = h->root.root.string;
+ else
+ {
+ name = (bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name));
+ if (name == NULL || *name == '\0')
+ name = bfd_section_name (input_bfd, sec);
+ }
+
+ switch (r)
+ {
case bfd_reloc_overflow:
if ((h != NULL)
- && (h->root.type == bfd_link_hash_undefweak))
- break;
+ && (h->root.type == bfd_link_hash_undefweak))
+ break;
(*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
- case bfd_reloc_undefined:
+ case bfd_reloc_undefined:
(*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE);
- break;
+ break;
- case bfd_reloc_outofrange:
- msg = _("internal error: out of range error");
- goto common_error;
+ case bfd_reloc_outofrange:
+ msg = _("internal error: out of range error");
+ goto common_error;
- case bfd_reloc_notsupported:
- msg = _("internal error: unsupported relocation error");
- goto common_error;
+ case bfd_reloc_notsupported:
+ msg = _("internal error: unsupported relocation error");
+ goto common_error;
- case bfd_reloc_dangerous:
- msg = _("internal error: dangerous error");
- goto common_error;
+ case bfd_reloc_dangerous:
+ msg = _("internal error: dangerous error");
+ goto common_error;
- default:
- msg = _("internal error: unknown error");
- /* fall through */
+ default:
+ msg = _("internal error: unknown error");
+ /* fall through */
- common_error:
+ common_error:
(*info->callbacks->warning) (info, msg, name, input_bfd,
input_section, rel->r_offset);
- break;
- }
- }
+ break;
+ }
+ }
}
return TRUE;
static asection *
lm32_elf_gc_mark_hook (asection *sec,
- struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct bfd_link_info *info,
+ Elf_Internal_Rela *rel,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
if (h != NULL)
switch (ELF32_R_TYPE (rel->r_info))
static bfd_boolean
lm32_elf_check_relocs (bfd *abfd,
- struct bfd_link_info *info,
- asection *sec,
- const Elf_Internal_Rela *relocs)
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
r_symndx = ELF32_R_SYM (rel->r_info);
r_type = ELF32_R_TYPE (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
/* Some relocs require a global offset table. */
if (htab->root.sgot == NULL)
- {
- switch (r_type)
- {
- case R_LM32_16_GOT:
- case R_LM32_GOTOFF_HI16:
- case R_LM32_GOTOFF_LO16:
- if (dynobj == NULL)
- htab->root.dynobj = dynobj = abfd;
- if (!_bfd_elf_create_got_section (dynobj, info))
- return FALSE;
- break;
- }
- }
+ {
+ switch (r_type)
+ {
+ case R_LM32_16_GOT:
+ case R_LM32_GOTOFF_HI16:
+ case R_LM32_GOTOFF_LO16:
+ if (dynobj == NULL)
+ htab->root.dynobj = dynobj = abfd;
+ if (!_bfd_elf_create_got_section (dynobj, info))
+ return FALSE;
+ break;
+ }
+ }
/* Some relocs require a rofixup table. */
if (IS_FDPIC (abfd))
- {
- switch (r_type)
- {
- case R_LM32_32:
- /* FDPIC requires a GOT if there is a .rofixup section
- (Normal ELF doesn't). */
- if (dynobj == NULL)
- htab->root.dynobj = dynobj = abfd;
- if (!_bfd_elf_create_got_section (dynobj, info))
- return FALSE;
- /* Create .rofixup section */
- if (htab->sfixup32 == NULL)
- {
- if (! create_rofixup_section (dynobj, info))
- return FALSE;
- }
- break;
- case R_LM32_16_GOT:
- case R_LM32_GOTOFF_HI16:
- case R_LM32_GOTOFF_LO16:
- /* Create .rofixup section. */
- if (htab->sfixup32 == NULL)
- {
+ {
+ switch (r_type)
+ {
+ case R_LM32_32:
+ /* FDPIC requires a GOT if there is a .rofixup section
+ (Normal ELF doesn't). */
+ if (dynobj == NULL)
+ htab->root.dynobj = dynobj = abfd;
+ if (!_bfd_elf_create_got_section (dynobj, info))
+ return FALSE;
+ /* Create .rofixup section */
+ if (htab->sfixup32 == NULL)
+ {
+ if (! create_rofixup_section (dynobj, info))
+ return FALSE;
+ }
+ break;
+ case R_LM32_16_GOT:
+ case R_LM32_GOTOFF_HI16:
+ case R_LM32_GOTOFF_LO16:
+ /* Create .rofixup section. */
+ if (htab->sfixup32 == NULL)
+ {
if (dynobj == NULL)
htab->root.dynobj = dynobj = abfd;
- if (! create_rofixup_section (dynobj, info))
- return FALSE;
- }
- break;
- }
- }
+ if (! create_rofixup_section (dynobj, info))
+ return FALSE;
+ }
+ break;
+ }
+ }
switch (r_type)
{
case R_LM32_16_GOT:
- if (h != NULL)
- h->got.refcount += 1;
- else
- {
- bfd_signed_vma *local_got_refcounts;
-
- /* This is a global offset table entry for a local symbol. */
- local_got_refcounts = elf_local_got_refcounts (abfd);
- if (local_got_refcounts == NULL)
- {
- bfd_size_type size;
-
- size = symtab_hdr->sh_info;
- size *= sizeof (bfd_signed_vma);
- local_got_refcounts = bfd_zalloc (abfd, size);
- if (local_got_refcounts == NULL)
- return FALSE;
- elf_local_got_refcounts (abfd) = local_got_refcounts;
- }
- local_got_refcounts[r_symndx] += 1;
- }
- break;
-
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_LM32_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_LM32_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
-
- }
+ if (h != NULL)
+ h->got.refcount += 1;
+ else
+ {
+ bfd_signed_vma *local_got_refcounts;
+
+ /* This is a global offset table entry for a local symbol. */
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+ if (local_got_refcounts == NULL)
+ {
+ bfd_size_type size;
+
+ size = symtab_hdr->sh_info;
+ size *= sizeof (bfd_signed_vma);
+ local_got_refcounts = bfd_zalloc (abfd, size);
+ if (local_got_refcounts == NULL)
+ return FALSE;
+ elf_local_got_refcounts (abfd) = local_got_refcounts;
+ }
+ local_got_refcounts[r_symndx] += 1;
+ }
+ break;
+
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_LM32_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_LM32_GNU_VTENTRY:
+ if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
+
+ }
}
return TRUE;
dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
for (; dyncon < dynconend; dyncon++)
- {
- Elf_Internal_Dyn dyn;
- asection *s;
-
- bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
-
- switch (dyn.d_tag)
- {
- default:
- break;
-
- case DT_PLTGOT:
- s = htab->root.sgotplt;
- goto get_vma;
- case DT_JMPREL:
- s = htab->root.srelplt;
- get_vma:
- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- break;
-
- case DT_PLTRELSZ:
- s = htab->root.srelplt;
+ {
+ Elf_Internal_Dyn dyn;
+ asection *s;
+
+ bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+
+ switch (dyn.d_tag)
+ {
+ default:
+ break;
+
+ case DT_PLTGOT:
+ s = htab->root.sgotplt;
+ goto get_vma;
+ case DT_JMPREL:
+ s = htab->root.srelplt;
+ get_vma:
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_PLTRELSZ:
+ s = htab->root.srelplt;
dyn.d_un.d_val = s->size;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- break;
- }
- }
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+ }
+ }
/* Fill in the first entry in the procedure linkage table. */
splt = htab->root.splt;
if (splt && splt->size > 0)
- {
- if (bfd_link_pic (info))
- {
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD0, splt->contents);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD1, splt->contents + 4);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD2, splt->contents + 8);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD3, splt->contents + 12);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD4, splt->contents + 16);
- }
- else
- {
- unsigned long addr;
- /* addr = .got + 4 */
- addr = sgot->output_section->vma + sgot->output_offset + 4;
- bfd_put_32 (output_bfd,
+ {
+ if (bfd_link_pic (info))
+ {
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD0, splt->contents);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD1, splt->contents + 4);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD2, splt->contents + 8);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD3, splt->contents + 12);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD4, splt->contents + 16);
+ }
+ else
+ {
+ unsigned long addr;
+ /* addr = .got + 4 */
+ addr = sgot->output_section->vma + sgot->output_offset + 4;
+ bfd_put_32 (output_bfd,
PLT0_ENTRY_WORD0 | ((addr >> 16) & 0xffff),
splt->contents);
- bfd_put_32 (output_bfd,
+ bfd_put_32 (output_bfd,
PLT0_ENTRY_WORD1 | (addr & 0xffff),
splt->contents + 4);
- bfd_put_32 (output_bfd, PLT0_ENTRY_WORD2, splt->contents + 8);
- bfd_put_32 (output_bfd, PLT0_ENTRY_WORD3, splt->contents + 12);
- bfd_put_32 (output_bfd, PLT0_ENTRY_WORD4, splt->contents + 16);
- }
-
- elf_section_data (splt->output_section)->this_hdr.sh_entsize =
- PLT_ENTRY_SIZE;
- }
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD2, splt->contents + 8);
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD3, splt->contents + 12);
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD4, splt->contents + 16);
+ }
+
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize =
+ PLT_ENTRY_SIZE;
+ }
}
/* Fill in the first three entries in the global offset table. */
if (sgot && sgot->size > 0)
{
if (sdyn == NULL)
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
else
- bfd_put_32 (output_bfd,
- sdyn->output_section->vma + sdyn->output_offset,
- sgot->contents);
+ bfd_put_32 (output_bfd,
+ sdyn->output_section->vma + sdyn->output_offset,
+ sgot->contents);
bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 4);
bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 8);
/* FIXME: This can be null if create_dynamic_sections wasn't called. */
if (elf_section_data (sgot->output_section) != NULL)
- elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
+ elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
}
if (lm32fdpic_fixup32_section (info))
{
struct elf_link_hash_entry *hgot = elf_hash_table (info)->hgot;
bfd_vma got_value = hgot->root.u.def.value
- + hgot->root.u.def.section->output_section->vma
- + hgot->root.u.def.section->output_offset;
+ + hgot->root.u.def.section->output_section->vma
+ + hgot->root.u.def.section->output_offset;
struct bfd_link_hash_entry *hend;
/* Last entry is pointer to GOT. */
/* Check we wrote enough entries. */
if (lm32fdpic_fixup32_section (info)->size
- != (lm32fdpic_fixup32_section (info)->reloc_count * 4))
- {
+ != (lm32fdpic_fixup32_section (info)->reloc_count * 4))
+ {
_bfd_error_handler
- ("LINKER BUG: .rofixup section size mismatch: size/4 %Ld != relocs %d",
- lm32fdpic_fixup32_section (info)->size/4,
- lm32fdpic_fixup32_section (info)->reloc_count);
- return FALSE;
- }
+ ("LINKER BUG: .rofixup section size mismatch: size/4 %Ld != relocs %d",
+ lm32fdpic_fixup32_section (info)->size/4,
+ lm32fdpic_fixup32_section (info)->reloc_count);
+ return FALSE;
+ }
hend = bfd_link_hash_lookup (info->hash, "__ROFIXUP_END__",
- FALSE, FALSE, TRUE);
+ FALSE, FALSE, TRUE);
if (hend
- && (hend->type == bfd_link_hash_defined
- || hend->type == bfd_link_hash_defweak))
- {
- bfd_vma value =
- lm32fdpic_fixup32_section (info)->output_section->vma
- + lm32fdpic_fixup32_section (info)->output_offset
- + lm32fdpic_fixup32_section (info)->size
- - hend->u.def.section->output_section->vma
- - hend->u.def.section->output_offset;
- BFD_ASSERT (hend->u.def.value == value);
- if (hend->u.def.value != value)
- {
+ && (hend->type == bfd_link_hash_defined
+ || hend->type == bfd_link_hash_defweak))
+ {
+ bfd_vma value =
+ lm32fdpic_fixup32_section (info)->output_section->vma
+ + lm32fdpic_fixup32_section (info)->output_offset
+ + lm32fdpic_fixup32_section (info)->size
+ - hend->u.def.section->output_section->vma
+ - hend->u.def.section->output_offset;
+ BFD_ASSERT (hend->u.def.value == value);
+ if (hend->u.def.value != value)
+ {
_bfd_error_handler
- ("LINKER BUG: .rofixup section hend->u.def.value != value: %Ld != %Ld", hend->u.def.value, value);
- return FALSE;
- }
- }
+ ("LINKER BUG: .rofixup section hend->u.def.value != value: %Ld != %Ld", hend->u.def.value, value);
+ return FALSE;
+ }
+ }
}
return TRUE;
Elf_Internal_Rela rela;
/* This symbol has an entry in the procedure linkage table. Set
- it up. */
+ it up. */
BFD_ASSERT (h->dynindx != -1);
splt = htab->root.splt;
BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL);
/* Get the index in the procedure linkage table which
- corresponds to this symbol. This is the index of this symbol
- in all the symbols for which we are making plt entries. The
- first entry in the procedure linkage table is reserved. */
+ corresponds to this symbol. This is the index of this symbol
+ in all the symbols for which we are making plt entries. The
+ first entry in the procedure linkage table is reserved. */
plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
/* Get the offset into the .got table of the entry that
- corresponds to this function. Each .got entry is 4 bytes.
- The first three are reserved. */
+ corresponds to this function. Each .got entry is 4 bytes.
+ The first three are reserved. */
got_offset = (plt_index + 3) * 4;
/* Fill in the entry in the procedure linkage table. */
if (! bfd_link_pic (info))
- {
- /* TODO */
- }
+ {
+ /* TODO */
+ }
else
- {
- /* TODO */
- }
+ {
+ /* TODO */
+ }
/* Fill in the entry in the global offset table. */
bfd_put_32 (output_bfd,
- (splt->output_section->vma
- + splt->output_offset
- + h->plt.offset
- + 12), /* same offset */
- sgot->contents + got_offset);
+ (splt->output_section->vma
+ + splt->output_offset
+ + h->plt.offset
+ + 12), /* same offset */
+ sgot->contents + got_offset);
/* Fill in the entry in the .rela.plt section. */
rela.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + got_offset);
+ + sgot->output_offset
+ + got_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_LM32_JMP_SLOT);
rela.r_addend = 0;
loc = srela->contents;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
if (!h->def_regular)
- {
- /* Mark the symbol as undefined, rather than as defined in
- the .plt section. Leave the value alone. */
- sym->st_shndx = SHN_UNDEF;
- }
+ {
+ /* Mark the symbol as undefined, rather than as defined in
+ the .plt section. Leave the value alone. */
+ sym->st_shndx = SHN_UNDEF;
+ }
}
Elf_Internal_Rela rela;
/* This symbol has an entry in the global offset table. Set it
- up. */
+ up. */
sgot = htab->root.sgot;
srela = htab->root.srelgot;
BFD_ASSERT (sgot != NULL && srela != NULL);
rela.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + (h->got.offset &~ 1));
+ + sgot->output_offset
+ + (h->got.offset &~ 1));
/* If this is a -Bsymbolic link, and the symbol is defined
- locally, we just want to emit a RELATIVE reloc. Likewise if
- the symbol was forced to be local because of a version file.
- The entry in the global offset table will already have been
- initialized in the relocate_section function. */
+ locally, we just want to emit a RELATIVE reloc. Likewise if
+ the symbol was forced to be local because of a version file.
+ The entry in the global offset table will already have been
+ initialized in the relocate_section function. */
if (bfd_link_pic (info)
- && (info->symbolic
+ && (info->symbolic
|| h->dynindx == -1
|| h->forced_local)
- && h->def_regular)
- {
- rela.r_info = ELF32_R_INFO (0, R_LM32_RELATIVE);
- rela.r_addend = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
- }
+ && h->def_regular)
+ {
+ rela.r_info = ELF32_R_INFO (0, R_LM32_RELATIVE);
+ rela.r_addend = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
else
- {
+ {
BFD_ASSERT ((h->got.offset & 1) == 0);
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
- rela.r_info = ELF32_R_INFO (h->dynindx, R_LM32_GLOB_DAT);
- rela.r_addend = 0;
- }
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_LM32_GLOB_DAT);
+ rela.r_addend = 0;
+ }
loc = srela->contents;
loc += srela->reloc_count * sizeof (Elf32_External_Rela);
/* This symbols needs a copy reloc. Set it up. */
BFD_ASSERT (h->dynindx != -1
- && (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak));
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak));
s = bfd_get_linker_section (htab->root.dynobj, ".rela.bss");
BFD_ASSERT (s != NULL);
rela.r_offset = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_LM32_COPY);
rela.r_addend = 0;
loc = s->contents;
case R_LM32_RELATIVE: return reloc_class_relative;
case R_LM32_JMP_SLOT: return reloc_class_plt;
case R_LM32_COPY: return reloc_class_copy;
- default: return reloc_class_normal;
+ default: return reloc_class_normal;
}
}
/* Make sure we know what is going on here. */
BFD_ASSERT (dynobj != NULL
- && (h->needs_plt
- || h->is_weakalias
- || (h->def_dynamic
- && h->ref_regular
- && !h->def_regular)));
+ && (h->needs_plt
+ || h->is_weakalias
+ || (h->def_dynamic
+ && h->ref_regular
+ && !h->def_regular)));
/* If this is a function, put it in the procedure linkage table. We
will fill in the contents of the procedure linkage table later,
|| h->needs_plt)
{
if (! bfd_link_pic (info)
- && !h->def_dynamic
- && !h->ref_dynamic
+ && !h->def_dynamic
+ && !h->ref_dynamic
&& h->root.type != bfd_link_hash_undefweak
&& h->root.type != bfd_link_hash_undefined)
- {
- /* This case can occur if we saw a PLT reloc in an input
- file, but the symbol was never referred to by a dynamic
- object. In such a case, we don't actually need to build
- a procedure linkage table, and we can just do a PCREL
- reloc instead. */
- h->plt.offset = (bfd_vma) -1;
- h->needs_plt = 0;
- }
+ {
+ /* This case can occur if we saw a PLT reloc in an input
+ file, but the symbol was never referred to by a dynamic
+ object. In such a case, we don't actually need to build
+ a procedure linkage table, and we can just do a PCREL
+ reloc instead. */
+ h->plt.offset = (bfd_vma) -1;
+ h->needs_plt = 0;
+ }
return TRUE;
}
&& h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
+ Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
- {
- asection *s = htab->root.splt;
-
- /* If this is the first .plt entry, make room for the special
- first entry. */
- if (s->size == 0)
- s->size += PLT_ENTRY_SIZE;
-
- h->plt.offset = s->size;
-
- /* If this symbol is not defined in a regular file, and we are
- not generating a shared library, then set the symbol to this
- location in the .plt. This is required to make function
- pointers compare as equal between the normal executable and
- the shared library. */
- if (! bfd_link_pic (info)
- && !h->def_regular)
- {
- h->root.u.def.section = s;
- h->root.u.def.value = h->plt.offset;
- }
-
- /* Make room for this entry. */
- s->size += PLT_ENTRY_SIZE;
-
- /* We also need to make an entry in the .got.plt section, which
- will be placed in the .got section by the linker script. */
- htab->root.sgotplt->size += 4;
-
- /* We also need to make an entry in the .rel.plt section. */
- htab->root.srelplt->size += sizeof (Elf32_External_Rela);
- }
+ {
+ asection *s = htab->root.splt;
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (s->size == 0)
+ s->size += PLT_ENTRY_SIZE;
+
+ h->plt.offset = s->size;
+
+ /* If this symbol is not defined in a regular file, and we are
+ not generating a shared library, then set the symbol to this
+ location in the .plt. This is required to make function
+ pointers compare as equal between the normal executable and
+ the shared library. */
+ if (! bfd_link_pic (info)
+ && !h->def_regular)
+ {
+ h->root.u.def.section = s;
+ h->root.u.def.value = h->plt.offset;
+ }
+
+ /* Make room for this entry. */
+ s->size += PLT_ENTRY_SIZE;
+
+ /* We also need to make an entry in the .got.plt section, which
+ will be placed in the .got section by the linker script. */
+ htab->root.sgotplt->size += 4;
+
+ /* We also need to make an entry in the .rel.plt section. */
+ htab->root.srelplt->size += sizeof (Elf32_External_Rela);
+ }
else
- {
- h->plt.offset = (bfd_vma) -1;
- h->needs_plt = 0;
- }
+ {
+ h->plt.offset = (bfd_vma) -1;
+ h->needs_plt = 0;
+ }
}
else
{
bfd_boolean dyn;
/* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
+ Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
s = htab->root.sgot;
s->size += 4;
dyn = htab->root.dynamic_sections_created;
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h))
- htab->root.srelgot->size += sizeof (Elf32_External_Rela);
+ htab->root.srelgot->size += sizeof (Elf32_External_Rela);
}
else
h->got.offset = (bfd_vma) -1;
if (bfd_link_pic (info))
{
if (h->def_regular
- && (h->forced_local
- || info->symbolic))
- {
- struct elf_dyn_relocs **pp;
-
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
- {
- p->count -= p->pc_count;
- p->pc_count = 0;
- if (p->count == 0)
- *pp = p->next;
- else
- pp = &p->next;
- }
- }
+ && (h->forced_local
+ || info->symbolic))
+ {
+ struct elf_dyn_relocs **pp;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
+ {
+ p->count -= p->pc_count;
+ p->pc_count = 0;
+ if (p->count == 0)
+ *pp = p->next;
+ else
+ pp = &p->next;
+ }
+ }
/* Also discard relocs on undefined weak syms with non-default
visibility. */
else
{
/* For the non-shared case, discard space for relocs against
- symbols which turn out to need copy relocs or are not
- dynamic. */
+ symbols which turn out to need copy relocs or are not
+ dynamic. */
if (!h->non_got_ref
- && ((h->def_dynamic
- && !h->def_regular)
- || (htab->root.dynamic_sections_created
- && (h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_undefined))))
- {
- /* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
- if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
-
- /* If that succeeded, we know we'll be keeping all the
- relocs. */
- if (h->dynindx != -1)
- goto keep;
- }
+ && ((h->def_dynamic
+ && !h->def_regular)
+ || (htab->root.dynamic_sections_created
+ && (h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_undefined))))
+ {
+ /* Make sure this symbol is output as a dynamic symbol.
+ Undefined weak syms won't yet be marked as dynamic. */
+ if (h->dynindx == -1
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ /* If that succeeded, we know we'll be keeping all the
+ relocs. */
+ if (h->dynindx != -1)
+ goto keep;
+ }
eh->dyn_relocs = NULL;
static bfd_boolean
lm32_elf_size_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
struct elf_lm32_link_hash_table *htab;
bfd *dynobj;
asection *srel;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
- continue;
+ continue;
for (s = ibfd->sections; s != NULL; s = s->next)
- {
- struct elf_dyn_relocs *p;
-
- for (p = ((struct elf_dyn_relocs *)
- elf_section_data (s)->local_dynrel);
- p != NULL;
- p = p->next)
- {
- if (! bfd_is_abs_section (p->sec)
- && bfd_is_abs_section (p->sec->output_section))
- {
- /* Input section has been discarded, either because
- it is a copy of a linkonce section or due to
- linker script /DISCARD/, so we'll be discarding
- the relocs too. */
- }
- else if (p->count != 0)
- {
- srel = elf_section_data (p->sec)->sreloc;
- srel->size += p->count * sizeof (Elf32_External_Rela);
- if ((p->sec->output_section->flags & SEC_READONLY) != 0)
- info->flags |= DF_TEXTREL;
- }
- }
- }
+ {
+ struct elf_dyn_relocs *p;
+
+ for (p = ((struct elf_dyn_relocs *)
+ elf_section_data (s)->local_dynrel);
+ p != NULL;
+ p = p->next)
+ {
+ if (! bfd_is_abs_section (p->sec)
+ && bfd_is_abs_section (p->sec->output_section))
+ {
+ /* Input section has been discarded, either because
+ it is a copy of a linkonce section or due to
+ linker script /DISCARD/, so we'll be discarding
+ the relocs too. */
+ }
+ else if (p->count != 0)
+ {
+ srel = elf_section_data (p->sec)->sreloc;
+ srel->size += p->count * sizeof (Elf32_External_Rela);
+ if ((p->sec->output_section->flags & SEC_READONLY) != 0)
+ info->flags |= DF_TEXTREL;
+ }
+ }
+ }
local_got = elf_local_got_refcounts (ibfd);
if (!local_got)
- continue;
+ continue;
symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
locsymcount = symtab_hdr->sh_info;
s = htab->root.sgot;
srel = htab->root.srelgot;
for (; local_got < end_local_got; ++local_got)
- {
- if (*local_got > 0)
- {
- *local_got = s->size;
- s->size += 4;
- if (bfd_link_pic (info))
- srel->size += sizeof (Elf32_External_Rela);
- }
- else
- *local_got = (bfd_vma) -1;
- }
+ {
+ if (*local_got > 0)
+ {
+ *local_got = s->size;
+ s->size += 4;
+ if (bfd_link_pic (info))
+ srel->size += sizeof (Elf32_External_Rela);
+ }
+ else
+ *local_got = (bfd_vma) -1;
+ }
}
/* Allocate global sym .plt and .got entries, and space for global
for (s = dynobj->sections; s != NULL; s = s->next)
{
if ((s->flags & SEC_LINKER_CREATED) == 0)
- continue;
+ continue;
if (s == htab->root.splt
- || s == htab->root.sgot
- || s == htab->root.sgotplt
+ || s == htab->root.sgot
+ || s == htab->root.sgotplt
|| s == htab->sdynbss)
- {
- /* Strip this section if we don't need it; see the
- comment below. */
- }
+ {
+ /* Strip this section if we don't need it; see the
+ comment below. */
+ }
else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
- {
- if (s->size != 0 && s != htab->root.srelplt)
- relocs = TRUE;
-
- /* We use the reloc_count field as a counter if we need
- to copy relocs into the output file. */
- s->reloc_count = 0;
- }
+ {
+ if (s->size != 0 && s != htab->root.srelplt)
+ relocs = TRUE;
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ s->reloc_count = 0;
+ }
else
/* It's not one of our sections, so don't allocate space. */
continue;
if (s->size == 0)
- {
- /* If we don't need this section, strip it from the
- output file. This is mostly to handle .rela.bss and
- .rela.plt. We must create both sections in
- create_dynamic_sections, because they must be created
- before the linker maps input sections to output
- sections. The linker does that before
- adjust_dynamic_symbol is called, and it is that
- function which decides whether anything needs to go
- into these sections. */
- s->flags |= SEC_EXCLUDE;
- continue;
- }
+ {
+ /* If we don't need this section, strip it from the
+ output file. This is mostly to handle .rela.bss and
+ .rela.plt. We must create both sections in
+ create_dynamic_sections, because they must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
+ s->flags |= SEC_EXCLUDE;
+ continue;
+ }
if ((s->flags & SEC_HAS_CONTENTS) == 0)
continue;
/* Allocate memory for the section contents. We use bfd_zalloc
- here in case unused entries are not reclaimed before the
- section's contents are written out. This should not happen,
- but this way if it does, we get a R_LM32_NONE reloc instead
- of garbage. */
+ here in case unused entries are not reclaimed before the
+ section's contents are written out. This should not happen,
+ but this way if it does, we get a R_LM32_NONE reloc instead
+ of garbage. */
s->contents = bfd_zalloc (dynobj, s->size);
if (s->contents == NULL)
- return FALSE;
+ return FALSE;
}
if (htab->root.dynamic_sections_created)
}
if (htab->root.splt->size != 0)
- {
- if (! add_dynamic_entry (DT_PLTGOT, 0)
- || ! add_dynamic_entry (DT_PLTRELSZ, 0)
- || ! add_dynamic_entry (DT_PLTREL, DT_RELA)
- || ! add_dynamic_entry (DT_JMPREL, 0))
- return FALSE;
- }
+ {
+ if (! add_dynamic_entry (DT_PLTGOT, 0)
+ || ! add_dynamic_entry (DT_PLTRELSZ, 0)
+ || ! add_dynamic_entry (DT_PLTREL, DT_RELA)
+ || ! add_dynamic_entry (DT_JMPREL, 0))
+ return FALSE;
+ }
if (relocs)
- {
- if (! add_dynamic_entry (DT_RELA, 0)
- || ! add_dynamic_entry (DT_RELASZ, 0)
- || ! add_dynamic_entry (DT_RELAENT,
- sizeof (Elf32_External_Rela)))
- return FALSE;
-
- /* If any dynamic relocs apply to a read-only section,
- then we need a DT_TEXTREL entry. */
- if ((info->flags & DF_TEXTREL) == 0)
- elf_link_hash_traverse (&htab->root, maybe_set_textrel, info);
-
- if ((info->flags & DF_TEXTREL) != 0)
- {
- if (! add_dynamic_entry (DT_TEXTREL, 0))
- return FALSE;
- }
- }
+ {
+ if (! add_dynamic_entry (DT_RELA, 0)
+ || ! add_dynamic_entry (DT_RELASZ, 0)
+ || ! add_dynamic_entry (DT_RELAENT,
+ sizeof (Elf32_External_Rela)))
+ return FALSE;
+
+ /* If any dynamic relocs apply to a read-only section,
+ then we need a DT_TEXTREL entry. */
+ if ((info->flags & DF_TEXTREL) == 0)
+ elf_link_hash_traverse (&htab->root, maybe_set_textrel, info);
+
+ if ((info->flags & DF_TEXTREL) != 0)
+ {
+ if (! add_dynamic_entry (DT_TEXTREL, 0))
+ return FALSE;
+ }
+ }
}
#undef add_dynamic_entry
int rgot_count = 0;
/* Look for deleted sections. */
for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link.next)
- {
- for (s = ibfd->sections; s != NULL; s = s->next)
- {
- if (s->reloc_count)
- {
- /* Count relocs that need .rofixup entires. */
- Elf_Internal_Rela *internal_relocs, *end;
- internal_relocs = elf_section_data (s)->relocs;
- if (internal_relocs == NULL)
- internal_relocs = (_bfd_elf_link_read_relocs (ibfd, s, NULL, NULL, FALSE));
- if (internal_relocs != NULL)
- {
- end = internal_relocs + s->reloc_count;
- while (internal_relocs < end)
- {
- Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
- struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (ibfd);
- unsigned long r_symndx;
- struct elf_link_hash_entry *h;
-
- symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
- sym_hashes = elf_sym_hashes (ibfd);
- r_symndx = ELF32_R_SYM (internal_relocs->r_info);
- h = NULL;
- if (r_symndx < symtab_hdr->sh_info)
- {
- }
- else
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- }
-
- /* Don't generate entries for weak symbols. */
- if (!h || (h && h->root.type != bfd_link_hash_undefweak))
- {
- if (!discarded_section (s) && !((bfd_get_section_flags (ibfd, s) & SEC_ALLOC) == 0))
- {
- switch (ELF32_R_TYPE (internal_relocs->r_info))
- {
- case R_LM32_32:
- r32_count++;
- break;
- case R_LM32_16_GOT:
- rgot_count++;
- break;
- }
- }
- }
- else
- {
- struct weak_symbol_list *current, *new_entry;
- /* Is this symbol already in the list? */
- for (current = list_start; current; current = current->next)
- {
- if (!strcmp (current->name, h->root.root.string))
- break;
- }
- if (!current && !discarded_section (s) && (bfd_get_section_flags (ibfd, s) & SEC_ALLOC))
- {
- /* Will this have an entry in the GOT. */
- if (ELF32_R_TYPE (internal_relocs->r_info) == R_LM32_16_GOT)
- {
- /* Create a new entry. */
- new_entry = malloc (sizeof (struct weak_symbol_list));
- if (!new_entry)
- return FALSE;
- new_entry->name = h->root.root.string;
- new_entry->next = NULL;
- /* Add to list */
- if (list_start == NULL)
- {
- list_start = new_entry;
- list_end = new_entry;
- }
- else
- {
- list_end->next = new_entry;
- list_end = new_entry;
- }
- /* Increase count of undefined weak symbols in the got. */
- rgot_weak_count++;
- }
- }
- }
- internal_relocs++;
- }
- }
- else
- return FALSE;
- }
- }
- }
+ {
+ for (s = ibfd->sections; s != NULL; s = s->next)
+ {
+ if (s->reloc_count)
+ {
+ /* Count relocs that need .rofixup entires. */
+ Elf_Internal_Rela *internal_relocs, *end;
+ internal_relocs = elf_section_data (s)->relocs;
+ if (internal_relocs == NULL)
+ internal_relocs = (_bfd_elf_link_read_relocs (ibfd, s, NULL, NULL, FALSE));
+ if (internal_relocs != NULL)
+ {
+ end = internal_relocs + s->reloc_count;
+ while (internal_relocs < end)
+ {
+ Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+ struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (ibfd);
+ unsigned long r_symndx;
+ struct elf_link_hash_entry *h;
+
+ symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
+ sym_hashes = elf_sym_hashes (ibfd);
+ r_symndx = ELF32_R_SYM (internal_relocs->r_info);
+ h = NULL;
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ }
+ else
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
+
+ /* Don't generate entries for weak symbols. */
+ if (!h || (h && h->root.type != bfd_link_hash_undefweak))
+ {
+ if (!discarded_section (s) && !((bfd_get_section_flags (ibfd, s) & SEC_ALLOC) == 0))
+ {
+ switch (ELF32_R_TYPE (internal_relocs->r_info))
+ {
+ case R_LM32_32:
+ r32_count++;
+ break;
+ case R_LM32_16_GOT:
+ rgot_count++;
+ break;
+ }
+ }
+ }
+ else
+ {
+ struct weak_symbol_list *current, *new_entry;
+ /* Is this symbol already in the list? */
+ for (current = list_start; current; current = current->next)
+ {
+ if (!strcmp (current->name, h->root.root.string))
+ break;
+ }
+ if (!current && !discarded_section (s) && (bfd_get_section_flags (ibfd, s) & SEC_ALLOC))
+ {
+ /* Will this have an entry in the GOT. */
+ if (ELF32_R_TYPE (internal_relocs->r_info) == R_LM32_16_GOT)
+ {
+ /* Create a new entry. */
+ new_entry = malloc (sizeof (struct weak_symbol_list));
+ if (!new_entry)
+ return FALSE;
+ new_entry->name = h->root.root.string;
+ new_entry->next = NULL;
+ /* Add to list */
+ if (list_start == NULL)
+ {
+ list_start = new_entry;
+ list_end = new_entry;
+ }
+ else
+ {
+ list_end->next = new_entry;
+ list_end = new_entry;
+ }
+ /* Increase count of undefined weak symbols in the got. */
+ rgot_weak_count++;
+ }
+ }
+ }
+ internal_relocs++;
+ }
+ }
+ else
+ return FALSE;
+ }
+ }
+ }
/* Free list. */
while (list_start)
- {
- list_end = list_start->next;
- free (list_start);
- list_start = list_end;
- }
+ {
+ list_end = list_start->next;
+ free (list_start);
+ list_start = list_end;
+ }
/* Size sections. */
lm32fdpic_fixup32_section (info)->size
= (r32_count + (htab->root.sgot->size / 4) - rgot_weak_count + 1) * 4;
if (lm32fdpic_fixup32_section (info)->size == 0)
- lm32fdpic_fixup32_section (info)->flags |= SEC_EXCLUDE;
+ lm32fdpic_fixup32_section (info)->flags |= SEC_EXCLUDE;
else
- {
- lm32fdpic_fixup32_section (info)->contents =
- bfd_zalloc (dynobj, lm32fdpic_fixup32_section (info)->size);
- if (lm32fdpic_fixup32_section (info)->contents == NULL)
- return FALSE;
- }
+ {
+ lm32fdpic_fixup32_section (info)->contents =
+ bfd_zalloc (dynobj, lm32fdpic_fixup32_section (info)->size);
+ if (lm32fdpic_fixup32_section (info)->contents == NULL)
+ return FALSE;
+ }
}
return TRUE;
if (IS_FDPIC (abfd) && (htab->sfixup32 == NULL))
{
if (! create_rofixup_section (abfd, info))
- return FALSE;
+ return FALSE;
}
/* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
.rel[a].bss sections. */
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
- | SEC_LINKER_CREATED);
+ | SEC_LINKER_CREATED);
pltflags = flags;
pltflags |= SEC_CODE;
if (bed->want_plt_sym)
{
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
- .plt section. */
+ .plt section. */
struct bfd_link_hash_entry *bh = NULL;
struct elf_link_hash_entry *h;
if (! (_bfd_generic_link_add_one_symbol
- (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
- (bfd_vma) 0, NULL, FALSE,
- get_elf_backend_data (abfd)->collect, &bh)))
- return FALSE;
+ (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
+ (bfd_vma) 0, NULL, FALSE,
+ get_elf_backend_data (abfd)->collect, &bh)))
+ return FALSE;
h = (struct elf_link_hash_entry *) bh;
h->def_regular = 1;
h->type = STT_OBJECT;
htab->root.hplt = h;
if (bfd_link_pic (info)
- && ! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
+ && ! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
}
s = bfd_make_section_anyway_with_flags (abfd,
if (bed->want_dynbss)
{
/* The .dynbss section is a place to put symbols which are defined
- by dynamic objects, are referenced by regular objects, and are
- not functions. We must allocate space for them in the process
- image and use a R_*_COPY reloc to tell the dynamic linker to
- initialize them at run time. The linker script puts the .dynbss
- section into the .bss section of the final image. */
+ by dynamic objects, are referenced by regular objects, and are
+ not functions. We must allocate space for them in the process
+ image and use a R_*_COPY reloc to tell the dynamic linker to
+ initialize them at run time. The linker script puts the .dynbss
+ section into the .bss section of the final image. */
s = bfd_make_section_anyway_with_flags (abfd, ".dynbss",
SEC_ALLOC | SEC_LINKER_CREATED);
htab->sdynbss = s;
if (s == NULL)
- return FALSE;
+ return FALSE;
/* The .rel[a].bss section holds copy relocs. This section is not
- normally needed. We need to create it here, though, so that the
- linker will map it to an output section. We can't just create it
- only if we need it, because we will not know whether we need it
- until we have seen all the input files, and the first time the
- main linker code calls BFD after examining all the input files
- (size_dynamic_sections) the input sections have already been
- mapped to the output sections. If the section turns out not to
- be needed, we can discard it later. We will never need this
- section when generating a shared object, since they do not use
- copy relocs. */
+ normally needed. We need to create it here, though, so that the
+ linker will map it to an output section. We can't just create it
+ only if we need it, because we will not know whether we need it
+ until we have seen all the input files, and the first time the
+ main linker code calls BFD after examining all the input files
+ (size_dynamic_sections) the input sections have already been
+ mapped to the output sections. If the section turns out not to
+ be needed, we can discard it later. We will never need this
+ section when generating a shared object, since they do not use
+ copy relocs. */
if (! bfd_link_pic (info))
- {
- s = bfd_make_section_anyway_with_flags (abfd,
+ {
+ s = bfd_make_section_anyway_with_flags (abfd,
(bed->default_use_rela_p
? ".rela.bss" : ".rel.bss"),
flags | SEC_READONLY);
- htab->srelbss = s;
- if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
- return FALSE;
- }
+ htab->srelbss = s;
+ if (s == NULL
+ || ! bfd_set_section_alignment (abfd, s, ptralign))
+ return FALSE;
+ }
}
return TRUE;
static void
lm32_elf_copy_indirect_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *dir,
- struct elf_link_hash_entry *ind)
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
struct elf_lm32_link_hash_entry * edir;
struct elf_lm32_link_hash_entry * eind;
if (eind->dyn_relocs != NULL)
{
if (edir->dyn_relocs != NULL)
- {
- struct elf_dyn_relocs **pp;
- struct elf_dyn_relocs *p;
-
- /* Add reloc counts against the indirect sym to the direct sym
- list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
- {
- struct elf_dyn_relocs *q;
-
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
- if (q->sec == p->sec)
- {
- q->pc_count += p->pc_count;
- q->count += p->count;
- *pp = p->next;
- break;
- }
- if (q == NULL)
- pp = &p->next;
- }
- *pp = edir->dyn_relocs;
- }
+ {
+ struct elf_dyn_relocs **pp;
+ struct elf_dyn_relocs *p;
+
+ /* Add reloc counts against the indirect sym to the direct sym
+ list. Merge any entries against the same section. */
+ for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
+ {
+ struct elf_dyn_relocs *q;
+
+ for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ if (q->sec == p->sec)
+ {
+ q->pc_count += p->pc_count;
+ q->count += p->count;
+ *pp = p->next;
+ break;
+ }
+ if (q == NULL)
+ pp = &p->next;
+ }
+ *pp = edir->dyn_relocs;
+ }
edir->dyn_relocs = eind->dyn_relocs;
eind->dyn_relocs = NULL;
}
-#define ELF_ARCH bfd_arch_lm32
+#define ELF_ARCH bfd_arch_lm32
#define ELF_TARGET_ID LM32_ELF_DATA
-#define ELF_MACHINE_CODE EM_LATTICEMICO32
-#define ELF_MAXPAGESIZE 0x1000
-
-#define TARGET_BIG_SYM lm32_elf32_vec
-#define TARGET_BIG_NAME "elf32-lm32"
-
-#define bfd_elf32_bfd_reloc_type_lookup lm32_reloc_type_lookup
-#define bfd_elf32_bfd_reloc_name_lookup lm32_reloc_name_lookup
-#define elf_info_to_howto lm32_info_to_howto_rela
-#define elf_info_to_howto_rel 0
-#define elf_backend_rela_normal 1
-#define elf_backend_object_p lm32_elf_object_p
-#define elf_backend_final_write_processing lm32_elf_final_write_processing
+#define ELF_MACHINE_CODE EM_LATTICEMICO32
+#define ELF_MAXPAGESIZE 0x1000
+
+#define TARGET_BIG_SYM lm32_elf32_vec
+#define TARGET_BIG_NAME "elf32-lm32"
+
+#define bfd_elf32_bfd_reloc_type_lookup lm32_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup lm32_reloc_name_lookup
+#define elf_info_to_howto lm32_info_to_howto_rela
+#define elf_info_to_howto_rel 0
+#define elf_backend_rela_normal 1
+#define elf_backend_object_p lm32_elf_object_p
+#define elf_backend_final_write_processing lm32_elf_final_write_processing
#define elf_backend_stack_align 8
-#define elf_backend_can_gc_sections 1
-#define elf_backend_can_refcount 1
-#define elf_backend_gc_mark_hook lm32_elf_gc_mark_hook
-#define elf_backend_plt_readonly 1
-#define elf_backend_want_got_plt 1
-#define elf_backend_want_plt_sym 0
-#define elf_backend_got_header_size 12
+#define elf_backend_can_gc_sections 1
+#define elf_backend_can_refcount 1
+#define elf_backend_gc_mark_hook lm32_elf_gc_mark_hook
+#define elf_backend_plt_readonly 1
+#define elf_backend_want_got_plt 1
+#define elf_backend_want_plt_sym 0
+#define elf_backend_got_header_size 12
#define elf_backend_dtrel_excludes_plt 1
-#define bfd_elf32_bfd_link_hash_table_create lm32_elf_link_hash_table_create
-#define elf_backend_check_relocs lm32_elf_check_relocs
-#define elf_backend_reloc_type_class lm32_elf_reloc_type_class
-#define elf_backend_copy_indirect_symbol lm32_elf_copy_indirect_symbol
-#define elf_backend_size_dynamic_sections lm32_elf_size_dynamic_sections
-#define elf_backend_omit_section_dynsym ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true)
-#define elf_backend_create_dynamic_sections lm32_elf_create_dynamic_sections
-#define elf_backend_finish_dynamic_sections lm32_elf_finish_dynamic_sections
-#define elf_backend_adjust_dynamic_symbol lm32_elf_adjust_dynamic_symbol
-#define elf_backend_finish_dynamic_symbol lm32_elf_finish_dynamic_symbol
-#define elf_backend_relocate_section lm32_elf_relocate_section
+#define bfd_elf32_bfd_link_hash_table_create lm32_elf_link_hash_table_create
+#define elf_backend_check_relocs lm32_elf_check_relocs
+#define elf_backend_reloc_type_class lm32_elf_reloc_type_class
+#define elf_backend_copy_indirect_symbol lm32_elf_copy_indirect_symbol
+#define elf_backend_size_dynamic_sections lm32_elf_size_dynamic_sections
+#define elf_backend_omit_section_dynsym ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true)
+#define elf_backend_create_dynamic_sections lm32_elf_create_dynamic_sections
+#define elf_backend_finish_dynamic_sections lm32_elf_finish_dynamic_sections
+#define elf_backend_adjust_dynamic_symbol lm32_elf_adjust_dynamic_symbol
+#define elf_backend_finish_dynamic_symbol lm32_elf_finish_dynamic_symbol
+#define elf_backend_relocate_section lm32_elf_relocate_section
#include "elf32-target.h"
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM lm32_elf32_fdpic_vec
-#undef TARGET_BIG_NAME
+#define TARGET_BIG_SYM lm32_elf32_fdpic_vec
+#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-lm32fdpic"
#undef elf32_bed
#define elf32_bed elf32_lm32fdpic_bed
-#undef elf_backend_always_size_sections
-#define elf_backend_always_size_sections lm32_elf_always_size_sections
-#undef bfd_elf32_bfd_copy_private_bfd_data
-#define bfd_elf32_bfd_copy_private_bfd_data lm32_elf_fdpic_copy_private_bfd_data
+#undef elf_backend_always_size_sections
+#define elf_backend_always_size_sections lm32_elf_always_size_sections
+#undef bfd_elf32_bfd_copy_private_bfd_data
+#define bfd_elf32_bfd_copy_private_bfd_data lm32_elf_fdpic_copy_private_bfd_data
#include "elf32-target.h"
bfd_elf_generic_reloc, /* special_function */
"R_M32C_8_PCREL", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ 0, /* src_mask */
+ 0xff, /* dst_mask */
+ TRUE), /* pcrel_offset */
HOWTO (R_M32C_16_PCREL, /* type */
0, /* rightshift */
bfd_elf_generic_reloc, /* special_function */
"R_M32C_16_PCREL", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
HOWTO (R_M32C_8, /* type */
0, /* rightshift */
bfd_elf_generic_reloc, /* special_function */
"R_M32C_8", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
+ 0, /* src_mask */
0xff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_M32C_LO16, /* type */
0, /* rightshift */
bfd_elf_generic_reloc, /* special_function */
"R_M32C_LO16", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
+ 0, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_M32C_HI8, /* type */
0, /* rightshift */
bfd_elf_generic_reloc, /* special_function */
"R_M32C_HI8", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
+ 0, /* src_mask */
0xff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_M32C_HI16, /* type */
0, /* rightshift */
bfd_elf_generic_reloc, /* special_function */
"R_M32C_HI16", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
+ 0, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_M32C_RL_JUMP, /* type */
0, /* rightshift */
bfd_elf_generic_reloc, /* special_function */
"R_M32C_RL_JUMP", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (R_M32C_RL_1ADDR, /* type */
0, /* rightshift */
bfd_elf_generic_reloc, /* special_function */
"R_M32C_RL_1ADDR", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (R_M32C_RL_2ADDR, /* type */
0, /* rightshift */
bfd_elf_generic_reloc, /* special_function */
"R_M32C_RL_2ADDR", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
\f
{
{ BFD_RELOC_NONE, R_M32C_NONE },
{ BFD_RELOC_16, R_M32C_16 },
- { BFD_RELOC_24, R_M32C_24 },
+ { BFD_RELOC_24, R_M32C_24 },
{ BFD_RELOC_32, R_M32C_32 },
- { BFD_RELOC_8_PCREL, R_M32C_8_PCREL },
- { BFD_RELOC_16_PCREL, R_M32C_16_PCREL },
+ { BFD_RELOC_8_PCREL, R_M32C_8_PCREL },
+ { BFD_RELOC_16_PCREL, R_M32C_16_PCREL },
{ BFD_RELOC_8, R_M32C_8 },
{ BFD_RELOC_LO16, R_M32C_LO16 },
{ BFD_RELOC_HI16, R_M32C_HI16 },
static reloc_howto_type *
m32c_reloc_type_lookup
- (bfd * abfd ATTRIBUTE_UNUSED,
+ (bfd * abfd ATTRIBUTE_UNUSED,
bfd_reloc_code_real_type code)
{
unsigned int i;
static void
m32c_info_to_howto_rela
- (bfd * abfd ATTRIBUTE_UNUSED,
- arelent * cache_ptr,
+ (bfd * abfd ATTRIBUTE_UNUSED,
+ arelent * cache_ptr,
Elf_Internal_Rela * dst)
{
unsigned int r_type;
static bfd_boolean
m32c_elf_relocate_section
- (bfd * output_bfd ATTRIBUTE_UNUSED,
+ (bfd * output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * relocs,
- Elf_Internal_Sym * local_syms,
- asection ** local_sections)
+ Elf_Internal_Sym * local_syms,
+ asection ** local_sections)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- Elf_Internal_Rela * rel;
- Elf_Internal_Rela * relend;
+ Elf_Internal_Rela * rel;
+ Elf_Internal_Rela * relend;
asection *splt;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
for (rel = relocs; rel < relend; rel ++)
{
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- const char * name = NULL;
- int r_type;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char * name = NULL;
+ int r_type;
r_type = ELF32_R_TYPE (rel->r_info);
if (bfd_link_relocatable (info))
{
/* This is a relocatable link. We don't have to change
- anything, unless the reloc is against a section symbol,
- in which case we have to adjust according to where the
- section symbol winds up in the output section. */
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
rel->r_addend += sec->output_offset;
continue;
relocation, *plt_offset);*/
if (relocation <= 0xffff)
{
- /* If the symbol is in range for a 16-bit address, we should
+ /* If the symbol is in range for a 16-bit address, we should
have deallocated the plt entry in relax_section. */
- BFD_ASSERT (*plt_offset == (bfd_vma) -1);
+ BFD_ASSERT (*plt_offset == (bfd_vma) -1);
}
else
{
static bfd_boolean
m32c_elf_check_relocs
- (bfd * abfd,
+ (bfd * abfd,
struct bfd_link_info * info,
- asection * sec,
+ asection * sec,
const Elf_Internal_Rela * relocs)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- const Elf_Internal_Rela * rel;
- const Elf_Internal_Rela * rel_end;
+ const Elf_Internal_Rela * rel;
+ const Elf_Internal_Rela * rel_end;
bfd_vma *local_plt_offsets;
asection *splt;
bfd *dynobj;
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
}
switch (ELF32_R_TYPE (rel->r_info))
- {
+ {
/* This relocation describes a 16-bit pointer to a function.
We may need to allocate a thunk in low memory; reserve memory
for it now. */
splt->size += 4;
}
break;
- }
+ }
}
return TRUE;
static bfd_boolean
m32c_elf_finish_dynamic_sections (bfd *abfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj = elf_hash_table (info)->dynobj;
asection *splt = elf_hash_table (info)->splt;
static bfd_boolean
m32c_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *splt;
switch (elf_elfheader (abfd)->e_flags & EF_M32C_CPU_MASK)
{
case EF_M32C_CPU_M16C: return bfd_mach_m16c;
- case EF_M32C_CPU_M32C: return bfd_mach_m32c;
+ case EF_M32C_CPU_M32C: return bfd_mach_m32c;
}
return bfd_mach_m16c;
static bfd_boolean
m32c_elf_relax_plt_section (asection *splt,
- struct bfd_link_info *info,
- bfd_boolean *again)
+ struct bfd_link_info *info,
+ bfd_boolean *again)
{
struct relax_plt_data relax_plt_data;
bfd *ibfd;
for (idx = 0; idx < nlocals; ++idx)
if (local_plt_offsets[idx] != (bfd_vma) -1)
{
- local_plt_offsets[idx] = entry;
+ local_plt_offsets[idx] = entry;
entry += 4;
}
}
static bfd_boolean
m32c_elf_relax_section
- (bfd * abfd,
- asection * sec,
+ (bfd * abfd,
+ asection * sec,
struct bfd_link_info * link_info,
- bfd_boolean * again)
+ bfd_boolean * again)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Shdr *shndx_hdr;
/* The RL_ relocs must be just before the operand relocs they go
with, so we must sort them to guarantee this. */
qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela),
- compare_reloc);
+ compare_reloc);
/* Walk through them looking for relaxing opportunities. */
irelend = internal_relocs + sec->reloc_count;
*/
/* Get the value of the symbol referred to by the reloc. Just
- in case this is the last reloc in the list, use the RL's
- addend to choose between this reloc (no addend) or the next
- (yes addend, which means at least one following reloc). */
+ in case this is the last reloc in the list, use the RL's
+ addend to choose between this reloc (no addend) or the next
+ (yes addend, which means at least one following reloc). */
srel = irel + (relax_relocs ? 1 : 0);
symval = OFFSET_FOR_RELOC (srel);
static bfd_boolean
m32c_elf_relax_delete_bytes
- (bfd * abfd,
+ (bfd * abfd,
asection * sec,
bfd_vma addr,
- int count)
+ int count)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Shdr *shndx_hdr;
Elf_External_Sym_Shndx *shndx;
struct elf_link_hash_entry ** sym_hashes;
struct elf_link_hash_entry ** end_hashes;
- unsigned int symcount;
+ unsigned int symcount;
contents = elf_section_data (sec)->this_hdr.contents;
#define elf_info_to_howto m32c_info_to_howto_rela
#define elf_backend_object_p m32c_elf_object_p
#define elf_backend_relocate_section m32c_elf_relocate_section
-#define elf_backend_check_relocs m32c_elf_check_relocs
+#define elf_backend_check_relocs m32c_elf_check_relocs
#define elf_backend_object_p m32c_elf_object_p
-#define elf_symbol_leading_char ('_')
+#define elf_symbol_leading_char ('_')
#define elf_backend_always_size_sections \
m32c_elf_always_size_sections
#define elf_backend_finish_dynamic_sections \
and the initial contents are unimportant (we zero them out).
Subsequent entries look like this. */
-#define PLT0_ENTRY_WORD0 0xd6c00000 /* seth r6, #high(.got+4) */
-#define PLT0_ENTRY_WORD1 0x86e60000 /* or3 r6, r6, #low(.got)+4) */
-#define PLT0_ENTRY_WORD2 0x24e626c6 /* ld r4, @r6+ -> ld r6, @r6 */
-#define PLT0_ENTRY_WORD3 0x1fc6f000 /* jmp r6 || pnop */
-#define PLT0_ENTRY_WORD4 PLT_EMPTY /* RIE -> RIE */
-
-#define PLT0_PIC_ENTRY_WORD0 0xa4cc0004 /* ld r4, @(4,r12) */
-#define PLT0_PIC_ENTRY_WORD1 0xa6cc0008 /* ld r6, @(8,r12) */
-#define PLT0_PIC_ENTRY_WORD2 0x1fc6f000 /* jmp r6 || nop */
-#define PLT0_PIC_ENTRY_WORD3 PLT_EMPTY /* RIE -> RIE */
-#define PLT0_PIC_ENTRY_WORD4 PLT_EMPTY /* RIE -> RIE */
-
-#define PLT_ENTRY_WORD0 0xe6000000 /* ld24 r6, .name_in_GOT */
-#define PLT_ENTRY_WORD1 0x06acf000 /* add r6, r12 || nop */
-#define PLT_ENTRY_WORD0b 0xd6c00000 /* seth r6, #high(.name_in_GOT) */
-#define PLT_ENTRY_WORD1b 0x86e60000 /* or3 r6, r6, #low(.name_in_GOT) */
-#define PLT_ENTRY_WORD2 0x26c61fc6 /* ld r6, @r6 -> jmp r6 */
-#define PLT_ENTRY_WORD3 0xe5000000 /* ld24 r5, $offset */
-#define PLT_ENTRY_WORD4 0xff000000 /* bra .plt0. */
+#define PLT0_ENTRY_WORD0 0xd6c00000 /* seth r6, #high(.got+4) */
+#define PLT0_ENTRY_WORD1 0x86e60000 /* or3 r6, r6, #low(.got)+4) */
+#define PLT0_ENTRY_WORD2 0x24e626c6 /* ld r4, @r6+ -> ld r6, @r6 */
+#define PLT0_ENTRY_WORD3 0x1fc6f000 /* jmp r6 || pnop */
+#define PLT0_ENTRY_WORD4 PLT_EMPTY /* RIE -> RIE */
+
+#define PLT0_PIC_ENTRY_WORD0 0xa4cc0004 /* ld r4, @(4,r12) */
+#define PLT0_PIC_ENTRY_WORD1 0xa6cc0008 /* ld r6, @(8,r12) */
+#define PLT0_PIC_ENTRY_WORD2 0x1fc6f000 /* jmp r6 || nop */
+#define PLT0_PIC_ENTRY_WORD3 PLT_EMPTY /* RIE -> RIE */
+#define PLT0_PIC_ENTRY_WORD4 PLT_EMPTY /* RIE -> RIE */
+
+#define PLT_ENTRY_WORD0 0xe6000000 /* ld24 r6, .name_in_GOT */
+#define PLT_ENTRY_WORD1 0x06acf000 /* add r6, r12 || nop */
+#define PLT_ENTRY_WORD0b 0xd6c00000 /* seth r6, #high(.name_in_GOT) */
+#define PLT_ENTRY_WORD1b 0x86e60000 /* or3 r6, r6, #low(.name_in_GOT) */
+#define PLT_ENTRY_WORD2 0x26c61fc6 /* ld r6, @r6 -> jmp r6 */
+#define PLT_ENTRY_WORD3 0xe5000000 /* ld24 r5, $offset */
+#define PLT_ENTRY_WORD4 0xff000000 /* bra .plt0. */
/* Utility to actually perform an R_M32R_10_PCREL reloc. */
relocation += reloc_entry->addend;
inplace_address = (bfd_byte *) data + reloc_entry->address;
-#define DOIT(x) \
- x = ( (x & ~reloc_entry->howto->dst_mask) | \
+#define DOIT(x) \
+ x = ( (x & ~reloc_entry->howto->dst_mask) | \
(((x & reloc_entry->howto->src_mask) + relocation) & \
reloc_entry->howto->dst_mask))
{
short x = bfd_get_16 (input_bfd, inplace_address);
DOIT (x);
- bfd_put_16 (input_bfd, (bfd_vma) x, inplace_address);
+ bfd_put_16 (input_bfd, (bfd_vma) x, inplace_address);
}
break;
case 2:
{
unsigned long x = bfd_get_32 (input_bfd, inplace_address);
DOIT (x);
- bfd_put_32 (input_bfd, (bfd_vma)x , inplace_address);
+ bfd_put_32 (input_bfd, (bfd_vma)x , inplace_address);
}
break;
default:
and if bfd_install_relocation gets called the addend may get added
again. */
HOWTO (R_M32R_10_PCREL, /* type */
- 2, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 10, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
+ 2, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 10, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
m32r_elf_10_pcrel_reloc, /* special_function */
"R_M32R_10_PCREL", /* name */
- FALSE, /* partial_inplace */
- 0xff, /* src_mask */
- 0xff, /* dst_mask */
+ FALSE, /* partial_inplace */
+ 0xff, /* src_mask */
+ 0xff, /* dst_mask */
TRUE), /* pcrel_offset */
/* A relative 18 bit relocation, right shifted by 2. */
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_M32R_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_M32R_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_M32R_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage. */
- HOWTO (R_M32R_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_M32R_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_M32R_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_M32R_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
EMPTY_HOWTO (13),
EMPTY_HOWTO (14),
FALSE), /* pcrel_offset */
HOWTO (R_M32R_10_PCREL_RELA, /* type */
- 2, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 10, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
+ 2, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 10, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
m32r_elf_10_pcrel_reloc, /* special_function */
"R_M32R_10_PCREL_RELA",/* name */
- FALSE, /* partial_inplace */
- 0xff, /* src_mask */
- 0xff, /* dst_mask */
+ FALSE, /* partial_inplace */
+ 0xff, /* src_mask */
+ 0xff, /* dst_mask */
TRUE), /* pcrel_offset */
/* A relative 18 bit relocation, right shifted by 2. */
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_M32R_RELA_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_M32R_RELA_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_M32R_RELA_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage. */
HOWTO (R_M32R_RELA_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_M32R_RELA_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_M32R_RELA_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* A 32 bit PC relative relocation. */
HOWTO (R_M32R_REL32, /* type */
Elf_Internal_Rela *dst)
{
BFD_ASSERT ((ELF32_R_TYPE(dst->r_info) == (unsigned int) R_M32R_NONE)
- || ((ELF32_R_TYPE(dst->r_info) > (unsigned int) R_M32R_GNU_VTENTRY)
- && (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_M32R_max)));
+ || ((ELF32_R_TYPE(dst->r_info) > (unsigned int) R_M32R_GNU_VTENTRY)
+ && (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_M32R_max)));
cache_ptr->howto = &m32r_elf_howto_table[ELF32_R_TYPE(dst->r_info)];
}
/* Call the allocation method of the superclass. */
ret = ((struct elf_m32r_link_hash_entry *)
- _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
- table, string));
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+ table, string));
if (ret != NULL)
{
struct elf_m32r_link_hash_entry *eh;
/* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and
.rel[a].bss sections. */
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
- | SEC_LINKER_CREATED);
+ | SEC_LINKER_CREATED);
pltflags = flags;
pltflags |= SEC_CODE;
if (bed->want_plt_sym)
{
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
- .plt section. */
+ .plt section. */
struct bfd_link_hash_entry *bh = NULL;
struct elf_link_hash_entry *h;
if (! (_bfd_generic_link_add_one_symbol
- (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
- (bfd_vma) 0, NULL, FALSE,
- get_elf_backend_data (abfd)->collect, &bh)))
- return FALSE;
+ (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
+ (bfd_vma) 0, NULL, FALSE,
+ get_elf_backend_data (abfd)->collect, &bh)))
+ return FALSE;
h = (struct elf_link_hash_entry *) bh;
h->def_regular = 1;
h->type = STT_OBJECT;
htab->root.hplt = h;
if (bfd_link_pic (info)
- && ! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
+ && ! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
}
s = bfd_make_section_anyway_with_flags (abfd,
if (bed->want_dynbss)
{
/* The .dynbss section is a place to put symbols which are defined
- by dynamic objects, are referenced by regular objects, and are
- not functions. We must allocate space for them in the process
- image and use a R_*_COPY reloc to tell the dynamic linker to
- initialize them at run time. The linker script puts the .dynbss
- section into the .bss section of the final image. */
+ by dynamic objects, are referenced by regular objects, and are
+ not functions. We must allocate space for them in the process
+ image and use a R_*_COPY reloc to tell the dynamic linker to
+ initialize them at run time. The linker script puts the .dynbss
+ section into the .bss section of the final image. */
s = bfd_make_section_anyway_with_flags (abfd, ".dynbss",
SEC_ALLOC | SEC_LINKER_CREATED);
htab->sdynbss = s;
if (s == NULL)
- return FALSE;
+ return FALSE;
/* The .rel[a].bss section holds copy relocs. This section is not
- normally needed. We need to create it here, though, so that the
- linker will map it to an output section. We can't just create it
- only if we need it, because we will not know whether we need it
- until we have seen all the input files, and the first time the
- main linker code calls BFD after examining all the input files
- (size_dynamic_sections) the input sections have already been
- mapped to the output sections. If the section turns out not to
- be needed, we can discard it later. We will never need this
- section when generating a shared object, since they do not use
- copy relocs. */
+ normally needed. We need to create it here, though, so that the
+ linker will map it to an output section. We can't just create it
+ only if we need it, because we will not know whether we need it
+ until we have seen all the input files, and the first time the
+ main linker code calls BFD after examining all the input files
+ (size_dynamic_sections) the input sections have already been
+ mapped to the output sections. If the section turns out not to
+ be needed, we can discard it later. We will never need this
+ section when generating a shared object, since they do not use
+ copy relocs. */
if (! bfd_link_pic (info))
- {
- s = bfd_make_section_anyway_with_flags (abfd,
+ {
+ s = bfd_make_section_anyway_with_flags (abfd,
(bed->default_use_rela_p
? ".rela.bss" : ".rel.bss"),
flags | SEC_READONLY);
- htab->srelbss = s;
- if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
- return FALSE;
- }
+ htab->srelbss = s;
+ if (s == NULL
+ || ! bfd_set_section_alignment (abfd, s, ptralign))
+ return FALSE;
+ }
}
return TRUE;
static void
m32r_elf_copy_indirect_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *dir,
- struct elf_link_hash_entry *ind)
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
struct elf_m32r_link_hash_entry * edir;
struct elf_m32r_link_hash_entry * eind;
if (eind->dyn_relocs != NULL)
{
if (edir->dyn_relocs != NULL)
- {
- struct elf_dyn_relocs **pp;
- struct elf_dyn_relocs *p;
-
- /* Add reloc counts against the indirect sym to the direct sym
- list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
- {
- struct elf_dyn_relocs *q;
-
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
- if (q->sec == p->sec)
- {
- q->pc_count += p->pc_count;
- q->count += p->count;
- *pp = p->next;
- break;
- }
- if (q == NULL)
- pp = &p->next;
- }
- *pp = edir->dyn_relocs;
- }
+ {
+ struct elf_dyn_relocs **pp;
+ struct elf_dyn_relocs *p;
+
+ /* Add reloc counts against the indirect sym to the direct sym
+ list. Merge any entries against the same section. */
+ for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
+ {
+ struct elf_dyn_relocs *q;
+
+ for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ if (q->sec == p->sec)
+ {
+ q->pc_count += p->pc_count;
+ q->count += p->count;
+ *pp = p->next;
+ break;
+ }
+ if (q == NULL)
+ pp = &p->next;
+ }
+ *pp = edir->dyn_relocs;
+ }
edir->dyn_relocs = eind->dyn_relocs;
eind->dyn_relocs = NULL;
/* Make sure we know what is going on here. */
BFD_ASSERT (dynobj != NULL
- && (h->needs_plt
- || h->is_weakalias
- || (h->def_dynamic
- && h->ref_regular
- && !h->def_regular)));
+ && (h->needs_plt
+ || h->is_weakalias
+ || (h->def_dynamic
+ && h->ref_regular
+ && !h->def_regular)));
/* If this is a function, put it in the procedure linkage table. We
will fill in the contents of the procedure linkage table later,
|| h->needs_plt)
{
if (! bfd_link_pic (info)
- && !h->def_dynamic
- && !h->ref_dynamic
+ && !h->def_dynamic
+ && !h->ref_dynamic
&& h->root.type != bfd_link_hash_undefweak
&& h->root.type != bfd_link_hash_undefined)
- {
- /* This case can occur if we saw a PLT reloc in an input
- file, but the symbol was never referred to by a dynamic
- object. In such a case, we don't actually need to build
- a procedure linkage table, and we can just do a PCREL
- reloc instead. */
- h->plt.offset = (bfd_vma) -1;
- h->needs_plt = 0;
- }
+ {
+ /* This case can occur if we saw a PLT reloc in an input
+ file, but the symbol was never referred to by a dynamic
+ object. In such a case, we don't actually need to build
+ a procedure linkage table, and we can just do a PCREL
+ reloc instead. */
+ h->plt.offset = (bfd_vma) -1;
+ h->needs_plt = 0;
+ }
return TRUE;
}
&& h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
+ Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
- {
- asection *s = htab->root.splt;
-
- /* If this is the first .plt entry, make room for the special
- first entry. */
- if (s->size == 0)
- s->size += PLT_ENTRY_SIZE;
-
- h->plt.offset = s->size;
-
- /* If this symbol is not defined in a regular file, and we are
- not generating a shared library, then set the symbol to this
- location in the .plt. This is required to make function
- pointers compare as equal between the normal executable and
- the shared library. */
- if (! bfd_link_pic (info)
- && !h->def_regular)
- {
- h->root.u.def.section = s;
- h->root.u.def.value = h->plt.offset;
- }
-
- /* Make room for this entry. */
- s->size += PLT_ENTRY_SIZE;
-
- /* We also need to make an entry in the .got.plt section, which
- will be placed in the .got section by the linker script. */
- htab->root.sgotplt->size += 4;
-
- /* We also need to make an entry in the .rel.plt section. */
- htab->root.srelplt->size += sizeof (Elf32_External_Rela);
- }
+ {
+ asection *s = htab->root.splt;
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (s->size == 0)
+ s->size += PLT_ENTRY_SIZE;
+
+ h->plt.offset = s->size;
+
+ /* If this symbol is not defined in a regular file, and we are
+ not generating a shared library, then set the symbol to this
+ location in the .plt. This is required to make function
+ pointers compare as equal between the normal executable and
+ the shared library. */
+ if (! bfd_link_pic (info)
+ && !h->def_regular)
+ {
+ h->root.u.def.section = s;
+ h->root.u.def.value = h->plt.offset;
+ }
+
+ /* Make room for this entry. */
+ s->size += PLT_ENTRY_SIZE;
+
+ /* We also need to make an entry in the .got.plt section, which
+ will be placed in the .got section by the linker script. */
+ htab->root.sgotplt->size += 4;
+
+ /* We also need to make an entry in the .rel.plt section. */
+ htab->root.srelplt->size += sizeof (Elf32_External_Rela);
+ }
else
- {
- h->plt.offset = (bfd_vma) -1;
- h->needs_plt = 0;
- }
+ {
+ h->plt.offset = (bfd_vma) -1;
+ h->needs_plt = 0;
+ }
}
else
{
bfd_boolean dyn;
/* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
+ Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
s = htab->root.sgot;
s->size += 4;
dyn = htab->root.dynamic_sections_created;
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h))
- htab->root.srelgot->size += sizeof (Elf32_External_Rela);
+ htab->root.srelgot->size += sizeof (Elf32_External_Rela);
}
else
h->got.offset = (bfd_vma) -1;
if (bfd_link_pic (info))
{
if (h->def_regular
- && (h->forced_local
- || info->symbolic))
- {
- struct elf_dyn_relocs **pp;
-
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
- {
- p->count -= p->pc_count;
- p->pc_count = 0;
- if (p->count == 0)
- *pp = p->next;
- else
- pp = &p->next;
- }
- }
+ && (h->forced_local
+ || info->symbolic))
+ {
+ struct elf_dyn_relocs **pp;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
+ {
+ p->count -= p->pc_count;
+ p->pc_count = 0;
+ if (p->count == 0)
+ *pp = p->next;
+ else
+ pp = &p->next;
+ }
+ }
/* Also discard relocs on undefined weak syms with non-default
visibility. */
else
{
/* For the non-shared case, discard space for relocs against
- symbols which turn out to need copy relocs or are not
- dynamic. */
+ symbols which turn out to need copy relocs or are not
+ dynamic. */
if (!h->non_got_ref
- && ((h->def_dynamic
- && !h->def_regular)
- || (htab->root.dynamic_sections_created
- && (h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_undefined))))
- {
- /* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
- if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
-
- /* If that succeeded, we know we'll be keeping all the
- relocs. */
- if (h->dynindx != -1)
- goto keep;
- }
+ && ((h->def_dynamic
+ && !h->def_regular)
+ || (htab->root.dynamic_sections_created
+ && (h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_undefined))))
+ {
+ /* Make sure this symbol is output as a dynamic symbol.
+ Undefined weak syms won't yet be marked as dynamic. */
+ if (h->dynindx == -1
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ /* If that succeeded, we know we'll be keeping all the
+ relocs. */
+ if (h->dynindx != -1)
+ goto keep;
+ }
eh->dyn_relocs = NULL;
asection *srel;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
- continue;
+ continue;
for (s = ibfd->sections; s != NULL; s = s->next)
- {
- struct elf_dyn_relocs *p;
-
- for (p = ((struct elf_dyn_relocs *)
- elf_section_data (s)->local_dynrel);
- p != NULL;
- p = p->next)
- {
- if (! bfd_is_abs_section (p->sec)
- && bfd_is_abs_section (p->sec->output_section))
- {
- /* Input section has been discarded, either because
- it is a copy of a linkonce section or due to
- linker script /DISCARD/, so we'll be discarding
- the relocs too. */
- }
- else if (p->count != 0)
- {
- srel = elf_section_data (p->sec)->sreloc;
- srel->size += p->count * sizeof (Elf32_External_Rela);
- if ((p->sec->output_section->flags & SEC_READONLY) != 0)
- info->flags |= DF_TEXTREL;
- }
- }
- }
+ {
+ struct elf_dyn_relocs *p;
+
+ for (p = ((struct elf_dyn_relocs *)
+ elf_section_data (s)->local_dynrel);
+ p != NULL;
+ p = p->next)
+ {
+ if (! bfd_is_abs_section (p->sec)
+ && bfd_is_abs_section (p->sec->output_section))
+ {
+ /* Input section has been discarded, either because
+ it is a copy of a linkonce section or due to
+ linker script /DISCARD/, so we'll be discarding
+ the relocs too. */
+ }
+ else if (p->count != 0)
+ {
+ srel = elf_section_data (p->sec)->sreloc;
+ srel->size += p->count * sizeof (Elf32_External_Rela);
+ if ((p->sec->output_section->flags & SEC_READONLY) != 0)
+ info->flags |= DF_TEXTREL;
+ }
+ }
+ }
local_got = elf_local_got_refcounts (ibfd);
if (!local_got)
- continue;
+ continue;
symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
locsymcount = symtab_hdr->sh_info;
s = htab->root.sgot;
srel = htab->root.srelgot;
for (; local_got < end_local_got; ++local_got)
- {
- if (*local_got > 0)
- {
- *local_got = s->size;
- s->size += 4;
- if (bfd_link_pic (info))
- srel->size += sizeof (Elf32_External_Rela);
- }
- else
- *local_got = (bfd_vma) -1;
- }
+ {
+ if (*local_got > 0)
+ {
+ *local_got = s->size;
+ s->size += 4;
+ if (bfd_link_pic (info))
+ srel->size += sizeof (Elf32_External_Rela);
+ }
+ else
+ *local_got = (bfd_vma) -1;
+ }
}
/* Allocate global sym .plt and .got entries, and space for global
for (s = dynobj->sections; s != NULL; s = s->next)
{
if ((s->flags & SEC_LINKER_CREATED) == 0)
- continue;
+ continue;
if (s == htab->root.splt
- || s == htab->root.sgot
- || s == htab->root.sgotplt
+ || s == htab->root.sgot
+ || s == htab->root.sgotplt
|| s == htab->sdynbss)
- {
- /* Strip this section if we don't need it; see the
- comment below. */
- }
+ {
+ /* Strip this section if we don't need it; see the
+ comment below. */
+ }
else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
- {
- if (s->size != 0 && s != htab->root.srelplt)
- relocs = TRUE;
-
- /* We use the reloc_count field as a counter if we need
- to copy relocs into the output file. */
- s->reloc_count = 0;
- }
+ {
+ if (s->size != 0 && s != htab->root.srelplt)
+ relocs = TRUE;
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ s->reloc_count = 0;
+ }
else
/* It's not one of our sections, so don't allocate space. */
continue;
if (s->size == 0)
- {
- /* If we don't need this section, strip it from the
- output file. This is mostly to handle .rela.bss and
- .rela.plt. We must create both sections in
- create_dynamic_sections, because they must be created
- before the linker maps input sections to output
- sections. The linker does that before
- adjust_dynamic_symbol is called, and it is that
- function which decides whether anything needs to go
- into these sections. */
- s->flags |= SEC_EXCLUDE;
- continue;
- }
+ {
+ /* If we don't need this section, strip it from the
+ output file. This is mostly to handle .rela.bss and
+ .rela.plt. We must create both sections in
+ create_dynamic_sections, because they must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
+ s->flags |= SEC_EXCLUDE;
+ continue;
+ }
if ((s->flags & SEC_HAS_CONTENTS) == 0)
continue;
/* Allocate memory for the section contents. We use bfd_zalloc
- here in case unused entries are not reclaimed before the
- section's contents are written out. This should not happen,
- but this way if it does, we get a R_M32R_NONE reloc instead
- of garbage. */
+ here in case unused entries are not reclaimed before the
+ section's contents are written out. This should not happen,
+ but this way if it does, we get a R_M32R_NONE reloc instead
+ of garbage. */
s->contents = bfd_zalloc (dynobj, s->size);
if (s->contents == NULL)
- return FALSE;
+ return FALSE;
}
if (htab->root.dynamic_sections_created)
}
if (htab->root.splt->size != 0)
- {
- if (! add_dynamic_entry (DT_PLTGOT, 0)
- || ! add_dynamic_entry (DT_PLTRELSZ, 0)
- || ! add_dynamic_entry (DT_PLTREL, DT_RELA)
- || ! add_dynamic_entry (DT_JMPREL, 0))
- return FALSE;
- }
+ {
+ if (! add_dynamic_entry (DT_PLTGOT, 0)
+ || ! add_dynamic_entry (DT_PLTRELSZ, 0)
+ || ! add_dynamic_entry (DT_PLTREL, DT_RELA)
+ || ! add_dynamic_entry (DT_JMPREL, 0))
+ return FALSE;
+ }
if (relocs)
- {
- if (! add_dynamic_entry (DT_RELA, 0)
- || ! add_dynamic_entry (DT_RELASZ, 0)
- || ! add_dynamic_entry (DT_RELAENT,
- sizeof (Elf32_External_Rela)))
- return FALSE;
-
- /* If any dynamic relocs apply to a read-only section,
- then we need a DT_TEXTREL entry. */
- if ((info->flags & DF_TEXTREL) == 0)
- elf_link_hash_traverse (&htab->root, maybe_set_textrel, info);
-
- if ((info->flags & DF_TEXTREL) != 0)
- {
- if (! add_dynamic_entry (DT_TEXTREL, 0))
- return FALSE;
- }
- }
+ {
+ if (! add_dynamic_entry (DT_RELA, 0)
+ || ! add_dynamic_entry (DT_RELASZ, 0)
+ || ! add_dynamic_entry (DT_RELAENT,
+ sizeof (Elf32_External_Rela)))
+ return FALSE;
+
+ /* If any dynamic relocs apply to a read-only section,
+ then we need a DT_TEXTREL entry. */
+ if ((info->flags & DF_TEXTREL) == 0)
+ elf_link_hash_traverse (&htab->root, maybe_set_textrel, info);
+
+ if ((info->flags & DF_TEXTREL) != 0)
+ {
+ if (! add_dynamic_entry (DT_TEXTREL, 0))
+ return FALSE;
+ }
+ }
}
#undef add_dynamic_entry
unsigned long r_symndx;
struct elf_link_hash_entry *h;
/* We can't modify r_addend here as elf_link_input_bfd has an assert to
- ensure it's zero (we use REL relocs, not RELA). Therefore this
- should be assigning zero to `addend', but for clarity we use
- `r_addend'. */
+ ensure it's zero (we use REL relocs, not RELA). Therefore this
+ should be assigning zero to `addend', but for clarity we use
+ `r_addend'. */
bfd_vma addend = rel->r_addend;
bfd_vma offset = rel->r_offset;
bfd_vma relocation;
}
if ( r_type == R_M32R_GNU_VTENTRY
- || r_type == R_M32R_GNU_VTINHERIT
- || r_type == R_M32R_NONE
- || r_type == R_M32R_RELA_GNU_VTENTRY
- || r_type == R_M32R_RELA_GNU_VTINHERIT)
- continue;
+ || r_type == R_M32R_GNU_VTINHERIT
+ || r_type == R_M32R_NONE
+ || r_type == R_M32R_RELA_GNU_VTENTRY
+ || r_type == R_M32R_RELA_GNU_VTINHERIT)
+ continue;
if (r_type <= R_M32R_GNU_VTENTRY)
- use_rel = TRUE;
+ use_rel = TRUE;
howto = m32r_elf_howto_table + r_type;
r_symndx = ELF32_R_SYM (rel->r_info);
switch ((int) r_type)
{
- case R_M32R_GOTOFF:
- /* Relocation is relative to the start of the global offset
- table (for ld24 rx, #uimm24). eg access at label+addend
+ case R_M32R_GOTOFF:
+ /* Relocation is relative to the start of the global offset
+ table (for ld24 rx, #uimm24). eg access at label+addend
- ld24 rx. #label@GOTOFF + addend
- sub rx, r12. */
+ ld24 rx. #label@GOTOFF + addend
+ sub rx, r12. */
- BFD_ASSERT (sgot != NULL);
+ BFD_ASSERT (sgot != NULL);
- relocation = -(relocation - sgot->output_section->vma);
- rel->r_addend = -rel->r_addend;
- break;
+ relocation = -(relocation - sgot->output_section->vma);
+ rel->r_addend = -rel->r_addend;
+ break;
- case R_M32R_GOTOFF_HI_ULO:
- case R_M32R_GOTOFF_HI_SLO:
- case R_M32R_GOTOFF_LO:
+ case R_M32R_GOTOFF_HI_ULO:
+ case R_M32R_GOTOFF_HI_SLO:
+ case R_M32R_GOTOFF_LO:
BFD_ASSERT (sgot != NULL);
relocation -= sgot->output_section->vma;
rel->r_addend += 0x10000;
break;
- case R_M32R_GOTPC24:
- /* .got(_GLOBAL_OFFSET_TABLE_) - pc relocation
- ld24 rx,#_GLOBAL_OFFSET_TABLE_
- */
- relocation = sgot->output_section->vma;
- break;
-
- case R_M32R_GOTPC_HI_ULO:
- case R_M32R_GOTPC_HI_SLO:
- case R_M32R_GOTPC_LO:
- {
- /* .got(_GLOBAL_OFFSET_TABLE_) - pc relocation
- bl .+4
- seth rx,#high(_GLOBAL_OFFSET_TABLE_)
- or3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4)
- or
- bl .+4
- seth rx,#shigh(_GLOBAL_OFFSET_TABLE_)
- add3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4)
- */
- relocation = sgot->output_section->vma;
- relocation -= (input_section->output_section->vma
- + input_section->output_offset
- + rel->r_offset);
- if ((r_type == R_M32R_GOTPC_HI_SLO)
- && ((relocation + rel->r_addend) & 0x8000))
- rel->r_addend += 0x10000;
-
- break;
- }
- case R_M32R_GOT16_HI_ULO:
- case R_M32R_GOT16_HI_SLO:
- case R_M32R_GOT16_LO:
- /* Fall through. */
- case R_M32R_GOT24:
- /* Relocation is to the entry for this symbol in the global
- offset table. */
- BFD_ASSERT (sgot != NULL);
-
- if (h != NULL)
- {
- bfd_boolean dyn;
- bfd_vma off;
-
- off = h->got.offset;
- BFD_ASSERT (off != (bfd_vma) -1);
-
- dyn = htab->root.dynamic_sections_created;
- if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
+ case R_M32R_GOTPC24:
+ /* .got(_GLOBAL_OFFSET_TABLE_) - pc relocation
+ ld24 rx,#_GLOBAL_OFFSET_TABLE_
+ */
+ relocation = sgot->output_section->vma;
+ break;
+
+ case R_M32R_GOTPC_HI_ULO:
+ case R_M32R_GOTPC_HI_SLO:
+ case R_M32R_GOTPC_LO:
+ {
+ /* .got(_GLOBAL_OFFSET_TABLE_) - pc relocation
+ bl .+4
+ seth rx,#high(_GLOBAL_OFFSET_TABLE_)
+ or3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4)
+ or
+ bl .+4
+ seth rx,#shigh(_GLOBAL_OFFSET_TABLE_)
+ add3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4)
+ */
+ relocation = sgot->output_section->vma;
+ relocation -= (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
+ if ((r_type == R_M32R_GOTPC_HI_SLO)
+ && ((relocation + rel->r_addend) & 0x8000))
+ rel->r_addend += 0x10000;
+
+ break;
+ }
+ case R_M32R_GOT16_HI_ULO:
+ case R_M32R_GOT16_HI_SLO:
+ case R_M32R_GOT16_LO:
+ /* Fall through. */
+ case R_M32R_GOT24:
+ /* Relocation is to the entry for this symbol in the global
+ offset table. */
+ BFD_ASSERT (sgot != NULL);
+
+ if (h != NULL)
+ {
+ bfd_boolean dyn;
+ bfd_vma off;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) -1);
+
+ dyn = htab->root.dynamic_sections_created;
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
bfd_link_pic (info),
h)
- || (bfd_link_pic (info)
- && (info->symbolic
- || h->dynindx == -1
- || h->forced_local)
- && h->def_regular))
- {
- /* This is actually a static link, or it is a
- -Bsymbolic link and the symbol is defined
- locally, or the symbol was forced to be local
- because of a version file. We must initialize
- this entry in the global offset table. Since the
- offset must always be a multiple of 4, we use the
- least significant bit to record whether we have
- initialized it already.
-
- When doing a dynamic link, we create a .rela.got
- relocation entry to initialize the value. This
- is done in the finish_dynamic_symbol routine. */
- if ((off & 1) != 0)
- off &= ~1;
- else
- {
- bfd_put_32 (output_bfd, relocation,
- sgot->contents + off);
- h->got.offset |= 1;
- }
- }
-
- relocation = sgot->output_offset + off;
- }
- else
- {
- bfd_vma off;
- bfd_byte *loc;
-
- BFD_ASSERT (local_got_offsets != NULL
- && local_got_offsets[r_symndx] != (bfd_vma) -1);
-
- off = local_got_offsets[r_symndx];
-
- /* The offset must always be a multiple of 4. We use
- the least significant bit to record whether we have
- already processed this entry. */
- if ((off & 1) != 0)
- off &= ~1;
- else
- {
- bfd_put_32 (output_bfd, relocation, sgot->contents + off);
-
- if (bfd_link_pic (info))
- {
- asection *srelgot;
- Elf_Internal_Rela outrel;
-
- /* We need to generate a R_M32R_RELATIVE reloc
- for the dynamic linker. */
- srelgot = htab->root.srelgot;
- BFD_ASSERT (srelgot != NULL);
-
- outrel.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + off);
- outrel.r_info = ELF32_R_INFO (0, R_M32R_RELATIVE);
- outrel.r_addend = relocation;
- loc = srelgot->contents;
- loc += srelgot->reloc_count * sizeof (Elf32_External_Rela);
- bfd_elf32_swap_reloca_out (output_bfd, &outrel,loc);
- ++srelgot->reloc_count;
- }
-
- local_got_offsets[r_symndx] |= 1;
- }
-
- relocation = sgot->output_offset + off;
- }
- if ((r_type == R_M32R_GOT16_HI_SLO)
- && ((relocation + rel->r_addend) & 0x8000))
- rel->r_addend += 0x10000;
-
- break;
-
- case R_M32R_26_PLTREL:
- /* Relocation is to the entry for this symbol in the
- procedure linkage table. */
-
- /* The native assembler will generate a 26_PLTREL reloc
- for a local symbol if you assemble a call from one
- section to another when using -K pic. */
- if (h == NULL)
- break;
-
- if (h->forced_local)
- break;
-
- if (h->plt.offset == (bfd_vma) -1)
+ || (bfd_link_pic (info)
+ && (info->symbolic
+ || h->dynindx == -1
+ || h->forced_local)
+ && h->def_regular))
+ {
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. We must initialize
+ this entry in the global offset table. Since the
+ offset must always be a multiple of 4, we use the
+ least significant bit to record whether we have
+ initialized it already.
+
+ When doing a dynamic link, we create a .rela.got
+ relocation entry to initialize the value. This
+ is done in the finish_dynamic_symbol routine. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_32 (output_bfd, relocation,
+ sgot->contents + off);
+ h->got.offset |= 1;
+ }
+ }
+
+ relocation = sgot->output_offset + off;
+ }
+ else
+ {
+ bfd_vma off;
+ bfd_byte *loc;
+
+ BFD_ASSERT (local_got_offsets != NULL
+ && local_got_offsets[r_symndx] != (bfd_vma) -1);
+
+ off = local_got_offsets[r_symndx];
+
+ /* The offset must always be a multiple of 4. We use
+ the least significant bit to record whether we have
+ already processed this entry. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ bfd_put_32 (output_bfd, relocation, sgot->contents + off);
+
+ if (bfd_link_pic (info))
+ {
+ asection *srelgot;
+ Elf_Internal_Rela outrel;
+
+ /* We need to generate a R_M32R_RELATIVE reloc
+ for the dynamic linker. */
+ srelgot = htab->root.srelgot;
+ BFD_ASSERT (srelgot != NULL);
+
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + off);
+ outrel.r_info = ELF32_R_INFO (0, R_M32R_RELATIVE);
+ outrel.r_addend = relocation;
+ loc = srelgot->contents;
+ loc += srelgot->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel,loc);
+ ++srelgot->reloc_count;
+ }
+
+ local_got_offsets[r_symndx] |= 1;
+ }
+
+ relocation = sgot->output_offset + off;
+ }
+ if ((r_type == R_M32R_GOT16_HI_SLO)
+ && ((relocation + rel->r_addend) & 0x8000))
+ rel->r_addend += 0x10000;
+
+ break;
+
+ case R_M32R_26_PLTREL:
+ /* Relocation is to the entry for this symbol in the
+ procedure linkage table. */
+
+ /* The native assembler will generate a 26_PLTREL reloc
+ for a local symbol if you assemble a call from one
+ section to another when using -K pic. */
+ if (h == NULL)
+ break;
+
+ if (h->forced_local)
+ break;
+
+ if (h->plt.offset == (bfd_vma) -1)
/* We didn't make a PLT entry for this symbol. This
happens when statically linking PIC code, or when
using -Bsymbolic. */
break;
- relocation = (splt->output_section->vma
- + splt->output_offset
- + h->plt.offset);
- break;
+ relocation = (splt->output_section->vma
+ + splt->output_offset
+ + h->plt.offset);
+ break;
- case R_M32R_HI16_SLO_RELA:
+ case R_M32R_HI16_SLO_RELA:
if ((relocation + rel->r_addend) & 0x8000)
rel->r_addend += 0x10000;
- /* Fall through. */
+ /* Fall through. */
- case R_M32R_16_RELA:
- case R_M32R_24_RELA:
- case R_M32R_32_RELA:
- case R_M32R_REL32:
+ case R_M32R_16_RELA:
+ case R_M32R_24_RELA:
+ case R_M32R_32_RELA:
+ case R_M32R_REL32:
case R_M32R_10_PCREL_RELA:
- case R_M32R_18_PCREL_RELA:
- case R_M32R_26_PCREL_RELA:
- case R_M32R_HI16_ULO_RELA:
- case R_M32R_LO16_RELA:
- if (bfd_link_pic (info)
- && r_symndx != STN_UNDEF
- && (input_section->flags & SEC_ALLOC) != 0
- && (( r_type != R_M32R_10_PCREL_RELA
- && r_type != R_M32R_18_PCREL_RELA
- && r_type != R_M32R_26_PCREL_RELA
- && r_type != R_M32R_REL32)
- || (h != NULL
- && h->dynindx != -1
- && (! info->symbolic
- || !h->def_regular))))
- {
- Elf_Internal_Rela outrel;
- bfd_boolean skip, relocate;
- bfd_byte *loc;
-
- /* When generating a shared object, these relocations
- are copied into the output file to be resolved at run
- time. */
- if (sreloc == NULL)
- {
+ case R_M32R_18_PCREL_RELA:
+ case R_M32R_26_PCREL_RELA:
+ case R_M32R_HI16_ULO_RELA:
+ case R_M32R_LO16_RELA:
+ if (bfd_link_pic (info)
+ && r_symndx != STN_UNDEF
+ && (input_section->flags & SEC_ALLOC) != 0
+ && (( r_type != R_M32R_10_PCREL_RELA
+ && r_type != R_M32R_18_PCREL_RELA
+ && r_type != R_M32R_26_PCREL_RELA
+ && r_type != R_M32R_REL32)
+ || (h != NULL
+ && h->dynindx != -1
+ && (! info->symbolic
+ || !h->def_regular))))
+ {
+ Elf_Internal_Rela outrel;
+ bfd_boolean skip, relocate;
+ bfd_byte *loc;
+
+ /* When generating a shared object, these relocations
+ are copied into the output file to be resolved at run
+ time. */
+ if (sreloc == NULL)
+ {
sreloc = _bfd_elf_get_dynamic_reloc_section
(input_bfd, input_section, /*rela?*/ TRUE);
if (sreloc == NULL)
return FALSE;
- }
-
- skip = FALSE;
- relocate = FALSE;
-
- outrel.r_offset = _bfd_elf_section_offset (output_bfd,
- info,
- input_section,
- rel->r_offset);
- if (outrel.r_offset == (bfd_vma) -1)
- skip = TRUE;
- else if (outrel.r_offset == (bfd_vma) -2)
- skip = relocate = TRUE;
- outrel.r_offset += (input_section->output_section->vma
- + input_section->output_offset);
-
- if (skip)
- memset (&outrel, 0, sizeof outrel);
- else if ( r_type == R_M32R_10_PCREL_RELA
- || r_type == R_M32R_18_PCREL_RELA
- || r_type == R_M32R_26_PCREL_RELA
- || r_type == R_M32R_REL32)
- {
- BFD_ASSERT (h != NULL && h->dynindx != -1);
- outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
- outrel.r_addend = rel->r_addend;
- }
- else
- {
- /* h->dynindx may be -1 if this symbol was marked to
- become local. */
- if (h == NULL
- || ((info->symbolic || h->dynindx == -1)
- && h->def_regular))
- {
- relocate = TRUE;
- outrel.r_info = ELF32_R_INFO (0, R_M32R_RELATIVE);
- outrel.r_addend = relocation + rel->r_addend;
- }
- else
- {
- BFD_ASSERT (h->dynindx != -1);
- outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
- outrel.r_addend = relocation + rel->r_addend;
- }
- }
-
- loc = sreloc->contents;
- loc += sreloc->reloc_count * sizeof (Elf32_External_Rela);
- bfd_elf32_swap_reloca_out (output_bfd, &outrel,loc);
- ++sreloc->reloc_count;
-
- /* If this reloc is against an external symbol, we do
- not want to fiddle with the addend. Otherwise, we
- need to include the symbol value so that it becomes
- an addend for the dynamic reloc. */
- if (! relocate)
- continue;
+ }
+
+ skip = FALSE;
+ relocate = FALSE;
+
+ outrel.r_offset = _bfd_elf_section_offset (output_bfd,
+ info,
+ input_section,
+ rel->r_offset);
+ if (outrel.r_offset == (bfd_vma) -1)
+ skip = TRUE;
+ else if (outrel.r_offset == (bfd_vma) -2)
+ skip = relocate = TRUE;
+ outrel.r_offset += (input_section->output_section->vma
+ + input_section->output_offset);
+
+ if (skip)
+ memset (&outrel, 0, sizeof outrel);
+ else if ( r_type == R_M32R_10_PCREL_RELA
+ || r_type == R_M32R_18_PCREL_RELA
+ || r_type == R_M32R_26_PCREL_RELA
+ || r_type == R_M32R_REL32)
+ {
+ BFD_ASSERT (h != NULL && h->dynindx != -1);
+ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+ outrel.r_addend = rel->r_addend;
+ }
+ else
+ {
+ /* h->dynindx may be -1 if this symbol was marked to
+ become local. */
+ if (h == NULL
+ || ((info->symbolic || h->dynindx == -1)
+ && h->def_regular))
+ {
+ relocate = TRUE;
+ outrel.r_info = ELF32_R_INFO (0, R_M32R_RELATIVE);
+ outrel.r_addend = relocation + rel->r_addend;
+ }
+ else
+ {
+ BFD_ASSERT (h->dynindx != -1);
+ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+ outrel.r_addend = relocation + rel->r_addend;
+ }
+ }
+
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel,loc);
+ ++sreloc->reloc_count;
+
+ /* If this reloc is against an external symbol, we do
+ not want to fiddle with the addend. Otherwise, we
+ need to include the symbol value so that it becomes
+ an addend for the dynamic reloc. */
+ if (! relocate)
+ continue;
break;
- }
+ }
else if (r_type != R_M32R_10_PCREL_RELA)
break;
/* Fall through. */
r = m32r_elf_do_10_pcrel_reloc (input_bfd, howto, input_section,
contents, offset,
sec, relocation, addend);
- goto check_reloc;
+ goto check_reloc;
case (int) R_M32R_HI16_SLO :
case (int) R_M32R_HI16_ULO :
relocation, addend);
}
- goto check_reloc;
+ goto check_reloc;
- case (int) R_M32R_SDA16_RELA:
+ case (int) R_M32R_SDA16_RELA:
case (int) R_M32R_SDA16 :
{
const char *name;
continue;
}
}
- /* Fall through. */
+ /* Fall through. */
default : /* OLD_M32R_RELOC */
goto check_reloc;
}
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, rel->r_addend);
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset,
+ relocation, rel->r_addend);
}
Elf_Internal_Rela rela;
/* This symbol has an entry in the procedure linkage table. Set
- it up. */
+ it up. */
BFD_ASSERT (h->dynindx != -1);
BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL);
/* Get the index in the procedure linkage table which
- corresponds to this symbol. This is the index of this symbol
- in all the symbols for which we are making plt entries. The
- first entry in the procedure linkage table is reserved. */
+ corresponds to this symbol. This is the index of this symbol
+ in all the symbols for which we are making plt entries. The
+ first entry in the procedure linkage table is reserved. */
plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
/* Get the offset into the .got table of the entry that
- corresponds to this function. Each .got entry is 4 bytes.
- The first three are reserved. */
+ corresponds to this function. Each .got entry is 4 bytes.
+ The first three are reserved. */
got_offset = (plt_index + 3) * 4;
/* Fill in the entry in the procedure linkage table. */
if (! bfd_link_pic (info))
- {
- bfd_put_32 (output_bfd,
- (PLT_ENTRY_WORD0b
- + (((sgot->output_section->vma
- + sgot->output_offset
- + got_offset) >> 16) & 0xffff)),
- splt->contents + h->plt.offset);
- bfd_put_32 (output_bfd,
- (PLT_ENTRY_WORD1b
- + ((sgot->output_section->vma
- + sgot->output_offset
- + got_offset) & 0xffff)),
- splt->contents + h->plt.offset + 4);
- bfd_put_32 (output_bfd, PLT_ENTRY_WORD2,
- splt->contents + h->plt.offset + 8);
- bfd_put_32 (output_bfd,
- (PLT_ENTRY_WORD3
- + plt_index * sizeof (Elf32_External_Rela)),
- splt->contents + h->plt.offset + 12);
- bfd_put_32 (output_bfd,
- (PLT_ENTRY_WORD4
- + (((unsigned int) ((- (h->plt.offset + 16)) >> 2)) & 0xffffff)),
- splt->contents + h->plt.offset + 16);
- }
+ {
+ bfd_put_32 (output_bfd,
+ (PLT_ENTRY_WORD0b
+ + (((sgot->output_section->vma
+ + sgot->output_offset
+ + got_offset) >> 16) & 0xffff)),
+ splt->contents + h->plt.offset);
+ bfd_put_32 (output_bfd,
+ (PLT_ENTRY_WORD1b
+ + ((sgot->output_section->vma
+ + sgot->output_offset
+ + got_offset) & 0xffff)),
+ splt->contents + h->plt.offset + 4);
+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD2,
+ splt->contents + h->plt.offset + 8);
+ bfd_put_32 (output_bfd,
+ (PLT_ENTRY_WORD3
+ + plt_index * sizeof (Elf32_External_Rela)),
+ splt->contents + h->plt.offset + 12);
+ bfd_put_32 (output_bfd,
+ (PLT_ENTRY_WORD4
+ + (((unsigned int) ((- (h->plt.offset + 16)) >> 2)) & 0xffffff)),
+ splt->contents + h->plt.offset + 16);
+ }
else
- {
- bfd_put_32 (output_bfd,
- PLT_ENTRY_WORD0 + got_offset,
- splt->contents + h->plt.offset);
- bfd_put_32 (output_bfd, PLT_ENTRY_WORD1,
- splt->contents + h->plt.offset + 4);
- bfd_put_32 (output_bfd, PLT_ENTRY_WORD2,
- splt->contents + h->plt.offset + 8);
- bfd_put_32 (output_bfd,
- (PLT_ENTRY_WORD3
- + plt_index * sizeof (Elf32_External_Rela)),
- splt->contents + h->plt.offset + 12);
- bfd_put_32 (output_bfd,
- (PLT_ENTRY_WORD4
- + (((unsigned int) ((- (h->plt.offset + 16)) >> 2)) & 0xffffff)),
- splt->contents + h->plt.offset + 16);
- }
+ {
+ bfd_put_32 (output_bfd,
+ PLT_ENTRY_WORD0 + got_offset,
+ splt->contents + h->plt.offset);
+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD1,
+ splt->contents + h->plt.offset + 4);
+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD2,
+ splt->contents + h->plt.offset + 8);
+ bfd_put_32 (output_bfd,
+ (PLT_ENTRY_WORD3
+ + plt_index * sizeof (Elf32_External_Rela)),
+ splt->contents + h->plt.offset + 12);
+ bfd_put_32 (output_bfd,
+ (PLT_ENTRY_WORD4
+ + (((unsigned int) ((- (h->plt.offset + 16)) >> 2)) & 0xffffff)),
+ splt->contents + h->plt.offset + 16);
+ }
/* Fill in the entry in the global offset table. */
bfd_put_32 (output_bfd,
- (splt->output_section->vma
- + splt->output_offset
- + h->plt.offset
- + 12), /* same offset */
- sgot->contents + got_offset);
+ (splt->output_section->vma
+ + splt->output_offset
+ + h->plt.offset
+ + 12), /* same offset */
+ sgot->contents + got_offset);
/* Fill in the entry in the .rela.plt section. */
rela.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + got_offset);
+ + sgot->output_offset
+ + got_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_M32R_JMP_SLOT);
rela.r_addend = 0;
loc = srela->contents;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
if (!h->def_regular)
- {
- /* Mark the symbol as undefined, rather than as defined in
- the .plt section. Leave the value alone. */
- sym->st_shndx = SHN_UNDEF;
- }
+ {
+ /* Mark the symbol as undefined, rather than as defined in
+ the .plt section. Leave the value alone. */
+ sym->st_shndx = SHN_UNDEF;
+ }
}
if (h->got.offset != (bfd_vma) -1)
Elf_Internal_Rela rela;
/* This symbol has an entry in the global offset table. Set it
- up. */
+ up. */
sgot = htab->root.sgot;
srela = htab->root.srelgot;
BFD_ASSERT (sgot != NULL && srela != NULL);
rela.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + (h->got.offset &~ 1));
+ + sgot->output_offset
+ + (h->got.offset &~ 1));
/* If this is a -Bsymbolic link, and the symbol is defined
- locally, we just want to emit a RELATIVE reloc. Likewise if
- the symbol was forced to be local because of a version file.
- The entry in the global offset table will already have been
- initialized in the relocate_section function. */
+ locally, we just want to emit a RELATIVE reloc. Likewise if
+ the symbol was forced to be local because of a version file.
+ The entry in the global offset table will already have been
+ initialized in the relocate_section function. */
if (bfd_link_pic (info)
- && (info->symbolic
+ && (info->symbolic
|| h->dynindx == -1
|| h->forced_local)
- && h->def_regular)
- {
- rela.r_info = ELF32_R_INFO (0, R_M32R_RELATIVE);
- rela.r_addend = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
- }
+ && h->def_regular)
+ {
+ rela.r_info = ELF32_R_INFO (0, R_M32R_RELATIVE);
+ rela.r_addend = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
else
- {
+ {
BFD_ASSERT ((h->got.offset & 1) == 0);
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
- rela.r_info = ELF32_R_INFO (h->dynindx, R_M32R_GLOB_DAT);
- rela.r_addend = 0;
- }
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_M32R_GLOB_DAT);
+ rela.r_addend = 0;
+ }
loc = srela->contents;
loc += srela->reloc_count * sizeof (Elf32_External_Rela);
/* This symbols needs a copy reloc. Set it up. */
BFD_ASSERT (h->dynindx != -1
- && (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak));
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak));
s = bfd_get_linker_section (htab->root.dynobj, ".rela.bss");
BFD_ASSERT (s != NULL);
rela.r_offset = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_M32R_COPY);
rela.r_addend = 0;
loc = s->contents;
dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
for (; dyncon < dynconend; dyncon++)
- {
- Elf_Internal_Dyn dyn;
- asection *s;
-
- bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
-
- switch (dyn.d_tag)
- {
- default:
- break;
-
- case DT_PLTGOT:
- s = htab->root.sgotplt;
- goto get_vma;
- case DT_JMPREL:
- s = htab->root.srelplt;
- get_vma:
- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- break;
-
- case DT_PLTRELSZ:
- s = htab->root.srelplt;
+ {
+ Elf_Internal_Dyn dyn;
+ asection *s;
+
+ bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+
+ switch (dyn.d_tag)
+ {
+ default:
+ break;
+
+ case DT_PLTGOT:
+ s = htab->root.sgotplt;
+ goto get_vma;
+ case DT_JMPREL:
+ s = htab->root.srelplt;
+ get_vma:
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+
+ case DT_PLTRELSZ:
+ s = htab->root.srelplt;
dyn.d_un.d_val = s->size;
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- break;
- }
- }
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ break;
+ }
+ }
/* Fill in the first entry in the procedure linkage table. */
splt = htab->root.splt;
if (splt && splt->size > 0)
- {
- if (bfd_link_pic (info))
- {
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD0, splt->contents);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD1, splt->contents + 4);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD2, splt->contents + 8);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD3, splt->contents + 12);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD4, splt->contents + 16);
- }
- else
- {
- unsigned long addr;
- /* addr = .got + 4 */
- addr = sgot->output_section->vma + sgot->output_offset + 4;
- bfd_put_32 (output_bfd,
+ {
+ if (bfd_link_pic (info))
+ {
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD0, splt->contents);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD1, splt->contents + 4);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD2, splt->contents + 8);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD3, splt->contents + 12);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD4, splt->contents + 16);
+ }
+ else
+ {
+ unsigned long addr;
+ /* addr = .got + 4 */
+ addr = sgot->output_section->vma + sgot->output_offset + 4;
+ bfd_put_32 (output_bfd,
PLT0_ENTRY_WORD0 | ((addr >> 16) & 0xffff),
splt->contents);
- bfd_put_32 (output_bfd,
+ bfd_put_32 (output_bfd,
PLT0_ENTRY_WORD1 | (addr & 0xffff),
splt->contents + 4);
- bfd_put_32 (output_bfd, PLT0_ENTRY_WORD2, splt->contents + 8);
- bfd_put_32 (output_bfd, PLT0_ENTRY_WORD3, splt->contents + 12);
- bfd_put_32 (output_bfd, PLT0_ENTRY_WORD4, splt->contents + 16);
- }
-
- elf_section_data (splt->output_section)->this_hdr.sh_entsize =
- PLT_ENTRY_SIZE;
- }
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD2, splt->contents + 8);
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD3, splt->contents + 12);
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD4, splt->contents + 16);
+ }
+
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize =
+ PLT_ENTRY_SIZE;
+ }
}
/* Fill in the first three entries in the global offset table. */
if (sgot && sgot->size > 0)
{
if (sdyn == NULL)
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
else
- bfd_put_32 (output_bfd,
- sdyn->output_section->vma + sdyn->output_offset,
- sgot->contents);
+ bfd_put_32 (output_bfd,
+ sdyn->output_section->vma + sdyn->output_offset,
+ sgot->contents);
bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 4);
bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 8);
if ((in_flags & EF_M32R_ARCH) != (out_flags & EF_M32R_ARCH))
{
if ( ((in_flags & EF_M32R_ARCH) != E_M32R_ARCH)
- || ((out_flags & EF_M32R_ARCH) == E_M32R_ARCH)
- || ((in_flags & EF_M32R_ARCH) == E_M32R2_ARCH))
+ || ((out_flags & EF_M32R_ARCH) == E_M32R_ARCH)
+ || ((in_flags & EF_M32R_ARCH) == E_M32R2_ARCH))
{
_bfd_error_handler
(_("%B: Instruction set mismatch with previous modules"), ibfd);
r_symndx = ELF32_R_SYM (rel->r_info);
r_type = ELF32_R_TYPE (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
/* Some relocs require a global offset table. */
if (htab->root.sgot == NULL)
- {
- switch (r_type)
- {
- case R_M32R_GOT16_HI_ULO:
- case R_M32R_GOT16_HI_SLO:
- case R_M32R_GOTOFF:
- case R_M32R_GOTOFF_HI_ULO:
- case R_M32R_GOTOFF_HI_SLO:
- case R_M32R_GOTOFF_LO:
- case R_M32R_GOT16_LO:
- case R_M32R_GOTPC24:
- case R_M32R_GOTPC_HI_ULO:
- case R_M32R_GOTPC_HI_SLO:
- case R_M32R_GOTPC_LO:
- case R_M32R_GOT24:
- if (dynobj == NULL)
- htab->root.dynobj = dynobj = abfd;
- if (!_bfd_elf_create_got_section (dynobj, info))
- return FALSE;
- break;
-
- default:
- break;
- }
- }
+ {
+ switch (r_type)
+ {
+ case R_M32R_GOT16_HI_ULO:
+ case R_M32R_GOT16_HI_SLO:
+ case R_M32R_GOTOFF:
+ case R_M32R_GOTOFF_HI_ULO:
+ case R_M32R_GOTOFF_HI_SLO:
+ case R_M32R_GOTOFF_LO:
+ case R_M32R_GOT16_LO:
+ case R_M32R_GOTPC24:
+ case R_M32R_GOTPC_HI_ULO:
+ case R_M32R_GOTPC_HI_SLO:
+ case R_M32R_GOTPC_LO:
+ case R_M32R_GOT24:
+ if (dynobj == NULL)
+ htab->root.dynobj = dynobj = abfd;
+ if (!_bfd_elf_create_got_section (dynobj, info))
+ return FALSE;
+ break;
+
+ default:
+ break;
+ }
+ }
switch (r_type)
- {
+ {
case R_M32R_GOT16_HI_ULO:
case R_M32R_GOT16_HI_SLO:
case R_M32R_GOT16_LO:
- case R_M32R_GOT24:
-
- if (h != NULL)
- h->got.refcount += 1;
- else
- {
- bfd_signed_vma *local_got_refcounts;
-
- /* This is a global offset table entry for a local
- symbol. */
- local_got_refcounts = elf_local_got_refcounts (abfd);
- if (local_got_refcounts == NULL)
- {
- bfd_size_type size;
-
- size = symtab_hdr->sh_info;
- size *= sizeof (bfd_signed_vma);
- local_got_refcounts = bfd_zalloc (abfd, size);
- if (local_got_refcounts == NULL)
- return FALSE;
- elf_local_got_refcounts (abfd) = local_got_refcounts;
- }
- local_got_refcounts[r_symndx] += 1;
- }
- break;
-
- case R_M32R_26_PLTREL:
- /* This symbol requires a procedure linkage table entry. We
- actually build the entry in adjust_dynamic_symbol,
- because this might be a case of linking PIC code without
- linking in any dynamic objects, in which case we don't
- need to generate a procedure linkage table after all. */
+ case R_M32R_GOT24:
+
+ if (h != NULL)
+ h->got.refcount += 1;
+ else
+ {
+ bfd_signed_vma *local_got_refcounts;
+
+ /* This is a global offset table entry for a local
+ symbol. */
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+ if (local_got_refcounts == NULL)
+ {
+ bfd_size_type size;
+
+ size = symtab_hdr->sh_info;
+ size *= sizeof (bfd_signed_vma);
+ local_got_refcounts = bfd_zalloc (abfd, size);
+ if (local_got_refcounts == NULL)
+ return FALSE;
+ elf_local_got_refcounts (abfd) = local_got_refcounts;
+ }
+ local_got_refcounts[r_symndx] += 1;
+ }
+ break;
+
+ case R_M32R_26_PLTREL:
+ /* This symbol requires a procedure linkage table entry. We
+ actually build the entry in adjust_dynamic_symbol,
+ because this might be a case of linking PIC code without
+ linking in any dynamic objects, in which case we don't
+ need to generate a procedure linkage table after all. */
/* If this is a local symbol, we resolve it directly without
creating a procedure linkage table entry. */
- if (h == NULL)
- continue;
+ if (h == NULL)
+ continue;
- if (h->forced_local)
- break;
+ if (h->forced_local)
+ break;
- h->needs_plt = 1;
+ h->needs_plt = 1;
h->plt.refcount += 1;
- break;
-
- case R_M32R_16_RELA:
- case R_M32R_24_RELA:
- case R_M32R_32_RELA:
- case R_M32R_REL32:
- case R_M32R_HI16_ULO_RELA:
- case R_M32R_HI16_SLO_RELA:
- case R_M32R_LO16_RELA:
- case R_M32R_SDA16_RELA:
+ break;
+
+ case R_M32R_16_RELA:
+ case R_M32R_24_RELA:
+ case R_M32R_32_RELA:
+ case R_M32R_REL32:
+ case R_M32R_HI16_ULO_RELA:
+ case R_M32R_HI16_SLO_RELA:
+ case R_M32R_LO16_RELA:
+ case R_M32R_SDA16_RELA:
case R_M32R_10_PCREL_RELA:
- case R_M32R_18_PCREL_RELA:
- case R_M32R_26_PCREL_RELA:
-
- if (h != NULL && !bfd_link_pic (info))
- {
- h->non_got_ref = 1;
- h->plt.refcount += 1;
- }
-
- /* If we are creating a shared library, and this is a reloc
- against a global symbol, or a non PC relative reloc
- against a local symbol, then we need to copy the reloc
- into the shared library. However, if we are linking with
- -Bsymbolic, we do not need to copy a reloc against a
- global symbol which is defined in an object we are
- including in the link (i.e., DEF_REGULAR is set). At
- this point we have not seen all the input files, so it is
- possible that DEF_REGULAR is not set now but will be set
- later (it is never cleared). We account for that
- possibility below by storing information in the
- dyn_relocs field of the hash table entry. A similar
- situation occurs when creating shared libraries and symbol
- visibility changes render the symbol local.
-
- If on the other hand, we are creating an executable, we
- may need to keep relocations for symbols satisfied by a
- dynamic library if we manage to avoid copy relocs for the
- symbol. */
- if ((bfd_link_pic (info)
- && (sec->flags & SEC_ALLOC) != 0
+ case R_M32R_18_PCREL_RELA:
+ case R_M32R_26_PCREL_RELA:
+
+ if (h != NULL && !bfd_link_pic (info))
+ {
+ h->non_got_ref = 1;
+ h->plt.refcount += 1;
+ }
+
+ /* If we are creating a shared library, and this is a reloc
+ against a global symbol, or a non PC relative reloc
+ against a local symbol, then we need to copy the reloc
+ into the shared library. However, if we are linking with
+ -Bsymbolic, we do not need to copy a reloc against a
+ global symbol which is defined in an object we are
+ including in the link (i.e., DEF_REGULAR is set). At
+ this point we have not seen all the input files, so it is
+ possible that DEF_REGULAR is not set now but will be set
+ later (it is never cleared). We account for that
+ possibility below by storing information in the
+ dyn_relocs field of the hash table entry. A similar
+ situation occurs when creating shared libraries and symbol
+ visibility changes render the symbol local.
+
+ If on the other hand, we are creating an executable, we
+ may need to keep relocations for symbols satisfied by a
+ dynamic library if we manage to avoid copy relocs for the
+ symbol. */
+ if ((bfd_link_pic (info)
+ && (sec->flags & SEC_ALLOC) != 0
&& (( r_type != R_M32R_26_PCREL_RELA
- && r_type != R_M32R_18_PCREL_RELA
- && r_type != R_M32R_10_PCREL_RELA
- && r_type != R_M32R_REL32)
- || (h != NULL
+ && r_type != R_M32R_18_PCREL_RELA
+ && r_type != R_M32R_10_PCREL_RELA
+ && r_type != R_M32R_REL32)
+ || (h != NULL
&& (! info->symbolic
- || h->root.type == bfd_link_hash_defweak
- || !h->def_regular))))
- || (!bfd_link_pic (info)
- && (sec->flags & SEC_ALLOC) != 0
- && h != NULL
- && (h->root.type == bfd_link_hash_defweak
- || !h->def_regular)))
- {
- struct elf_dyn_relocs *p;
- struct elf_dyn_relocs **head;
-
- if (dynobj == NULL)
- htab->root.dynobj = dynobj = abfd;
-
- /* When creating a shared object, we must copy these
- relocs into the output file. We create a reloc
- section in dynobj and make room for the reloc. */
- if (sreloc == NULL)
- {
+ || h->root.type == bfd_link_hash_defweak
+ || !h->def_regular))))
+ || (!bfd_link_pic (info)
+ && (sec->flags & SEC_ALLOC) != 0
+ && h != NULL
+ && (h->root.type == bfd_link_hash_defweak
+ || !h->def_regular)))
+ {
+ struct elf_dyn_relocs *p;
+ struct elf_dyn_relocs **head;
+
+ if (dynobj == NULL)
+ htab->root.dynobj = dynobj = abfd;
+
+ /* When creating a shared object, we must copy these
+ relocs into the output file. We create a reloc
+ section in dynobj and make room for the reloc. */
+ if (sreloc == NULL)
+ {
sreloc = _bfd_elf_make_dynamic_reloc_section
(sec, dynobj, 2, abfd, /*rela?*/ TRUE);
if (sreloc == NULL)
return FALSE;
- }
-
- /* If this is a global symbol, we count the number of
- relocations we need for this symbol. */
- if (h != NULL)
- head = &((struct elf_m32r_link_hash_entry *) h)->dyn_relocs;
- else
- {
- /* Track dynamic relocs needed for local syms too. */
- asection *s;
- void *vpp;
+ }
+
+ /* If this is a global symbol, we count the number of
+ relocations we need for this symbol. */
+ if (h != NULL)
+ head = &((struct elf_m32r_link_hash_entry *) h)->dyn_relocs;
+ else
+ {
+ /* Track dynamic relocs needed for local syms too. */
+ asection *s;
+ void *vpp;
Elf_Internal_Sym *isym;
isym = bfd_sym_from_r_symndx (&htab->sym_cache,
s = sec;
vpp = &elf_section_data (s)->local_dynrel;
- head = (struct elf_dyn_relocs **) vpp;
- }
-
- p = *head;
- if (p == NULL || p->sec != sec)
- {
- bfd_size_type amt = sizeof (*p);
-
- p = bfd_alloc (dynobj, amt);
- if (p == NULL)
- return FALSE;
- p->next = *head;
- *head = p;
- p->sec = sec;
- p->count = 0;
- p->pc_count = 0;
- }
-
- p->count += 1;
- if ( ELF32_R_TYPE (rel->r_info) == R_M32R_26_PCREL_RELA
- || ELF32_R_TYPE (rel->r_info) == R_M32R_18_PCREL_RELA
+ head = (struct elf_dyn_relocs **) vpp;
+ }
+
+ p = *head;
+ if (p == NULL || p->sec != sec)
+ {
+ bfd_size_type amt = sizeof (*p);
+
+ p = bfd_alloc (dynobj, amt);
+ if (p == NULL)
+ return FALSE;
+ p->next = *head;
+ *head = p;
+ p->sec = sec;
+ p->count = 0;
+ p->pc_count = 0;
+ }
+
+ p->count += 1;
+ if ( ELF32_R_TYPE (rel->r_info) == R_M32R_26_PCREL_RELA
+ || ELF32_R_TYPE (rel->r_info) == R_M32R_18_PCREL_RELA
|| ELF32_R_TYPE (rel->r_info) == R_M32R_10_PCREL_RELA
|| ELF32_R_TYPE (rel->r_info) == R_M32R_REL32)
- p->pc_count += 1;
- }
- break;
-
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_M32R_RELA_GNU_VTINHERIT:
- case R_M32R_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_M32R_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
- case R_M32R_RELA_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
- }
+ p->pc_count += 1;
+ }
+ break;
+
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_M32R_RELA_GNU_VTINHERIT:
+ case R_M32R_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_M32R_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+ case R_M32R_RELA_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
+ }
}
return TRUE;
static const struct bfd_elf_special_section m32r_elf_special_sections[] =
{
- { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
+ { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
static enum elf_reloc_type_class
case R_M32R_RELATIVE: return reloc_class_relative;
case R_M32R_JMP_SLOT: return reloc_class_plt;
case R_M32R_COPY: return reloc_class_copy;
- default: return reloc_class_normal;
+ default: return reloc_class_normal;
}
}
\f
#define ELF_MACHINE_ALT1 EM_CYGNUS_M32R
#define ELF_MAXPAGESIZE 0x1 /* Explicitly requested by Mitsubishi. */
-#define TARGET_BIG_SYM m32r_elf32_vec
+#define TARGET_BIG_SYM m32r_elf32_vec
#define TARGET_BIG_NAME "elf32-m32r"
-#define TARGET_LITTLE_SYM m32r_elf32_le_vec
-#define TARGET_LITTLE_NAME "elf32-m32rle"
+#define TARGET_LITTLE_SYM m32r_elf32_le_vec
+#define TARGET_LITTLE_NAME "elf32-m32rle"
#define elf_info_to_howto m32r_info_to_howto
#define elf_info_to_howto_rel m32r_info_to_howto_rel
#define elf_backend_symbol_processing _bfd_m32r_elf_symbol_processing
#define elf_backend_add_symbol_hook m32r_elf_add_symbol_hook
#define elf_backend_relocate_section m32r_elf_relocate_section
-#define elf_backend_gc_mark_hook m32r_elf_gc_mark_hook
-#define elf_backend_check_relocs m32r_elf_check_relocs
+#define elf_backend_gc_mark_hook m32r_elf_gc_mark_hook
+#define elf_backend_check_relocs m32r_elf_check_relocs
-#define elf_backend_create_dynamic_sections m32r_elf_create_dynamic_sections
-#define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create
-#define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections
+#define elf_backend_create_dynamic_sections m32r_elf_create_dynamic_sections
+#define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create
+#define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections
#define elf_backend_omit_section_dynsym \
((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true)
-#define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections
-#define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol
-#define elf_backend_finish_dynamic_symbol m32r_elf_finish_dynamic_symbol
-#define elf_backend_reloc_type_class m32r_elf_reloc_type_class
-#define elf_backend_copy_indirect_symbol m32r_elf_copy_indirect_symbol
+#define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections
+#define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol
+#define elf_backend_finish_dynamic_symbol m32r_elf_finish_dynamic_symbol
+#define elf_backend_reloc_type_class m32r_elf_reloc_type_class
+#define elf_backend_copy_indirect_symbol m32r_elf_copy_indirect_symbol
-#define elf_backend_can_gc_sections 1
+#define elf_backend_can_gc_sections 1
/*#if !USE_REL
#define elf_backend_rela_normal 1
#endif*/
#define elf_backend_got_header_size 12
#define elf_backend_dtrel_excludes_plt 1
-#define elf_backend_may_use_rel_p 1
+#define elf_backend_may_use_rel_p 1
#ifdef USE_M32R_OLD_RELOC
-#define elf_backend_default_use_rela_p 0
-#define elf_backend_may_use_rela_p 0
+#define elf_backend_default_use_rela_p 0
+#define elf_backend_may_use_rela_p 0
#else
-#define elf_backend_default_use_rela_p 1
-#define elf_backend_may_use_rela_p 1
+#define elf_backend_default_use_rela_p 1
+#define elf_backend_may_use_rela_p 1
#endif
#define elf_backend_object_p m32r_elf_object_p
-#define elf_backend_final_write_processing m32r_elf_final_write_processing
-#define bfd_elf32_bfd_merge_private_bfd_data m32r_elf_merge_private_bfd_data
+#define elf_backend_final_write_processing m32r_elf_final_write_processing
+#define bfd_elf32_bfd_merge_private_bfd_data m32r_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags m32r_elf_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data m32r_elf_print_private_bfd_data
#define elf_backend_special_sections m32r_elf_special_sections
#include "elf32-target.h"
-#undef ELF_MAXPAGESIZE
-#define ELF_MAXPAGESIZE 0x1000
-
-#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM m32r_elf32_linux_vec
-#undef TARGET_BIG_NAME
-#define TARGET_BIG_NAME "elf32-m32r-linux"
-#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM m32r_elf32_linux_le_vec
-#undef TARGET_LITTLE_NAME
-#define TARGET_LITTLE_NAME "elf32-m32rle-linux"
-#undef elf32_bed
-#define elf32_bed elf32_m32r_lin_bed
+#undef ELF_MAXPAGESIZE
+#define ELF_MAXPAGESIZE 0x1000
+
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM m32r_elf32_linux_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-m32r-linux"
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM m32r_elf32_linux_le_vec
+#undef TARGET_LITTLE_NAME
+#define TARGET_LITTLE_NAME "elf32-m32rle-linux"
+#undef elf32_bed
+#define elf32_bed elf32_m32r_lin_bed
#include "elf32-target.h"
FALSE, /* partial_inplace */
0x00ff, /* src_mask */
0x00ff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* A 16 bit absolute relocation */
HOWTO (R_M68HC11_16, /* type */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_M68HC11_GNU_VTINHERIT, /* type */
FALSE), /* pcrel_offset */
/* A 24 bit relocation */
- HOWTO (R_M68HC11_24, /* type */
+ HOWTO (R_M68HC11_24, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
24, /* bitsize */
FALSE), /* pcrel_offset */
/* A 16-bit low relocation */
- HOWTO (R_M68HC11_LO16, /* type */
+ HOWTO (R_M68HC11_LO16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE), /* pcrel_offset */
/* A page relocation */
- HOWTO (R_M68HC11_PAGE, /* type */
+ HOWTO (R_M68HC11_PAGE, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
TRUE, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* Mark beginning of Gcc relaxation group instruction. */
HOWTO (R_M68HC11_RL_GROUP, /* type */
TRUE, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
};
/* Map BFD reloc types to M68HC11 ELF reloc types. */
static reloc_howto_type *
bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
unsigned int i;
static void
m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *cache_ptr, Elf_Internal_Rela *dst)
+ arelent *cache_ptr, Elf_Internal_Rela *dst)
{
unsigned int r_type;
*/
sym_value = (stub_entry->target_value
- + stub_entry->target_section->output_offset
- + stub_entry->target_section->output_section->vma);
+ + stub_entry->target_section->output_offset
+ + stub_entry->target_section->output_section->vma);
phys_addr = m68hc11_phys_addr (&htab->pinfo, sym_value);
phys_page = m68hc11_phys_page (&htab->pinfo, sym_value);
static bfd_boolean
m68hc11_elf_size_one_stub (struct bfd_hash_entry *gen_entry,
- void *in_arg ATTRIBUTE_UNUSED)
+ void *in_arg ATTRIBUTE_UNUSED)
{
struct elf32_m68hc11_stub_hash_entry *stub_entry;
static void
m68hc11_relax_group (bfd *abfd, asection *sec, bfd_byte *contents,
- unsigned value, unsigned long offset,
- unsigned long end_group)
+ unsigned value, unsigned long offset,
+ unsigned long end_group)
{
unsigned char code;
unsigned long start_offset;
start_offset = offset;
code = bfd_get_8 (abfd, contents + offset);
if (code == 0x18)
- {
- bset_use_y++;
- offset++;
- code = bfd_get_8 (abfd, contents + offset);
- }
+ {
+ bset_use_y++;
+ offset++;
+ code = bfd_get_8 (abfd, contents + offset);
+ }
/* Check the instruction and translate to use direct addressing mode. */
switch (code)
- {
- /* bset */
- case 0x1C:
- code = 0x14;
- isize = 3;
- break;
-
- /* brclr */
- case 0x1F:
- code = 0x13;
- isize = 4;
- break;
-
- /* brset */
- case 0x1E:
- code = 0x12;
- isize = 4;
- break;
-
- /* bclr */
- case 0x1D:
- code = 0x15;
- isize = 3;
- break;
-
- /* This instruction is not recognized and we are not
- at end of the relax group. Ignore and don't remove
- the first LDX (we don't know what it is used for...). */
- default:
- return;
- }
+ {
+ /* bset */
+ case 0x1C:
+ code = 0x14;
+ isize = 3;
+ break;
+
+ /* brclr */
+ case 0x1F:
+ code = 0x13;
+ isize = 4;
+ break;
+
+ /* brset */
+ case 0x1E:
+ code = 0x12;
+ isize = 4;
+ break;
+
+ /* bclr */
+ case 0x1D:
+ code = 0x15;
+ isize = 3;
+ break;
+
+ /* This instruction is not recognized and we are not
+ at end of the relax group. Ignore and don't remove
+ the first LDX (we don't know what it is used for...). */
+ default:
+ return;
+ }
new_value = (unsigned) bfd_get_8 (abfd, contents + offset + 1);
new_value += value;
if ((new_value & 0xff00) == 0 && bset_use_y == relax_ldy)
- {
- bfd_put_8 (abfd, code, contents + offset);
- bfd_put_8 (abfd, new_value, contents + offset + 1);
- if (start_offset != offset)
- {
- m68hc11_elf_relax_delete_bytes (abfd, sec, start_offset,
- offset - start_offset);
- end_group--;
- }
- }
+ {
+ bfd_put_8 (abfd, code, contents + offset);
+ bfd_put_8 (abfd, new_value, contents + offset + 1);
+ if (start_offset != offset)
+ {
+ m68hc11_elf_relax_delete_bytes (abfd, sec, start_offset,
+ offset - start_offset);
+ end_group--;
+ }
+ }
else
- {
- can_delete_ldx = 0;
- }
+ {
+ can_delete_ldx = 0;
+ }
offset = start_offset + isize;
}
if (can_delete_ldx)
static bfd_boolean
m68hc11_elf_relax_section (bfd *abfd, asection *sec,
- struct bfd_link_info *link_info, bfd_boolean *again)
+ struct bfd_link_info *link_info, bfd_boolean *again)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *internal_relocs;
/* Checking for branch relaxation relies on the relocations to
be sorted on 'r_offset'. This is not guaranteed so we must sort. */
qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela),
- compare_reloc);
+ compare_reloc);
/* Walk through them looking for relaxing opportunities. */
irelend = internal_relocs + sec->reloc_count;
/* If this isn't something that can be relaxed, then ignore
this reloc. */
if (ELF32_R_TYPE (irel->r_info) != (int) R_M68HC11_16
- && ELF32_R_TYPE (irel->r_info) != (int) R_M68HC11_RL_JUMP
- && ELF32_R_TYPE (irel->r_info) != (int) R_M68HC11_RL_GROUP)
- {
- prev_insn_branch = 0;
- prev_insn_group = 0;
- continue;
- }
+ && ELF32_R_TYPE (irel->r_info) != (int) R_M68HC11_RL_JUMP
+ && ELF32_R_TYPE (irel->r_info) != (int) R_M68HC11_RL_GROUP)
+ {
+ prev_insn_branch = 0;
+ prev_insn_group = 0;
+ continue;
+ }
/* Get the section contents if we haven't done so already. */
if (contents == NULL)
{
Elf_Internal_Rela *nrel;
unsigned char code;
- unsigned char roffset;
+ unsigned char roffset;
- prev_insn_branch = 0;
- prev_insn_group = 0;
+ prev_insn_branch = 0;
+ prev_insn_group = 0;
/* Do nothing if this reloc is the last byte in the section. */
if (irel->r_offset + 2 >= sec->size)
/* Make sure our destination immediately follows the
unconditional branch. */
- roffset = bfd_get_8 (abfd, contents + irel->r_offset + 1);
- if (roffset != 3)
- continue;
+ roffset = bfd_get_8 (abfd, contents + irel->r_offset + 1);
+ if (roffset != 3)
+ continue;
- prev_insn_branch = irel;
- prev_insn_group = 0;
- continue;
- }
+ prev_insn_branch = irel;
+ prev_insn_group = 0;
+ continue;
+ }
/* Read this BFD's symbols if we haven't done so already. */
if (isymbuf == NULL && symtab_hdr->sh_info != 0)
{
/* A local symbol. */
isym = isymbuf + ELF32_R_SYM (irel->r_info);
- is_far = isym->st_other & STO_M68HC12_FAR;
- sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ is_far = isym->st_other & STO_M68HC12_FAR;
+ sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
symval = (isym->st_value
+ sym_sec->output_section->vma
+ sym_sec->output_offset);
&& h->root.type != bfd_link_hash_defweak)
{
/* This appears to be a reference to an undefined
- symbol. Just ignore it--it will be caught by the
- regular reloc processing. */
- prev_insn_branch = 0;
- prev_insn_group = 0;
+ symbol. Just ignore it--it will be caught by the
+ regular reloc processing. */
+ prev_insn_branch = 0;
+ prev_insn_group = 0;
continue;
}
- is_far = h->other & STO_M68HC12_FAR;
- isym = 0;
- sym_sec = h->root.u.def.section;
+ is_far = h->other & STO_M68HC12_FAR;
+ isym = 0;
+ sym_sec = h->root.u.def.section;
symval = (h->root.u.def.value
+ sym_sec->output_section->vma
+ sym_sec->output_offset);
if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_RL_GROUP)
{
- prev_insn_branch = 0;
- prev_insn_group = 0;
+ prev_insn_branch = 0;
+ prev_insn_group = 0;
/* Do nothing if this reloc is the last byte in the section. */
if (irel->r_offset == sec->size)
continue;
- prev_insn_group = irel;
- insn_group_value = isym->st_value;
- continue;
- }
+ prev_insn_group = irel;
+ insn_group_value = isym->st_value;
+ continue;
+ }
/* When we relax some bytes, the size of our section changes.
- This affects the layout of next input sections that go in our
- output section. When the symbol is part of another section that
- will go in the same output section as the current one, it's
- final address may now be incorrect (too far). We must let the
- linker re-compute all section offsets before processing this
- reloc. Code example:
-
- Initial Final
- .sect .text section size = 6 section size = 4
- jmp foo
- jmp bar
- .sect .text.foo_bar output_offset = 6 output_offset = 4
- foo: rts
- bar: rts
-
- If we process the reloc now, the jmp bar is replaced by a
- relative branch to the initial bar address (output_offset 6). */
+ This affects the layout of next input sections that go in our
+ output section. When the symbol is part of another section that
+ will go in the same output section as the current one, it's
+ final address may now be incorrect (too far). We must let the
+ linker re-compute all section offsets before processing this
+ reloc. Code example:
+
+ Initial Final
+ .sect .text section size = 6 section size = 4
+ jmp foo
+ jmp bar
+ .sect .text.foo_bar output_offset = 6 output_offset = 4
+ foo: rts
+ bar: rts
+
+ If we process the reloc now, the jmp bar is replaced by a
+ relative branch to the initial bar address (output_offset 6). */
if (*again && sym_sec != sec
- && sym_sec->output_section == sec->output_section)
- {
- prev_insn_group = 0;
- prev_insn_branch = 0;
- continue;
- }
+ && sym_sec->output_section == sec->output_section)
+ {
+ prev_insn_group = 0;
+ prev_insn_branch = 0;
+ continue;
+ }
value = symval;
/* Try to turn a far branch to a near branch. */
if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_16
- && prev_insn_branch)
- {
- bfd_vma offset;
- unsigned char code;
-
- offset = value - (prev_insn_branch->r_offset
- + sec->output_section->vma
- + sec->output_offset + 2);
-
- /* If the offset is still out of -128..+127 range,
- leave that far branch unchanged. */
- if ((offset & 0xff80) != 0 && (offset & 0xff80) != 0xff80)
- {
- prev_insn_branch = 0;
- continue;
- }
-
- /* Shrink the branch. */
- code = bfd_get_8 (abfd, contents + prev_insn_branch->r_offset);
- if (code == 0x7e)
- {
- code = 0x20;
- bfd_put_8 (abfd, code, contents + prev_insn_branch->r_offset);
- bfd_put_8 (abfd, 0xff,
- contents + prev_insn_branch->r_offset + 1);
- irel->r_offset = prev_insn_branch->r_offset + 1;
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_M68HC11_PCREL_8);
- m68hc11_elf_relax_delete_bytes (abfd, sec,
- irel->r_offset + 1, 1);
- }
- else
- {
- code ^= 0x1;
- bfd_put_8 (abfd, code, contents + prev_insn_branch->r_offset);
- bfd_put_8 (abfd, 0xff,
- contents + prev_insn_branch->r_offset + 1);
- irel->r_offset = prev_insn_branch->r_offset + 1;
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_M68HC11_PCREL_8);
- m68hc11_elf_relax_delete_bytes (abfd, sec,
- irel->r_offset + 1, 3);
- }
- prev_insn_branch = 0;
- *again = TRUE;
- }
+ && prev_insn_branch)
+ {
+ bfd_vma offset;
+ unsigned char code;
+
+ offset = value - (prev_insn_branch->r_offset
+ + sec->output_section->vma
+ + sec->output_offset + 2);
+
+ /* If the offset is still out of -128..+127 range,
+ leave that far branch unchanged. */
+ if ((offset & 0xff80) != 0 && (offset & 0xff80) != 0xff80)
+ {
+ prev_insn_branch = 0;
+ continue;
+ }
+
+ /* Shrink the branch. */
+ code = bfd_get_8 (abfd, contents + prev_insn_branch->r_offset);
+ if (code == 0x7e)
+ {
+ code = 0x20;
+ bfd_put_8 (abfd, code, contents + prev_insn_branch->r_offset);
+ bfd_put_8 (abfd, 0xff,
+ contents + prev_insn_branch->r_offset + 1);
+ irel->r_offset = prev_insn_branch->r_offset + 1;
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_M68HC11_PCREL_8);
+ m68hc11_elf_relax_delete_bytes (abfd, sec,
+ irel->r_offset + 1, 1);
+ }
+ else
+ {
+ code ^= 0x1;
+ bfd_put_8 (abfd, code, contents + prev_insn_branch->r_offset);
+ bfd_put_8 (abfd, 0xff,
+ contents + prev_insn_branch->r_offset + 1);
+ irel->r_offset = prev_insn_branch->r_offset + 1;
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_M68HC11_PCREL_8);
+ m68hc11_elf_relax_delete_bytes (abfd, sec,
+ irel->r_offset + 1, 3);
+ }
+ prev_insn_branch = 0;
+ *again = TRUE;
+ }
/* Try to turn a 16 bit address into a 8 bit page0 address. */
else if (ELF32_R_TYPE (irel->r_info) == (int) R_M68HC11_16
- && (value & 0xff00) == 0)
+ && (value & 0xff00) == 0)
{
- unsigned char code;
- unsigned short offset;
- struct m68hc11_direct_relax *rinfo;
-
- prev_insn_branch = 0;
- offset = bfd_get_16 (abfd, contents + irel->r_offset);
- offset += value;
- if ((offset & 0xff00) != 0)
- {
- prev_insn_group = 0;
- continue;
- }
-
- if (prev_insn_group)
- {
- unsigned long old_sec_size = sec->size;
-
- /* Note that we've changed the relocation contents, etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- free_relocs = NULL;
-
- elf_section_data (sec)->this_hdr.contents = contents;
- free_contents = NULL;
-
- symtab_hdr->contents = (bfd_byte *) isymbuf;
- free_extsyms = NULL;
-
- m68hc11_relax_group (abfd, sec, contents, offset,
- prev_insn_group->r_offset,
- insn_group_value);
- irel = prev_insn_group;
- prev_insn_group = 0;
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_M68HC11_NONE);
- if (sec->size != old_sec_size)
- *again = TRUE;
- continue;
- }
-
- /* Get the opcode. */
- code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
- rinfo = find_relaxable_insn (code);
- if (rinfo == 0)
- {
- prev_insn_group = 0;
- continue;
- }
-
- /* Note that we've changed the relocation contents, etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- free_relocs = NULL;
-
- elf_section_data (sec)->this_hdr.contents = contents;
- free_contents = NULL;
-
- symtab_hdr->contents = (bfd_byte *) isymbuf;
- free_extsyms = NULL;
-
- /* Fix the opcode. */
- /* printf ("A relaxable case : 0x%02x (%s)\n",
- code, rinfo->name); */
- bfd_put_8 (abfd, rinfo->direct_code,
- contents + irel->r_offset - 1);
-
- /* Delete one byte of data (upper byte of address). */
- m68hc11_elf_relax_delete_bytes (abfd, sec, irel->r_offset, 1);
-
- /* Fix the relocation's type. */
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_M68HC11_8);
-
- /* That will change things, so, we should relax again. */
- *again = TRUE;
- }
+ unsigned char code;
+ unsigned short offset;
+ struct m68hc11_direct_relax *rinfo;
+
+ prev_insn_branch = 0;
+ offset = bfd_get_16 (abfd, contents + irel->r_offset);
+ offset += value;
+ if ((offset & 0xff00) != 0)
+ {
+ prev_insn_group = 0;
+ continue;
+ }
+
+ if (prev_insn_group)
+ {
+ unsigned long old_sec_size = sec->size;
+
+ /* Note that we've changed the relocation contents, etc. */
+ elf_section_data (sec)->relocs = internal_relocs;
+ free_relocs = NULL;
+
+ elf_section_data (sec)->this_hdr.contents = contents;
+ free_contents = NULL;
+
+ symtab_hdr->contents = (bfd_byte *) isymbuf;
+ free_extsyms = NULL;
+
+ m68hc11_relax_group (abfd, sec, contents, offset,
+ prev_insn_group->r_offset,
+ insn_group_value);
+ irel = prev_insn_group;
+ prev_insn_group = 0;
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_M68HC11_NONE);
+ if (sec->size != old_sec_size)
+ *again = TRUE;
+ continue;
+ }
+
+ /* Get the opcode. */
+ code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
+ rinfo = find_relaxable_insn (code);
+ if (rinfo == 0)
+ {
+ prev_insn_group = 0;
+ continue;
+ }
+
+ /* Note that we've changed the relocation contents, etc. */
+ elf_section_data (sec)->relocs = internal_relocs;
+ free_relocs = NULL;
+
+ elf_section_data (sec)->this_hdr.contents = contents;
+ free_contents = NULL;
+
+ symtab_hdr->contents = (bfd_byte *) isymbuf;
+ free_extsyms = NULL;
+
+ /* Fix the opcode. */
+ /* printf ("A relaxable case : 0x%02x (%s)\n",
+ code, rinfo->name); */
+ bfd_put_8 (abfd, rinfo->direct_code,
+ contents + irel->r_offset - 1);
+
+ /* Delete one byte of data (upper byte of address). */
+ m68hc11_elf_relax_delete_bytes (abfd, sec, irel->r_offset, 1);
+
+ /* Fix the relocation's type. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_M68HC11_8);
+
+ /* That will change things, so, we should relax again. */
+ *again = TRUE;
+ }
else if (ELF32_R_TYPE (irel->r_info) == R_M68HC11_16 && !is_far)
- {
- unsigned char code;
- bfd_vma offset;
-
- prev_insn_branch = 0;
- code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
- if (code == 0x7e || code == 0xbd)
- {
- offset = value - (irel->r_offset
- + sec->output_section->vma
- + sec->output_offset + 1);
- offset += bfd_get_16 (abfd, contents + irel->r_offset);
-
- /* If the offset is still out of -128..+127 range,
- leave that far branch unchanged. */
- if ((offset & 0xff80) == 0 || (offset & 0xff80) == 0xff80)
- {
-
- /* Note that we've changed the relocation contents, etc. */
- elf_section_data (sec)->relocs = internal_relocs;
- free_relocs = NULL;
-
- elf_section_data (sec)->this_hdr.contents = contents;
- free_contents = NULL;
-
- symtab_hdr->contents = (bfd_byte *) isymbuf;
- free_extsyms = NULL;
-
- /* Shrink the branch. */
- code = (code == 0x7e) ? 0x20 : 0x8d;
- bfd_put_8 (abfd, code,
- contents + irel->r_offset - 1);
- bfd_put_8 (abfd, 0xff,
- contents + irel->r_offset);
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_M68HC11_PCREL_8);
- m68hc11_elf_relax_delete_bytes (abfd, sec,
- irel->r_offset + 1, 1);
- /* That will change things, so, we should relax again. */
- *again = TRUE;
- }
- }
- }
+ {
+ unsigned char code;
+ bfd_vma offset;
+
+ prev_insn_branch = 0;
+ code = bfd_get_8 (abfd, contents + irel->r_offset - 1);
+ if (code == 0x7e || code == 0xbd)
+ {
+ offset = value - (irel->r_offset
+ + sec->output_section->vma
+ + sec->output_offset + 1);
+ offset += bfd_get_16 (abfd, contents + irel->r_offset);
+
+ /* If the offset is still out of -128..+127 range,
+ leave that far branch unchanged. */
+ if ((offset & 0xff80) == 0 || (offset & 0xff80) == 0xff80)
+ {
+
+ /* Note that we've changed the relocation contents, etc. */
+ elf_section_data (sec)->relocs = internal_relocs;
+ free_relocs = NULL;
+
+ elf_section_data (sec)->this_hdr.contents = contents;
+ free_contents = NULL;
+
+ symtab_hdr->contents = (bfd_byte *) isymbuf;
+ free_extsyms = NULL;
+
+ /* Shrink the branch. */
+ code = (code == 0x7e) ? 0x20 : 0x8d;
+ bfd_put_8 (abfd, code,
+ contents + irel->r_offset - 1);
+ bfd_put_8 (abfd, 0xff,
+ contents + irel->r_offset);
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_M68HC11_PCREL_8);
+ m68hc11_elf_relax_delete_bytes (abfd, sec,
+ irel->r_offset + 1, 1);
+ /* That will change things, so, we should relax again. */
+ *again = TRUE;
+ }
+ }
+ }
prev_insn_branch = 0;
prev_insn_group = 0;
}
static void
m68hc11_elf_relax_delete_bytes (bfd *abfd, asection *sec,
- bfd_vma addr, int count)
+ bfd_vma addr, int count)
{
Elf_Internal_Shdr *symtab_hdr;
unsigned int sec_shndx;
case we no longer care about it. Don't delete relocs which
represent addresses, though. */
if (ELF32_R_TYPE (irel->r_info) != R_M68HC11_RL_JUMP
- && irel->r_offset >= addr && irel->r_offset < addr + count)
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- R_M68HC11_NONE);
+ && irel->r_offset >= addr && irel->r_offset < addr + count)
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ R_M68HC11_NONE);
if (ELF32_R_TYPE (irel->r_info) == R_M68HC11_NONE)
- continue;
+ continue;
/* Get the new reloc address. */
if ((irel->r_offset > addr
irel->r_offset -= count;
/* If this is a PC relative reloc, see if the range it covers
- includes the bytes we have deleted. */
+ includes the bytes we have deleted. */
switch (ELF32_R_TYPE (irel->r_info))
{
default:
break;
case R_M68HC11_RL_JUMP:
- code = bfd_get_8 (abfd, contents + irel->r_offset);
- switch (code)
- {
- /* jsr and jmp instruction are also marked with RL_JUMP
- relocs but no adjustment must be made. */
- case 0x7e:
- case 0x9d:
- case 0xbd:
- continue;
-
- case 0x12:
- case 0x13:
- branch_pos = 3;
- raddr = 4;
-
- /* Special case when we translate a brclr N,y into brclr *<addr>
- In this case, the 0x18 page2 prefix is removed.
- The reloc offset is not modified but the instruction
- size is reduced by 1. */
- if (old_offset == addr)
- raddr++;
- break;
-
- case 0x1e:
- case 0x1f:
- branch_pos = 3;
- raddr = 4;
- break;
-
- case 0x18:
- branch_pos = 4;
- raddr = 5;
- break;
-
- default:
- branch_pos = 1;
- raddr = 2;
- break;
- }
- offset = bfd_get_8 (abfd, contents + irel->r_offset + branch_pos);
- raddr += old_offset;
- raddr += ((unsigned short) offset | ((offset & 0x80) ? 0xff00 : 0));
- if (irel->r_offset < addr && raddr > addr)
- {
- offset -= count;
- bfd_put_8 (abfd, offset, contents + irel->r_offset + branch_pos);
- }
- else if (irel->r_offset >= addr && raddr <= addr)
- {
- offset += count;
- bfd_put_8 (abfd, offset, contents + irel->r_offset + branch_pos);
- }
- else
- {
- /*printf ("Not adjusted 0x%04x [0x%4x 0x%4x]\n", raddr,
- irel->r_offset, addr);*/
- }
-
- break;
+ code = bfd_get_8 (abfd, contents + irel->r_offset);
+ switch (code)
+ {
+ /* jsr and jmp instruction are also marked with RL_JUMP
+ relocs but no adjustment must be made. */
+ case 0x7e:
+ case 0x9d:
+ case 0xbd:
+ continue;
+
+ case 0x12:
+ case 0x13:
+ branch_pos = 3;
+ raddr = 4;
+
+ /* Special case when we translate a brclr N,y into brclr *<addr>
+ In this case, the 0x18 page2 prefix is removed.
+ The reloc offset is not modified but the instruction
+ size is reduced by 1. */
+ if (old_offset == addr)
+ raddr++;
+ break;
+
+ case 0x1e:
+ case 0x1f:
+ branch_pos = 3;
+ raddr = 4;
+ break;
+
+ case 0x18:
+ branch_pos = 4;
+ raddr = 5;
+ break;
+
+ default:
+ branch_pos = 1;
+ raddr = 2;
+ break;
+ }
+ offset = bfd_get_8 (abfd, contents + irel->r_offset + branch_pos);
+ raddr += old_offset;
+ raddr += ((unsigned short) offset | ((offset & 0x80) ? 0xff00 : 0));
+ if (irel->r_offset < addr && raddr > addr)
+ {
+ offset -= count;
+ bfd_put_8 (abfd, offset, contents + irel->r_offset + branch_pos);
+ }
+ else if (irel->r_offset >= addr && raddr <= addr)
+ {
+ offset += count;
+ bfd_put_8 (abfd, offset, contents + irel->r_offset + branch_pos);
+ }
+ else
+ {
+ /*printf ("Not adjusted 0x%04x [0x%4x 0x%4x]\n", raddr,
+ irel->r_offset, addr);*/
+ }
+
+ break;
}
}
{ STRING_COMMA_LEN (".page0"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".softregs"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".vectors"), 0, SHT_PROGBITS, SHF_ALLOC },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
\f
#define ELF_ARCH bfd_arch_m68hc11
#define ELF_MACHINE_CODE EM_68HC11
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM m68hc11_elf32_vec
+#define TARGET_BIG_SYM m68hc11_elf32_vec
#define TARGET_BIG_NAME "elf32-m68hc11"
#define elf_info_to_howto 0
#define elf_backend_merge_symbol_attribute elf32_m68hc11_merge_symbol_attribute
#define bfd_elf32_bfd_link_hash_table_create \
- m68hc11_elf_bfd_link_hash_table_create
+ m68hc11_elf_bfd_link_hash_table_create
#define bfd_elf32_bfd_merge_private_bfd_data \
_bfd_m68hc11_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags _bfd_m68hc11_elf_set_private_flags
Banked
Address Space
- | | Page n
+ | | Page n
+---------------+ 0x1010000
- | |
- | jsr _foo |
- | .. | Page 3
- | _foo: |
+ | |
+ | jsr _foo |
+ | .. | Page 3
+ | _foo: |
+---------------+ 0x100C000
- | |
- | call _bar |
- | .. | Page 2
- | _bar: |
+ | |
+ | call _bar |
+ | .. | Page 2
+ | _bar: |
+---------------+ 0x1008000
- /------>| |
- | | call _foo | Page 1
- | | |
+ /------>| |
+ | | call _foo | Page 1
+ | | |
| +---------------+ 0x1004000
- Physical | | |
- Address Space | | | Page 0
- | | |
+ Physical | | |
+ Address Space | | | Page 0
+ | | |
+-----------+ 0x00FFFF | +---------------+ 0x1000000
| | |
| call _foo | |
| | |
+-----------+ 0x00BFFF -+---/
- | | |
+ | | |
| | |
| | 16K |
| | |
FALSE, /* partial_inplace */
0x00ff, /* src_mask */
0x00ff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* A 16 bit absolute relocation */
HOWTO (R_M68HC11_16, /* type */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_M68HC11_GNU_VTINHERIT, /* type */
FALSE), /* pcrel_offset */
/* A 24 bit relocation */
- HOWTO (R_M68HC11_24, /* type */
+ HOWTO (R_M68HC11_24, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
24, /* bitsize */
FALSE), /* pcrel_offset */
/* A 16-bit low relocation */
- HOWTO (R_M68HC11_LO16, /* type */
+ HOWTO (R_M68HC11_LO16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE), /* pcrel_offset */
/* A page relocation */
- HOWTO (R_M68HC11_PAGE, /* type */
+ HOWTO (R_M68HC11_PAGE, /* type */
0, /* rightshift */
0, /* size (0 = byte, 1 = short, 2 = long) */
8, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_M68HC12_16B", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A 9 bit PC-rel relocation. */
TRUE, /* partial_inplace */
0xfe00, /* src_mask */
0x01ff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* A 10 bit PC-rel relocation. */
HOWTO (R_M68HC12_PCREL_10, /* type */
TRUE, /* partial_inplace */
0xfc00, /* src_mask */
0x03ff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* A 8 bit absolute relocation (upper address). */
HOWTO (R_M68HC12_HI8XG, /* type */
TRUE, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* Mark beginning of Gcc relaxation group instruction. */
HOWTO (R_M68HC11_RL_GROUP, /* type */
TRUE, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
};
/* Map BFD reloc types to M68HC11 ELF reloc types. */
static reloc_howto_type *
bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
unsigned int i;
static void
m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *cache_ptr, Elf_Internal_Rela *dst)
+ arelent *cache_ptr, Elf_Internal_Rela *dst)
{
unsigned int r_type;
*/
sym_value = (stub_entry->target_value
- + stub_entry->target_section->output_offset
- + stub_entry->target_section->output_section->vma);
+ + stub_entry->target_section->output_offset
+ + stub_entry->target_section->output_section->vma);
phys_addr = m68hc11_phys_addr (&htab->pinfo, sym_value);
phys_page = m68hc11_phys_page (&htab->pinfo, sym_value);
static bfd_boolean
m68hc12_elf_size_one_stub (struct bfd_hash_entry *gen_entry,
- void *in_arg ATTRIBUTE_UNUSED)
+ void *in_arg ATTRIBUTE_UNUSED)
{
struct elf32_m68hc11_stub_hash_entry *stub_entry;
break;
case EF_M68HC11_GENERIC:
bfd_default_set_arch_mach (abfd, bfd_arch_m68hc12,
- bfd_mach_m6812_default);
+ bfd_mach_m6812_default);
break;
default:
return FALSE;
{ STRING_COMMA_LEN (".page0"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".softregs"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".vectors"), 0, SHT_PROGBITS, SHF_ALLOC },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
\f
#define ELF_ARCH bfd_arch_m68hc12
#define ELF_MACHINE_CODE EM_68HC12
#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM m68hc12_elf32_vec
+#define TARGET_BIG_SYM m68hc12_elf32_vec
#define TARGET_BIG_NAME "elf32-m68hc12"
#define elf_info_to_howto 0
#define elf_backend_merge_symbol_attribute elf32_m68hc11_merge_symbol_attribute
#define bfd_elf32_bfd_link_hash_table_create \
- m68hc12_elf_bfd_link_hash_table_create
+ m68hc12_elf_bfd_link_hash_table_create
#define bfd_elf32_bfd_merge_private_bfd_data \
_bfd_m68hc11_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags _bfd_m68hc11_elf_set_private_flags
(struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
static void m68hc11_elf_set_symbol (bfd* abfd, struct bfd_link_info *info,
- const char* name, bfd_vma value,
- asection* sec);
+ const char* name, bfd_vma value,
+ asection* sec);
static bfd_boolean m68hc11_elf_export_one_stub
(struct bfd_hash_entry *gen_entry, void *in_arg);
static struct bfd_hash_entry *
stub_hash_newfunc (struct bfd_hash_entry *entry, struct bfd_hash_table *table,
- const char *string)
+ const char *string)
{
/* Allocate the structure if it has not already been allocated by a
subclass. */
static struct elf32_m68hc11_stub_hash_entry *
m68hc12_add_stub (const char *stub_name, asection *section,
- struct m68hc11_elf_link_hash_table *htab)
+ struct m68hc11_elf_link_hash_table *htab)
{
struct elf32_m68hc11_stub_hash_entry *stub_entry;
/* Enter this entry into the linker stub hash table. */
stub_entry = m68hc12_stub_hash_lookup (htab->stub_hash_table, stub_name,
- TRUE, FALSE);
+ TRUE, FALSE);
if (stub_entry == NULL)
{
/* xgettext:c-format */
if (htab->stub_section == 0)
{
htab->stub_section = (*htab->add_stub_section) (".tramp",
- htab->tramp_section);
+ htab->tramp_section);
}
stub_entry->stub_sec = htab->stub_section;
bfd_boolean
elf32_m68hc11_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
- Elf_Internal_Sym *sym,
- const char **namep ATTRIBUTE_UNUSED,
- flagword *flagsp ATTRIBUTE_UNUSED,
- asection **secp ATTRIBUTE_UNUSED,
- bfd_vma *valp ATTRIBUTE_UNUSED)
+ Elf_Internal_Sym *sym,
+ const char **namep ATTRIBUTE_UNUSED,
+ flagword *flagsp ATTRIBUTE_UNUSED,
+ asection **secp ATTRIBUTE_UNUSED,
+ bfd_vma *valp ATTRIBUTE_UNUSED)
{
if (sym->st_other & STO_M68HC12_FAR)
{
h = (struct elf_link_hash_entry *)
bfd_link_hash_lookup (info->hash, "__far_trampoline",
- FALSE, FALSE, FALSE);
+ FALSE, FALSE, FALSE);
if (h == NULL)
- {
- struct bfd_link_hash_entry* entry = NULL;
-
- _bfd_generic_link_add_one_symbol (info, abfd,
- "__far_trampoline",
- BSF_GLOBAL,
- bfd_und_section_ptr,
- (bfd_vma) 0, (const char*) NULL,
- FALSE, FALSE, &entry);
- }
+ {
+ struct bfd_link_hash_entry* entry = NULL;
+
+ _bfd_generic_link_add_one_symbol (info, abfd,
+ "__far_trampoline",
+ BSF_GLOBAL,
+ bfd_und_section_ptr,
+ (bfd_vma) 0, (const char*) NULL,
+ FALSE, FALSE, &entry);
+ }
}
return TRUE;
section != NULL;
section = section->next)
{
- const char* name = bfd_get_section_name (input_bfd, section);
+ const char* name = bfd_get_section_name (input_bfd, section);
- if (!strcmp (name, ".tramp"))
- htab->tramp_section = section;
+ if (!strcmp (name, ".tramp"))
+ htab->tramp_section = section;
- if (!strcmp (name, ".text"))
- text_section = section;
+ if (!strcmp (name, ".text"))
+ text_section = section;
if (top_id < section->id)
top_id = section->id;
bfd_boolean
elf32_m68hc11_size_stubs (bfd *output_bfd, bfd *stub_bfd,
- struct bfd_link_info *info,
- asection * (*add_stub_section) (const char*, asection*))
+ struct bfd_link_info *info,
+ asection * (*add_stub_section) (const char*, asection*))
{
bfd *input_bfd;
asection *section;
symtab_hdr->contents = (unsigned char *) local_syms;
}
if (local_syms == NULL)
- {
- free (all_local_syms);
+ {
+ free (all_local_syms);
return FALSE;
- }
+ }
all_local_syms[bfd_indx] = local_syms;
}
/* We'll need the symbol table in a second. */
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
if (symtab_hdr->sh_info == 0)
- continue;
+ continue;
local_syms = all_local_syms[bfd_indx];
/* Walk over each section attached to the input bfd. */
for (section = input_bfd->sections;
- section != NULL;
- section = section->next)
- {
- Elf_Internal_Rela *internal_relocs, *irelaend, *irela;
-
- /* If there aren't any relocs, then there's nothing more
- to do. */
- if ((section->flags & SEC_RELOC) == 0
- || section->reloc_count == 0)
- continue;
-
- /* If this section is a link-once section that will be
- discarded, then don't create any stubs. */
- if (section->output_section == NULL
- || section->output_section->owner != output_bfd)
- continue;
-
- /* Get the relocs. */
- internal_relocs
- = _bfd_elf_link_read_relocs (input_bfd, section, NULL,
+ section != NULL;
+ section = section->next)
+ {
+ Elf_Internal_Rela *internal_relocs, *irelaend, *irela;
+
+ /* If there aren't any relocs, then there's nothing more
+ to do. */
+ if ((section->flags & SEC_RELOC) == 0
+ || section->reloc_count == 0)
+ continue;
+
+ /* If this section is a link-once section that will be
+ discarded, then don't create any stubs. */
+ if (section->output_section == NULL
+ || section->output_section->owner != output_bfd)
+ continue;
+
+ /* Get the relocs. */
+ internal_relocs
+ = _bfd_elf_link_read_relocs (input_bfd, section, NULL,
(Elf_Internal_Rela *) NULL,
info->keep_memory);
- if (internal_relocs == NULL)
- goto error_ret_free_local;
-
- /* Now examine each relocation. */
- irela = internal_relocs;
- irelaend = irela + section->reloc_count;
- for (; irela < irelaend; irela++)
- {
- unsigned int r_type, r_indx;
- struct elf32_m68hc11_stub_hash_entry *stub_entry;
- asection *sym_sec;
- bfd_vma sym_value;
- struct elf_link_hash_entry *hash;
- const char *stub_name;
- Elf_Internal_Sym *sym;
-
- r_type = ELF32_R_TYPE (irela->r_info);
-
- /* Only look at 16-bit relocs. */
- if (r_type != (unsigned int) R_M68HC11_16)
- continue;
-
- /* Now determine the call target, its name, value,
- section. */
- r_indx = ELF32_R_SYM (irela->r_info);
- if (r_indx < symtab_hdr->sh_info)
- {
- /* It's a local symbol. */
- Elf_Internal_Shdr *hdr;
- bfd_boolean is_far;
-
- sym = local_syms + r_indx;
- is_far = (sym && (sym->st_other & STO_M68HC12_FAR));
- if (!is_far)
- continue;
+ if (internal_relocs == NULL)
+ goto error_ret_free_local;
+
+ /* Now examine each relocation. */
+ irela = internal_relocs;
+ irelaend = irela + section->reloc_count;
+ for (; irela < irelaend; irela++)
+ {
+ unsigned int r_type, r_indx;
+ struct elf32_m68hc11_stub_hash_entry *stub_entry;
+ asection *sym_sec;
+ bfd_vma sym_value;
+ struct elf_link_hash_entry *hash;
+ const char *stub_name;
+ Elf_Internal_Sym *sym;
+
+ r_type = ELF32_R_TYPE (irela->r_info);
+
+ /* Only look at 16-bit relocs. */
+ if (r_type != (unsigned int) R_M68HC11_16)
+ continue;
+
+ /* Now determine the call target, its name, value,
+ section. */
+ r_indx = ELF32_R_SYM (irela->r_info);
+ if (r_indx < symtab_hdr->sh_info)
+ {
+ /* It's a local symbol. */
+ Elf_Internal_Shdr *hdr;
+ bfd_boolean is_far;
+
+ sym = local_syms + r_indx;
+ is_far = (sym && (sym->st_other & STO_M68HC12_FAR));
+ if (!is_far)
+ continue;
if (sym->st_shndx >= elf_numsections (input_bfd))
sym_sec = NULL;
hdr = elf_elfsections (input_bfd)[sym->st_shndx];
sym_sec = hdr->bfd_section;
}
- stub_name = (bfd_elf_string_from_elf_section
- (input_bfd, symtab_hdr->sh_link,
- sym->st_name));
- sym_value = sym->st_value;
- hash = NULL;
- }
- else
- {
- /* It's an external symbol. */
- int e_indx;
-
- e_indx = r_indx - symtab_hdr->sh_info;
- hash = (struct elf_link_hash_entry *)
- (sym_hashes[e_indx]);
-
- while (hash->root.type == bfd_link_hash_indirect
- || hash->root.type == bfd_link_hash_warning)
- hash = ((struct elf_link_hash_entry *)
- hash->root.u.i.link);
-
- if (hash->root.type == bfd_link_hash_defined
- || hash->root.type == bfd_link_hash_defweak
- || hash->root.type == bfd_link_hash_new)
- {
- if (!(hash->other & STO_M68HC12_FAR))
- continue;
- }
- else if (hash->root.type == bfd_link_hash_undefweak)
- {
- continue;
- }
- else if (hash->root.type == bfd_link_hash_undefined)
- {
- continue;
- }
- else
- {
- bfd_set_error (bfd_error_bad_value);
- goto error_ret_free_internal;
- }
- sym_sec = hash->root.u.def.section;
- sym_value = hash->root.u.def.value;
- stub_name = hash->root.root.string;
- }
-
- if (!stub_name)
- goto error_ret_free_internal;
-
- stub_entry = m68hc12_stub_hash_lookup
- (htab->stub_hash_table,
- stub_name,
- FALSE, FALSE);
- if (stub_entry == NULL)
- {
- if (add_stub_section == 0)
- continue;
-
- stub_entry = m68hc12_add_stub (stub_name, section, htab);
- if (stub_entry == NULL)
- {
- error_ret_free_internal:
- if (elf_section_data (section)->relocs == NULL)
- free (internal_relocs);
- goto error_ret_free_local;
- }
- }
-
- stub_entry->target_value = sym_value;
- stub_entry->target_section = sym_sec;
- }
-
- /* We're done with the internal relocs, free them. */
- if (elf_section_data (section)->relocs == NULL)
- free (internal_relocs);
- }
+ stub_name = (bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link,
+ sym->st_name));
+ sym_value = sym->st_value;
+ hash = NULL;
+ }
+ else
+ {
+ /* It's an external symbol. */
+ int e_indx;
+
+ e_indx = r_indx - symtab_hdr->sh_info;
+ hash = (struct elf_link_hash_entry *)
+ (sym_hashes[e_indx]);
+
+ while (hash->root.type == bfd_link_hash_indirect
+ || hash->root.type == bfd_link_hash_warning)
+ hash = ((struct elf_link_hash_entry *)
+ hash->root.u.i.link);
+
+ if (hash->root.type == bfd_link_hash_defined
+ || hash->root.type == bfd_link_hash_defweak
+ || hash->root.type == bfd_link_hash_new)
+ {
+ if (!(hash->other & STO_M68HC12_FAR))
+ continue;
+ }
+ else if (hash->root.type == bfd_link_hash_undefweak)
+ {
+ continue;
+ }
+ else if (hash->root.type == bfd_link_hash_undefined)
+ {
+ continue;
+ }
+ else
+ {
+ bfd_set_error (bfd_error_bad_value);
+ goto error_ret_free_internal;
+ }
+ sym_sec = hash->root.u.def.section;
+ sym_value = hash->root.u.def.value;
+ stub_name = hash->root.root.string;
+ }
+
+ if (!stub_name)
+ goto error_ret_free_internal;
+
+ stub_entry = m68hc12_stub_hash_lookup
+ (htab->stub_hash_table,
+ stub_name,
+ FALSE, FALSE);
+ if (stub_entry == NULL)
+ {
+ if (add_stub_section == 0)
+ continue;
+
+ stub_entry = m68hc12_add_stub (stub_name, section, htab);
+ if (stub_entry == NULL)
+ {
+ error_ret_free_internal:
+ if (elf_section_data (section)->relocs == NULL)
+ free (internal_relocs);
+ goto error_ret_free_local;
+ }
+ }
+
+ stub_entry->target_value = sym_value;
+ stub_entry->target_section = sym_sec;
+ }
+
+ /* We're done with the internal relocs, free them. */
+ if (elf_section_data (section)->relocs == NULL)
+ free (internal_relocs);
+ }
}
if (add_stub_section)
{
/* OK, we've added some stubs. Find out the new size of the
- stub sections. */
+ stub sections. */
for (stub_sec = htab->stub_bfd->sections;
- stub_sec != NULL;
- stub_sec = stub_sec->next)
- {
- stub_sec->size = 0;
- }
+ stub_sec != NULL;
+ stub_sec = stub_sec->next)
+ {
+ stub_sec->size = 0;
+ }
bfd_hash_traverse (htab->stub_hash_table, htab->size_one_stub, htab);
}
/* Export the symbol for debugging/disassembling. */
m68hc11_elf_set_symbol (htab->stub_bfd, info, name,
- stub_entry->stub_offset,
- stub_entry->stub_sec);
+ stub_entry->stub_offset,
+ stub_entry->stub_sec);
free (name);
return result;
}
/* Export a symbol or set its value and section. */
static void
m68hc11_elf_set_symbol (bfd *abfd, struct bfd_link_info *info,
- const char *name, bfd_vma value, asection *sec)
+ const char *name, bfd_vma value, asection *sec)
{
struct elf_link_hash_entry *h;
if (h == NULL)
{
_bfd_generic_link_add_one_symbol (info, abfd,
- name,
- BSF_GLOBAL,
- sec,
- value,
- (const char*) NULL,
- TRUE, FALSE, NULL);
+ name,
+ BSF_GLOBAL,
+ sec,
+ value,
+ (const char*) NULL,
+ TRUE, FALSE, NULL);
}
else
{
if (param.use_memory_banks)
{
m68hc11_elf_set_symbol (abfd, info, BFD_M68HC11_BANK_START_NAME,
- htab->pinfo.bank_physical,
- bfd_abs_section_ptr);
+ htab->pinfo.bank_physical,
+ bfd_abs_section_ptr);
m68hc11_elf_set_symbol (abfd, info, BFD_M68HC11_BANK_VIRTUAL_NAME,
- htab->pinfo.bank_virtual,
- bfd_abs_section_ptr);
+ htab->pinfo.bank_virtual,
+ bfd_abs_section_ptr);
m68hc11_elf_set_symbol (abfd, info, BFD_M68HC11_BANK_SIZE_NAME,
- htab->pinfo.bank_size,
- bfd_abs_section_ptr);
+ htab->pinfo.bank_size,
+ bfd_abs_section_ptr);
}
return TRUE;
pinfo->bank_size = 1 << M68HC12_BANK_SHIFT;
h = bfd_link_hash_lookup (info->hash, BFD_M68HC11_BANK_START_NAME,
- FALSE, FALSE, TRUE);
+ FALSE, FALSE, TRUE);
if (h != (struct bfd_link_hash_entry*) NULL
&& h->type == bfd_link_hash_defined)
pinfo->bank_physical = (h->u.def.value
- + h->u.def.section->output_section->vma
- + h->u.def.section->output_offset);
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
h = bfd_link_hash_lookup (info->hash, BFD_M68HC11_BANK_VIRTUAL_NAME,
- FALSE, FALSE, TRUE);
+ FALSE, FALSE, TRUE);
if (h != (struct bfd_link_hash_entry*) NULL
&& h->type == bfd_link_hash_defined)
pinfo->bank_virtual = (h->u.def.value
- + h->u.def.section->output_section->vma
- + h->u.def.section->output_offset);
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
h = bfd_link_hash_lookup (info->hash, BFD_M68HC11_BANK_SIZE_NAME,
- FALSE, FALSE, TRUE);
+ FALSE, FALSE, TRUE);
if (h != (struct bfd_link_hash_entry*) NULL
&& h->type == bfd_link_hash_defined)
pinfo->bank_size = (h->u.def.value
- + h->u.def.section->output_section->vma
- + h->u.def.section->output_offset);
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
pinfo->bank_shift = 0;
for (i = pinfo->bank_size; i != 0; i >>= 1)
pinfo->bank_param_initialized = 1;
h = bfd_link_hash_lookup (info->hash, "__far_trampoline", FALSE,
- FALSE, TRUE);
+ FALSE, TRUE);
if (h != (struct bfd_link_hash_entry*) NULL
&& h->type == bfd_link_hash_defined)
pinfo->trampoline_addr = (h->u.def.value
- + h->u.def.section->output_section->vma
- + h->u.def.section->output_offset);
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
}
/* Return 1 if the address is in banked memory.
bfd_reloc_status_type
m68hc11_elf_ignore_reloc (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *reloc_entry,
- asymbol *symbol ATTRIBUTE_UNUSED,
- void *data ATTRIBUTE_UNUSED,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd != NULL)
reloc_entry->address += input_section->output_offset;
bfd_reloc_status_type
m68hc11_elf_special_reloc (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *reloc_entry,
- asymbol *symbol,
- void *data ATTRIBUTE_UNUSED,
- asection *input_section,
- bfd *output_bfd,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void *data ATTRIBUTE_UNUSED,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message ATTRIBUTE_UNUSED)
{
if (output_bfd != (bfd *) NULL
&& (symbol->flags & BSF_SECTION_SYM) == 0
bfd_boolean
elf32_m68hc11_check_relocs (bfd *abfd, struct bfd_link_info *info,
- asection *sec, const Elf_Internal_Rela *relocs)
+ asection *sec, const Elf_Internal_Rela *relocs)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- const Elf_Internal_Rela * rel;
- const Elf_Internal_Rela * rel_end;
+ const Elf_Internal_Rela * rel;
+ const Elf_Internal_Rela * rel_end;
if (bfd_link_relocatable (info))
return TRUE;
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes [r_symndx - symtab_hdr->sh_info];
}
switch (ELF32_R_TYPE (rel->r_info))
- {
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_M68HC11_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_M68HC11_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
- }
+ {
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_M68HC11_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_M68HC11_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
+ }
}
return TRUE;
/* Relocate a 68hc11/68hc12 ELF section. */
bfd_boolean
elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info,
- bfd *input_bfd, asection *input_section,
- bfd_byte *contents, Elf_Internal_Rela *relocs,
- Elf_Internal_Sym *local_syms,
- asection **local_sections)
+ struct bfd_link_info *info,
+ bfd *input_bfd, asection *input_section,
+ bfd_byte *contents, Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
r_type = ELF32_R_TYPE (rel->r_info);
if (r_type == R_M68HC11_GNU_VTENTRY
- || r_type == R_M68HC11_GNU_VTINHERIT)
- continue;
+ || r_type == R_M68HC11_GNU_VTINHERIT)
+ continue;
(*ebd->elf_info_to_howto_rel) (input_bfd, &arel, rel);
howto = arel.howto;
phys_addr = m68hc11_phys_addr (pinfo, relocation + rel->r_addend);
phys_page = m68hc11_phys_page (pinfo, relocation + rel->r_addend);
switch (r_type)
- {
- case R_M68HC12_LO8XG:
- /* This relocation is specific to XGATE IMM16 calls and will precede
+ {
+ case R_M68HC12_LO8XG:
+ /* This relocation is specific to XGATE IMM16 calls and will precede
a HI8. tc-m68hc11 only generates them in pairs.
Leave the relocation to the HI8XG step. */
- r = bfd_reloc_ok;
- r_type = R_M68HC11_NONE;
- break;
+ r = bfd_reloc_ok;
+ r_type = R_M68HC11_NONE;
+ break;
- case R_M68HC12_HI8XG:
- /* This relocation is specific to XGATE IMM16 calls and must follow
- a LO8XG. Does not actually check that it was a LO8XG.
+ case R_M68HC12_HI8XG:
+ /* This relocation is specific to XGATE IMM16 calls and must follow
+ a LO8XG. Does not actually check that it was a LO8XG.
Adjusts high and low bytes. */
- relocation = phys_addr;
- if ((e_flags & E_M68HC11_XGATE_RAMOFFSET)
+ relocation = phys_addr;
+ if ((e_flags & E_M68HC11_XGATE_RAMOFFSET)
&& (relocation >= 0x2000))
relocation += 0xc000; /* HARDCODED RAM offset for XGATE. */
- /* Fetch 16 bit value including low byte in previous insn. */
- val = (bfd_get_8 (input_bfd, (bfd_byte*) contents + rel->r_offset) << 8)
+ /* Fetch 16 bit value including low byte in previous insn. */
+ val = (bfd_get_8 (input_bfd, (bfd_byte*) contents + rel->r_offset) << 8)
| bfd_get_8 (input_bfd, (bfd_byte*) contents + rel->r_offset - 2);
- /* Add on value to preserve carry, then write zero to high byte. */
- relocation += val;
+ /* Add on value to preserve carry, then write zero to high byte. */
+ relocation += val;
- /* Write out top byte. */
- bfd_put_8 (input_bfd, (relocation >> 8) & 0xff,
+ /* Write out top byte. */
+ bfd_put_8 (input_bfd, (relocation >> 8) & 0xff,
(bfd_byte*) contents + rel->r_offset);
- /* Write out low byte to previous instruction. */
- bfd_put_8 (input_bfd, relocation & 0xff,
+ /* Write out low byte to previous instruction. */
+ bfd_put_8 (input_bfd, relocation & 0xff,
(bfd_byte*) contents + rel->r_offset - 2);
- /* Mark as relocation completed. */
- r = bfd_reloc_ok;
- r_type = R_M68HC11_NONE;
- break;
-
- /* The HI8 and LO8 relocs are generated by %hi(expr) %lo(expr)
- assembler directives. %hi does not support carry. */
- case R_M68HC11_HI8:
- case R_M68HC11_LO8:
- relocation = phys_addr;
- break;
-
- case R_M68HC11_24:
- /* Reloc used by 68HC12 call instruction. */
- bfd_put_16 (input_bfd, phys_addr,
- (bfd_byte*) contents + rel->r_offset);
- bfd_put_8 (input_bfd, phys_page,
- (bfd_byte*) contents + rel->r_offset + 2);
- r = bfd_reloc_ok;
- r_type = R_M68HC11_NONE;
- break;
-
- case R_M68HC11_NONE:
- r = bfd_reloc_ok;
- break;
-
- case R_M68HC11_LO16:
- /* Reloc generated by %addr(expr) gas to obtain the
- address as mapped in the memory bank window. */
- relocation = phys_addr;
- break;
-
- case R_M68HC11_PAGE:
- /* Reloc generated by %page(expr) gas to obtain the
- page number associated with the address. */
- relocation = phys_page;
- break;
-
- case R_M68HC11_16:
- /* Get virtual address of instruction having the relocation. */
- if (is_far)
- {
- msg = _("Reference to the far symbol `%s' using a wrong "
- "relocation may result in incorrect execution");
- buf = xmalloc (strlen (msg) + strlen (name) + 10);
- sprintf (buf, msg, name);
+ /* Mark as relocation completed. */
+ r = bfd_reloc_ok;
+ r_type = R_M68HC11_NONE;
+ break;
+
+ /* The HI8 and LO8 relocs are generated by %hi(expr) %lo(expr)
+ assembler directives. %hi does not support carry. */
+ case R_M68HC11_HI8:
+ case R_M68HC11_LO8:
+ relocation = phys_addr;
+ break;
+
+ case R_M68HC11_24:
+ /* Reloc used by 68HC12 call instruction. */
+ bfd_put_16 (input_bfd, phys_addr,
+ (bfd_byte*) contents + rel->r_offset);
+ bfd_put_8 (input_bfd, phys_page,
+ (bfd_byte*) contents + rel->r_offset + 2);
+ r = bfd_reloc_ok;
+ r_type = R_M68HC11_NONE;
+ break;
+
+ case R_M68HC11_NONE:
+ r = bfd_reloc_ok;
+ break;
+
+ case R_M68HC11_LO16:
+ /* Reloc generated by %addr(expr) gas to obtain the
+ address as mapped in the memory bank window. */
+ relocation = phys_addr;
+ break;
+
+ case R_M68HC11_PAGE:
+ /* Reloc generated by %page(expr) gas to obtain the
+ page number associated with the address. */
+ relocation = phys_page;
+ break;
+
+ case R_M68HC11_16:
+ /* Get virtual address of instruction having the relocation. */
+ if (is_far)
+ {
+ msg = _("Reference to the far symbol `%s' using a wrong "
+ "relocation may result in incorrect execution");
+ buf = xmalloc (strlen (msg) + strlen (name) + 10);
+ sprintf (buf, msg, name);
(*info->callbacks->warning)
(info, buf, name, input_bfd, NULL, rel->r_offset);
free (buf);
- }
+ }
- /* Get virtual address of instruction having the relocation. */
- insn_addr = input_section->output_section->vma
- + input_section->output_offset
- + rel->r_offset;
+ /* Get virtual address of instruction having the relocation. */
+ insn_addr = input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset;
- insn_page = m68hc11_phys_page (pinfo, insn_addr);
+ insn_page = m68hc11_phys_page (pinfo, insn_addr);
- /* If we are linking an S12 instruction against an XGATE symbol, we
- need to change the offset of the symbol value so that it's correct
+ /* If we are linking an S12 instruction against an XGATE symbol, we
+ need to change the offset of the symbol value so that it's correct
from the S12's perspective. */
- if (is_xgate_symbol)
+ if (is_xgate_symbol)
{
/* The ram in the global space is mapped to 0x2000 in the 16-bit
address space for S12 and 0xE000 in the 16-bit address space
}
}
- if (m68hc11_addr_is_banked (pinfo, relocation + rel->r_addend)
- && m68hc11_addr_is_banked (pinfo, insn_addr)
- && phys_page != insn_page && !(e_flags & E_M68HC11_NO_BANK_WARNING))
- {
+ if (m68hc11_addr_is_banked (pinfo, relocation + rel->r_addend)
+ && m68hc11_addr_is_banked (pinfo, insn_addr)
+ && phys_page != insn_page && !(e_flags & E_M68HC11_NO_BANK_WARNING))
+ {
/* xgettext:c-format */
- msg = _("banked address [%lx:%04lx] (%lx) is not in the same bank "
- "as current banked address [%lx:%04lx] (%lx)");
- buf = xmalloc (strlen (msg) + 128);
- sprintf (buf, msg, phys_page, phys_addr,
- (long) (relocation + rel->r_addend),
- insn_page, m68hc11_phys_addr (pinfo, insn_addr),
- (long) (insn_addr));
+ msg = _("banked address [%lx:%04lx] (%lx) is not in the same bank "
+ "as current banked address [%lx:%04lx] (%lx)");
+ buf = xmalloc (strlen (msg) + 128);
+ sprintf (buf, msg, phys_page, phys_addr,
+ (long) (relocation + rel->r_addend),
+ insn_page, m68hc11_phys_addr (pinfo, insn_addr),
+ (long) (insn_addr));
(*info->callbacks->warning) (info, buf, name, input_bfd,
input_section, rel->r_offset);
free (buf);
- break;
- }
+ break;
+ }
- if (phys_page != 0 && insn_page == 0)
- {
+ if (phys_page != 0 && insn_page == 0)
+ {
/* xgettext:c-format */
- msg = _("reference to a banked address [%lx:%04lx] in the "
- "normal address space at %04lx");
- buf = xmalloc (strlen (msg) + 128);
- sprintf (buf, msg, phys_page, phys_addr, insn_addr);
+ msg = _("reference to a banked address [%lx:%04lx] in the "
+ "normal address space at %04lx");
+ buf = xmalloc (strlen (msg) + 128);
+ sprintf (buf, msg, phys_page, phys_addr, insn_addr);
(*info->callbacks->warning) (info, buf, name, input_bfd,
input_section, insn_addr);
free (buf);
- relocation = phys_addr;
- break;
- }
+ relocation = phys_addr;
+ break;
+ }
- /* If this is a banked address use the phys_addr so that
- we stay in the banked window. */
- if (m68hc11_addr_is_banked (pinfo, relocation + rel->r_addend))
- relocation = phys_addr;
- break;
- }
+ /* If this is a banked address use the phys_addr so that
+ we stay in the banked window. */
+ if (m68hc11_addr_is_banked (pinfo, relocation + rel->r_addend))
+ relocation = phys_addr;
+ break;
+ }
/* If we are linking an XGATE instruction against an S12 symbol, we
- need to change the offset of the symbol value so that it's correct
+ need to change the offset of the symbol value so that it's correct
from the XGATE's perspective. */
if (!strcmp (howto->name, "R_XGATE_IMM8_LO")
- || !strcmp (howto->name, "R_XGATE_IMM8_HI"))
- {
- /* We can only offset S12 addresses that lie within the non-paged
- area of RAM. */
- if (!is_xgate_symbol && !is_section_symbol)
- {
- /* The ram in the global space is mapped to 0x2000 and stops at
- 0x4000 in the 16-bit address space for S12 and 0xE000 in the
- 16-bit address space for XGATE. */
- if (relocation >= 0x2000 && relocation < 0x4000)
- /* We offset the address by the difference
- between these two mappings. */
- relocation += 0xC000;
- else
- {
- /* Get virtual address of instruction having the relocation. */
- insn_addr = input_section->output_section->vma
- + input_section->output_offset + rel->r_offset;
-
- msg = _("S12 address (%lx) is not within shared RAM"
- "(0x2000-0x4000), therefore you must manually "
- "offset the address in your code");
- buf = xmalloc (strlen (msg) + 128);
- sprintf (buf, msg, phys_addr);
+ || !strcmp (howto->name, "R_XGATE_IMM8_HI"))
+ {
+ /* We can only offset S12 addresses that lie within the non-paged
+ area of RAM. */
+ if (!is_xgate_symbol && !is_section_symbol)
+ {
+ /* The ram in the global space is mapped to 0x2000 and stops at
+ 0x4000 in the 16-bit address space for S12 and 0xE000 in the
+ 16-bit address space for XGATE. */
+ if (relocation >= 0x2000 && relocation < 0x4000)
+ /* We offset the address by the difference
+ between these two mappings. */
+ relocation += 0xC000;
+ else
+ {
+ /* Get virtual address of instruction having the relocation. */
+ insn_addr = input_section->output_section->vma
+ + input_section->output_offset + rel->r_offset;
+
+ msg = _("S12 address (%lx) is not within shared RAM"
+ "(0x2000-0x4000), therefore you must manually "
+ "offset the address in your code");
+ buf = xmalloc (strlen (msg) + 128);
+ sprintf (buf, msg, phys_addr);
(*info->callbacks->warning) (info, buf, name, input_bfd,
input_section, insn_addr);
free (buf);
- break;
- }
- }
- }
+ break;
+ }
+ }
+ }
if (r_type != R_M68HC11_NONE)
- {
- if ((r_type == R_M68HC12_PCREL_9) || (r_type == R_M68HC12_PCREL_10))
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation - 2, rel->r_addend);
- else
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, rel->r_addend);
- }
+ {
+ if ((r_type == R_M68HC12_PCREL_9) || (r_type == R_M68HC12_PCREL_10))
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset,
+ relocation - 2, rel->r_addend);
+ else
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset,
+ relocation, rel->r_addend);
+ }
if (r != bfd_reloc_ok)
{
{
_bfd_error_handler
(_("%B: linking files compiled for 16-bit integers (-mshort) "
- "and others for 32-bit integers"), ibfd);
+ "and others for 32-bit integers"), ibfd);
ok = FALSE;
}
if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64))
{
_bfd_error_handler
(_("%B: linking files compiled for 32-bit double (-fshort-double) "
- "and others for 64-bit double"), ibfd);
+ "and others for 64-bit double"), ibfd);
ok = FALSE;
}
{
_bfd_error_handler
(_("%B: linking files compiled for HCS12 with "
- "others compiled for HC12"), ibfd);
+ "others compiled for HC12"), ibfd);
ok = FALSE;
}
new_flags = ((new_flags & ~EF_M68HC11_MACH_MASK)
- | (EF_M68HC11_MERGE_MACH (new_flags, old_flags)));
+ | (EF_M68HC11_MERGE_MACH (new_flags, old_flags)));
elf_elfheader (obfd)->e_flags = new_flags;
}
static void scan_sections_for_abi (bfd *abfd ATTRIBUTE_UNUSED,
- asection *asect, void *arg)
+ asection *asect, void *arg)
{
struct m68hc11_scan_param* p = (struct m68hc11_scan_param*) arg;
These parameters are obtained from the symbol table by looking
at the following:
- __bank_start Symbol marking the start of memory bank window
- (bank_physical)
- __bank_virtual Logical address of symbols for which the transformation
- must be computed
- __bank_page_size Size in bytes of page size (this is *NOT* the memory
- bank window size and the window size is always
- less or equal to the page size)
+ __bank_start Symbol marking the start of memory bank window
+ (bank_physical)
+ __bank_virtual Logical address of symbols for which the transformation
+ must be computed
+ __bank_page_size Size in bytes of page size (this is *NOT* the memory
+ bank window size and the window size is always
+ less or equal to the page size)
For 68HC12, the window is at 0x8000 and the page size is 16K (full window).
For 68HC11 this is board specific (implemented by external hardware). */
static reloc_howto_type howto_table[] =
{
- HOWTO(R_68K_NONE, 0, 3, 0, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_NONE", FALSE, 0, 0x00000000,FALSE),
- HOWTO(R_68K_32, 0, 2,32, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_32", FALSE, 0, 0xffffffff,FALSE),
- HOWTO(R_68K_16, 0, 1,16, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_16", FALSE, 0, 0x0000ffff,FALSE),
- HOWTO(R_68K_8, 0, 0, 8, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_8", FALSE, 0, 0x000000ff,FALSE),
- HOWTO(R_68K_PC32, 0, 2,32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_PC32", FALSE, 0, 0xffffffff,TRUE),
- HOWTO(R_68K_PC16, 0, 1,16, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PC16", FALSE, 0, 0x0000ffff,TRUE),
- HOWTO(R_68K_PC8, 0, 0, 8, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PC8", FALSE, 0, 0x000000ff,TRUE),
- HOWTO(R_68K_GOT32, 0, 2,32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_GOT32", FALSE, 0, 0xffffffff,TRUE),
- HOWTO(R_68K_GOT16, 0, 1,16, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_GOT16", FALSE, 0, 0x0000ffff,TRUE),
- HOWTO(R_68K_GOT8, 0, 0, 8, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_GOT8", FALSE, 0, 0x000000ff,TRUE),
- HOWTO(R_68K_GOT32O, 0, 2,32, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_GOT32O", FALSE, 0, 0xffffffff,FALSE),
- HOWTO(R_68K_GOT16O, 0, 1,16, FALSE,0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_GOT16O", FALSE, 0, 0x0000ffff,FALSE),
- HOWTO(R_68K_GOT8O, 0, 0, 8, FALSE,0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_GOT8O", FALSE, 0, 0x000000ff,FALSE),
- HOWTO(R_68K_PLT32, 0, 2,32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_PLT32", FALSE, 0, 0xffffffff,TRUE),
- HOWTO(R_68K_PLT16, 0, 1,16, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PLT16", FALSE, 0, 0x0000ffff,TRUE),
- HOWTO(R_68K_PLT8, 0, 0, 8, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PLT8", FALSE, 0, 0x000000ff,TRUE),
- HOWTO(R_68K_PLT32O, 0, 2,32, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_PLT32O", FALSE, 0, 0xffffffff,FALSE),
- HOWTO(R_68K_PLT16O, 0, 1,16, FALSE,0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PLT16O", FALSE, 0, 0x0000ffff,FALSE),
- HOWTO(R_68K_PLT8O, 0, 0, 8, FALSE,0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PLT8O", FALSE, 0, 0x000000ff,FALSE),
- HOWTO(R_68K_COPY, 0, 0, 0, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_COPY", FALSE, 0, 0xffffffff,FALSE),
- HOWTO(R_68K_GLOB_DAT, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_GLOB_DAT", FALSE, 0, 0xffffffff,FALSE),
- HOWTO(R_68K_JMP_SLOT, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_JMP_SLOT", FALSE, 0, 0xffffffff,FALSE),
- HOWTO(R_68K_RELATIVE, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_RELATIVE", FALSE, 0, 0xffffffff,FALSE),
+ HOWTO(R_68K_NONE, 0, 3, 0, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_NONE", FALSE, 0, 0x00000000,FALSE),
+ HOWTO(R_68K_32, 0, 2,32, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_32", FALSE, 0, 0xffffffff,FALSE),
+ HOWTO(R_68K_16, 0, 1,16, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_16", FALSE, 0, 0x0000ffff,FALSE),
+ HOWTO(R_68K_8, 0, 0, 8, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_8", FALSE, 0, 0x000000ff,FALSE),
+ HOWTO(R_68K_PC32, 0, 2,32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_PC32", FALSE, 0, 0xffffffff,TRUE),
+ HOWTO(R_68K_PC16, 0, 1,16, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PC16", FALSE, 0, 0x0000ffff,TRUE),
+ HOWTO(R_68K_PC8, 0, 0, 8, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PC8", FALSE, 0, 0x000000ff,TRUE),
+ HOWTO(R_68K_GOT32, 0, 2,32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_GOT32", FALSE, 0, 0xffffffff,TRUE),
+ HOWTO(R_68K_GOT16, 0, 1,16, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_GOT16", FALSE, 0, 0x0000ffff,TRUE),
+ HOWTO(R_68K_GOT8, 0, 0, 8, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_GOT8", FALSE, 0, 0x000000ff,TRUE),
+ HOWTO(R_68K_GOT32O, 0, 2,32, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_GOT32O", FALSE, 0, 0xffffffff,FALSE),
+ HOWTO(R_68K_GOT16O, 0, 1,16, FALSE,0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_GOT16O", FALSE, 0, 0x0000ffff,FALSE),
+ HOWTO(R_68K_GOT8O, 0, 0, 8, FALSE,0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_GOT8O", FALSE, 0, 0x000000ff,FALSE),
+ HOWTO(R_68K_PLT32, 0, 2,32, TRUE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_PLT32", FALSE, 0, 0xffffffff,TRUE),
+ HOWTO(R_68K_PLT16, 0, 1,16, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PLT16", FALSE, 0, 0x0000ffff,TRUE),
+ HOWTO(R_68K_PLT8, 0, 0, 8, TRUE, 0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PLT8", FALSE, 0, 0x000000ff,TRUE),
+ HOWTO(R_68K_PLT32O, 0, 2,32, FALSE,0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_68K_PLT32O", FALSE, 0, 0xffffffff,FALSE),
+ HOWTO(R_68K_PLT16O, 0, 1,16, FALSE,0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PLT16O", FALSE, 0, 0x0000ffff,FALSE),
+ HOWTO(R_68K_PLT8O, 0, 0, 8, FALSE,0, complain_overflow_signed, bfd_elf_generic_reloc, "R_68K_PLT8O", FALSE, 0, 0x000000ff,FALSE),
+ HOWTO(R_68K_COPY, 0, 0, 0, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_COPY", FALSE, 0, 0xffffffff,FALSE),
+ HOWTO(R_68K_GLOB_DAT, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_GLOB_DAT", FALSE, 0, 0xffffffff,FALSE),
+ HOWTO(R_68K_JMP_SLOT, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_JMP_SLOT", FALSE, 0, 0xffffffff,FALSE),
+ HOWTO(R_68K_RELATIVE, 0, 2,32, FALSE,0, complain_overflow_dont, bfd_elf_generic_reloc, "R_68K_RELATIVE", FALSE, 0, 0xffffffff,FALSE),
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_68K_GNU_VTINHERIT, /* type */
0, /* rightshift */
static const bfd_byte elf_isab_plt0_entry[ISAB_PLT_ENTRY_SIZE] =
{
- 0x20, 0x3c, /* move.l #offset,%d0 */
- 0, 0, 0, 0, /* + (.got + 4) - . */
+ 0x20, 0x3c, /* move.l #offset,%d0 */
+ 0, 0, 0, 0, /* + (.got + 4) - . */
0x2f, 0x3b, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l),-(%sp) */
- 0x20, 0x3c, /* move.l #offset,%d0 */
- 0, 0, 0, 0, /* + (.got + 8) - . */
+ 0x20, 0x3c, /* move.l #offset,%d0 */
+ 0, 0, 0, 0, /* + (.got + 8) - . */
0x20, 0x7b, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l), %a0 */
- 0x4e, 0xd0, /* jmp (%a0) */
+ 0x4e, 0xd0, /* jmp (%a0) */
0x4e, 0x71 /* nop */
};
static const bfd_byte elf_isab_plt_entry[ISAB_PLT_ENTRY_SIZE] =
{
- 0x20, 0x3c, /* move.l #offset,%d0 */
- 0, 0, 0, 0, /* + (.got.plt entry) - . */
+ 0x20, 0x3c, /* move.l #offset,%d0 */
+ 0, 0, 0, 0, /* + (.got.plt entry) - . */
0x20, 0x7b, 0x08, 0xfa, /* move.l (-6,%pc,%d0:l), %a0 */
- 0x4e, 0xd0, /* jmp (%a0) */
- 0x2f, 0x3c, /* move.l #offset,-(%sp) */
- 0, 0, 0, 0, /* + reloc index */
- 0x60, 0xff, /* bra.l .plt */
- 0, 0, 0, 0 /* + .plt - . */
+ 0x4e, 0xd0, /* jmp (%a0) */
+ 0x2f, 0x3c, /* move.l #offset,-(%sp) */
+ 0, 0, 0, 0, /* + reloc index */
+ 0x60, 0xff, /* bra.l .plt */
+ 0, 0, 0, 0 /* + .plt - . */
};
static const struct elf_m68k_plt_info elf_isab_plt_info =
0x2f, 0x3c, /* move.l #offset,-(%sp) */
0, 0, 0, 0, /* replaced with offset into relocation table */
0x61, 0xff, /* bsr.l .plt */
- 0, 0, 0, 0 /* replaced with .plt - . */
+ 0, 0, 0, 0 /* replaced with .plt - . */
};
static const struct elf_m68k_plt_info elf_isac_plt_info =
static const bfd_byte elf_cpu32_plt0_entry[CPU32_PLT_ENTRY_SIZE] =
{
0x2f, 0x3b, 0x01, 0x70, /* move.l (%pc,addr),-(%sp) */
- 0, 0, 0, 2, /* + (.got + 4) - . */
+ 0, 0, 0, 2, /* + (.got + 4) - . */
0x22, 0x7b, 0x01, 0x70, /* moveal %pc@(0xc), %a1 */
- 0, 0, 0, 2, /* + (.got + 8) - . */
- 0x4e, 0xd1, /* jmp %a1@ */
- 0, 0, 0, 0, /* pad out to 24 bytes. */
+ 0, 0, 0, 2, /* + (.got + 8) - . */
+ 0x4e, 0xd1, /* jmp %a1@ */
+ 0, 0, 0, 0, /* pad out to 24 bytes. */
0, 0
};
static const bfd_byte elf_cpu32_plt_entry[CPU32_PLT_ENTRY_SIZE] =
{
0x22, 0x7b, 0x01, 0x70, /* moveal %pc@(0xc), %a1 */
- 0, 0, 0, 2, /* + (.got.plt entry) - . */
- 0x4e, 0xd1, /* jmp %a1@ */
- 0x2f, 0x3c, /* move.l #offset,-(%sp) */
- 0, 0, 0, 0, /* + reloc index */
- 0x60, 0xff, /* bra.l .plt */
- 0, 0, 0, 0, /* + .plt - . */
+ 0, 0, 0, 2, /* + (.got.plt entry) - . */
+ 0x4e, 0xd1, /* jmp %a1@ */
+ 0x2f, 0x3c, /* move.l #offset,-(%sp) */
+ 0, 0, 0, 0, /* + reloc index */
+ 0x60, 0xff, /* bra.l .plt */
+ 0, 0, 0, 0, /* + .plt - . */
0, 0
};
case R_68K_PLT32:
/* This symbol requires a procedure linkage table entry. We
actually build the entry in adjust_dynamic_symbol,
- because this might be a case of linking PIC code which is
- never referenced by a dynamic object, in which case we
- don't need to generate a procedure linkage table entry
- after all. */
+ because this might be a case of linking PIC code which is
+ never referenced by a dynamic object, in which case we
+ don't need to generate a procedure linkage table entry
+ after all. */
/* If this is a local symbol, we resolve it directly without
creating a procedure linkage table entry. */
|| h->needs_plt)
{
if ((h->plt.refcount <= 0
- || SYMBOL_CALLS_LOCAL (info, h)
+ || SYMBOL_CALLS_LOCAL (info, h)
|| ((ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
|| UNDEFWEAK_NO_DYNAMIC_RELOC (info, h))
&& h->root.type == bfd_link_hash_undefweak))
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
/* This reloc will be computed at runtime, so there's no
- need to do anything now, except for R_68K_32
- relocations that have been turned into
- R_68K_RELATIVE. */
+ need to do anything now, except for R_68K_32
+ relocations that have been turned into
+ R_68K_RELATIVE. */
if (!relocate)
continue;
}
#define elf_backend_gc_mark_hook elf_m68k_gc_mark_hook
#define elf_backend_copy_indirect_symbol elf_m68k_copy_indirect_symbol
#define bfd_elf32_bfd_merge_private_bfd_data \
- elf32_m68k_merge_private_bfd_data
+ elf32_m68k_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags \
- elf32_m68k_set_private_flags
+ elf32_m68k_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data \
- elf32_m68k_print_private_bfd_data
+ elf32_m68k_print_private_bfd_data
#define elf_backend_reloc_type_class elf32_m68k_reloc_type_class
#define elf_backend_plt_sym_val elf_m68k_plt_sym_val
#define elf_backend_object_p elf32_m68k_object_p
#define TARGET_BIG_NAME "elf32-m88k"
#define ELF_ARCH bfd_arch_m88k
#define ELF_MACHINE_CODE EM_88K
-#define ELF_MAXPAGESIZE 1 /* FIXME: This number is wrong, It should be the page size in bytes. */
+#define ELF_MAXPAGESIZE 1 /* FIXME: This number is wrong, It should be the page size in bytes. */
#define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
#define elf_info_to_howto _bfd_elf_no_info_to_howto
if (! elf_flags_init (obfd))
{
- /* First call, no flags set. */
+ /* First call, no flags set. */
elf_flags_init (obfd) = TRUE;
elf_elfheader (obfd)->e_flags = new_flags;
}
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
+ NULL, /* special_function */
"R_MCORE_NONE", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_MCORE_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_MCORE_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_MCORE_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage. */
- HOWTO (R_MCORE_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_MCORE_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_MCORE_RELATIVE, /* type */
+ HOWTO (R_MCORE_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_MCORE_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_MCORE_RELATIVE, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_signed, /* complain_on_overflow */
- NULL, /* special_function */
- "R_MCORE_RELATIVE", /* name */
+ NULL, /* special_function */
+ "R_MCORE_RELATIVE", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
case BFD_RELOC_MCORE_PCREL_IMM4BY2: mcore_reloc = R_MCORE_PCRELIMM4BY2; break;
case BFD_RELOC_32_PCREL: mcore_reloc = R_MCORE_PCREL32; break;
case BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2: mcore_reloc = R_MCORE_PCRELJSR_IMM11BY2; break;
- case BFD_RELOC_VTABLE_INHERIT: mcore_reloc = R_MCORE_GNU_VTINHERIT; break;
- case BFD_RELOC_VTABLE_ENTRY: mcore_reloc = R_MCORE_GNU_VTENTRY; break;
- case BFD_RELOC_RVA: mcore_reloc = R_MCORE_RELATIVE; break;
+ case BFD_RELOC_VTABLE_INHERIT: mcore_reloc = R_MCORE_GNU_VTINHERIT; break;
+ case BFD_RELOC_VTABLE_ENTRY: mcore_reloc = R_MCORE_GNU_VTENTRY; break;
+ case BFD_RELOC_RVA: mcore_reloc = R_MCORE_RELATIVE; break;
default:
return NULL;
}
for (; rel < relend; rel++)
{
- enum elf_mcore_reloc_type r_type = (enum elf_mcore_reloc_type) ELF32_R_TYPE (rel->r_info);
- bfd_vma offset = rel->r_offset;
- bfd_vma addend = rel->r_addend;
- bfd_reloc_status_type r = bfd_reloc_other;
- asection * sec = NULL;
- reloc_howto_type * howto;
- bfd_vma relocation;
- Elf_Internal_Sym * sym = NULL;
- unsigned long r_symndx;
+ enum elf_mcore_reloc_type r_type = (enum elf_mcore_reloc_type) ELF32_R_TYPE (rel->r_info);
+ bfd_vma offset = rel->r_offset;
+ bfd_vma addend = rel->r_addend;
+ bfd_reloc_status_type r = bfd_reloc_other;
+ asection * sec = NULL;
+ reloc_howto_type * howto;
+ bfd_vma relocation;
+ Elf_Internal_Sym * sym = NULL;
+ unsigned long r_symndx;
struct elf_link_hash_entry * h = NULL;
- unsigned short oldinst = 0;
+ unsigned short oldinst = 0;
/* Unknown relocation handling. */
if ((unsigned) r_type >= (unsigned) R_MCORE_max
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes [r_symndx - symtab_hdr->sh_info];
}
switch (ELF32_R_TYPE (rel->r_info))
- {
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_MCORE_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_MCORE_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
- }
+ {
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_MCORE_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_MCORE_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
+ }
}
return TRUE;
{
{ STRING_COMMA_LEN (".ctors"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".dtors"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
#define TARGET_BIG_SYM mcore_elf32_be_vec
#define TARGET_BIG_NAME "elf32-mcore-big"
-#define TARGET_LITTLE_SYM mcore_elf32_le_vec
-#define TARGET_LITTLE_NAME "elf32-mcore-little"
+#define TARGET_LITTLE_SYM mcore_elf32_le_vec
+#define TARGET_LITTLE_NAME "elf32-mcore-little"
#define ELF_ARCH bfd_arch_mcore
#define ELF_MACHINE_CODE EM_MCORE
#define bfd_elf32_bfd_reloc_name_lookup mcore_elf_reloc_name_lookup
#define elf_backend_relocate_section mcore_elf_relocate_section
#define elf_backend_gc_mark_hook mcore_elf_gc_mark_hook
-#define elf_backend_check_relocs mcore_elf_check_relocs
+#define elf_backend_check_relocs mcore_elf_check_relocs
#define elf_backend_special_sections mcore_elf_special_sections
#define elf_backend_can_gc_sections 1
static reloc_howto_type mep_elf_howto_table [] =
{
/* type, size, bits, leftshift, rightshift, pcrel, OD/OS/OU, mask. */
- MEPREL (R_MEP_NONE, 3, 0, 0, 0, 0, N, 0),
- MEPREL (R_RELC, 0, 0, 0, 0, 0, N, 0),
+ MEPREL (R_MEP_NONE, 3, 0, 0, 0, 0, N, 0),
+ MEPREL (R_RELC, 0, 0, 0, 0, 0, N, 0),
/* MEPRELOC:HOWTO */
/* This section generated from bfd/mep-relocs.pl from include/elf/mep.h. */
- MEPREL (R_MEP_8, 0, 8, 0, 0, 0, U, 0xff),
- MEPREL (R_MEP_16, 1, 16, 0, 0, 0, U, 0xffff),
- MEPREL (R_MEP_32, 2, 32, 0, 0, 0, U, 0xffffffff),
+ MEPREL (R_MEP_8, 0, 8, 0, 0, 0, U, 0xff),
+ MEPREL (R_MEP_16, 1, 16, 0, 0, 0, U, 0xffff),
+ MEPREL (R_MEP_32, 2, 32, 0, 0, 0, U, 0xffffffff),
MEPREL (R_MEP_PCREL8A2, 1, 8, 1, 1, 1, S, 0x00fe),
MEPREL (R_MEP_PCREL12A2,1, 12, 1, 1, 1, S, 0x0ffe),
MEPREL (R_MEP_PCREL17A2,2, 17, 0, 1, 1, S, 0x0000ffff),
MEPREL (R_MEP_PCREL24A2,2, 24, 0, 1, 1, S, 0x07f0ffff),
MEPREL (R_MEP_PCABS24A2,2, 24, 0, 1, 0, U, 0x07f0ffff),
- MEPREL (R_MEP_LOW16, 2, 16, 0, 0, 0, N, 0x0000ffff),
- MEPREL (R_MEP_HI16U, 2, 32, 0,16, 0, N, 0x0000ffff),
- MEPREL (R_MEP_HI16S, 2, 32, 0,16, 0, N, 0x0000ffff),
- MEPREL (R_MEP_GPREL, 2, 16, 0, 0, 0, S, 0x0000ffff),
- MEPREL (R_MEP_TPREL, 2, 16, 0, 0, 0, S, 0x0000ffff),
- MEPREL (R_MEP_TPREL7, 1, 7, 0, 0, 0, U, 0x007f),
+ MEPREL (R_MEP_LOW16, 2, 16, 0, 0, 0, N, 0x0000ffff),
+ MEPREL (R_MEP_HI16U, 2, 32, 0,16, 0, N, 0x0000ffff),
+ MEPREL (R_MEP_HI16S, 2, 32, 0,16, 0, N, 0x0000ffff),
+ MEPREL (R_MEP_GPREL, 2, 16, 0, 0, 0, S, 0x0000ffff),
+ MEPREL (R_MEP_TPREL, 2, 16, 0, 0, 0, S, 0x0000ffff),
+ MEPREL (R_MEP_TPREL7, 1, 7, 0, 0, 0, U, 0x007f),
MEPREL (R_MEP_TPREL7A2, 1, 7, 1, 1, 0, U, 0x007e),
MEPREL (R_MEP_TPREL7A4, 1, 7, 2, 2, 0, U, 0x007c),
- MEPREL (R_MEP_UIMM24, 2, 24, 0, 0, 0, U, 0x00ffffff),
+ MEPREL (R_MEP_UIMM24, 2, 24, 0, 0, 0, U, 0x00ffffff),
MEPREL (R_MEP_ADDR24A4, 2, 24, 0, 2, 0, U, 0x00fcffff),
MEPREL (R_MEP_GNU_VTINHERIT,1, 0,16,32, 0, N, 0x0000),
- MEPREL (R_MEP_GNU_VTENTRY,1, 0,16,32, 0, N, 0x0000),
+ MEPREL (R_MEP_GNU_VTENTRY,1, 0,16,32, 0, N, 0x0000),
/* MEPRELOC:END */
};
static bfd_reloc_status_type
mep_final_link_relocate
- (reloc_howto_type * howto,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ (reloc_howto_type * howto,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * rel,
- bfd_vma relocation)
+ bfd_vma relocation)
{
unsigned long u;
long s;
static void
mep_info_to_howto_rela
- (bfd * abfd ATTRIBUTE_UNUSED,
- arelent * cache_ptr,
+ (bfd * abfd ATTRIBUTE_UNUSED,
+ arelent * cache_ptr,
Elf_Internal_Rela * dst)
{
unsigned int r_type;
static bfd_boolean
mep_elf_relocate_section
- (bfd * output_bfd ATTRIBUTE_UNUSED,
+ (bfd * output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * relocs,
- Elf_Internal_Sym * local_syms,
- asection ** local_sections)
+ Elf_Internal_Sym * local_syms,
+ asection ** local_sections)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- Elf_Internal_Rela * rel;
- Elf_Internal_Rela * relend;
+ Elf_Internal_Rela * rel;
+ Elf_Internal_Rela * relend;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
for (rel = relocs; rel < relend; rel ++)
{
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- const char * name = NULL;
- int r_type;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char * name = NULL;
+ int r_type;
r_type = ELF32_R_TYPE (rel->r_info);
r_symndx = ELF32_R_SYM (rel->r_info);
}
static bfd_boolean
-mep_elf_fake_sections (bfd * abfd ATTRIBUTE_UNUSED,
+mep_elf_fake_sections (bfd * abfd ATTRIBUTE_UNUSED,
Elf_Internal_Shdr * hdr,
- asection * sec)
+ asection * sec)
{
if (sec->flags & SEC_MEP_VLIW)
hdr->sh_flags |= SHF_MEP_VLIW;
#define elf_info_to_howto_rel NULL
#define elf_info_to_howto mep_info_to_howto_rela
#define elf_backend_relocate_section mep_elf_relocate_section
-#define elf_backend_object_p mep_elf_object_p
+#define elf_backend_object_p mep_elf_object_p
#define elf_backend_section_flags mep_elf_section_flags
#define elf_backend_fake_sections mep_elf_fake_sections
/* Variable names follow a coding style.
Please follow this (Apps Hungarian) style:
- Structure/Variable Prefix
- elf_link_hash_table "etab"
- elf_link_hash_entry "eh"
+ Structure/Variable Prefix
+ elf_link_hash_table "etab"
+ elf_link_hash_entry "eh"
- elf_metag_link_hash_table "htab"
- elf_metag_link_hash_entry "hh"
+ elf_metag_link_hash_table "htab"
+ elf_metag_link_hash_entry "hh"
- bfd_link_hash_table "btab"
- bfd_link_hash_entry "bh"
+ bfd_link_hash_table "btab"
+ bfd_link_hash_entry "bh"
bfd_hash_table containing stubs "bstab"
- elf_metag_stub_hash_entry "hsh"
+ elf_metag_stub_hash_entry "hsh"
Always remember to use GNU Coding Style. */
static const struct metag_reloc_map metag_reloc_map [] =
{
- { BFD_RELOC_NONE, R_METAG_NONE },
- { BFD_RELOC_32, R_METAG_ADDR32 },
- { BFD_RELOC_METAG_HIADDR16, R_METAG_HIADDR16 },
- { BFD_RELOC_METAG_LOADDR16, R_METAG_LOADDR16 },
+ { BFD_RELOC_NONE, R_METAG_NONE },
+ { BFD_RELOC_32, R_METAG_ADDR32 },
+ { BFD_RELOC_METAG_HIADDR16, R_METAG_HIADDR16 },
+ { BFD_RELOC_METAG_LOADDR16, R_METAG_LOADDR16 },
{ BFD_RELOC_METAG_RELBRANCH, R_METAG_RELBRANCH },
{ BFD_RELOC_METAG_GETSETOFF, R_METAG_GETSETOFF },
- { BFD_RELOC_VTABLE_INHERIT, R_METAG_GNU_VTINHERIT },
- { BFD_RELOC_VTABLE_ENTRY, R_METAG_GNU_VTENTRY },
- { BFD_RELOC_METAG_REL8, R_METAG_REL8 },
- { BFD_RELOC_METAG_REL16, R_METAG_REL16 },
+ { BFD_RELOC_VTABLE_INHERIT, R_METAG_GNU_VTINHERIT },
+ { BFD_RELOC_VTABLE_ENTRY, R_METAG_GNU_VTENTRY },
+ { BFD_RELOC_METAG_REL8, R_METAG_REL8 },
+ { BFD_RELOC_METAG_REL16, R_METAG_REL16 },
{ BFD_RELOC_METAG_HI16_GOTOFF, R_METAG_HI16_GOTOFF },
{ BFD_RELOC_METAG_LO16_GOTOFF, R_METAG_LO16_GOTOFF },
{ BFD_RELOC_METAG_GETSET_GOTOFF, R_METAG_GETSET_GOTOFF },
{ BFD_RELOC_METAG_GETSET_GOT, R_METAG_GETSET_GOT },
{ BFD_RELOC_METAG_HI16_GOTPC, R_METAG_HI16_GOTPC },
{ BFD_RELOC_METAG_LO16_GOTPC, R_METAG_LO16_GOTPC },
- { BFD_RELOC_METAG_HI16_PLT, R_METAG_HI16_PLT },
- { BFD_RELOC_METAG_LO16_PLT, R_METAG_LO16_PLT },
+ { BFD_RELOC_METAG_HI16_PLT, R_METAG_HI16_PLT },
+ { BFD_RELOC_METAG_LO16_PLT, R_METAG_LO16_PLT },
{ BFD_RELOC_METAG_RELBRANCH_PLT, R_METAG_RELBRANCH_PLT },
- { BFD_RELOC_METAG_GOTOFF, R_METAG_GOTOFF },
- { BFD_RELOC_METAG_PLT, R_METAG_PLT },
- { BFD_RELOC_METAG_COPY, R_METAG_COPY },
- { BFD_RELOC_METAG_JMP_SLOT, R_METAG_JMP_SLOT },
- { BFD_RELOC_METAG_RELATIVE, R_METAG_RELATIVE },
- { BFD_RELOC_METAG_GLOB_DAT, R_METAG_GLOB_DAT },
- { BFD_RELOC_METAG_TLS_GD, R_METAG_TLS_GD },
- { BFD_RELOC_METAG_TLS_LDM, R_METAG_TLS_LDM },
+ { BFD_RELOC_METAG_GOTOFF, R_METAG_GOTOFF },
+ { BFD_RELOC_METAG_PLT, R_METAG_PLT },
+ { BFD_RELOC_METAG_COPY, R_METAG_COPY },
+ { BFD_RELOC_METAG_JMP_SLOT, R_METAG_JMP_SLOT },
+ { BFD_RELOC_METAG_RELATIVE, R_METAG_RELATIVE },
+ { BFD_RELOC_METAG_GLOB_DAT, R_METAG_GLOB_DAT },
+ { BFD_RELOC_METAG_TLS_GD, R_METAG_TLS_GD },
+ { BFD_RELOC_METAG_TLS_LDM, R_METAG_TLS_LDM },
{ BFD_RELOC_METAG_TLS_LDO_HI16, R_METAG_TLS_LDO_HI16 },
{ BFD_RELOC_METAG_TLS_LDO_LO16, R_METAG_TLS_LDO_LO16 },
- { BFD_RELOC_METAG_TLS_LDO, R_METAG_TLS_LDO },
- { BFD_RELOC_METAG_TLS_IE, R_METAG_TLS_IE },
+ { BFD_RELOC_METAG_TLS_LDO, R_METAG_TLS_LDO },
+ { BFD_RELOC_METAG_TLS_IE, R_METAG_TLS_IE },
{ BFD_RELOC_METAG_TLS_IENONPIC, R_METAG_TLS_IENONPIC },
{ BFD_RELOC_METAG_TLS_IENONPIC_HI16, R_METAG_TLS_IENONPIC_HI16 },
{ BFD_RELOC_METAG_TLS_IENONPIC_LO16, R_METAG_TLS_IENONPIC_LO16 },
{ BFD_RELOC_METAG_TLS_TPOFF, R_METAG_TLS_TPOFF },
{ BFD_RELOC_METAG_TLS_DTPMOD, R_METAG_TLS_DTPMOD },
{ BFD_RELOC_METAG_TLS_DTPOFF, R_METAG_TLS_DTPOFF },
- { BFD_RELOC_METAG_TLS_LE, R_METAG_TLS_LE },
+ { BFD_RELOC_METAG_TLS_LE, R_METAG_TLS_LE },
{ BFD_RELOC_METAG_TLS_LE_HI16, R_METAG_TLS_LE_HI16 },
{ BFD_RELOC_METAG_TLS_LE_LO16, R_METAG_TLS_LE_LO16 },
};
{
/* This reloc does nothing. */
HOWTO (R_MICROBLAZE_NONE, /* Type. */
- 0, /* Rightshift. */
- 3, /* Size (0 = byte, 1 = short, 2 = long). */
- 0, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- NULL, /* Special Function. */
- "R_MICROBLAZE_NONE", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ 0, /* Rightshift. */
+ 3, /* Size (0 = byte, 1 = short, 2 = long). */
+ 0, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ NULL, /* Special Function. */
+ "R_MICROBLAZE_NONE", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* A standard 32 bit relocation. */
- HOWTO (R_MICROBLAZE_32, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_bitfield, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_32", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0xffffffff, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ HOWTO (R_MICROBLAZE_32, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_bitfield, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_32", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0xffffffff, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* A standard PCREL 32 bit relocation. */
HOWTO (R_MICROBLAZE_32_PCREL,/* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_bitfield, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_32_PCREL", /* Name. */
- TRUE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0xffffffff, /* Dest Mask. */
- TRUE), /* PC relative offset? */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_bitfield, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_32_PCREL", /* Name. */
+ TRUE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0xffffffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
/* A 64 bit PCREL relocation. Table-entry not really used. */
HOWTO (R_MICROBLAZE_64_PCREL,/* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_64_PCREL", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- TRUE), /* PC relative offset? */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_64_PCREL", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
/* The low half of a PCREL 32 bit relocation. */
- HOWTO (R_MICROBLAZE_32_PCREL_LO, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_signed, /* Complain on overflow. */
- bfd_elf_generic_reloc, /* Special Function. */
- "R_MICROBLAZE_32_PCREL_LO", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- TRUE), /* PC relative offset? */
+ HOWTO (R_MICROBLAZE_32_PCREL_LO, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_signed, /* Complain on overflow. */
+ bfd_elf_generic_reloc, /* Special Function. */
+ "R_MICROBLAZE_32_PCREL_LO", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
/* A 64 bit relocation. Table entry not really used. */
- HOWTO (R_MICROBLAZE_64, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_64", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ HOWTO (R_MICROBLAZE_64, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_64", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* The low half of a 32 bit relocation. */
- HOWTO (R_MICROBLAZE_32_LO, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_signed, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_32_LO", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ HOWTO (R_MICROBLAZE_32_LO, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_signed, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_32_LO", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* Read-only small data section relocation. */
- HOWTO (R_MICROBLAZE_SRO32, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_bitfield, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_SRO32", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ HOWTO (R_MICROBLAZE_SRO32, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_bitfield, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_SRO32", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* Read-write small data area relocation. */
- HOWTO (R_MICROBLAZE_SRW32, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_bitfield, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_SRW32", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- FALSE), /* PC relative offset? */
-
- /* This reloc does nothing. Used for relaxation. */
+ HOWTO (R_MICROBLAZE_SRW32, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_bitfield, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_SRW32", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
+
+ /* This reloc does nothing. Used for relaxation. */
HOWTO (R_MICROBLAZE_64_NONE, /* Type. */
- 0, /* Rightshift. */
- 3, /* Size (0 = byte, 1 = short, 2 = long). */
- 0, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- NULL, /* Special Function. */
- "R_MICROBLAZE_64_NONE",/* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ 0, /* Rightshift. */
+ 3, /* Size (0 = byte, 1 = short, 2 = long). */
+ 0, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ NULL, /* Special Function. */
+ "R_MICROBLAZE_64_NONE",/* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* Symbol Op Symbol relocation. */
- HOWTO (R_MICROBLAZE_32_SYM_OP_SYM, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_bitfield, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_32_SYM_OP_SYM", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0xffffffff, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ HOWTO (R_MICROBLAZE_32_SYM_OP_SYM, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_bitfield, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_32_SYM_OP_SYM", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0xffffffff, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_MICROBLAZE_GNU_VTINHERIT, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 0, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont,/* Complain on overflow. */
- NULL, /* Special Function. */
- "R_MICROBLAZE_GNU_VTINHERIT", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 0, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont,/* Complain on overflow. */
+ NULL, /* Special Function. */
+ "R_MICROBLAZE_GNU_VTINHERIT", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* GNU extension to record C++ vtable member usage. */
HOWTO (R_MICROBLAZE_GNU_VTENTRY, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 0, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont,/* Complain on overflow. */
- _bfd_elf_rel_vtable_reloc_fn, /* Special Function. */
- "R_MICROBLAZE_GNU_VTENTRY", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 0, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont,/* Complain on overflow. */
+ _bfd_elf_rel_vtable_reloc_fn, /* Special Function. */
+ "R_MICROBLAZE_GNU_VTENTRY", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* A 64 bit GOTPC relocation. Table-entry not really used. */
- HOWTO (R_MICROBLAZE_GOTPC_64, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc, /* Special Function. */
- "R_MICROBLAZE_GOTPC_64", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- TRUE), /* PC relative offset? */
+ HOWTO (R_MICROBLAZE_GOTPC_64, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc, /* Special Function. */
+ "R_MICROBLAZE_GOTPC_64", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
/* A 64 bit GOT relocation. Table-entry not really used. */
HOWTO (R_MICROBLAZE_GOT_64, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_GOT_64",/* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_GOT_64",/* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* A 64 bit PLT relocation. Table-entry not really used. */
HOWTO (R_MICROBLAZE_PLT_64, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_PLT_64",/* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- TRUE), /* PC relative offset? */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_PLT_64",/* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
/* Table-entry not really used. */
- HOWTO (R_MICROBLAZE_REL, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_REL", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- TRUE), /* PC relative offset? */
+ HOWTO (R_MICROBLAZE_REL, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_REL", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
/* Table-entry not really used. */
HOWTO (R_MICROBLAZE_JUMP_SLOT,/* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_JUMP_SLOT", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- TRUE), /* PC relative offset? */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_JUMP_SLOT", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
/* Table-entry not really used. */
HOWTO (R_MICROBLAZE_GLOB_DAT,/* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_GLOB_DAT", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- TRUE), /* PC relative offset? */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_GLOB_DAT", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
/* A 64 bit GOT relative relocation. Table-entry not really used. */
- HOWTO (R_MICROBLAZE_GOTOFF_64, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_GOTOFF_64", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ HOWTO (R_MICROBLAZE_GOTOFF_64, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_GOTOFF_64", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* A 32 bit GOT relative relocation. Table-entry not really used. */
- HOWTO (R_MICROBLAZE_GOTOFF_32, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc, /* Special Function. */
- "R_MICROBLAZE_GOTOFF_32", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ HOWTO (R_MICROBLAZE_GOTOFF_32, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc, /* Special Function. */
+ "R_MICROBLAZE_GOTOFF_32", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* COPY relocation. Table-entry not really used. */
- HOWTO (R_MICROBLAZE_COPY, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_MICROBLAZE_COPY", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x0000ffff, /* Dest Mask. */
- FALSE), /* PC relative offset? */
+ HOWTO (R_MICROBLAZE_COPY, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_MICROBLAZE_COPY", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x0000ffff, /* Dest Mask. */
+ FALSE), /* PC relative offset? */
/* Marker relocs for TLS. */
HOWTO (R_MICROBLAZE_TLS,
if (h != (struct bfd_link_hash_entry *) NULL
&& h->type == bfd_link_hash_defined)
ro_small_data_pointer = (h->u.def.value
- + h->u.def.section->output_section->vma
- + h->u.def.section->output_offset);
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
h = bfd_link_hash_lookup (info->hash, RW_SDA_ANCHOR_NAME, FALSE, FALSE, TRUE);
if (h != (struct bfd_link_hash_entry *) NULL
&& h->type == bfd_link_hash_defined)
rw_small_data_pointer = (h->u.def.value
- + h->u.def.section->output_section->vma
- + h->u.def.section->output_offset);
+ + h->u.def.section->output_section->vma
+ + h->u.def.section->output_offset);
}
static bfd_vma
rel.r_addend = addend;
bfd_elf32_swap_reloca_out (output_bfd, &rel,
- (sreloc->contents + reloc_index * sizeof (Elf32_External_Rela)));
+ (sreloc->contents + reloc_index * sizeof (Elf32_External_Rela)));
}
/* This code is taken from elf32-m32r.c
static bfd_boolean
microblaze_elf_relocate_section (bfd *output_bfd,
- struct bfd_link_info *info,
- bfd *input_bfd,
- asection *input_section,
- bfd_byte *contents,
- Elf_Internal_Rela *relocs,
- Elf_Internal_Sym *local_syms,
- asection **local_sections)
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
struct elf32_mb_link_hash_table *htab;
Elf_Internal_Shdr *symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+ offset + INST_WORD_SIZE);
relocation += addend;
bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
- contents + offset + endian);
+ contents + offset + endian);
bfd_put_16 (input_bfd, relocation & 0xffff,
- contents + offset + endian + INST_WORD_SIZE);
+ contents + offset + endian + INST_WORD_SIZE);
break;
case (int) R_MICROBLAZE_PLT_64:
+ input_section->output_offset
+ offset + INST_WORD_SIZE);
bfd_put_16 (input_bfd, (immediate >> 16) & 0xffff,
- contents + offset + endian);
+ contents + offset + endian);
bfd_put_16 (input_bfd, immediate & 0xffff,
- contents + offset + endian + INST_WORD_SIZE);
+ contents + offset + endian + INST_WORD_SIZE);
}
else
{
+ offset + INST_WORD_SIZE);
immediate = relocation;
bfd_put_16 (input_bfd, (immediate >> 16) & 0xffff,
- contents + offset + endian);
+ contents + offset + endian);
bfd_put_16 (input_bfd, immediate & 0xffff,
- contents + offset + endian + INST_WORD_SIZE);
+ contents + offset + endian + INST_WORD_SIZE);
}
break;
}
}
else if (IS_TLS_GD(tls_type))
{
- if (! need_relocs)
+ if (! need_relocs)
bfd_put_32 (output_bfd, 1,
htab->elf.sgot->contents + off);
- else
+ else
microblaze_elf_output_dynamic_relocation
(output_bfd,
htab->elf.srelgot,
+ off2);
if (IS_TLS_LD(tls_type))
{
- /* For LD, offset should be 0 */
- *offp |= 1;
- bfd_put_32 (output_bfd, 0,
+ /* For LD, offset should be 0 */
+ *offp |= 1;
+ bfd_put_32 (output_bfd, 0,
htab->elf.sgot->contents + off2);
}
else if (IS_TLS_GD(tls_type))
{
- *offp |= 1;
- static_value -= dtprel_base(info);
- if (need_relocs)
+ *offp |= 1;
+ static_value -= dtprel_base(info);
+ if (need_relocs)
microblaze_elf_output_dynamic_relocation
(output_bfd,
htab->elf.srelgot,
htab->elf.srelgot->reloc_count++,
/* symindex= */ indx, R_MICROBLAZE_TLSDTPREL32,
got_offset, indx ? 0 : static_value);
- else
+ else
bfd_put_32 (output_bfd, static_value,
htab->elf.sgot->contents + off2);
}
/* Apply Current Relocation */
bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
- contents + offset + endian);
+ contents + offset + endian);
bfd_put_16 (input_bfd, relocation & 0xffff,
- contents + offset + endian + INST_WORD_SIZE);
+ contents + offset + endian + INST_WORD_SIZE);
unresolved_reloc = FALSE;
break;
+ input_section->output_offset
+ offset + INST_WORD_SIZE);
bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
- contents + offset + endian);
+ contents + offset + endian);
bfd_put_16 (input_bfd, relocation & 0xffff,
- contents + offset + endian + INST_WORD_SIZE);
+ contents + offset + endian + INST_WORD_SIZE);
}
break;
}
+ input_section->output_offset
+ offset + INST_WORD_SIZE);
bfd_put_16 (input_bfd, (relocation >> 16) & 0xffff,
- contents + offset + endian);
+ contents + offset + endian);
bfd_put_16 (input_bfd, relocation & 0xffff,
- contents + offset + endian + INST_WORD_SIZE);
+ contents + offset + endian + INST_WORD_SIZE);
}
break;
}
for (i = 0; i < sec->relax_count; i++)
{
if (end <= sec->relax[i].addr)
- break;
+ break;
if ((end != start) && (start > sec->relax[i].addr))
- continue;
+ continue;
fixup += sec->relax[i].size;
}
return fixup;
symcount = symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
if (isymbuf == NULL)
isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, symcount,
- 0, NULL, NULL, NULL);
+ 0, NULL, NULL, NULL);
BFD_ASSERT (isymbuf != NULL);
internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, link_info->keep_memory);
if (!bfd_get_section_contents (abfd, sec, contents,
(file_ptr) 0, sec->size))
goto error_return;
- elf_section_data (sec)->this_hdr.contents = contents;
+ elf_section_data (sec)->this_hdr.contents = contents;
}
}
asection *sym_sec;
isym = isymbuf + ELF32_R_SYM (irel->r_info);
- if (isym->st_shndx == SHN_UNDEF)
+ if (isym->st_shndx == SHN_UNDEF)
sym_sec = bfd_und_section_ptr;
else if (isym->st_shndx == SHN_ABS)
sym_sec = bfd_abs_section_ptr;
h = elf_sym_hashes (abfd)[indx];
BFD_ASSERT (h != NULL);
- if (h->root.type != bfd_link_hash_defined
+ if (h->root.type != bfd_link_hash_defined
&& h->root.type != bfd_link_hash_defweak)
/* This appears to be a reference to an undefined
symbol. Just ignore it--it will be caught by the
}
/* If this is a PC-relative reloc, subtract the instr offset from
- the symbol value. */
+ the symbol value. */
if (ELF32_R_TYPE (irel->r_info) == (int) R_MICROBLAZE_64_PCREL)
{
symval = symval + irel->r_addend
- (irel->r_offset
+ sec->output_section->vma
+ sec->output_offset);
- }
+ }
else
symval += irel->r_addend;
if ((symval & 0xffff8000) == 0
|| (symval & 0xffff8000) == 0xffff8000)
{
- /* We can delete this instruction. */
+ /* We can delete this instruction. */
sec->relax[sec->relax_count].addr = irel->r_offset;
sec->relax[sec->relax_count].size = INST_WORD_SIZE;
sec->relax_count++;
/* Rewrite relocation type. */
- switch ((enum elf_microblaze_reloc_type) ELF32_R_TYPE (irel->r_info))
+ switch ((enum elf_microblaze_reloc_type) ELF32_R_TYPE (irel->r_info))
{
case R_MICROBLAZE_64_PCREL:
irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- (int) R_MICROBLAZE_32_PCREL_LO);
+ (int) R_MICROBLAZE_32_PCREL_LO);
break;
case R_MICROBLAZE_64:
- irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
- (int) R_MICROBLAZE_32_LO);
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ (int) R_MICROBLAZE_32_LO);
break;
default:
/* Cannot happen. */
BFD_ASSERT (FALSE);
- }
- }
+ }
+ }
} /* Loop through all relocations. */
/* Loop through the relocs again, and see if anything needs to change. */
sec->relax[sec->relax_count].addr = sec->size;
for (irel = internal_relocs; irel < irelend; irel++, rel_count++)
- {
+ {
bfd_vma nraddr;
- /* Get the new reloc address. */
+ /* Get the new reloc address. */
nraddr = irel->r_offset - calc_fixup (irel->r_offset, 0, sec);
- switch ((enum elf_microblaze_reloc_type) ELF32_R_TYPE (irel->r_info))
+ switch ((enum elf_microblaze_reloc_type) ELF32_R_TYPE (irel->r_info))
{
default:
break;
case R_MICROBLAZE_64:
case R_MICROBLAZE_32_LO:
/* If this reloc is against a symbol defined in this
- section, we must check the addend to see it will put the value in
- range to be adjusted, and hence must be changed. */
+ section, we must check the addend to see it will put the value in
+ range to be adjusted, and hence must be changed. */
if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
- {
+ {
isym = isymbuf + ELF32_R_SYM (irel->r_info);
/* Only handle relocs against .text. */
if (isym->st_shndx == shndx
&& ELF32_ST_TYPE (isym->st_info) == STT_SECTION)
irel->r_addend -= calc_fixup (irel->r_addend, 0, sec);
- }
+ }
break;
case R_MICROBLAZE_NONE:
{
- /* This was a PC-relative instruction that was
- completely resolved. */
- int sfix, efix;
- bfd_vma target_address;
- target_address = irel->r_addend + irel->r_offset;
- sfix = calc_fixup (irel->r_offset, 0, sec);
- efix = calc_fixup (target_address, 0, sec);
- irel->r_addend -= (efix - sfix);
- /* Should use HOWTO. */
- microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
- irel->r_addend);
+ /* This was a PC-relative instruction that was
+ completely resolved. */
+ int sfix, efix;
+ bfd_vma target_address;
+ target_address = irel->r_addend + irel->r_offset;
+ sfix = calc_fixup (irel->r_offset, 0, sec);
+ efix = calc_fixup (target_address, 0, sec);
+ irel->r_addend -= (efix - sfix);
+ /* Should use HOWTO. */
+ microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
+ irel->r_addend);
}
break;
case R_MICROBLAZE_64_NONE:
{
- /* This was a PC-relative 64-bit instruction that was
- completely resolved. */
- int sfix, efix;
- bfd_vma target_address;
+ /* This was a PC-relative 64-bit instruction that was
+ completely resolved. */
+ int sfix, efix;
+ bfd_vma target_address;
target_address = irel->r_addend + irel->r_offset + INST_WORD_SIZE;
sfix = calc_fixup (irel->r_offset + INST_WORD_SIZE, 0, sec);
efix = calc_fixup (target_address, 0, sec);
irel->r_addend -= (efix - sfix);
microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset
- + INST_WORD_SIZE, irel->r_addend);
+ + INST_WORD_SIZE, irel->r_addend);
}
break;
}
- irel->r_offset = nraddr;
- } /* Change all relocs in this section. */
+ irel->r_offset = nraddr;
+ } /* Change all relocs in this section. */
/* Look through all other sections. */
for (o = abfd->sections; o != NULL; o = o->next)
- {
- Elf_Internal_Rela *irelocs;
- Elf_Internal_Rela *irelscan, *irelscanend;
- bfd_byte *ocontents;
-
- if (o == sec
- || (o->flags & SEC_RELOC) == 0
- || o->reloc_count == 0)
- continue;
-
- /* We always cache the relocs. Perhaps, if info->keep_memory is
- FALSE, we should free them, if we are permitted to. */
-
- irelocs = _bfd_elf_link_read_relocs (abfd, o, NULL, NULL, TRUE);
- if (irelocs == NULL)
- goto error_return;
-
- ocontents = NULL;
- irelscanend = irelocs + o->reloc_count;
- for (irelscan = irelocs; irelscan < irelscanend; irelscan++)
- {
- if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32)
- {
- isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
-
- /* Look at the reloc only if the value has been resolved. */
- if (isym->st_shndx == shndx
- && (ELF32_ST_TYPE (isym->st_info) == STT_SECTION))
- {
- if (ocontents == NULL)
- {
- if (elf_section_data (o)->this_hdr.contents != NULL)
- ocontents = elf_section_data (o)->this_hdr.contents;
- else
- {
- /* We always cache the section contents.
- Perhaps, if info->keep_memory is FALSE, we
- should free them, if we are permitted to. */
- if (o->rawsize == 0)
- o->rawsize = o->size;
- ocontents = (bfd_byte *) bfd_malloc (o->rawsize);
- if (ocontents == NULL)
- goto error_return;
- if (!bfd_get_section_contents (abfd, o, ocontents,
- (file_ptr) 0,
+ {
+ Elf_Internal_Rela *irelocs;
+ Elf_Internal_Rela *irelscan, *irelscanend;
+ bfd_byte *ocontents;
+
+ if (o == sec
+ || (o->flags & SEC_RELOC) == 0
+ || o->reloc_count == 0)
+ continue;
+
+ /* We always cache the relocs. Perhaps, if info->keep_memory is
+ FALSE, we should free them, if we are permitted to. */
+
+ irelocs = _bfd_elf_link_read_relocs (abfd, o, NULL, NULL, TRUE);
+ if (irelocs == NULL)
+ goto error_return;
+
+ ocontents = NULL;
+ irelscanend = irelocs + o->reloc_count;
+ for (irelscan = irelocs; irelscan < irelscanend; irelscan++)
+ {
+ if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32)
+ {
+ isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
+
+ /* Look at the reloc only if the value has been resolved. */
+ if (isym->st_shndx == shndx
+ && (ELF32_ST_TYPE (isym->st_info) == STT_SECTION))
+ {
+ if (ocontents == NULL)
+ {
+ if (elf_section_data (o)->this_hdr.contents != NULL)
+ ocontents = elf_section_data (o)->this_hdr.contents;
+ else
+ {
+ /* We always cache the section contents.
+ Perhaps, if info->keep_memory is FALSE, we
+ should free them, if we are permitted to. */
+ if (o->rawsize == 0)
+ o->rawsize = o->size;
+ ocontents = (bfd_byte *) bfd_malloc (o->rawsize);
+ if (ocontents == NULL)
+ goto error_return;
+ if (!bfd_get_section_contents (abfd, o, ocontents,
+ (file_ptr) 0,
o->rawsize))
- goto error_return;
- elf_section_data (o)->this_hdr.contents = ocontents;
- }
+ goto error_return;
+ elf_section_data (o)->this_hdr.contents = ocontents;
+ }
- }
+ }
irelscan->r_addend -= calc_fixup (irelscan->r_addend, 0, sec);
- }
+ }
else if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32_SYM_OP_SYM)
{
isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
offset = calc_fixup (target_address, 0, sec);
immediate -= offset;
irelscan->r_addend -= offset;
- microblaze_bfd_write_imm_value_32 (abfd, ocontents + irelscan->r_offset,
- irelscan->r_addend);
+ microblaze_bfd_write_imm_value_32 (abfd, ocontents + irelscan->r_offset,
+ irelscan->r_addend);
}
}
elf_section_data (o)->this_hdr.contents = ocontents;
}
}
- unsigned long instr_hi = bfd_get_32 (abfd, ocontents
- + irelscan->r_offset);
- unsigned long instr_lo = bfd_get_32 (abfd, ocontents
- + irelscan->r_offset
- + INST_WORD_SIZE);
- immediate = (instr_hi & 0x0000ffff) << 16;
- immediate |= (instr_lo & 0x0000ffff);
+ unsigned long instr_hi = bfd_get_32 (abfd, ocontents
+ + irelscan->r_offset);
+ unsigned long instr_lo = bfd_get_32 (abfd, ocontents
+ + irelscan->r_offset
+ + INST_WORD_SIZE);
+ immediate = (instr_hi & 0x0000ffff) << 16;
+ immediate |= (instr_lo & 0x0000ffff);
offset = calc_fixup (irelscan->r_addend, 0, sec);
immediate -= offset;
irelscan->r_addend -= offset;
elf_section_data (o)->this_hdr.contents = ocontents;
}
}
- unsigned long instr_hi = bfd_get_32 (abfd, ocontents
- + irelscan->r_offset);
- unsigned long instr_lo = bfd_get_32 (abfd, ocontents
- + irelscan->r_offset
- + INST_WORD_SIZE);
- immediate = (instr_hi & 0x0000ffff) << 16;
- immediate |= (instr_lo & 0x0000ffff);
+ unsigned long instr_hi = bfd_get_32 (abfd, ocontents
+ + irelscan->r_offset);
+ unsigned long instr_lo = bfd_get_32 (abfd, ocontents
+ + irelscan->r_offset
+ + INST_WORD_SIZE);
+ immediate = (instr_hi & 0x0000ffff) << 16;
+ immediate |= (instr_lo & 0x0000ffff);
target_address = immediate;
offset = calc_fixup (target_address, 0, sec);
immediate -= offset;
irelscan->r_addend -= offset;
- microblaze_bfd_write_imm_value_64 (abfd, ocontents
- + irelscan->r_offset, immediate);
+ microblaze_bfd_write_imm_value_64 (abfd, ocontents
+ + irelscan->r_offset, immediate);
}
}
- }
- }
+ }
+ }
/* Adjust the local symbols defined in this section. */
isymend = isymbuf + symtab_hdr->sh_info;
for (isym = isymbuf; isym < isymend; isym++)
- {
- if (isym->st_shndx == shndx)
- {
- isym->st_value -= calc_fixup (isym->st_value, 0, sec);
- if (isym->st_size)
- isym->st_size -= calc_fixup (isym->st_value, isym->st_size, sec);
- }
- }
+ {
+ if (isym->st_shndx == shndx)
+ {
+ isym->st_value -= calc_fixup (isym->st_value, 0, sec);
+ if (isym->st_size)
+ isym->st_size -= calc_fixup (isym->st_value, isym->st_size, sec);
+ }
+ }
/* Now adjust the global symbols defined in this section. */
isym = isymbuf + symtab_hdr->sh_info;
symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)) - symtab_hdr->sh_info;
for (sym_index = 0; sym_index < symcount; sym_index++)
- {
- sym_hash = elf_sym_hashes (abfd)[sym_index];
- if ((sym_hash->root.type == bfd_link_hash_defined
- || sym_hash->root.type == bfd_link_hash_defweak)
- && sym_hash->root.u.def.section == sec)
- {
- sym_hash->root.u.def.value -= calc_fixup (sym_hash->root.u.def.value,
- 0, sec);
- if (sym_hash->size)
- sym_hash->size -= calc_fixup (sym_hash->root.u.def.value,
- sym_hash->size, sec);
- }
- }
+ {
+ sym_hash = elf_sym_hashes (abfd)[sym_index];
+ if ((sym_hash->root.type == bfd_link_hash_defined
+ || sym_hash->root.type == bfd_link_hash_defweak)
+ && sym_hash->root.u.def.section == sec)
+ {
+ sym_hash->root.u.def.value -= calc_fixup (sym_hash->root.u.def.value,
+ 0, sec);
+ if (sym_hash->size)
+ sym_hash->size -= calc_fixup (sym_hash->root.u.def.value,
+ sym_hash->size, sec);
+ }
+ }
/* Physically move the code and change the cooked size. */
dest = sec->relax[0].addr;
for (i = 0; i < sec->relax_count; i++)
- {
- int len;
- src = sec->relax[i].addr + sec->relax[i].size;
- len = sec->relax[i+1].addr - sec->relax[i].addr - sec->relax[i].size;
+ {
+ int len;
+ src = sec->relax[i].addr + sec->relax[i].size;
+ len = sec->relax[i+1].addr - sec->relax[i].addr - sec->relax[i].size;
- memmove (contents + dest, contents + src, len);
- sec->size -= sec->relax[i].size;
- dest += len;
- }
+ memmove (contents + dest, contents + src, len);
+ sec->size -= sec->relax[i].size;
+ dest += len;
+ }
elf_section_data (sec)->relocs = internal_relocs;
free_relocs = NULL;
static asection *
microblaze_elf_gc_mark_hook (asection *sec,
struct bfd_link_info * info,
- Elf_Internal_Rela * rel,
- struct elf_link_hash_entry * h,
- Elf_Internal_Sym * sym)
+ Elf_Internal_Rela * rel,
+ struct elf_link_hash_entry * h,
+ Elf_Internal_Sym * sym)
{
if (h != NULL)
switch (ELF32_R_TYPE (rel->r_info))
#define PLT_ENTRY_SIZE 16
-#define PLT_ENTRY_WORD_0 0xb0000000 /* "imm 0". */
-#define PLT_ENTRY_WORD_1 0xe9940000 /* "lwi r12,r20,0" - relocated to lwi r12,r20,func@GOT. */
-#define PLT_ENTRY_WORD_1_NOPIC 0xe9800000 /* "lwi r12,r0,0" - non-PIC object. */
-#define PLT_ENTRY_WORD_2 0x98186000 /* "brad r12". */
-#define PLT_ENTRY_WORD_3 0x80000000 /* "nop". */
+#define PLT_ENTRY_WORD_0 0xb0000000 /* "imm 0". */
+#define PLT_ENTRY_WORD_1 0xe9940000 /* "lwi r12,r20,0" - relocated to lwi r12,r20,func@GOT. */
+#define PLT_ENTRY_WORD_1_NOPIC 0xe9800000 /* "lwi r12,r0,0" - non-PIC object. */
+#define PLT_ENTRY_WORD_2 0x98186000 /* "brad r12". */
+#define PLT_ENTRY_WORD_3 0x80000000 /* "nop". */
static bfd_boolean
update_local_sym_info (bfd *abfd,
size *= (sizeof (*local_got_refcounts) + sizeof (*local_got_tls_masks));
local_got_refcounts = bfd_zalloc (abfd, size);
if (local_got_refcounts == NULL)
- return FALSE;
+ return FALSE;
elf_local_got_refcounts (abfd) = local_got_refcounts;
}
local_got_tls_masks =
- (unsigned char *) (local_got_refcounts + symtab_hdr->sh_info);
+ (unsigned char *) (local_got_refcounts + symtab_hdr->sh_info);
local_got_tls_masks[r_symndx] |= tls_type;
local_got_refcounts[r_symndx] += 1;
static bfd_boolean
microblaze_elf_check_relocs (bfd * abfd,
struct bfd_link_info * info,
- asection * sec,
+ asection * sec,
const Elf_Internal_Rela * relocs)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
struct elf_link_hash_entry ** sym_hashes_end;
- const Elf_Internal_Rela * rel;
- const Elf_Internal_Rela * rel_end;
+ const Elf_Internal_Rela * rel;
+ const Elf_Internal_Rela * rel_end;
struct elf32_mb_link_hash_table *htab;
asection *sreloc = NULL;
r_type = ELF32_R_TYPE (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes [r_symndx - symtab_hdr->sh_info];
}
switch (r_type)
- {
+ {
/* This relocation describes the C++ object vtable hierarchy.
Reconstruct it for later use during GC. */
- case R_MICROBLAZE_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
+ case R_MICROBLAZE_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
- case R_MICROBLAZE_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
+ case R_MICROBLAZE_GNU_VTENTRY:
+ if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
/* This relocation requires .plt entry. */
- case R_MICROBLAZE_PLT_64:
- if (h != NULL)
+ case R_MICROBLAZE_PLT_64:
+ if (h != NULL)
{
h->needs_plt = 1;
h->plt.refcount += 1;
}
- break;
+ break;
/* This relocation requires .got entry. */
- case R_MICROBLAZE_TLSGD:
- tls_type |= (TLS_TLS | TLS_GD);
- goto dogottls;
- case R_MICROBLAZE_TLSLD:
- tls_type |= (TLS_TLS | TLS_LD);
+ case R_MICROBLAZE_TLSGD:
+ tls_type |= (TLS_TLS | TLS_GD);
+ goto dogottls;
+ case R_MICROBLAZE_TLSLD:
+ tls_type |= (TLS_TLS | TLS_LD);
/* Fall through. */
- dogottls:
- sec->has_tls_reloc = 1;
+ dogottls:
+ sec->has_tls_reloc = 1;
/* Fall through. */
- case R_MICROBLAZE_GOT_64:
- if (htab->elf.sgot == NULL)
- {
- if (htab->elf.dynobj == NULL)
- htab->elf.dynobj = abfd;
- if (!_bfd_elf_create_got_section (htab->elf.dynobj, info))
- return FALSE;
- }
- if (h != NULL)
+ case R_MICROBLAZE_GOT_64:
+ if (htab->elf.sgot == NULL)
+ {
+ if (htab->elf.dynobj == NULL)
+ htab->elf.dynobj = abfd;
+ if (!_bfd_elf_create_got_section (htab->elf.dynobj, info))
+ return FALSE;
+ }
+ if (h != NULL)
{
h->got.refcount += 1;
elf32_mb_hash_entry (h)->tls_mask |= tls_type;
}
- else
+ else
{
if (! update_local_sym_info(abfd, symtab_hdr, r_symndx, tls_type) )
return FALSE;
}
- break;
+ break;
case R_MICROBLAZE_GOTOFF_64:
case R_MICROBLAZE_GOTOFF_32:
}
break;
- case R_MICROBLAZE_64:
- case R_MICROBLAZE_64_PCREL:
- case R_MICROBLAZE_32:
- {
- if (h != NULL && !bfd_link_pic (info))
+ case R_MICROBLAZE_64:
+ case R_MICROBLAZE_64_PCREL:
+ case R_MICROBLAZE_32:
+ {
+ if (h != NULL && !bfd_link_pic (info))
{
/* we may need a copy reloc. */
h->non_got_ref = 1;
dynamic library if we manage to avoid copy relocs for the
symbol. */
- if ((bfd_link_pic (info)
- && (sec->flags & SEC_ALLOC) != 0
- && (r_type != R_MICROBLAZE_64_PCREL
- || (h != NULL
+ if ((bfd_link_pic (info)
+ && (sec->flags & SEC_ALLOC) != 0
+ && (r_type != R_MICROBLAZE_64_PCREL
+ || (h != NULL
&& (! info->symbolic
|| h->root.type == bfd_link_hash_defweak
|| !h->def_regular))))
- || (!bfd_link_pic (info)
- && (sec->flags & SEC_ALLOC) != 0
- && h != NULL
- && (h->root.type == bfd_link_hash_defweak
- || !h->def_regular)))
- {
- struct elf_dyn_relocs *p;
- struct elf_dyn_relocs **head;
-
- /* When creating a shared object, we must copy these
- relocs into the output file. We create a reloc
- section in dynobj and make room for the reloc. */
+ || (!bfd_link_pic (info)
+ && (sec->flags & SEC_ALLOC) != 0
+ && h != NULL
+ && (h->root.type == bfd_link_hash_defweak
+ || !h->def_regular)))
+ {
+ struct elf_dyn_relocs *p;
+ struct elf_dyn_relocs **head;
+
+ /* When creating a shared object, we must copy these
+ relocs into the output file. We create a reloc
+ section in dynobj and make room for the reloc. */
if (sreloc == NULL)
{
if (r_type == R_MICROBLAZE_64_PCREL)
p->pc_count += 1;
}
- }
- break;
- }
+ }
+ break;
+ }
}
return TRUE;
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
- {
- asection *s = htab->elf.splt;
-
- /* The first entry in .plt is reserved. */
- if (s->size == 0)
- s->size = PLT_ENTRY_SIZE;
-
- h->plt.offset = s->size;
-
- /* If this symbol is not defined in a regular file, and we are
- not generating a shared library, then set the symbol to this
- location in the .plt. This is required to make function
- pointers compare as equal between the normal executable and
- the shared library. */
- if (! bfd_link_pic (info)
- && !h->def_regular)
- {
- h->root.u.def.section = s;
- h->root.u.def.value = h->plt.offset;
- }
-
- /* Make room for this entry. */
- s->size += PLT_ENTRY_SIZE;
-
- /* We also need to make an entry in the .got.plt section, which
- will be placed in the .got section by the linker script. */
+ {
+ asection *s = htab->elf.splt;
+
+ /* The first entry in .plt is reserved. */
+ if (s->size == 0)
+ s->size = PLT_ENTRY_SIZE;
+
+ h->plt.offset = s->size;
+
+ /* If this symbol is not defined in a regular file, and we are
+ not generating a shared library, then set the symbol to this
+ location in the .plt. This is required to make function
+ pointers compare as equal between the normal executable and
+ the shared library. */
+ if (! bfd_link_pic (info)
+ && !h->def_regular)
+ {
+ h->root.u.def.section = s;
+ h->root.u.def.value = h->plt.offset;
+ }
+
+ /* Make room for this entry. */
+ s->size += PLT_ENTRY_SIZE;
+
+ /* We also need to make an entry in the .got.plt section, which
+ will be placed in the .got section by the linker script. */
htab->elf.sgotplt->size += 4;
- /* We also need to make an entry in the .rel.plt section. */
- htab->elf.srelplt->size += sizeof (Elf32_External_Rela);
- }
+ /* We also need to make an entry in the .rel.plt section. */
+ htab->elf.srelplt->size += sizeof (Elf32_External_Rela);
+ }
else
- {
- h->plt.offset = (bfd_vma) -1;
- h->needs_plt = 0;
- }
+ {
+ h->plt.offset = (bfd_vma) -1;
+ h->needs_plt = 0;
+ }
}
else
{
asection *s;
/* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
+ Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
need = 0;
if ((eh->tls_mask & TLS_TLS) != 0)
- {
- /* Handle TLS Symbol */
- if ((eh->tls_mask & TLS_LD) != 0)
- {
- if (!eh->elf.def_dynamic)
- /* We'll just use htab->tlsld_got.offset. This should
- always be the case. It's a little odd if we have
- a local dynamic reloc against a non-local symbol. */
- htab->tlsld_got.refcount += 1;
- else
- need += 8;
- }
- if ((eh->tls_mask & TLS_GD) != 0)
- need += 8;
- }
+ {
+ /* Handle TLS Symbol */
+ if ((eh->tls_mask & TLS_LD) != 0)
+ {
+ if (!eh->elf.def_dynamic)
+ /* We'll just use htab->tlsld_got.offset. This should
+ always be the case. It's a little odd if we have
+ a local dynamic reloc against a non-local symbol. */
+ htab->tlsld_got.refcount += 1;
+ else
+ need += 8;
+ }
+ if ((eh->tls_mask & TLS_GD) != 0)
+ need += 8;
+ }
else
- {
- /* Regular (non-TLS) symbol */
- need += 4;
- }
+ {
+ /* Regular (non-TLS) symbol */
+ need += 4;
+ }
if (need == 0)
- {
- h->got.offset = (bfd_vma) -1;
- }
+ {
+ h->got.offset = (bfd_vma) -1;
+ }
else
- {
- s = htab->elf.sgot;
- h->got.offset = s->size;
- s->size += need;
- htab->elf.srelgot->size += need * (sizeof (Elf32_External_Rela) / 4);
- }
+ {
+ s = htab->elf.sgot;
+ h->got.offset = s->size;
+ s->size += need;
+ htab->elf.srelgot->size += need * (sizeof (Elf32_External_Rela) / 4);
+ }
}
else
h->got.offset = (bfd_vma) -1;
asection *srel;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
- continue;
+ continue;
for (s = ibfd->sections; s != NULL; s = s->next)
{
local_got = elf_local_got_refcounts (ibfd);
if (!local_got)
- continue;
+ continue;
symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
locsymcount = symtab_hdr->sh_info;
if (bfd_link_pic (info))
srel->size += need * (sizeof (Elf32_External_Rela) / 4);
}
- }
- else
- *local_got = (bfd_vma) -1;
- }
+ }
+ else
+ *local_got = (bfd_vma) -1;
+ }
}
/* Allocate global sym .plt and .got entries, and space for global
htab->tlsld_got.offset = htab->elf.sgot->size;
htab->elf.sgot->size += 8;
if (bfd_link_pic (info))
- htab->elf.srelgot->size += sizeof (Elf32_External_Rela);
+ htab->elf.srelgot->size += sizeof (Elf32_External_Rela);
}
else
htab->tlsld_got.offset = (bfd_vma) -1;
{
/* Make space for the trailing nop in .plt. */
if (htab->elf.splt->size > 0)
- htab->elf.splt->size += 4;
+ htab->elf.splt->size += 4;
}
/* The check_relocs and adjust_dynamic_symbol entry points have
bfd_boolean strip = FALSE;
if ((s->flags & SEC_LINKER_CREATED) == 0)
- continue;
+ continue;
/* It's OK to base decisions on the section name, because none
- of the dynobj section names depend upon the input files. */
+ of the dynobj section names depend upon the input files. */
name = bfd_get_section_name (dynobj, s);
if (strncmp (name, ".rela", 5) == 0)
- {
- if (s->size == 0)
- {
- /* If we don't need this section, strip it from the
- output file. This is to handle .rela.bss and
- .rela.plt. We must create it in
- create_dynamic_sections, because it must be created
- before the linker maps input sections to output
- sections. The linker does that before
- adjust_dynamic_symbol is called, and it is that
- function which decides whether anything needs to go
- into these sections. */
- strip = TRUE;
- }
- else
- {
- /* We use the reloc_count field as a counter if we need
- to copy relocs into the output file. */
- s->reloc_count = 0;
- }
- }
+ {
+ if (s->size == 0)
+ {
+ /* If we don't need this section, strip it from the
+ output file. This is to handle .rela.bss and
+ .rela.plt. We must create it in
+ create_dynamic_sections, because it must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
+ strip = TRUE;
+ }
+ else
+ {
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ s->reloc_count = 0;
+ }
+ }
else if (s != htab->elf.splt
&& s != htab->elf.sgot
&& s != htab->elf.sgotplt
&& s != htab->elf.sdynbss
&& s != htab->elf.sdynrelro)
- {
- /* It's not one of our sections, so don't allocate space. */
- continue;
- }
+ {
+ /* It's not one of our sections, so don't allocate space. */
+ continue;
+ }
if (strip)
- {
- s->flags |= SEC_EXCLUDE;
- continue;
- }
+ {
+ s->flags |= SEC_EXCLUDE;
+ continue;
+ }
/* Allocate memory for the section contents. */
/* FIXME: This should be a call to bfd_alloc not bfd_zalloc.
- Unused entries should be reclaimed before the section's contents
- are written out, but at the moment this does not happen. Thus in
- order to prevent writing out garbage, we initialise the section's
- contents to zero. */
+ Unused entries should be reclaimed before the section's contents
+ are written out, but at the moment this does not happen. Thus in
+ order to prevent writing out garbage, we initialise the section's
+ contents to zero. */
s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
if (s->contents == NULL && s->size != 0)
- return FALSE;
+ return FALSE;
}
if (elf_hash_table (info)->dynamic_sections_created)
_bfd_elf_add_dynamic_entry (info, TAG, VAL)
if (bfd_link_executable (info))
- {
- if (!add_dynamic_entry (DT_DEBUG, 0))
- return FALSE;
- }
+ {
+ if (!add_dynamic_entry (DT_DEBUG, 0))
+ return FALSE;
+ }
if (!add_dynamic_entry (DT_RELA, 0)
- || !add_dynamic_entry (DT_RELASZ, 0)
- || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela)))
+ || !add_dynamic_entry (DT_RELASZ, 0)
+ || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela)))
return FALSE;
if (htab->elf.splt->size != 0)
- {
- if (!add_dynamic_entry (DT_PLTGOT, 0)
- || !add_dynamic_entry (DT_PLTRELSZ, 0)
- || !add_dynamic_entry (DT_PLTREL, DT_RELA)
- || !add_dynamic_entry (DT_JMPREL, 0)
- || !add_dynamic_entry (DT_BIND_NOW, 1))
- return FALSE;
- }
+ {
+ if (!add_dynamic_entry (DT_PLTGOT, 0)
+ || !add_dynamic_entry (DT_PLTRELSZ, 0)
+ || !add_dynamic_entry (DT_PLTREL, DT_RELA)
+ || !add_dynamic_entry (DT_JMPREL, 0)
+ || !add_dynamic_entry (DT_BIND_NOW, 1))
+ return FALSE;
+ }
if (info->flags & DF_TEXTREL)
- {
- if (!add_dynamic_entry (DT_TEXTREL, 0))
- return FALSE;
- }
+ {
+ if (!add_dynamic_entry (DT_TEXTREL, 0))
+ return FALSE;
+ }
}
#undef add_dynamic_entry
return TRUE;
bfd_vma got_addr;
/* This symbol has an entry in the procedure linkage table. Set
- it up. */
+ it up. */
BFD_ASSERT (h->dynindx != -1);
splt = htab->elf.splt;
/* For non-PIC objects we need absolute address of the GOT entry. */
if (!bfd_link_pic (info))
- got_addr += sgotplt->output_section->vma + sgotplt->output_offset;
+ got_addr += sgotplt->output_section->vma + sgotplt->output_offset;
/* Fill in the entry in the procedure linkage table. */
bfd_put_32 (output_bfd, PLT_ENTRY_WORD_0 + ((got_addr >> 16) & 0xffff),
- splt->contents + h->plt.offset);
+ splt->contents + h->plt.offset);
if (bfd_link_pic (info))
- bfd_put_32 (output_bfd, PLT_ENTRY_WORD_1 + (got_addr & 0xffff),
- splt->contents + h->plt.offset + 4);
+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD_1 + (got_addr & 0xffff),
+ splt->contents + h->plt.offset + 4);
else
- bfd_put_32 (output_bfd, PLT_ENTRY_WORD_1_NOPIC + (got_addr & 0xffff),
- splt->contents + h->plt.offset + 4);
+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD_1_NOPIC + (got_addr & 0xffff),
+ splt->contents + h->plt.offset + 4);
bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD_2,
- splt->contents + h->plt.offset + 8);
+ splt->contents + h->plt.offset + 8);
bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD_3,
- splt->contents + h->plt.offset + 12);
+ splt->contents + h->plt.offset + 12);
/* Any additions to the .got section??? */
/* bfd_put_32 (output_bfd,
/* Fill in the entry in the .rela.plt section. */
rela.r_offset = (sgotplt->output_section->vma
- + sgotplt->output_offset
- + got_offset);
+ + sgotplt->output_offset
+ + got_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_MICROBLAZE_JUMP_SLOT);
rela.r_addend = 0;
loc = srela->contents;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
if (!h->def_regular)
- {
- /* Mark the symbol as undefined, rather than as defined in
- the .plt section. Zero the value. */
- sym->st_shndx = SHN_UNDEF;
- sym->st_value = 0;
- }
+ {
+ /* Mark the symbol as undefined, rather than as defined in
+ the .plt section. Zero the value. */
+ sym->st_shndx = SHN_UNDEF;
+ sym->st_value = 0;
+ }
}
/* h->got.refcount to be checked ? */
if (h->got.offset != (bfd_vma) -1 &&
! ((h->got.offset & 1) ||
- IS_TLS_LD(eh->tls_mask) || IS_TLS_GD(eh->tls_mask)))
+ IS_TLS_LD(eh->tls_mask) || IS_TLS_GD(eh->tls_mask)))
{
asection *sgot;
asection *srela;
bfd_vma offset;
/* This symbol has an entry in the global offset table. Set it
- up. */
+ up. */
sgot = htab->elf.sgot;
srela = htab->elf.srelgot;
+ (h->got.offset &~ (bfd_vma) 1));
/* If this is a -Bsymbolic link, and the symbol is defined
- locally, we just want to emit a RELATIVE reloc. Likewise if
- the symbol was forced to be local because of a version file.
- The entry in the global offset table will already have been
- initialized in the relocate_section function. */
+ locally, we just want to emit a RELATIVE reloc. Likewise if
+ the symbol was forced to be local because of a version file.
+ The entry in the global offset table will already have been
+ initialized in the relocate_section function. */
if (bfd_link_pic (info)
- && ((info->symbolic && h->def_regular)
+ && ((info->symbolic && h->def_regular)
|| h->dynindx == -1))
- {
- asection *sec = h->root.u.def.section;
+ {
+ asection *sec = h->root.u.def.section;
bfd_vma value;
value = h->root.u.def.value;
it is too late to change our minds now... */
value += sec->output_section->vma + sec->output_offset;
- microblaze_elf_output_dynamic_relocation (output_bfd,
- srela, srela->reloc_count++,
- /* symindex= */ 0,
- R_MICROBLAZE_REL, offset,
- value);
- }
+ microblaze_elf_output_dynamic_relocation (output_bfd,
+ srela, srela->reloc_count++,
+ /* symindex= */ 0,
+ R_MICROBLAZE_REL, offset,
+ value);
+ }
else
- {
- microblaze_elf_output_dynamic_relocation (output_bfd,
- srela, srela->reloc_count++,
- h->dynindx,
- R_MICROBLAZE_GLOB_DAT,
- offset, 0);
- }
+ {
+ microblaze_elf_output_dynamic_relocation (output_bfd,
+ srela, srela->reloc_count++,
+ h->dynindx,
+ R_MICROBLAZE_GLOB_DAT,
+ offset, 0);
+ }
bfd_put_32 (output_bfd, (bfd_vma) 0,
- sgot->contents + (h->got.offset &~ (bfd_vma) 1));
+ sgot->contents + (h->got.offset &~ (bfd_vma) 1));
}
if (h->needs_copy)
BFD_ASSERT (h->dynindx != -1);
rela.r_offset = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_MICROBLAZE_COPY);
rela.r_addend = 0;
if (h->root.u.def.section == htab->elf.sdynrelro)
dyncon = (Elf32_External_Dyn *) sdyn->contents;
dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
for (; dyncon < dynconend; dyncon++)
- {
- Elf_Internal_Dyn dyn;
+ {
+ Elf_Internal_Dyn dyn;
asection *s;
- bfd_boolean size;
+ bfd_boolean size;
- bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+ bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
- switch (dyn.d_tag)
- {
+ switch (dyn.d_tag)
+ {
case DT_PLTGOT:
s = htab->elf.sgotplt;
size = FALSE;
default:
continue;
- }
+ }
if (s == NULL)
dyn.d_un.d_val = 0;
dyn.d_un.d_val = s->size;
}
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- }
+ }
splt = htab->elf.splt;
BFD_ASSERT (splt != NULL && sdyn != NULL);
/* Clear the first entry in the procedure linkage table,
and put a nop in the last four bytes. */
if (splt->size > 0)
- {
- memset (splt->contents, 0, PLT_ENTRY_SIZE);
- bfd_put_32 (output_bfd, (bfd_vma) 0x80000000 /* nop. */,
- splt->contents + splt->size - 4);
- }
+ {
+ memset (splt->contents, 0, PLT_ENTRY_SIZE);
+ bfd_put_32 (output_bfd, (bfd_vma) 0x80000000 /* nop. */,
+ splt->contents + splt->size - 4);
+ }
elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
}
if (sgot && sgot->size > 0)
{
if (sdyn == NULL)
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
else
- bfd_put_32 (output_bfd,
- sdyn->output_section->vma + sdyn->output_offset,
- sgot->contents);
+ bfd_put_32 (output_bfd,
+ sdyn->output_section->vma + sdyn->output_offset,
+ sgot->contents);
elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
}
static bfd_boolean
microblaze_elf_add_symbol_hook (bfd *abfd,
- struct bfd_link_info *info,
- Elf_Internal_Sym *sym,
- const char **namep ATTRIBUTE_UNUSED,
- flagword *flagsp ATTRIBUTE_UNUSED,
- asection **secp,
- bfd_vma *valp)
+ struct bfd_link_info *info,
+ Elf_Internal_Sym *sym,
+ const char **namep ATTRIBUTE_UNUSED,
+ flagword *flagsp ATTRIBUTE_UNUSED,
+ asection **secp,
+ bfd_vma *valp)
{
if (sym->st_shndx == SHN_COMMON
&& !bfd_link_relocatable (info)
put into .sbss. */
*secp = bfd_make_section_old_way (abfd, ".sbss");
if (*secp == NULL
- || ! bfd_set_section_flags (abfd, *secp, SEC_IS_COMMON))
- return FALSE;
+ || ! bfd_set_section_flags (abfd, *secp, SEC_IS_COMMON))
+ return FALSE;
*valp = sym->st_size;
}
#define TARGET_LITTLE_SYM microblaze_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-microblazeel"
-#define TARGET_BIG_SYM microblaze_elf32_vec
+#define TARGET_BIG_SYM microblaze_elf32_vec
#define TARGET_BIG_NAME "elf32-microblaze"
#define ELF_ARCH bfd_arch_microblaze
#define elf_info_to_howto_rel NULL
#define bfd_elf32_bfd_reloc_type_lookup microblaze_elf_reloc_type_lookup
-#define bfd_elf32_bfd_is_local_label_name microblaze_elf_is_local_label_name
+#define bfd_elf32_bfd_is_local_label_name microblaze_elf_is_local_label_name
#define elf_backend_relocate_section microblaze_elf_relocate_section
-#define bfd_elf32_bfd_relax_section microblaze_elf_relax_section
-#define bfd_elf32_bfd_merge_private_bfd_data _bfd_generic_verify_endian_match
+#define bfd_elf32_bfd_relax_section microblaze_elf_relax_section
+#define bfd_elf32_bfd_merge_private_bfd_data _bfd_generic_verify_endian_match
#define bfd_elf32_bfd_reloc_name_lookup microblaze_elf_reloc_name_lookup
#define elf_backend_gc_mark_hook microblaze_elf_gc_mark_hook
-#define elf_backend_check_relocs microblaze_elf_check_relocs
-#define elf_backend_copy_indirect_symbol microblaze_elf_copy_indirect_symbol
-#define bfd_elf32_bfd_link_hash_table_create microblaze_elf_link_hash_table_create
+#define elf_backend_check_relocs microblaze_elf_check_relocs
+#define elf_backend_copy_indirect_symbol microblaze_elf_copy_indirect_symbol
+#define bfd_elf32_bfd_link_hash_table_create microblaze_elf_link_hash_table_create
#define elf_backend_can_gc_sections 1
-#define elf_backend_can_refcount 1
-#define elf_backend_want_got_plt 1
-#define elf_backend_plt_readonly 1
-#define elf_backend_got_header_size 12
+#define elf_backend_can_refcount 1
+#define elf_backend_want_got_plt 1
+#define elf_backend_plt_readonly 1
+#define elf_backend_got_header_size 12
#define elf_backend_want_dynrelro 1
-#define elf_backend_rela_normal 1
+#define elf_backend_rela_normal 1
#define elf_backend_dtrel_excludes_plt 1
-#define elf_backend_adjust_dynamic_symbol microblaze_elf_adjust_dynamic_symbol
-#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
-#define elf_backend_finish_dynamic_sections microblaze_elf_finish_dynamic_sections
-#define elf_backend_finish_dynamic_symbol microblaze_elf_finish_dynamic_symbol
-#define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections
+#define elf_backend_adjust_dynamic_symbol microblaze_elf_adjust_dynamic_symbol
+#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
+#define elf_backend_finish_dynamic_sections microblaze_elf_finish_dynamic_sections
+#define elf_backend_finish_dynamic_symbol microblaze_elf_finish_dynamic_symbol
+#define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections
#define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook
#include "elf32-target.h"
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC + 4. */
_bfd_mips_elf_generic_reloc, /* special_function */
/* Protected jump conversion. This is an optimization hint. No
relocation is required for correctness. */
- HOWTO (R_MIPS_JALR, /* type */
+ HOWTO (R_MIPS_JALR, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
- "R_MIPS_JALR", /* name */
+ "R_MIPS_JALR", /* name */
FALSE, /* partial_inplace */
0x00000000, /* src_mask */
0x00000000, /* dst_mask */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_GPREL", /* name */
TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A MIPS16 reference to the global offset table. */
"R_MIPS16_GOT16", /* name */
TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A MIPS16 call through the global offset table. */
"R_MIPS16_CALL16", /* name */
TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* MIPS16 high 16 bits of symbol value. */
"R_MIPS16_HI16", /* name */
TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* MIPS16 low 16 bits of symbol value. */
"R_MIPS16_LO16", /* name */
TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* MIPS16 TLS general dynamic variable reference. */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
_bfd_mips_elf_generic_reloc, /* special_function */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_COPY", /* name */
FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0x0, /* dst_mask */
+ 0x0, /* src_mask */
+ 0x0, /* dst_mask */
FALSE); /* pcrel_offset */
/* Originally a VxWorks extension, but now used for other systems too. */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_JUMP_SLOT", /* name */
FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0x0, /* dst_mask */
+ 0x0, /* src_mask */
+ 0x0, /* dst_mask */
FALSE); /* pcrel_offset */
/* Used in EH tables. */
"R_MIPS_EH", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
+ 0xffffffff, /* dst_mask */
FALSE); /* pcrel_offset */
/* Set the GP value for OUTPUT_BFD. Returns FALSE if this is a
if (r_type >= R_MICROMIPS_min && r_type < R_MICROMIPS_max)
return &elf_micromips_howto_table_rel[r_type - R_MICROMIPS_min];
if (r_type >= R_MIPS16_min && r_type < R_MIPS16_max)
- return &elf_mips16_howto_table_rel[r_type - R_MIPS16_min];
+ return &elf_mips16_howto_table_rel[r_type - R_MIPS16_min];
if (r_type >= (unsigned int) R_MIPS_max)
{
_bfd_error_handler (_("Unrecognised MIPS reloc number: %d"), r_type);
#undef ELF_MAXPAGESIZE
#undef ELF_COMMONPAGESIZE
-#define TARGET_LITTLE_SYM mips_elf32_trad_le_vec
-#define TARGET_LITTLE_NAME "elf32-tradlittlemips"
-#define TARGET_BIG_SYM mips_elf32_trad_be_vec
-#define TARGET_BIG_NAME "elf32-tradbigmips"
+#define TARGET_LITTLE_SYM mips_elf32_trad_le_vec
+#define TARGET_LITTLE_NAME "elf32-tradlittlemips"
+#define TARGET_BIG_SYM mips_elf32_trad_be_vec
+#define TARGET_BIG_NAME "elf32-tradbigmips"
/* The MIPS ABI says at Page 5-1:
Virtual addresses and file offsets for MIPS segments are congruent
#undef ELF_MAXPAGESIZE
#undef ELF_COMMONPAGESIZE
-#define TARGET_LITTLE_SYM mips_elf32_vxworks_le_vec
-#define TARGET_LITTLE_NAME "elf32-littlemips-vxworks"
-#define TARGET_BIG_SYM mips_elf32_vxworks_be_vec
-#define TARGET_BIG_NAME "elf32-bigmips-vxworks"
+#define TARGET_LITTLE_SYM mips_elf32_vxworks_le_vec
+#define TARGET_LITTLE_NAME "elf32-littlemips-vxworks"
+#define TARGET_BIG_SYM mips_elf32_vxworks_be_vec
+#define TARGET_BIG_NAME "elf32-bigmips-vxworks"
#undef ELF_OSABI
#undef elf32_bed
static const struct moxie_reloc_map moxie_reloc_map [] =
{
- { BFD_RELOC_NONE, R_MOXIE_NONE },
- { BFD_RELOC_32, R_MOXIE_32 },
+ { BFD_RELOC_NONE, R_MOXIE_NONE },
+ { BFD_RELOC_32, R_MOXIE_32 },
{ BFD_RELOC_MOXIE_10_PCREL, R_MOXIE_PCREL10 },
};
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
\f
#define ELF_ARCH bfd_arch_moxie
#define ELF_MACHINE_CODE EM_MOXIE
-#define ELF_MACHINE_ALT1 EM_MOXIE_OLD
+#define ELF_MACHINE_ALT1 EM_MOXIE_OLD
#define ELF_MAXPAGESIZE 0x1
-#define TARGET_BIG_SYM moxie_elf32_be_vec
+#define TARGET_BIG_SYM moxie_elf32_be_vec
#define TARGET_BIG_NAME "elf32-bigmoxie"
-#define TARGET_LITTLE_SYM moxie_elf32_le_vec
+#define TARGET_LITTLE_SYM moxie_elf32_le_vec
#define TARGET_LITTLE_NAME "elf32-littlemoxie"
#define elf_info_to_howto_rel NULL
#define elf_info_to_howto moxie_info_to_howto_rela
#define elf_backend_relocate_section moxie_elf_relocate_section
#define elf_backend_gc_mark_hook moxie_elf_gc_mark_hook
-#define elf_backend_check_relocs moxie_elf_check_relocs
+#define elf_backend_check_relocs moxie_elf_check_relocs
#define elf_backend_can_gc_sections 1
#define elf_backend_rela_normal 1
FALSE, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
EMPTY_HOWTO (R_MSP430_EHTYPE),
FALSE, /* partial_inplace */
0x3ff, /* src_mask */
0x3ff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* A 10 bit PC relative relocation for complicated polymorphs. */
HOWTO (R_MSP430X_2X_PCREL, /* type */
static const struct msp430_reloc_map msp430_reloc_map[] =
{
- {BFD_RELOC_NONE, R_MSP430_NONE},
- {BFD_RELOC_32, R_MSP430_32},
- {BFD_RELOC_MSP430_10_PCREL, R_MSP430_10_PCREL},
- {BFD_RELOC_16, R_MSP430_16_BYTE},
- {BFD_RELOC_MSP430_16_PCREL, R_MSP430_16_PCREL},
- {BFD_RELOC_MSP430_16, R_MSP430_16},
+ {BFD_RELOC_NONE, R_MSP430_NONE},
+ {BFD_RELOC_32, R_MSP430_32},
+ {BFD_RELOC_MSP430_10_PCREL, R_MSP430_10_PCREL},
+ {BFD_RELOC_16, R_MSP430_16_BYTE},
+ {BFD_RELOC_MSP430_16_PCREL, R_MSP430_16_PCREL},
+ {BFD_RELOC_MSP430_16, R_MSP430_16},
{BFD_RELOC_MSP430_16_PCREL_BYTE, R_MSP430_16_PCREL_BYTE},
- {BFD_RELOC_MSP430_16_BYTE, R_MSP430_16_BYTE},
- {BFD_RELOC_MSP430_2X_PCREL, R_MSP430_2X_PCREL},
- {BFD_RELOC_MSP430_RL_PCREL, R_MSP430_RL_PCREL},
- {BFD_RELOC_8, R_MSP430_8},
- {BFD_RELOC_MSP430_SYM_DIFF, R_MSP430_SYM_DIFF}
+ {BFD_RELOC_MSP430_16_BYTE, R_MSP430_16_BYTE},
+ {BFD_RELOC_MSP430_2X_PCREL, R_MSP430_2X_PCREL},
+ {BFD_RELOC_MSP430_RL_PCREL, R_MSP430_RL_PCREL},
+ {BFD_RELOC_8, R_MSP430_8},
+ {BFD_RELOC_MSP430_SYM_DIFF, R_MSP430_SYM_DIFF}
};
static const struct msp430_reloc_map msp430x_reloc_map[] =
{
- {BFD_RELOC_NONE, R_MSP430_NONE},
- {BFD_RELOC_32, R_MSP430_ABS32},
- {BFD_RELOC_16, R_MSP430_ABS16},
- {BFD_RELOC_8, R_MSP430_ABS8},
- {BFD_RELOC_MSP430_ABS8, R_MSP430_ABS8},
+ {BFD_RELOC_NONE, R_MSP430_NONE},
+ {BFD_RELOC_32, R_MSP430_ABS32},
+ {BFD_RELOC_16, R_MSP430_ABS16},
+ {BFD_RELOC_8, R_MSP430_ABS8},
+ {BFD_RELOC_MSP430_ABS8, R_MSP430_ABS8},
{BFD_RELOC_MSP430X_PCR20_EXT_SRC, R_MSP430X_PCR20_EXT_SRC},
{BFD_RELOC_MSP430X_PCR20_EXT_DST, R_MSP430X_PCR20_EXT_DST},
{BFD_RELOC_MSP430X_PCR20_EXT_ODST, R_MSP430X_PCR20_EXT_ODST},
{BFD_RELOC_MSP430X_ABS20_EXT_ODST, R_MSP430X_ABS20_EXT_ODST},
{BFD_RELOC_MSP430X_ABS20_ADR_SRC, R_MSP430X_ABS20_ADR_SRC},
{BFD_RELOC_MSP430X_ABS20_ADR_DST, R_MSP430X_ABS20_ADR_DST},
- {BFD_RELOC_MSP430X_PCR16, R_MSP430X_PCR16},
+ {BFD_RELOC_MSP430X_PCR16, R_MSP430X_PCR16},
{BFD_RELOC_MSP430X_PCR20_CALL, R_MSP430X_PCR20_CALL},
- {BFD_RELOC_MSP430X_ABS16, R_MSP430X_ABS16},
- {BFD_RELOC_MSP430_ABS_HI16, R_MSP430_ABS_HI16},
- {BFD_RELOC_MSP430_PREL31, R_MSP430_PREL31},
- {BFD_RELOC_MSP430_10_PCREL, R_MSP430X_10_PCREL},
- {BFD_RELOC_MSP430_2X_PCREL, R_MSP430X_2X_PCREL},
- {BFD_RELOC_MSP430_RL_PCREL, R_MSP430X_PCR16},
- {BFD_RELOC_MSP430_SYM_DIFF, R_MSP430X_SYM_DIFF}
+ {BFD_RELOC_MSP430X_ABS16, R_MSP430X_ABS16},
+ {BFD_RELOC_MSP430_ABS_HI16, R_MSP430_ABS_HI16},
+ {BFD_RELOC_MSP430_PREL31, R_MSP430_PREL31},
+ {BFD_RELOC_MSP430_10_PCREL, R_MSP430X_10_PCREL},
+ {BFD_RELOC_MSP430_2X_PCREL, R_MSP430X_2X_PCREL},
+ {BFD_RELOC_MSP430_RL_PCREL, R_MSP430X_PCR16},
+ {BFD_RELOC_MSP430_SYM_DIFF, R_MSP430X_SYM_DIFF}
};
static inline bfd_boolean
routines, but a few relocs, we have to do them ourselves. */
static bfd_reloc_status_type
-msp430_final_link_relocate (reloc_howto_type * howto,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
- Elf_Internal_Rela * rel,
- bfd_vma relocation,
+msp430_final_link_relocate (reloc_howto_type * howto,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
+ Elf_Internal_Rela * rel,
+ bfd_vma relocation,
struct bfd_link_info * info)
{
static asection * sym_diff_section;
1. 3 words -> 1 word
- eq == jeq label jne +4; br lab
- ne != jne label jeq +4; br lab
- lt < jl label jge +4; br lab
- ltu < jlo label lhs +4; br lab
- ge >= jge label jl +4; br lab
- geu >= jhs label jlo +4; br lab
+ eq == jeq label jne +4; br lab
+ ne != jne label jeq +4; br lab
+ lt < jl label jge +4; br lab
+ ltu < jlo label lhs +4; br lab
+ ge >= jge label jl +4; br lab
+ geu >= jhs label jlo +4; br lab
2. 4 words -> 1 word
- ltn < jn jn +2; jmp +4; br lab
+ ltn < jn jn +2; jmp +4; br lab
3. 4 words -> 2 words
- gt > jeq +2; jge label jeq +6; jl +4; br label
- gtu > jeq +2; jhs label jeq +6; jlo +4; br label
+ gt > jeq +2; jge label jeq +6; jl +4; br label
+ gtu > jeq +2; jhs label jeq +6; jlo +4; br label
4. 4 words -> 2 words and 2 labels
- leu <= jeq label; jlo label jeq +2; jhs +4; br label
- le <= jeq label; jl label jeq +2; jge +4; br label
+ leu <= jeq label; jlo label jeq +2; jhs +4; br label
+ le <= jeq label; jl label jeq +2; jge +4; br label
=================================================================
codemap for first cases is (labels masked ):
int off; /* Offset from old label for new code. */
int ncl; /* New code length. */
} rcode[] =
-{/* lab,cdx,bs,off,ncl */
+{/* lab,cdx,bs,off,ncl */
{ 0x0000, 0x0000, 0x3c00, 0x0000, 1, 0, 2, 2, 2}, /* jump */
{ 0x0000, 0x2002, 0x2400, 0x0000, 1, 1, 4, 4, 2}, /* eq */
{ 0x0000, 0x2402, 0x2000, 0x0000, 1, 1, 4, 4, 2}, /* ne */
{ 0x2403, 0x2802, 0x2401, 0x2c00, 2, 2, 4, 6, 4}, /* gtu */
{ 0x2401, 0x2c02, 0x2400, 0x2800, 3, 2, 4, 6, 4}, /* leu , 2 labels */
{ 0x2401, 0x2c02, 0x2400, 0x2800, 3, 2, 4, 6, 4}, /* le , 2 labels */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0}
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
/* Return TRUE if a symbol exists at the given address. */
Elf_Internal_Rela * internal_relocs;
Elf_Internal_Rela * irel;
Elf_Internal_Rela * irelend;
- bfd_byte * contents = NULL;
+ bfd_byte * contents = NULL;
Elf_Internal_Sym * isymbuf = NULL;
/* Assume nothing changes. */
bfd_vma symval;
/* If this isn't something that can be relaxed, then ignore
- this reloc. */
+ this reloc. */
if (uses_msp430x_relocs (abfd)
- && ELF32_R_TYPE (irel->r_info) == (int) R_MSP430X_10_PCREL)
+ && ELF32_R_TYPE (irel->r_info) == (int) R_MSP430X_10_PCREL)
;
else if (! uses_msp430x_relocs (abfd)
- && ELF32_R_TYPE (irel->r_info) == (int) R_MSP430_10_PCREL)
+ && ELF32_R_TYPE (irel->r_info) == (int) R_MSP430_10_PCREL)
;
else
continue;
}
/* For simplicity of coding, we are going to modify the section
- contents, the section relocs, and the BFD symbol table. We
- must tell the rest of the code not to free up this
- information. It would be possible to instead create a table
- of changes which have to be made, as is done in coff-mips.c;
- that would be more work, but would require less memory when
- the linker is run. */
+ contents, the section relocs, and the BFD symbol table. We
+ must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
bfd_signed_vma value = symval;
int opcode;
into:
J<inv-cond> 1f
BR[A] #label
- 1: */
+ 1: */
switch (opcode & 0xfc00)
{
case 0x3800: opcode = 0x3402; break; /* Jl -> Jge +2 */
case 0x3000: /* jn */
/* There is no direct inverse of the Jn insn.
FIXME: we could do this as:
- Jn 1f
- br 2f
+ Jn 1f
+ br 2f
1: br label
- 2: */
+ 2: */
continue;
default:
/* Not a conditional branch instruction. */
#define elf_backend_may_use_rela_p 1
#define elf_backend_default_use_rela_p 1
-#undef elf_backend_obj_attrs_vendor
+#undef elf_backend_obj_attrs_vendor
#define elf_backend_obj_attrs_vendor "mspabi"
-#undef elf_backend_obj_attrs_section
+#undef elf_backend_obj_attrs_section
#define elf_backend_obj_attrs_section ".MSP430.attributes"
-#undef elf_backend_obj_attrs_section_type
+#undef elf_backend_obj_attrs_section_type
#define elf_backend_obj_attrs_section_type SHT_MSP430_ATTRIBUTES
-#define elf_backend_section_from_shdr elf32_msp430_section_from_shdr
-#define elf_backend_obj_attrs_handle_unknown elf32_msp430_obj_attrs_handle_unknown
-#undef elf_backend_obj_attrs_arg_type
+#define elf_backend_section_from_shdr elf32_msp430_section_from_shdr
+#define elf_backend_obj_attrs_handle_unknown elf32_msp430_obj_attrs_handle_unknown
+#undef elf_backend_obj_attrs_arg_type
#define elf_backend_obj_attrs_arg_type elf32_msp430_obj_attrs_arg_type
#define bfd_elf32_bfd_merge_private_bfd_data elf32_msp430_merge_private_bfd_data
#define elf_backend_eh_frame_address_size elf32_msp430_eh_frame_address_size
#define ELF_MAXPAGESIZE 4
#define ELF_OSABI ELFOSABI_STANDALONE
-#define TARGET_LITTLE_SYM msp430_elf32_vec
+#define TARGET_LITTLE_SYM msp430_elf32_vec
#define TARGET_LITTLE_NAME "elf32-msp430"
-#define elf_info_to_howto msp430_info_to_howto_rela
-#define elf_info_to_howto_rel NULL
-#define elf_backend_relocate_section elf32_msp430_relocate_section
-#define elf_backend_check_relocs elf32_msp430_check_relocs
-#define elf_backend_can_gc_sections 1
+#define elf_info_to_howto msp430_info_to_howto_rela
+#define elf_info_to_howto_rel NULL
+#define elf_backend_relocate_section elf32_msp430_relocate_section
+#define elf_backend_check_relocs elf32_msp430_check_relocs
+#define elf_backend_can_gc_sections 1
#define elf_backend_final_write_processing bfd_elf_msp430_final_write_processing
#define elf_backend_object_p elf32_msp430_object_p
#define bfd_elf32_bfd_relax_section msp430_elf_relax_section
#define bfd_elf32_bfd_is_target_special_symbol msp430_elf_is_target_special_symbol
-#undef elf32_bed
+#undef elf32_bed
#define elf32_bed elf32_msp430_bed
#include "elf32-target.h"
/* The TI compiler sets the OSABI field to ELFOSABI_NONE. */
-#undef TARGET_LITTLE_SYM
-#define TARGET_LITTLE_SYM msp430_elf32_ti_vec
+#undef TARGET_LITTLE_SYM
+#define TARGET_LITTLE_SYM msp430_elf32_ti_vec
-#undef elf32_bed
+#undef elf32_bed
#define elf32_bed elf32_msp430_ti_bed
#undef ELF_OSABI
static const struct bfd_elf_special_section msp430_ti_elf_special_sections[] =
{
- /* prefix, prefix_length, suffix_len, type, attributes. */
+ /* prefix, prefix_length, suffix_len, type, attributes. */
{ STRING_COMMA_LEN (".TI.symbol.alias"), 0, SHT_MSP430_SYM_ALIASES, 0 },
{ STRING_COMMA_LEN (".TI.section.flags"), 0, SHT_MSP430_SEC_FLAGS, 0 },
{ STRING_COMMA_LEN ("_TI_build_attrib"), 0, SHT_MSP430_ATTRIBUTES, 0 },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
-#undef elf_backend_special_sections
-#define elf_backend_special_sections msp430_ti_elf_special_sections
+#undef elf_backend_special_sections
+#define elf_backend_special_sections msp430_ti_elf_special_sections
#include "elf32-target.h"
static reloc_howto_type mt_elf_howto_table [] =
{
/* This reloc does nothing. */
- HOWTO (R_MT_NONE, /* type */
- 0, /* rightshift */
- 3, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_MT_NONE", /* name */
- FALSE, /* partial_inplace */
- 0 , /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_MT_NONE, /* type */
+ 0, /* rightshift */
+ 3, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MT_NONE", /* name */
+ FALSE, /* partial_inplace */
+ 0 , /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* A 16 bit absolute relocation. */
- HOWTO (R_MT_16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_MT_16", /* name */
- FALSE, /* partial_inplace */
- 0 , /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_MT_16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MT_16", /* name */
+ FALSE, /* partial_inplace */
+ 0 , /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* A 32 bit absolute relocation. */
- HOWTO (R_MT_32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_MT_32", /* name */
- FALSE, /* partial_inplace */
- 0 , /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_MT_32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MT_32", /* name */
+ FALSE, /* partial_inplace */
+ 0 , /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* A 32 bit pc-relative relocation. */
- HOWTO (R_MT_32_PCREL, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_MT_32_PCREL", /* name */
- FALSE, /* partial_inplace */
- 0 , /* src_mask */
- 0xffffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOWTO (R_MT_32_PCREL, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MT_32_PCREL", /* name */
+ FALSE, /* partial_inplace */
+ 0 , /* src_mask */
+ 0xffffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
/* A 16 bit pc-relative relocation. */
- HOWTO (R_MT_PC16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_MT_PC16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ HOWTO (R_MT_PC16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MT_PC16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
/* high 16 bits of symbol value. */
- HOWTO (R_MT_HI16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_MT_HI16", /* name */
- FALSE, /* partial_inplace */
- 0xffff0000, /* src_mask */
- 0xffff0000, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_MT_HI16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MT_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff0000, /* src_mask */
+ 0xffff0000, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* Low 16 bits of symbol value. */
- HOWTO (R_MT_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_MT_LO16", /* name */
- FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_MT_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_MT_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0xffff, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
/* Map BFD reloc types to MT ELF reloc types. */
static reloc_howto_type *
mt_reloc_type_lookup
- (bfd * abfd ATTRIBUTE_UNUSED,
+ (bfd * abfd ATTRIBUTE_UNUSED,
bfd_reloc_code_real_type code)
{
/* Note that the mt_elf_howto_table is indxed by the R_
bfd_reloc_status_type
mt_elf_relocate_hi16
- (bfd * input_bfd,
+ (bfd * input_bfd,
Elf_Internal_Rela * relhi,
- bfd_byte * contents,
- bfd_vma value)
+ bfd_byte * contents,
+ bfd_vma value)
{
bfd_vma insn;
static void
mt_info_to_howto_rela
- (bfd * abfd ATTRIBUTE_UNUSED,
- arelent * cache_ptr,
+ (bfd * abfd ATTRIBUTE_UNUSED,
+ arelent * cache_ptr,
Elf_Internal_Rela * dst)
{
unsigned int r_type;
static bfd_reloc_status_type
mt_final_link_relocate
- (reloc_howto_type * howto,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ (reloc_howto_type * howto,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * rel,
- bfd_vma relocation)
+ bfd_vma relocation)
{
return _bfd_final_link_relocate (howto, input_bfd, input_section,
contents, rel->r_offset,
static bfd_boolean
mt_elf_relocate_section
- (bfd * output_bfd ATTRIBUTE_UNUSED,
+ (bfd * output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * relocs,
- Elf_Internal_Sym * local_syms,
- asection ** local_sections)
+ Elf_Internal_Sym * local_syms,
+ asection ** local_sections)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- Elf_Internal_Rela * rel;
- Elf_Internal_Rela * relend;
+ Elf_Internal_Rela * rel;
+ Elf_Internal_Rela * relend;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
for (rel = relocs; rel < relend; rel ++)
{
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- const char * name = NULL;
- int r_type;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char * name = NULL;
+ int r_type;
r_type = ELF32_R_TYPE (rel->r_info);
/* Finally, the sole MT-specific part. */
switch (r_type)
- {
- case R_MT_HI16:
- r = mt_elf_relocate_hi16 (input_bfd, rel, contents, relocation);
- break;
+ {
+ case R_MT_HI16:
+ r = mt_elf_relocate_hi16 (input_bfd, rel, contents, relocation);
+ break;
default:
- r = mt_final_link_relocate (howto, input_bfd, input_section,
- contents, rel, relocation);
- break;
- }
+ r = mt_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel, relocation);
+ break;
+ }
if (r != bfd_reloc_ok)
static bfd_boolean
mt_elf_check_relocs
- (bfd * abfd,
+ (bfd * abfd,
struct bfd_link_info * info,
- asection * sec,
+ asection * sec,
const Elf_Internal_Rela * relocs)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- const Elf_Internal_Rela * rel;
- const Elf_Internal_Rela * rel_end;
+ const Elf_Internal_Rela * rel;
+ const Elf_Internal_Rela * rel_end;
if (bfd_link_relocatable (info))
return TRUE;
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
\f
#define TARGET_BIG_SYM mt_elf32_vec
-#define TARGET_BIG_NAME "elf32-mt"
+#define TARGET_BIG_NAME "elf32-mt"
#define ELF_ARCH bfd_arch_mt
#define ELF_MACHINE_CODE EM_MT
-#define ELF_MAXPAGESIZE 1 /* No pages on the MT. */
+#define ELF_MAXPAGESIZE 1 /* No pages on the MT. */
#define elf_info_to_howto_rel NULL
#define elf_info_to_howto mt_info_to_howto_rela
#define elf_backend_relocate_section mt_elf_relocate_section
-#define bfd_elf32_bfd_reloc_type_lookup mt_reloc_type_lookup
-#define bfd_elf32_bfd_reloc_name_lookup mt_reloc_name_lookup
+#define bfd_elf32_bfd_reloc_type_lookup mt_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_name_lookup mt_reloc_name_lookup
-#define elf_backend_check_relocs mt_elf_check_relocs
-#define elf_backend_object_p mt_elf_object_p
+#define elf_backend_check_relocs mt_elf_check_relocs
+#define elf_backend_object_p mt_elf_object_p
#define elf_backend_rela_normal 1
#define elf_backend_can_gc_sections 1
/* The first entry in a procedure linkage table are reserved,
and the initial contents are unimportant (we zero them out).
Subsequent entries look like this. */
-#define PLT0_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(.got+4) */
-#define PLT0_ENTRY_WORD1 0x58f78000 /* ori r15, r25, LO12(.got+4) */
-#define PLT0_ENTRY_WORD2 0x05178000 /* lwi r17, [r15+0] */
-#define PLT0_ENTRY_WORD3 0x04f78001 /* lwi r15, [r15+4] */
-#define PLT0_ENTRY_WORD4 0x4a003c00 /* jr r15 */
+#define PLT0_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(.got+4) */
+#define PLT0_ENTRY_WORD1 0x58f78000 /* ori r15, r25, LO12(.got+4) */
+#define PLT0_ENTRY_WORD2 0x05178000 /* lwi r17, [r15+0] */
+#define PLT0_ENTRY_WORD3 0x04f78001 /* lwi r15, [r15+4] */
+#define PLT0_ENTRY_WORD4 0x4a003c00 /* jr r15 */
/* $ta is change to $r15 (from $r25). */
#define PLT0_PIC_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(got[1]@GOT) */
-#define PLT0_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[1]@GOT) */
-#define PLT0_PIC_ENTRY_WORD2 0x40f7f400 /* add r15, gp, r15 */
-#define PLT0_PIC_ENTRY_WORD3 0x05178000 /* lwi r17, [r15+0] */
-#define PLT0_PIC_ENTRY_WORD4 0x04f78001 /* lwi r15, [r15+4] */
-#define PLT0_PIC_ENTRY_WORD5 0x4a003c00 /* jr r15 */
-
-#define PLT_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(&got[n+3]) */
-#define PLT_ENTRY_WORD1 0x04f78000 /* lwi r15, r15, LO12(&got[n+3]) */
-#define PLT_ENTRY_WORD2 0x4a003c00 /* jr r15 */
-#define PLT_ENTRY_WORD3 0x45000000 /* movi r16, sizeof(RELA) * n */
-#define PLT_ENTRY_WORD4 0x48000000 /* j .plt0. */
+#define PLT0_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[1]@GOT) */
+#define PLT0_PIC_ENTRY_WORD2 0x40f7f400 /* add r15, gp, r15 */
+#define PLT0_PIC_ENTRY_WORD3 0x05178000 /* lwi r17, [r15+0] */
+#define PLT0_PIC_ENTRY_WORD4 0x04f78001 /* lwi r15, [r15+4] */
+#define PLT0_PIC_ENTRY_WORD5 0x4a003c00 /* jr r15 */
+
+#define PLT_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(&got[n+3]) */
+#define PLT_ENTRY_WORD1 0x04f78000 /* lwi r15, r15, LO12(&got[n+3]) */
+#define PLT_ENTRY_WORD2 0x4a003c00 /* jr r15 */
+#define PLT_ENTRY_WORD3 0x45000000 /* movi r16, sizeof(RELA) * n */
+#define PLT_ENTRY_WORD4 0x48000000 /* j .plt0. */
#define PLT_PIC_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(got[n+3]@GOT) */
-#define PLT_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[n+3]@GOT) */
-#define PLT_PIC_ENTRY_WORD2 0x38febc02 /* lw r15, [gp+r15] */
-#define PLT_PIC_ENTRY_WORD3 0x4a003c00 /* jr r15 */
-#define PLT_PIC_ENTRY_WORD4 0x45000000 /* movi r16, sizeof(RELA) * n */
-#define PLT_PIC_ENTRY_WORD5 0x48000000 /* j .plt0 */
+#define PLT_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[n+3]@GOT) */
+#define PLT_PIC_ENTRY_WORD2 0x38febc02 /* lw r15, [gp+r15] */
+#define PLT_PIC_ENTRY_WORD3 0x4a003c00 /* jr r15 */
+#define PLT_PIC_ENTRY_WORD4 0x45000000 /* movi r16, sizeof(RELA) * n */
+#define PLT_PIC_ENTRY_WORD5 0x48000000 /* j .plt0 */
/* These are macros used to get the relocation accurate value. */
#define ACCURATE_8BIT_S1 (0x100)
}
static bfd_boolean
-nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
+nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
- Elf_Internal_Rela * relocs,
- Elf_Internal_Sym * local_syms,
- asection ** local_sections)
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
+ Elf_Internal_Rela * relocs,
+ Elf_Internal_Sym * local_syms,
+ asection ** local_sections)
{
Elf_Internal_Shdr *symtab_hdr;
struct elf_link_hash_entry **sym_hashes;
{
/* There are 3 variations for LONGCALL1
case 4-4-2; 16-bit on, optimize off or optimize for space
- sethi ta, hi20(symbol) ; LONGCALL1/HI20
+ sethi ta, hi20(symbol) ; LONGCALL1/HI20
ori ta, ta, lo12(symbol) ; LO12S0
- jral5 ta ;
+ jral5 ta ;
case 4-4-4; 16-bit off, optimize don't care
- sethi ta, hi20(symbol) ; LONGCALL1/HI20
+ sethi ta, hi20(symbol) ; LONGCALL1/HI20
ori ta, ta, lo12(symbol) ; LO12S0
- jral ta ;
+ jral ta ;
case 4-4-4; 16-bit on, optimize for speed
- sethi ta, hi20(symbol) ; LONGCALL1/HI20
+ sethi ta, hi20(symbol) ; LONGCALL1/HI20
ori ta, ta, lo12(symbol) ; LO12S0
- jral ta ;
+ jral ta ;
Check code for -mlong-calls output. */
/* Get the reloc for the address from which the register is
{
/* There are 3 variations for LONGCALL3
case 4-4-4-2; 16-bit on, optimize off or optimize for space
- bltz rt, $1 ; LONGCALL3
- sethi ta, hi20(symbol) ; HI20
+ bltz rt, $1 ; LONGCALL3
+ sethi ta, hi20(symbol) ; HI20
ori ta, ta, lo12(symbol) ; LO12S0
- jral5 ta ;
+ jral5 ta ;
$1
case 4-4-4-4; 16-bit off, optimize don't care
- bltz rt, $1 ; LONGCALL3
- sethi ta, hi20(symbol) ; HI20
+ bltz rt, $1 ; LONGCALL3
+ sethi ta, hi20(symbol) ; HI20
ori ta, ta, lo12(symbol) ; LO12S0
- jral ta ;
+ jral ta ;
$1
case 4-4-4-4; 16-bit on, optimize for speed
- bltz rt, $1 ; LONGCALL3
- sethi ta, hi20(symbol) ; HI20
+ bltz rt, $1 ; LONGCALL3
+ sethi ta, hi20(symbol) ; HI20
ori ta, ta, lo12(symbol) ; LO12S0
- jral ta ;
+ jral ta ;
$1 */
/* Get the reloc for the address from which the register is
{
/* There are 3 variations for LONGJUMP1
case 4-4-2; 16-bit bit on, optimize off or optimize for space
- sethi ta, hi20(symbol) ; LONGJUMP1/HI20
- ori ta, ta, lo12(symbol) ; LO12S0
- jr5 ta ;
+ sethi ta, hi20(symbol) ; LONGJUMP1/HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jr5 ta ;
case 4-4-4; 16-bit off, optimize don't care
- sethi ta, hi20(symbol) ; LONGJUMP1/HI20
- ori ta, ta, lo12(symbol) ; LO12S0
- jr ta ;
+ sethi ta, hi20(symbol) ; LONGJUMP1/HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jr ta ;
case 4-4-4; 16-bit on, optimize for speed
- sethi ta, hi20(symbol) ; LONGJUMP1/HI20
- ori ta, ta, lo12(symbol) ; LO12S0
- jr ta ; */
+ sethi ta, hi20(symbol) ; LONGJUMP1/HI20
+ ori ta, ta, lo12(symbol) ; LO12S0
+ jr ta ; */
/* Get the reloc for the address from which the register is
being loaded. This reloc will tell us which function is
/* There are 5 variations for LONGJUMP3
case 1: 2-4-4-2; 1st insn convertible, 16-bit on,
optimize off or optimize for space
- bnes38 rt, ra, $1 ; LONGJUMP3
- sethi ta, hi20(symbol) ; HI20
+ bnes38 rt, ra, $1 ; LONGJUMP3
+ sethi ta, hi20(symbol) ; HI20
ori ta, ta, lo12(symbol) ; LO12S0
- jr5 ta ;
- $1: ;
+ jr5 ta ;
+ $1: ;
case 2: 2-4-4-2; 1st insn convertible, 16-bit on, optimize for speed
- bnes38 rt, ra, $1 ; LONGJUMP3
- sethi ta, hi20(symbol) ; HI20
+ bnes38 rt, ra, $1 ; LONGJUMP3
+ sethi ta, hi20(symbol) ; HI20
ori ta, ta, lo12(symbol) ; LO12S0
- jr5 ta ;
- $1: ; LABEL
+ jr5 ta ;
+ $1: ; LABEL
case 3: 4-4-4-2; 1st insn not convertible, 16-bit on,
optimize off or optimize for space
- bne rt, ra, $1 ; LONGJUMP3
- sethi ta, hi20(symbol) ; HI20
+ bne rt, ra, $1 ; LONGJUMP3
+ sethi ta, hi20(symbol) ; HI20
ori ta, ta, lo12(symbol) ; LO12S0
- jr5 ta ;
- $1: ;
+ jr5 ta ;
+ $1: ;
case 4: 4-4-4-4; 1st insn don't care, 16-bit off, optimize don't care
16-bit off if no INSN16
- bne rt, ra, $1 ; LONGJUMP3
- sethi ta, hi20(symbol) ; HI20
+ bne rt, ra, $1 ; LONGJUMP3
+ sethi ta, hi20(symbol) ; HI20
ori ta, ta, lo12(symbol) ; LO12S0
- jr ta ;
- $1: ;
+ jr ta ;
+ $1: ;
case 5: 4-4-4-4; 1st insn not convertible, 16-bit on, optimize for speed
16-bit off if no INSN16
- bne rt, ra, $1 ; LONGJUMP3
- sethi ta, hi20(symbol) ; HI20
+ bne rt, ra, $1 ; LONGJUMP3
+ sethi ta, hi20(symbol) ; HI20
ori ta, ta, lo12(symbol) ; LO12S0
- jr ta ;
- $1: ; LABEL */
+ jr ta ;
+ $1: ; LABEL */
/* Get the reloc for the address from which the register is
being loaded. This reloc will tell us which function is
Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again)
{
/* Local TLS non-pic
- sethi ta, hi20(symbol@tpoff) ; TLS_LE_HI20
+ sethi ta, hi20(symbol@tpoff) ; TLS_LE_HI20
ori ta, ta, lo12(symbol@tpoff) ; TLS_LE_LO12
- add ra, ta, tp ; TLS_LE_ADD */
+ add ra, ta, tp ; TLS_LE_ADD */
uint32_t insn;
bfd_vma laddr;
#define ELF_ARCH bfd_arch_nds32
#define ELF_MACHINE_CODE EM_NDS32
#define ELF_MAXPAGESIZE 0x1000
-#define ELF_TARGET_ID NDS32_ELF_DATA
+#define ELF_TARGET_ID NDS32_ELF_DATA
#define TARGET_BIG_SYM nds32_elf32_be_vec
#define TARGET_BIG_NAME "elf32-nds32be"
#define bfd_elf32_bfd_relax_section nds32_elf_relax_section
#define bfd_elf32_bfd_set_private_flags nds32_elf_set_private_flags
-#define bfd_elf32_mkobject nds32_elf_mkobject
+#define bfd_elf32_mkobject nds32_elf_mkobject
#define elf_backend_action_discarded nds32_elf_action_discarded
#define elf_backend_add_symbol_hook nds32_elf_add_symbol_hook
#define elf_backend_check_relocs nds32_elf_check_relocs
#define elf_backend_final_write_processing nds32_elf_final_write_processing
#define elf_backend_special_sections nds32_elf_special_sections
#define bfd_elf32_bfd_get_relocated_section_contents \
- nds32_elf_get_relocated_section_contents
+ nds32_elf_get_relocated_section_contents
#define elf_backend_can_gc_sections 1
#define elf_backend_can_refcount 1
extern void nds32_insertion_sort
(void *, size_t, size_t, int (*) (const void *, const void *));
-extern int nds32_elf_ex9_init (void);
-extern int nds32_convert_32_to_16 (bfd *, uint32_t, uint16_t *, int *);
-extern int nds32_convert_16_to_32 (bfd *, uint16_t, uint32_t *);
-extern void bfd_elf32_nds32_set_target_option (struct bfd_link_info *,
+extern int nds32_elf_ex9_init (void);
+extern int nds32_convert_32_to_16 (bfd *, uint32_t, uint16_t *, int *);
+extern int nds32_convert_16_to_32 (bfd *, uint16_t, uint32_t *);
+extern void bfd_elf32_nds32_set_target_option (struct bfd_link_info *,
int, int, FILE *, int,
int, int, int, FILE *,
FILE *, int, int,
TRUE,
6,
complain_overflow_signed,
- bfd_elf_generic_reloc, /* FIXME? */
+ bfd_elf_generic_reloc, /* FIXME? */
"R_NIOS2_R2_I10_1_PCREL",
FALSE,
0xffc0,
static reloc_howto_type or1k_elf_howto_table[] =
{
/* This reloc does nothing. */
- HOWTO (R_OR1K_NONE, /* type */
- 0, /* rightshift */
- 3, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_NONE", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_OR1K_NONE, /* type */
+ 0, /* rightshift */
+ 3, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_NONE", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (R_OR1K_32,
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_32", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_32", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (R_OR1K_16,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (R_OR1K_8,
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_unsigned, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_8", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_unsigned, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_8", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xff, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (R_OR1K_LO_16_IN_INSN, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_LO_16_IN_INSN", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_LO_16_IN_INSN", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (R_OR1K_HI_16_IN_INSN, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_HI_16_IN_INSN", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_HI_16_IN_INSN", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* A PC relative 26 bit relocation, right shifted by 2. */
HOWTO (R_OR1K_INSN_REL_26, /* type */
- 2, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 26, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_INSN_REL_26", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0x03ffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 26, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_INSN_REL_26", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0x03ffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_OR1K_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_OR1K_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_OR1K_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage. */
HOWTO (R_OR1K_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_OR1K_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_OR1K_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
HOWTO (R_OR1K_32_PCREL,
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_32_PCREL", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffffffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_32_PCREL", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
HOWTO (R_OR1K_16_PCREL,
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_16_PCREL", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_16_PCREL", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ TRUE), /* pcrel_offset */
HOWTO (R_OR1K_8_PCREL,
- 0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_8_PCREL", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xff, /* dst_mask */
- TRUE), /* pcrel_offset */
-
- HOWTO (R_OR1K_GOTPC_HI16, /* Type. */
- 16, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc, /* Special Function. */
- "R_OR1K_GOTPC_HI16", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0xffff, /* Dest Mask. */
- TRUE), /* PC relative offset? */
-
- HOWTO (R_OR1K_GOTPC_LO16, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc, /* Special Function. */
- "R_OR1K_GOTPC_LO16", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0xffff, /* Dest Mask. */
- TRUE), /* PC relative offset? */
-
- HOWTO (R_OR1K_GOT16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_GOT16", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_8_PCREL", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xff, /* dst_mask */
+ TRUE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_GOTPC_HI16, /* Type. */
+ 16, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc, /* Special Function. */
+ "R_OR1K_GOTPC_HI16", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0xffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
+
+ HOWTO (R_OR1K_GOTPC_LO16, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc, /* Special Function. */
+ "R_OR1K_GOTPC_LO16", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0xffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
+
+ HOWTO (R_OR1K_GOT16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_GOT16", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* A 26 bit PLT relocation. Shifted by 2. */
- HOWTO (R_OR1K_PLT26, /* Type. */
- 2, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 26, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
- complain_overflow_dont, /* Complain on overflow. */
- bfd_elf_generic_reloc,/* Special Function. */
- "R_OR1K_PLT26", /* Name. */
- FALSE, /* Partial Inplace. */
- 0, /* Source Mask. */
- 0x03ffffff, /* Dest Mask. */
- TRUE), /* PC relative offset? */
-
- HOWTO (R_OR1K_GOTOFF_HI16, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_GOTOFF_HI16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_GOTOFF_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_GOTOFF_LO16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_COPY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_COPY", /* name */
- FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_GLOB_DAT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_GLOB_DAT", /* name */
- FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_JMP_SLOT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_JMP_SLOT", /* name */
- FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_RELATIVE, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_RELATIVE", /* name */
- FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_TLS_GD_HI16, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_TLS_GD_HI16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_TLS_GD_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_TLS_GD_LO16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_TLS_LDM_HI16, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_TLS_LDM_HI16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_TLS_LDM_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_TLS_LDM_LO16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_TLS_LDO_HI16, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_TLS_LDO_HI16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_TLS_LDO_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_TLS_LDO_LO16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_TLS_IE_HI16, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_TLS_IE_HI16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_TLS_IE_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_TLS_IE_LO16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_TLS_LE_HI16, /* type */
- 16, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_TLS_LE_HI16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_OR1K_TLS_LE_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_OR1K_TLS_LE_LO16", /* name */
- FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_OR1K_PLT26, /* Type. */
+ 2, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 26, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
+ complain_overflow_dont, /* Complain on overflow. */
+ bfd_elf_generic_reloc,/* Special Function. */
+ "R_OR1K_PLT26", /* Name. */
+ FALSE, /* Partial Inplace. */
+ 0, /* Source Mask. */
+ 0x03ffffff, /* Dest Mask. */
+ TRUE), /* PC relative offset? */
+
+ HOWTO (R_OR1K_GOTOFF_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_GOTOFF_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_GOTOFF_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_GOTOFF_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_COPY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_COPY", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_GLOB_DAT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_GLOB_DAT", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_JMP_SLOT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_JMP_SLOT", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_RELATIVE, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_RELATIVE", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_GD_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_GD_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_GD_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_GD_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LDM_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LDM_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LDM_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LDM_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LDO_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LDO_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LDO_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LDO_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_IE_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_IE_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_IE_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_IE_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LE_HI16, /* type */
+ 16, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LE_HI16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_OR1K_TLS_LE_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_OR1K_TLS_LE_LO16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0, /* src_mask */
+ 0xffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
static const struct or1k_reloc_map or1k_reloc_map[] =
{
- { BFD_RELOC_NONE, R_OR1K_NONE },
- { BFD_RELOC_32, R_OR1K_32 },
- { BFD_RELOC_16, R_OR1K_16 },
- { BFD_RELOC_8, R_OR1K_8 },
- { BFD_RELOC_LO16, R_OR1K_LO_16_IN_INSN },
- { BFD_RELOC_HI16, R_OR1K_HI_16_IN_INSN },
- { BFD_RELOC_OR1K_REL_26, R_OR1K_INSN_REL_26 },
- { BFD_RELOC_VTABLE_ENTRY, R_OR1K_GNU_VTENTRY },
- { BFD_RELOC_VTABLE_INHERIT, R_OR1K_GNU_VTINHERIT },
- { BFD_RELOC_32_PCREL, R_OR1K_32_PCREL },
- { BFD_RELOC_16_PCREL, R_OR1K_16_PCREL },
- { BFD_RELOC_8_PCREL, R_OR1K_8_PCREL },
- { BFD_RELOC_OR1K_GOTPC_HI16, R_OR1K_GOTPC_HI16 },
- { BFD_RELOC_OR1K_GOTPC_LO16, R_OR1K_GOTPC_LO16 },
- { BFD_RELOC_OR1K_GOT16, R_OR1K_GOT16 },
- { BFD_RELOC_OR1K_PLT26, R_OR1K_PLT26 },
+ { BFD_RELOC_NONE, R_OR1K_NONE },
+ { BFD_RELOC_32, R_OR1K_32 },
+ { BFD_RELOC_16, R_OR1K_16 },
+ { BFD_RELOC_8, R_OR1K_8 },
+ { BFD_RELOC_LO16, R_OR1K_LO_16_IN_INSN },
+ { BFD_RELOC_HI16, R_OR1K_HI_16_IN_INSN },
+ { BFD_RELOC_OR1K_REL_26, R_OR1K_INSN_REL_26 },
+ { BFD_RELOC_VTABLE_ENTRY, R_OR1K_GNU_VTENTRY },
+ { BFD_RELOC_VTABLE_INHERIT, R_OR1K_GNU_VTINHERIT },
+ { BFD_RELOC_32_PCREL, R_OR1K_32_PCREL },
+ { BFD_RELOC_16_PCREL, R_OR1K_16_PCREL },
+ { BFD_RELOC_8_PCREL, R_OR1K_8_PCREL },
+ { BFD_RELOC_OR1K_GOTPC_HI16, R_OR1K_GOTPC_HI16 },
+ { BFD_RELOC_OR1K_GOTPC_LO16, R_OR1K_GOTPC_LO16 },
+ { BFD_RELOC_OR1K_GOT16, R_OR1K_GOT16 },
+ { BFD_RELOC_OR1K_PLT26, R_OR1K_PLT26 },
{ BFD_RELOC_OR1K_GOTOFF_HI16, R_OR1K_GOTOFF_HI16 },
{ BFD_RELOC_OR1K_GOTOFF_LO16, R_OR1K_GOTOFF_LO16 },
- { BFD_RELOC_OR1K_GLOB_DAT, R_OR1K_GLOB_DAT },
- { BFD_RELOC_OR1K_COPY, R_OR1K_COPY },
- { BFD_RELOC_OR1K_JMP_SLOT, R_OR1K_JMP_SLOT },
- { BFD_RELOC_OR1K_RELATIVE, R_OR1K_RELATIVE },
+ { BFD_RELOC_OR1K_GLOB_DAT, R_OR1K_GLOB_DAT },
+ { BFD_RELOC_OR1K_COPY, R_OR1K_COPY },
+ { BFD_RELOC_OR1K_JMP_SLOT, R_OR1K_JMP_SLOT },
+ { BFD_RELOC_OR1K_RELATIVE, R_OR1K_RELATIVE },
{ BFD_RELOC_OR1K_TLS_GD_HI16, R_OR1K_TLS_GD_HI16 },
{ BFD_RELOC_OR1K_TLS_GD_LO16, R_OR1K_TLS_GD_LO16 },
- { BFD_RELOC_OR1K_TLS_LDM_HI16, R_OR1K_TLS_LDM_HI16 },
- { BFD_RELOC_OR1K_TLS_LDM_LO16, R_OR1K_TLS_LDM_LO16 },
- { BFD_RELOC_OR1K_TLS_LDO_HI16, R_OR1K_TLS_LDO_HI16 },
- { BFD_RELOC_OR1K_TLS_LDO_LO16, R_OR1K_TLS_LDO_LO16 },
+ { BFD_RELOC_OR1K_TLS_LDM_HI16, R_OR1K_TLS_LDM_HI16 },
+ { BFD_RELOC_OR1K_TLS_LDM_LO16, R_OR1K_TLS_LDM_LO16 },
+ { BFD_RELOC_OR1K_TLS_LDO_HI16, R_OR1K_TLS_LDO_HI16 },
+ { BFD_RELOC_OR1K_TLS_LDO_LO16, R_OR1K_TLS_LDO_LO16 },
{ BFD_RELOC_OR1K_TLS_IE_HI16, R_OR1K_TLS_IE_HI16 },
{ BFD_RELOC_OR1K_TLS_IE_LO16, R_OR1K_TLS_IE_LO16 },
{ BFD_RELOC_OR1K_TLS_LE_HI16, R_OR1K_TLS_LE_HI16 },
#define TLS_UNKNOWN 0
#define TLS_NONE 1
-#define TLS_GD 2
-#define TLS_LD 3
-#define TLS_IE 4
-#define TLS_LE 5
+#define TLS_GD 2
+#define TLS_LD 3
+#define TLS_IE 4
+#define TLS_LE 5
/* ELF linker hash entry. */
struct elf_or1k_link_hash_entry
elf_or1k_mkobject (bfd *abfd)
{
return bfd_elf_allocate_object (abfd, sizeof (struct elf_or1k_obj_tdata),
- OR1K_ELF_DATA);
+ OR1K_ELF_DATA);
}
/* Create an entry in an or1k ELF linker hash table. */
static struct bfd_hash_entry *
or1k_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table,
- const char *string)
+ struct bfd_hash_table *table,
+ const char *string)
{
struct elf_or1k_link_hash_entry *ret =
(struct elf_or1k_link_hash_entry *) entry;
subclass. */
if (ret == NULL)
ret = bfd_hash_allocate (table,
- sizeof (struct elf_or1k_link_hash_entry));
+ sizeof (struct elf_or1k_link_hash_entry));
if (ret == NULL)
return NULL;
/* Call the allocation method of the superclass. */
ret = ((struct elf_or1k_link_hash_entry *)
- _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
- table, string));
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret,
+ table, string));
if (ret != NULL)
{
struct elf_or1k_link_hash_entry *eh;
return NULL;
if (!_bfd_elf_link_hash_table_init (&ret->root, abfd,
- or1k_elf_link_hash_newfunc,
- sizeof (struct elf_or1k_link_hash_entry),
- OR1K_ELF_DATA))
+ or1k_elf_link_hash_newfunc,
+ sizeof (struct elf_or1k_link_hash_entry),
+ OR1K_ELF_DATA))
{
free (ret);
return NULL;
for (i = 0;
i < (sizeof (or1k_elf_howto_table)
- / sizeof (or1k_elf_howto_table[0]));
+ / sizeof (or1k_elf_howto_table[0]));
i++)
if (or1k_elf_howto_table[i].name != NULL
- && strcasecmp (or1k_elf_howto_table[i].name, r_name) == 0)
+ && strcasecmp (or1k_elf_howto_table[i].name, r_name) == 0)
return &or1k_elf_howto_table[i];
return NULL;
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_type == R_OR1K_GNU_VTINHERIT
- || r_type == R_OR1K_GNU_VTENTRY)
- continue;
+ || r_type == R_OR1K_GNU_VTENTRY)
+ continue;
if (r_type < 0 || r_type >= (int) R_OR1K_max)
- {
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
howto = or1k_elf_howto_table + ELF32_R_TYPE (rel->r_info);
h = NULL;
sec = NULL;
if (r_symndx < symtab_hdr->sh_info)
- {
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
-
- name = bfd_elf_string_from_elf_section
- (input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
- }
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+
+ name = bfd_elf_string_from_elf_section
+ (input_bfd, symtab_hdr->sh_link, sym->st_name);
+ name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ }
else
- {
- bfd_boolean unresolved_reloc, warned, ignored;
+ {
+ bfd_boolean unresolved_reloc, warned, ignored;
- RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
- r_symndx, symtab_hdr, sym_hashes,
- h, sec, relocation,
- unresolved_reloc, warned, ignored);
- }
+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+ r_symndx, symtab_hdr, sym_hashes,
+ h, sec, relocation,
+ unresolved_reloc, warned, ignored);
+ }
if (sec != NULL && discarded_section (sec))
- RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
- rel, 1, relend, howto, 0, contents);
+ RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
+ rel, 1, relend, howto, 0, contents);
if (bfd_link_relocatable (info))
- continue;
+ continue;
switch (howto->type)
- {
- case R_OR1K_PLT26:
- {
- if (htab->root.splt != NULL && h != NULL
- && h->plt.offset != (bfd_vma) -1)
- {
- relocation = (htab->root.splt->output_section->vma
- + htab->root.splt->output_offset
- + h->plt.offset);
- }
- break;
- }
-
- case R_OR1K_GOT16:
- /* Relocation is to the entry for this symbol in the global
- offset table. */
- BFD_ASSERT (sgot != NULL);
- if (h != NULL)
- {
- bfd_boolean dyn;
- bfd_vma off;
-
- off = h->got.offset;
- BFD_ASSERT (off != (bfd_vma) -1);
-
- dyn = htab->root.dynamic_sections_created;
- if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
+ {
+ case R_OR1K_PLT26:
+ {
+ if (htab->root.splt != NULL && h != NULL
+ && h->plt.offset != (bfd_vma) -1)
+ {
+ relocation = (htab->root.splt->output_section->vma
+ + htab->root.splt->output_offset
+ + h->plt.offset);
+ }
+ break;
+ }
+
+ case R_OR1K_GOT16:
+ /* Relocation is to the entry for this symbol in the global
+ offset table. */
+ BFD_ASSERT (sgot != NULL);
+ if (h != NULL)
+ {
+ bfd_boolean dyn;
+ bfd_vma off;
+
+ off = h->got.offset;
+ BFD_ASSERT (off != (bfd_vma) -1);
+
+ dyn = htab->root.dynamic_sections_created;
+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
bfd_link_pic (info),
h)
- || (bfd_link_pic (info)
- && SYMBOL_REFERENCES_LOCAL (info, h)))
- {
- /* This is actually a static link, or it is a
- -Bsymbolic link and the symbol is defined
- locally, or the symbol was forced to be local
- because of a version file. We must initialize
- this entry in the global offset table. Since the
- offset must always be a multiple of 4, we use the
- least significant bit to record whether we have
- initialized it already.
-
- When doing a dynamic link, we create a .rela.got
- relocation entry to initialize the value. This
- is done in the finish_dynamic_symbol routine. */
- if ((off & 1) != 0)
- off &= ~1;
- else
- {
- /* Write entry in GOT. */
- bfd_put_32 (output_bfd, relocation,
- sgot->contents + off);
- /* Mark GOT entry as having been written. */
- h->got.offset |= 1;
- }
- }
-
- relocation = sgot->output_offset + off;
- }
- else
- {
- bfd_vma off;
- bfd_byte *loc;
-
- BFD_ASSERT (local_got_offsets != NULL
- && local_got_offsets[r_symndx] != (bfd_vma) -1);
-
- /* Get offset into GOT table. */
- off = local_got_offsets[r_symndx];
-
- /* The offset must always be a multiple of 4. We use
- the least significant bit to record whether we have
- already processed this entry. */
- if ((off & 1) != 0)
- off &= ~1;
- else
- {
- /* Write entry in GOT. */
- bfd_put_32 (output_bfd, relocation, sgot->contents + off);
- if (bfd_link_pic (info))
- {
- asection *srelgot;
- Elf_Internal_Rela outrel;
-
- /* We need to generate a R_OR1K_RELATIVE reloc
- for the dynamic linker. */
- srelgot = htab->root.srelgot;
- BFD_ASSERT (srelgot != NULL);
-
- outrel.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + off);
- outrel.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE);
- outrel.r_addend = relocation;
- loc = srelgot->contents;
- loc += srelgot->reloc_count * sizeof (Elf32_External_Rela);
- bfd_elf32_swap_reloca_out (output_bfd, &outrel,loc);
- ++srelgot->reloc_count;
- }
-
- local_got_offsets[r_symndx] |= 1;
- }
- relocation = sgot->output_offset + off;
- }
-
- /* Addend should be zero. */
- if (rel->r_addend != 0)
+ || (bfd_link_pic (info)
+ && SYMBOL_REFERENCES_LOCAL (info, h)))
+ {
+ /* This is actually a static link, or it is a
+ -Bsymbolic link and the symbol is defined
+ locally, or the symbol was forced to be local
+ because of a version file. We must initialize
+ this entry in the global offset table. Since the
+ offset must always be a multiple of 4, we use the
+ least significant bit to record whether we have
+ initialized it already.
+
+ When doing a dynamic link, we create a .rela.got
+ relocation entry to initialize the value. This
+ is done in the finish_dynamic_symbol routine. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ /* Write entry in GOT. */
+ bfd_put_32 (output_bfd, relocation,
+ sgot->contents + off);
+ /* Mark GOT entry as having been written. */
+ h->got.offset |= 1;
+ }
+ }
+
+ relocation = sgot->output_offset + off;
+ }
+ else
+ {
+ bfd_vma off;
+ bfd_byte *loc;
+
+ BFD_ASSERT (local_got_offsets != NULL
+ && local_got_offsets[r_symndx] != (bfd_vma) -1);
+
+ /* Get offset into GOT table. */
+ off = local_got_offsets[r_symndx];
+
+ /* The offset must always be a multiple of 4. We use
+ the least significant bit to record whether we have
+ already processed this entry. */
+ if ((off & 1) != 0)
+ off &= ~1;
+ else
+ {
+ /* Write entry in GOT. */
+ bfd_put_32 (output_bfd, relocation, sgot->contents + off);
+ if (bfd_link_pic (info))
+ {
+ asection *srelgot;
+ Elf_Internal_Rela outrel;
+
+ /* We need to generate a R_OR1K_RELATIVE reloc
+ for the dynamic linker. */
+ srelgot = htab->root.srelgot;
+ BFD_ASSERT (srelgot != NULL);
+
+ outrel.r_offset = (sgot->output_section->vma
+ + sgot->output_offset
+ + off);
+ outrel.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE);
+ outrel.r_addend = relocation;
+ loc = srelgot->contents;
+ loc += srelgot->reloc_count * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel,loc);
+ ++srelgot->reloc_count;
+ }
+
+ local_got_offsets[r_symndx] |= 1;
+ }
+ relocation = sgot->output_offset + off;
+ }
+
+ /* Addend should be zero. */
+ if (rel->r_addend != 0)
_bfd_error_handler
- (_("internal error: addend should be zero for R_OR1K_GOT16"));
+ (_("internal error: addend should be zero for R_OR1K_GOT16"));
- break;
+ break;
- case R_OR1K_GOTOFF_LO16:
- case R_OR1K_GOTOFF_HI16:
- /* Relocation is offset from GOT. */
- BFD_ASSERT (sgot != NULL);
+ case R_OR1K_GOTOFF_LO16:
+ case R_OR1K_GOTOFF_HI16:
+ /* Relocation is offset from GOT. */
+ BFD_ASSERT (sgot != NULL);
relocation
-= (htab->root.hgot->root.u.def.value
+ htab->root.hgot->root.u.def.section->output_offset
+ htab->root.hgot->root.u.def.section->output_section->vma);
- break;
-
- case R_OR1K_INSN_REL_26:
- case R_OR1K_HI_16_IN_INSN:
- case R_OR1K_LO_16_IN_INSN:
- case R_OR1K_32:
- /* R_OR1K_16? */
- {
- /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols
- from removed linkonce sections, or sections discarded by
- a linker script. */
- if (r_symndx == STN_UNDEF
- || (input_section->flags & SEC_ALLOC) == 0)
- break;
-
- if ((bfd_link_pic (info)
- && (h == NULL
- || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
+ break;
+
+ case R_OR1K_INSN_REL_26:
+ case R_OR1K_HI_16_IN_INSN:
+ case R_OR1K_LO_16_IN_INSN:
+ case R_OR1K_32:
+ /* R_OR1K_16? */
+ {
+ /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols
+ from removed linkonce sections, or sections discarded by
+ a linker script. */
+ if (r_symndx == STN_UNDEF
+ || (input_section->flags & SEC_ALLOC) == 0)
+ break;
+
+ if ((bfd_link_pic (info)
+ && (h == NULL
+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak)
&& (howto->type != R_OR1K_INSN_REL_26
|| !SYMBOL_CALLS_LOCAL (info, h)))
- || (!bfd_link_pic (info)
- && h != NULL
- && h->dynindx != -1
- && !h->non_got_ref
- && ((h->def_dynamic
- && !h->def_regular)
- || h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_undefined)))
- {
- Elf_Internal_Rela outrel;
- bfd_byte *loc;
- bfd_boolean skip;
-
- /* When generating a shared object, these relocations
- are copied into the output file to be resolved at run
- time. */
-
- BFD_ASSERT (sreloc != NULL);
-
- skip = FALSE;
-
- outrel.r_offset =
- _bfd_elf_section_offset (output_bfd, info, input_section,
- rel->r_offset);
- if (outrel.r_offset == (bfd_vma) -1)
- skip = TRUE;
- else if (outrel.r_offset == (bfd_vma) -2)
- skip = TRUE;
- outrel.r_offset += (input_section->output_section->vma
- + input_section->output_offset);
-
- if (skip)
- memset (&outrel, 0, sizeof outrel);
- /* h->dynindx may be -1 if the symbol was marked to
- become local. */
- else if (h != NULL
- && ((! info->symbolic && h->dynindx != -1)
- || !h->def_regular))
- {
- BFD_ASSERT (h->dynindx != -1);
- outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
- outrel.r_addend = rel->r_addend;
- }
- else
- {
- if (r_type == R_OR1K_32)
- {
- outrel.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE);
- outrel.r_addend = relocation + rel->r_addend;
- }
- else
- {
- BFD_FAIL ();
+ || (!bfd_link_pic (info)
+ && h != NULL
+ && h->dynindx != -1
+ && !h->non_got_ref
+ && ((h->def_dynamic
+ && !h->def_regular)
+ || h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_undefined)))
+ {
+ Elf_Internal_Rela outrel;
+ bfd_byte *loc;
+ bfd_boolean skip;
+
+ /* When generating a shared object, these relocations
+ are copied into the output file to be resolved at run
+ time. */
+
+ BFD_ASSERT (sreloc != NULL);
+
+ skip = FALSE;
+
+ outrel.r_offset =
+ _bfd_elf_section_offset (output_bfd, info, input_section,
+ rel->r_offset);
+ if (outrel.r_offset == (bfd_vma) -1)
+ skip = TRUE;
+ else if (outrel.r_offset == (bfd_vma) -2)
+ skip = TRUE;
+ outrel.r_offset += (input_section->output_section->vma
+ + input_section->output_offset);
+
+ if (skip)
+ memset (&outrel, 0, sizeof outrel);
+ /* h->dynindx may be -1 if the symbol was marked to
+ become local. */
+ else if (h != NULL
+ && ((! info->symbolic && h->dynindx != -1)
+ || !h->def_regular))
+ {
+ BFD_ASSERT (h->dynindx != -1);
+ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
+ outrel.r_addend = rel->r_addend;
+ }
+ else
+ {
+ if (r_type == R_OR1K_32)
+ {
+ outrel.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE);
+ outrel.r_addend = relocation + rel->r_addend;
+ }
+ else
+ {
+ BFD_FAIL ();
_bfd_error_handler
- (_("%B: probably compiled without -fPIC?"),
- input_bfd);
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
- }
-
- loc = sreloc->contents;
- loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
- bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
- break;
- }
- break;
- }
-
- case R_OR1K_TLS_LDM_HI16:
- case R_OR1K_TLS_LDM_LO16:
- case R_OR1K_TLS_LDO_HI16:
- case R_OR1K_TLS_LDO_LO16:
- /* TODO: implement support for local dynamic. */
- BFD_FAIL ();
+ (_("%B: probably compiled without -fPIC?"),
+ input_bfd);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ }
+
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+ break;
+ }
+ break;
+ }
+
+ case R_OR1K_TLS_LDM_HI16:
+ case R_OR1K_TLS_LDM_LO16:
+ case R_OR1K_TLS_LDO_HI16:
+ case R_OR1K_TLS_LDO_LO16:
+ /* TODO: implement support for local dynamic. */
+ BFD_FAIL ();
_bfd_error_handler
- (_("%B: support for local dynamic not implemented"),
- input_bfd);
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
-
-
- case R_OR1K_TLS_GD_HI16:
- case R_OR1K_TLS_GD_LO16:
- case R_OR1K_TLS_IE_HI16:
- case R_OR1K_TLS_IE_LO16:
- {
- bfd_vma gotoff;
- Elf_Internal_Rela rela;
- bfd_byte *loc;
- int dynamic;
-
- sreloc = bfd_get_section_by_name (dynobj, ".rela.got");
-
- /* Mark as TLS related GOT entry by setting
- bit 2 as well as bit 1. */
- if (h != NULL)
- {
- gotoff = h->got.offset;
- h->got.offset |= 3;
- }
- else
- {
- gotoff = local_got_offsets[r_symndx];
- local_got_offsets[r_symndx] |= 3;
- }
-
- /* Only process the relocation once. */
- if (gotoff & 1)
- {
- relocation = sgot->output_offset + (gotoff & ~3);
- break;
- }
-
- BFD_ASSERT (elf_hash_table (info)->hgot == NULL
+ (_("%B: support for local dynamic not implemented"),
+ input_bfd);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+
+
+ case R_OR1K_TLS_GD_HI16:
+ case R_OR1K_TLS_GD_LO16:
+ case R_OR1K_TLS_IE_HI16:
+ case R_OR1K_TLS_IE_LO16:
+ {
+ bfd_vma gotoff;
+ Elf_Internal_Rela rela;
+ bfd_byte *loc;
+ int dynamic;
+
+ sreloc = bfd_get_section_by_name (dynobj, ".rela.got");
+
+ /* Mark as TLS related GOT entry by setting
+ bit 2 as well as bit 1. */
+ if (h != NULL)
+ {
+ gotoff = h->got.offset;
+ h->got.offset |= 3;
+ }
+ else
+ {
+ gotoff = local_got_offsets[r_symndx];
+ local_got_offsets[r_symndx] |= 3;
+ }
+
+ /* Only process the relocation once. */
+ if (gotoff & 1)
+ {
+ relocation = sgot->output_offset + (gotoff & ~3);
+ break;
+ }
+
+ BFD_ASSERT (elf_hash_table (info)->hgot == NULL
|| elf_hash_table (info)->hgot->root.u.def.value == 0);
- /* Dynamic entries will require relocations. if we do not need
- them we will just use the default R_OR1K_NONE and
- not set anything. */
- dynamic = bfd_link_pic (info)
+ /* Dynamic entries will require relocations. if we do not need
+ them we will just use the default R_OR1K_NONE and
+ not set anything. */
+ dynamic = bfd_link_pic (info)
|| (sec && (sec->flags & SEC_ALLOC) != 0
&& h != NULL
&& (h->root.type == bfd_link_hash_defweak || !h->def_regular));
- /* Shared GD. */
- if (dynamic && (howto->type == R_OR1K_TLS_GD_HI16
+ /* Shared GD. */
+ if (dynamic && (howto->type == R_OR1K_TLS_GD_HI16
|| howto->type == R_OR1K_TLS_GD_LO16))
- {
- int i;
-
- /* Add DTPMOD and DTPOFF GOT and rela entries. */
- for (i = 0; i < 2; ++i)
- {
- rela.r_offset = sgot->output_section->vma +
- sgot->output_offset + gotoff + i*4;
- if (h != NULL && h->dynindx != -1)
- {
- rela.r_info = ELF32_R_INFO (h->dynindx,
- (i == 0 ? R_OR1K_TLS_DTPMOD : R_OR1K_TLS_DTPOFF));
- rela.r_addend = 0;
- }
- else
- {
- rela.r_info = ELF32_R_INFO (0,
- (i == 0 ? R_OR1K_TLS_DTPMOD : R_OR1K_TLS_DTPOFF));
- rela.r_addend = tpoff (info, relocation);
- }
-
- loc = sreloc->contents;
- loc += sreloc->reloc_count++ *
- sizeof (Elf32_External_Rela);
-
- bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
- bfd_put_32 (output_bfd, 0, sgot->contents + gotoff + i*4);
- }
- }
- /* Static GD. */
- else if (howto->type == R_OR1K_TLS_GD_HI16
- || howto->type == R_OR1K_TLS_GD_LO16)
- {
- bfd_put_32 (output_bfd, 1, sgot->contents + gotoff);
- bfd_put_32 (output_bfd, tpoff (info, relocation),
- sgot->contents + gotoff + 4);
- }
- /* Shared IE. */
- else if (dynamic)
- {
- /* Add TPOFF GOT and rela entries. */
- rela.r_offset = sgot->output_section->vma +
- sgot->output_offset + gotoff;
- if (h != NULL && h->dynindx != -1)
- {
- rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_TLS_TPOFF);
- rela.r_addend = 0;
- }
- else
- {
- rela.r_info = ELF32_R_INFO (0, R_OR1K_TLS_TPOFF);
- rela.r_addend = tpoff (info, relocation);
- }
-
- loc = sreloc->contents;
- loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
-
- bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
- bfd_put_32 (output_bfd, 0, sgot->contents + gotoff);
- }
- /* Static IE. */
- else
- {
- bfd_put_32 (output_bfd, tpoff (info, relocation),
+ {
+ int i;
+
+ /* Add DTPMOD and DTPOFF GOT and rela entries. */
+ for (i = 0; i < 2; ++i)
+ {
+ rela.r_offset = sgot->output_section->vma +
+ sgot->output_offset + gotoff + i*4;
+ if (h != NULL && h->dynindx != -1)
+ {
+ rela.r_info = ELF32_R_INFO (h->dynindx,
+ (i == 0 ? R_OR1K_TLS_DTPMOD : R_OR1K_TLS_DTPOFF));
+ rela.r_addend = 0;
+ }
+ else
+ {
+ rela.r_info = ELF32_R_INFO (0,
+ (i == 0 ? R_OR1K_TLS_DTPMOD : R_OR1K_TLS_DTPOFF));
+ rela.r_addend = tpoff (info, relocation);
+ }
+
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count++ *
+ sizeof (Elf32_External_Rela);
+
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ bfd_put_32 (output_bfd, 0, sgot->contents + gotoff + i*4);
+ }
+ }
+ /* Static GD. */
+ else if (howto->type == R_OR1K_TLS_GD_HI16
+ || howto->type == R_OR1K_TLS_GD_LO16)
+ {
+ bfd_put_32 (output_bfd, 1, sgot->contents + gotoff);
+ bfd_put_32 (output_bfd, tpoff (info, relocation),
+ sgot->contents + gotoff + 4);
+ }
+ /* Shared IE. */
+ else if (dynamic)
+ {
+ /* Add TPOFF GOT and rela entries. */
+ rela.r_offset = sgot->output_section->vma +
+ sgot->output_offset + gotoff;
+ if (h != NULL && h->dynindx != -1)
+ {
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_TLS_TPOFF);
+ rela.r_addend = 0;
+ }
+ else
+ {
+ rela.r_info = ELF32_R_INFO (0, R_OR1K_TLS_TPOFF);
+ rela.r_addend = tpoff (info, relocation);
+ }
+
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
+
+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
+ bfd_put_32 (output_bfd, 0, sgot->contents + gotoff);
+ }
+ /* Static IE. */
+ else
+ {
+ bfd_put_32 (output_bfd, tpoff (info, relocation),
sgot->contents + gotoff);
- }
- relocation = sgot->output_offset + gotoff;
- break;
- }
- case R_OR1K_TLS_LE_HI16:
- case R_OR1K_TLS_LE_LO16:
-
- /* Relocation is offset from TP. */
- relocation = tpoff (info, relocation);
- break;
-
- case R_OR1K_TLS_DTPMOD:
- case R_OR1K_TLS_DTPOFF:
- case R_OR1K_TLS_TPOFF:
- /* These are resolved dynamically on load and shouldn't
- be used as linker input. */
- BFD_FAIL ();
+ }
+ relocation = sgot->output_offset + gotoff;
+ break;
+ }
+ case R_OR1K_TLS_LE_HI16:
+ case R_OR1K_TLS_LE_LO16:
+
+ /* Relocation is offset from TP. */
+ relocation = tpoff (info, relocation);
+ break;
+
+ case R_OR1K_TLS_DTPMOD:
+ case R_OR1K_TLS_DTPOFF:
+ case R_OR1K_TLS_TPOFF:
+ /* These are resolved dynamically on load and shouldn't
+ be used as linker input. */
+ BFD_FAIL ();
_bfd_error_handler
- (_("%B: will not resolve runtime TLS relocation"),
- input_bfd);
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
-
- default:
- break;
- }
+ (_("%B: will not resolve runtime TLS relocation"),
+ input_bfd);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+
+ default:
+ break;
+ }
r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents,
- rel->r_offset, relocation, rel->r_addend);
+ rel->r_offset, relocation, rel->r_addend);
if (r != bfd_reloc_ok)
- {
- const char *msg = NULL;
+ {
+ const char *msg = NULL;
- switch (r)
- {
- case bfd_reloc_overflow:
+ switch (r)
+ {
+ case bfd_reloc_overflow:
(*info->callbacks->reloc_overflow)
- (info, (h ? &h->root : NULL), name, howto->name,
- (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
- break;
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
+ break;
- case bfd_reloc_undefined:
+ case bfd_reloc_undefined:
(*info->callbacks->undefined_symbol)
- (info, name, input_bfd, input_section, rel->r_offset, TRUE);
- break;
+ (info, name, input_bfd, input_section, rel->r_offset, TRUE);
+ break;
- case bfd_reloc_outofrange:
- msg = _("internal error: out of range error");
- break;
+ case bfd_reloc_outofrange:
+ msg = _("internal error: out of range error");
+ break;
- case bfd_reloc_notsupported:
- msg = _("internal error: unsupported relocation error");
- break;
+ case bfd_reloc_notsupported:
+ msg = _("internal error: unsupported relocation error");
+ break;
- case bfd_reloc_dangerous:
- msg = _("internal error: dangerous relocation");
- break;
+ case bfd_reloc_dangerous:
+ msg = _("internal error: dangerous relocation");
+ break;
- default:
- msg = _("internal error: unknown error");
- break;
- }
+ default:
+ msg = _("internal error: unknown error");
+ break;
+ }
- if (msg)
+ if (msg)
(*info->callbacks->warning) (info, msg, name, input_bfd,
input_section, rel->r_offset);
- }
+ }
}
return TRUE;
{
case R_OR1K_GNU_VTINHERIT:
case R_OR1K_GNU_VTENTRY:
- return NULL;
+ return NULL;
}
return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
- {
- h = sym_hashes[r_symndx - symtab_hdr->sh_info];
- while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- }
+ {
+ h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ while (h->root.type == bfd_link_hash_indirect
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
switch (ELF32_R_TYPE (rel->r_info))
- {
- case R_OR1K_TLS_GD_HI16:
- case R_OR1K_TLS_GD_LO16:
- tls_type = TLS_GD;
- break;
- case R_OR1K_TLS_LDM_HI16:
- case R_OR1K_TLS_LDM_LO16:
- case R_OR1K_TLS_LDO_HI16:
- case R_OR1K_TLS_LDO_LO16:
- tls_type = TLS_LD;
- break;
- case R_OR1K_TLS_IE_HI16:
- case R_OR1K_TLS_IE_LO16:
- tls_type = TLS_IE;
- break;
- case R_OR1K_TLS_LE_HI16:
- case R_OR1K_TLS_LE_LO16:
- tls_type = TLS_LE;
- break;
- default:
- tls_type = TLS_NONE;
- }
+ {
+ case R_OR1K_TLS_GD_HI16:
+ case R_OR1K_TLS_GD_LO16:
+ tls_type = TLS_GD;
+ break;
+ case R_OR1K_TLS_LDM_HI16:
+ case R_OR1K_TLS_LDM_LO16:
+ case R_OR1K_TLS_LDO_HI16:
+ case R_OR1K_TLS_LDO_LO16:
+ tls_type = TLS_LD;
+ break;
+ case R_OR1K_TLS_IE_HI16:
+ case R_OR1K_TLS_IE_LO16:
+ tls_type = TLS_IE;
+ break;
+ case R_OR1K_TLS_LE_HI16:
+ case R_OR1K_TLS_LE_LO16:
+ tls_type = TLS_LE;
+ break;
+ default:
+ tls_type = TLS_NONE;
+ }
/* Record TLS type. */
if (h != NULL)
- ((struct elf_or1k_link_hash_entry *) h)->tls_type = tls_type;
+ ((struct elf_or1k_link_hash_entry *) h)->tls_type = tls_type;
else
- {
- unsigned char *local_tls_type;
-
- /* This is a TLS type record for a local symbol. */
- local_tls_type = (unsigned char *) elf_or1k_local_tls_type (abfd);
- if (local_tls_type == NULL)
- {
- bfd_size_type size;
-
- size = symtab_hdr->sh_info;
- local_tls_type = bfd_zalloc (abfd, size);
- if (local_tls_type == NULL)
- return FALSE;
- elf_or1k_local_tls_type (abfd) = local_tls_type;
- }
- local_tls_type[r_symndx] = tls_type;
- }
+ {
+ unsigned char *local_tls_type;
+
+ /* This is a TLS type record for a local symbol. */
+ local_tls_type = (unsigned char *) elf_or1k_local_tls_type (abfd);
+ if (local_tls_type == NULL)
+ {
+ bfd_size_type size;
+
+ size = symtab_hdr->sh_info;
+ local_tls_type = bfd_zalloc (abfd, size);
+ if (local_tls_type == NULL)
+ return FALSE;
+ elf_or1k_local_tls_type (abfd) = local_tls_type;
+ }
+ local_tls_type[r_symndx] = tls_type;
+ }
switch (ELF32_R_TYPE (rel->r_info))
- {
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_OR1K_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_OR1K_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
-
- /* This relocation requires .plt entry. */
- case R_OR1K_PLT26:
- if (h != NULL)
- {
- h->needs_plt = 1;
- h->plt.refcount += 1;
- }
- break;
-
- case R_OR1K_GOT16:
- case R_OR1K_GOTOFF_HI16:
- case R_OR1K_GOTOFF_LO16:
- case R_OR1K_TLS_GD_HI16:
- case R_OR1K_TLS_GD_LO16:
- case R_OR1K_TLS_IE_HI16:
- case R_OR1K_TLS_IE_LO16:
- if (htab->root.sgot == NULL)
- {
- if (dynobj == NULL)
- htab->root.dynobj = dynobj = abfd;
- if (!_bfd_elf_create_got_section (dynobj, info))
- return FALSE;
- }
-
- if (ELF32_R_TYPE (rel->r_info) != R_OR1K_GOTOFF_HI16 &&
- ELF32_R_TYPE (rel->r_info) != R_OR1K_GOTOFF_LO16)
- {
- if (h != NULL)
- h->got.refcount += 1;
- else
- {
- bfd_signed_vma *local_got_refcounts;
-
- /* This is a global offset table entry for a local symbol. */
- local_got_refcounts = elf_local_got_refcounts (abfd);
- if (local_got_refcounts == NULL)
- {
- bfd_size_type size;
-
- size = symtab_hdr->sh_info;
- size *= sizeof (bfd_signed_vma);
- local_got_refcounts = bfd_zalloc (abfd, size);
- if (local_got_refcounts == NULL)
- return FALSE;
- elf_local_got_refcounts (abfd) = local_got_refcounts;
- }
- local_got_refcounts[r_symndx] += 1;
- }
- }
- break;
-
- case R_OR1K_INSN_REL_26:
- case R_OR1K_HI_16_IN_INSN:
- case R_OR1K_LO_16_IN_INSN:
- case R_OR1K_32:
- /* R_OR1K_16? */
- {
- if (h != NULL && !bfd_link_pic (info))
- {
- /* We may need a copy reloc. */
- h->non_got_ref = 1;
-
- /* We may also need a .plt entry. */
- h->plt.refcount += 1;
- if (ELF32_R_TYPE (rel->r_info) != R_OR1K_INSN_REL_26)
- h->pointer_equality_needed = 1;
- }
-
- /* If we are creating a shared library, and this is a reloc
- against a global symbol, or a non PC relative reloc
- against a local symbol, then we need to copy the reloc
- into the shared library. However, if we are linking with
- -Bsymbolic, we do not need to copy a reloc against a
- global symbol which is defined in an object we are
- including in the link (i.e., DEF_REGULAR is set). At
- this point we have not seen all the input files, so it is
- possible that DEF_REGULAR is not set now but will be set
- later (it is never cleared). In case of a weak definition,
- DEF_REGULAR may be cleared later by a strong definition in
- a shared library. We account for that possibility below by
- storing information in the relocs_copied field of the hash
- table entry. A similar situation occurs when creating
- shared libraries and symbol visibility changes render the
- symbol local.
-
- If on the other hand, we are creating an executable, we
- may need to keep relocations for symbols satisfied by a
- dynamic library if we manage to avoid copy relocs for the
- symbol. */
-
- if ((bfd_link_pic (info)
- && (sec->flags & SEC_ALLOC) != 0
- && (ELF32_R_TYPE (rel->r_info) != R_OR1K_INSN_REL_26
- || (h != NULL
- && (!SYMBOLIC_BIND (info, h)
- || h->root.type == bfd_link_hash_defweak
- || !h->def_regular))))
- || (!bfd_link_pic (info)
- && (sec->flags & SEC_ALLOC) != 0
- && h != NULL
- && (h->root.type == bfd_link_hash_defweak
- || !h->def_regular)))
- {
- struct elf_dyn_relocs *p;
- struct elf_dyn_relocs **head;
-
- /* When creating a shared object, we must copy these
- relocs into the output file. We create a reloc
- section in dynobj and make room for the reloc. */
- if (sreloc == NULL)
- {
- const char *name;
- unsigned int strndx = elf_elfheader (abfd)->e_shstrndx;
- unsigned int shnam = _bfd_elf_single_rel_hdr (sec)->sh_name;
-
- name = bfd_elf_string_from_elf_section (abfd, strndx, shnam);
- if (name == NULL)
- return FALSE;
-
- if (strncmp (name, ".rela", 5) != 0
- || strcmp (bfd_get_section_name (abfd, sec),
- name + 5) != 0)
- {
+ {
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_OR1K_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_OR1K_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
+
+ /* This relocation requires .plt entry. */
+ case R_OR1K_PLT26:
+ if (h != NULL)
+ {
+ h->needs_plt = 1;
+ h->plt.refcount += 1;
+ }
+ break;
+
+ case R_OR1K_GOT16:
+ case R_OR1K_GOTOFF_HI16:
+ case R_OR1K_GOTOFF_LO16:
+ case R_OR1K_TLS_GD_HI16:
+ case R_OR1K_TLS_GD_LO16:
+ case R_OR1K_TLS_IE_HI16:
+ case R_OR1K_TLS_IE_LO16:
+ if (htab->root.sgot == NULL)
+ {
+ if (dynobj == NULL)
+ htab->root.dynobj = dynobj = abfd;
+ if (!_bfd_elf_create_got_section (dynobj, info))
+ return FALSE;
+ }
+
+ if (ELF32_R_TYPE (rel->r_info) != R_OR1K_GOTOFF_HI16 &&
+ ELF32_R_TYPE (rel->r_info) != R_OR1K_GOTOFF_LO16)
+ {
+ if (h != NULL)
+ h->got.refcount += 1;
+ else
+ {
+ bfd_signed_vma *local_got_refcounts;
+
+ /* This is a global offset table entry for a local symbol. */
+ local_got_refcounts = elf_local_got_refcounts (abfd);
+ if (local_got_refcounts == NULL)
+ {
+ bfd_size_type size;
+
+ size = symtab_hdr->sh_info;
+ size *= sizeof (bfd_signed_vma);
+ local_got_refcounts = bfd_zalloc (abfd, size);
+ if (local_got_refcounts == NULL)
+ return FALSE;
+ elf_local_got_refcounts (abfd) = local_got_refcounts;
+ }
+ local_got_refcounts[r_symndx] += 1;
+ }
+ }
+ break;
+
+ case R_OR1K_INSN_REL_26:
+ case R_OR1K_HI_16_IN_INSN:
+ case R_OR1K_LO_16_IN_INSN:
+ case R_OR1K_32:
+ /* R_OR1K_16? */
+ {
+ if (h != NULL && !bfd_link_pic (info))
+ {
+ /* We may need a copy reloc. */
+ h->non_got_ref = 1;
+
+ /* We may also need a .plt entry. */
+ h->plt.refcount += 1;
+ if (ELF32_R_TYPE (rel->r_info) != R_OR1K_INSN_REL_26)
+ h->pointer_equality_needed = 1;
+ }
+
+ /* If we are creating a shared library, and this is a reloc
+ against a global symbol, or a non PC relative reloc
+ against a local symbol, then we need to copy the reloc
+ into the shared library. However, if we are linking with
+ -Bsymbolic, we do not need to copy a reloc against a
+ global symbol which is defined in an object we are
+ including in the link (i.e., DEF_REGULAR is set). At
+ this point we have not seen all the input files, so it is
+ possible that DEF_REGULAR is not set now but will be set
+ later (it is never cleared). In case of a weak definition,
+ DEF_REGULAR may be cleared later by a strong definition in
+ a shared library. We account for that possibility below by
+ storing information in the relocs_copied field of the hash
+ table entry. A similar situation occurs when creating
+ shared libraries and symbol visibility changes render the
+ symbol local.
+
+ If on the other hand, we are creating an executable, we
+ may need to keep relocations for symbols satisfied by a
+ dynamic library if we manage to avoid copy relocs for the
+ symbol. */
+
+ if ((bfd_link_pic (info)
+ && (sec->flags & SEC_ALLOC) != 0
+ && (ELF32_R_TYPE (rel->r_info) != R_OR1K_INSN_REL_26
+ || (h != NULL
+ && (!SYMBOLIC_BIND (info, h)
+ || h->root.type == bfd_link_hash_defweak
+ || !h->def_regular))))
+ || (!bfd_link_pic (info)
+ && (sec->flags & SEC_ALLOC) != 0
+ && h != NULL
+ && (h->root.type == bfd_link_hash_defweak
+ || !h->def_regular)))
+ {
+ struct elf_dyn_relocs *p;
+ struct elf_dyn_relocs **head;
+
+ /* When creating a shared object, we must copy these
+ relocs into the output file. We create a reloc
+ section in dynobj and make room for the reloc. */
+ if (sreloc == NULL)
+ {
+ const char *name;
+ unsigned int strndx = elf_elfheader (abfd)->e_shstrndx;
+ unsigned int shnam = _bfd_elf_single_rel_hdr (sec)->sh_name;
+
+ name = bfd_elf_string_from_elf_section (abfd, strndx, shnam);
+ if (name == NULL)
+ return FALSE;
+
+ if (strncmp (name, ".rela", 5) != 0
+ || strcmp (bfd_get_section_name (abfd, sec),
+ name + 5) != 0)
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: bad relocation section name `%s\'"),
- abfd, name);
- }
-
- if (htab->root.dynobj == NULL)
- htab->root.dynobj = abfd;
- dynobj = htab->root.dynobj;
-
- sreloc = bfd_get_section_by_name (dynobj, name);
- if (sreloc == NULL)
- {
- sreloc = _bfd_elf_make_dynamic_reloc_section
- (sec, dynobj, 2, abfd, /*rela?*/ TRUE);
-
- if (sreloc == NULL)
- return FALSE;
- }
- elf_section_data (sec)->sreloc = sreloc;
- }
-
- /* If this is a global symbol, we count the number of
- relocations we need for this symbol. */
- if (h != NULL)
- head = &((struct elf_or1k_link_hash_entry *) h)->dyn_relocs;
- else
- {
- /* Track dynamic relocs needed for local syms too.
- We really need local syms available to do this
- easily. Oh well. */
-
- asection *s;
- Elf_Internal_Sym *isym;
- void *vpp;
-
- isym = bfd_sym_from_r_symndx (&htab->sym_sec,
- abfd, r_symndx);
- if (isym == NULL)
- return FALSE;
-
- s = bfd_section_from_elf_index (abfd, isym->st_shndx);
- if (s == NULL)
- return FALSE;
-
- vpp = &elf_section_data (s)->local_dynrel;
- head = (struct elf_dyn_relocs **) vpp;
- }
-
- p = *head;
- if (p == NULL || p->sec != sec)
- {
- bfd_size_type amt = sizeof *p;
- p = ((struct elf_dyn_relocs *)
- bfd_alloc (htab->root.dynobj, amt));
- if (p == NULL)
- return FALSE;
- p->next = *head;
- *head = p;
- p->sec = sec;
- p->count = 0;
- p->pc_count = 0;
- }
-
- p->count += 1;
- if (ELF32_R_TYPE (rel->r_info) == R_OR1K_INSN_REL_26)
- p->pc_count += 1;
- }
- }
- break;
- }
+ (_("%B: bad relocation section name `%s\'"),
+ abfd, name);
+ }
+
+ if (htab->root.dynobj == NULL)
+ htab->root.dynobj = abfd;
+ dynobj = htab->root.dynobj;
+
+ sreloc = bfd_get_section_by_name (dynobj, name);
+ if (sreloc == NULL)
+ {
+ sreloc = _bfd_elf_make_dynamic_reloc_section
+ (sec, dynobj, 2, abfd, /*rela?*/ TRUE);
+
+ if (sreloc == NULL)
+ return FALSE;
+ }
+ elf_section_data (sec)->sreloc = sreloc;
+ }
+
+ /* If this is a global symbol, we count the number of
+ relocations we need for this symbol. */
+ if (h != NULL)
+ head = &((struct elf_or1k_link_hash_entry *) h)->dyn_relocs;
+ else
+ {
+ /* Track dynamic relocs needed for local syms too.
+ We really need local syms available to do this
+ easily. Oh well. */
+
+ asection *s;
+ Elf_Internal_Sym *isym;
+ void *vpp;
+
+ isym = bfd_sym_from_r_symndx (&htab->sym_sec,
+ abfd, r_symndx);
+ if (isym == NULL)
+ return FALSE;
+
+ s = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ if (s == NULL)
+ return FALSE;
+
+ vpp = &elf_section_data (s)->local_dynrel;
+ head = (struct elf_dyn_relocs **) vpp;
+ }
+
+ p = *head;
+ if (p == NULL || p->sec != sec)
+ {
+ bfd_size_type amt = sizeof *p;
+ p = ((struct elf_dyn_relocs *)
+ bfd_alloc (htab->root.dynobj, amt));
+ if (p == NULL)
+ return FALSE;
+ p->next = *head;
+ *head = p;
+ p->sec = sec;
+ p->count = 0;
+ p->pc_count = 0;
+ }
+
+ p->count += 1;
+ if (ELF32_R_TYPE (rel->r_info) == R_OR1K_INSN_REL_26)
+ p->pc_count += 1;
+ }
+ }
+ break;
+ }
}
return TRUE;
static bfd_boolean
or1k_elf_finish_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *sdyn, *sgot;
dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
for (; dyncon < dynconend; dyncon++)
- {
- Elf_Internal_Dyn dyn;
- asection *s;
+ {
+ Elf_Internal_Dyn dyn;
+ asection *s;
- bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
+ bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn);
- switch (dyn.d_tag)
- {
- default:
- continue;
+ switch (dyn.d_tag)
+ {
+ default:
+ continue;
- case DT_PLTGOT:
- s = htab->root.sgotplt;
- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
- break;
+ case DT_PLTGOT:
+ s = htab->root.sgotplt;
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ break;
- case DT_JMPREL:
- s = htab->root.srelplt;
- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
- break;
+ case DT_JMPREL:
+ s = htab->root.srelplt;
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ break;
- case DT_PLTRELSZ:
- s = htab->root.srelplt;
- dyn.d_un.d_val = s->size;
- break;
- }
- bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
- }
+ case DT_PLTRELSZ:
+ s = htab->root.srelplt;
+ dyn.d_un.d_val = s->size;
+ break;
+ }
+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
+ }
/* Fill in the first entry in the procedure linkage table. */
splt = htab->root.splt;
if (splt && splt->size > 0)
- {
- if (bfd_link_pic (info))
- {
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD0,
- splt->contents);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD1,
- splt->contents + 4);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD2,
- splt->contents + 8);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD3,
- splt->contents + 12);
- bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD4,
- splt->contents + 16);
- }
- else
- {
- unsigned long addr;
- /* addr = .got + 4 */
- addr = sgot->output_section->vma + sgot->output_offset + 4;
- bfd_put_32 (output_bfd,
- PLT0_ENTRY_WORD0 | ((addr >> 16) & 0xffff),
- splt->contents);
- bfd_put_32 (output_bfd,
- PLT0_ENTRY_WORD1 | (addr & 0xffff),
- splt->contents + 4);
- bfd_put_32 (output_bfd, PLT0_ENTRY_WORD2, splt->contents + 8);
- bfd_put_32 (output_bfd, PLT0_ENTRY_WORD3, splt->contents + 12);
- bfd_put_32 (output_bfd, PLT0_ENTRY_WORD4, splt->contents + 16);
- }
-
- elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
- }
+ {
+ if (bfd_link_pic (info))
+ {
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD0,
+ splt->contents);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD1,
+ splt->contents + 4);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD2,
+ splt->contents + 8);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD3,
+ splt->contents + 12);
+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD4,
+ splt->contents + 16);
+ }
+ else
+ {
+ unsigned long addr;
+ /* addr = .got + 4 */
+ addr = sgot->output_section->vma + sgot->output_offset + 4;
+ bfd_put_32 (output_bfd,
+ PLT0_ENTRY_WORD0 | ((addr >> 16) & 0xffff),
+ splt->contents);
+ bfd_put_32 (output_bfd,
+ PLT0_ENTRY_WORD1 | (addr & 0xffff),
+ splt->contents + 4);
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD2, splt->contents + 8);
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD3, splt->contents + 12);
+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD4, splt->contents + 16);
+ }
+
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4;
+ }
}
/* Set the first entry in the global offset table to the address of
if (sgot && sgot->size > 0)
{
if (sdyn == NULL)
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
else
- bfd_put_32 (output_bfd,
- sdyn->output_section->vma + sdyn->output_offset,
- sgot->contents);
+ bfd_put_32 (output_bfd,
+ sdyn->output_section->vma + sdyn->output_offset,
+ sgot->contents);
elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
}
static bfd_boolean
or1k_elf_finish_dynamic_symbol (bfd *output_bfd,
- struct bfd_link_info *info,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
struct elf_or1k_link_hash_table *htab;
bfd_byte *loc;
Elf_Internal_Rela rela;
/* This symbol has an entry in the procedure linkage table. Set
- it up. */
+ it up. */
BFD_ASSERT (h->dynindx != -1);
splt = htab->root.splt;
BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL);
/* Get the index in the procedure linkage table which
- corresponds to this symbol. This is the index of this symbol
- in all the symbols for which we are making plt entries. The
- first entry in the procedure linkage table is reserved. */
+ corresponds to this symbol. This is the index of this symbol
+ in all the symbols for which we are making plt entries. The
+ first entry in the procedure linkage table is reserved. */
plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1;
/* Get the offset into the .got table of the entry that
- corresponds to this function. Each .got entry is 4 bytes.
- The first three are reserved. */
+ corresponds to this function. Each .got entry is 4 bytes.
+ The first three are reserved. */
got_offset = (plt_index + 3) * 4;
got_addr = got_offset;
/* Fill in the entry in the procedure linkage table. */
if (! bfd_link_pic (info))
- {
- got_addr += htab->root.sgotplt->output_section->vma
- + htab->root.sgotplt->output_offset;
- bfd_put_32 (output_bfd, PLT_ENTRY_WORD0 | ((got_addr >> 16) & 0xffff),
- splt->contents + h->plt.offset);
- bfd_put_32 (output_bfd, PLT_ENTRY_WORD1 | (got_addr & 0xffff),
- splt->contents + h->plt.offset + 4);
- bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD2,
- splt->contents + h->plt.offset + 8);
- bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD3,
- splt->contents + h->plt.offset + 12);
- bfd_put_32 (output_bfd, PLT_ENTRY_WORD4
- | plt_index * sizeof (Elf32_External_Rela),
- splt->contents + h->plt.offset + 16);
- }
+ {
+ got_addr += htab->root.sgotplt->output_section->vma
+ + htab->root.sgotplt->output_offset;
+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD0 | ((got_addr >> 16) & 0xffff),
+ splt->contents + h->plt.offset);
+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD1 | (got_addr & 0xffff),
+ splt->contents + h->plt.offset + 4);
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD2,
+ splt->contents + h->plt.offset + 8);
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD3,
+ splt->contents + h->plt.offset + 12);
+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD4
+ | plt_index * sizeof (Elf32_External_Rela),
+ splt->contents + h->plt.offset + 16);
+ }
else
- {
- bfd_put_32 (output_bfd, PLT_PIC_ENTRY_WORD0 | (got_addr & 0xffff),
- splt->contents + h->plt.offset);
- bfd_put_32 (output_bfd, PLT_PIC_ENTRY_WORD1
- | plt_index * sizeof (Elf32_External_Rela),
- splt->contents + h->plt.offset + 4);
- bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD2,
- splt->contents + h->plt.offset + 8);
- bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD3,
- splt->contents + h->plt.offset + 12);
- bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD4,
- splt->contents + h->plt.offset + 16);
- }
+ {
+ bfd_put_32 (output_bfd, PLT_PIC_ENTRY_WORD0 | (got_addr & 0xffff),
+ splt->contents + h->plt.offset);
+ bfd_put_32 (output_bfd, PLT_PIC_ENTRY_WORD1
+ | plt_index * sizeof (Elf32_External_Rela),
+ splt->contents + h->plt.offset + 4);
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD2,
+ splt->contents + h->plt.offset + 8);
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD3,
+ splt->contents + h->plt.offset + 12);
+ bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD4,
+ splt->contents + h->plt.offset + 16);
+ }
/* Fill in the entry in the global offset table. */
bfd_put_32 (output_bfd,
- (splt->output_section->vma
- + splt->output_offset), /* Same offset. */
- sgot->contents + got_offset);
+ (splt->output_section->vma
+ + splt->output_offset), /* Same offset. */
+ sgot->contents + got_offset);
/* Fill in the entry in the .rela.plt section. */
rela.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + got_offset);
+ + sgot->output_offset
+ + got_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_JMP_SLOT);
rela.r_addend = 0;
loc = srela->contents;
bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
if (!h->def_regular)
- {
- /* Mark the symbol as undefined, rather than as defined in
- the .plt section. Leave the value alone. */
- sym->st_shndx = SHN_UNDEF;
- }
+ {
+ /* Mark the symbol as undefined, rather than as defined in
+ the .plt section. Leave the value alone. */
+ sym->st_shndx = SHN_UNDEF;
+ }
}
Elf_Internal_Rela rela;
/* This symbol has an entry in the global offset table. Set it
- up. */
+ up. */
sgot = htab->root.sgot;
srela = htab->root.srelgot;
BFD_ASSERT (sgot != NULL && srela != NULL);
rela.r_offset = (sgot->output_section->vma
- + sgot->output_offset
- + (h->got.offset &~ 1));
+ + sgot->output_offset
+ + (h->got.offset &~ 1));
/* If this is a -Bsymbolic link, and the symbol is defined
- locally, we just want to emit a RELATIVE reloc. Likewise if
- the symbol was forced to be local because of a version file.
- The entry in the global offset table will already have been
- initialized in the relocate_section function. */
+ locally, we just want to emit a RELATIVE reloc. Likewise if
+ the symbol was forced to be local because of a version file.
+ The entry in the global offset table will already have been
+ initialized in the relocate_section function. */
if (bfd_link_pic (info) && SYMBOL_REFERENCES_LOCAL (info, h))
- {
- rela.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE);
- rela.r_addend = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
- }
+ {
+ rela.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE);
+ rela.r_addend = (h->root.u.def.value
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
+ }
else
- {
- BFD_ASSERT ((h->got.offset & 1) == 0);
- bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
- rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_GLOB_DAT);
- rela.r_addend = 0;
- }
+ {
+ BFD_ASSERT ((h->got.offset & 1) == 0);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset);
+ rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_GLOB_DAT);
+ rela.r_addend = 0;
+ }
loc = srela->contents;
loc += srela->reloc_count * sizeof (Elf32_External_Rela);
/* This symbols needs a copy reloc. Set it up. */
BFD_ASSERT (h->dynindx != -1
- && (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak));
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak));
rela.r_offset = (h->root.u.def.value
- + h->root.u.def.section->output_section->vma
- + h->root.u.def.section->output_offset);
+ + h->root.u.def.section->output_section->vma
+ + h->root.u.def.section->output_offset);
rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_COPY);
rela.r_addend = 0;
if (h->root.u.def.section == htab->root.sdynrelro)
static enum elf_reloc_type_class
or1k_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
- const asection *rel_sec ATTRIBUTE_UNUSED,
- const Elf_Internal_Rela *rela)
+ const asection *rel_sec ATTRIBUTE_UNUSED,
+ const Elf_Internal_Rela *rela)
{
switch ((int) ELF32_R_TYPE (rela->r_info))
{
case R_OR1K_RELATIVE: return reloc_class_relative;
case R_OR1K_JMP_SLOT: return reloc_class_plt;
- case R_OR1K_COPY: return reloc_class_copy;
- default: return reloc_class_normal;
+ case R_OR1K_COPY: return reloc_class_copy;
+ default: return reloc_class_normal;
}
}
static bfd_boolean
or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *h)
+ struct elf_link_hash_entry *h)
{
struct elf_or1k_link_hash_table *htab;
bfd *dynobj;
/* Make sure we know what is going on here. */
BFD_ASSERT (dynobj != NULL
- && (h->needs_plt
- || h->is_weakalias
- || (h->def_dynamic
- && h->ref_regular
- && !h->def_regular)));
+ && (h->needs_plt
+ || h->is_weakalias
+ || (h->def_dynamic
+ && h->ref_regular
+ && !h->def_regular)));
/* If this is a function, put it in the procedure linkage table. We
will fill in the contents of the procedure linkage table later,
|| h->needs_plt)
{
if (! bfd_link_pic (info)
- && !h->def_dynamic
- && !h->ref_dynamic
- && h->root.type != bfd_link_hash_undefweak
- && h->root.type != bfd_link_hash_undefined)
- {
- /* This case can occur if we saw a PLT reloc in an input
- file, but the symbol was never referred to by a dynamic
- object. In such a case, we don't actually need to build
- a procedure linkage table, and we can just do a PCREL
- reloc instead. */
- h->plt.offset = (bfd_vma) -1;
- h->needs_plt = 0;
- }
+ && !h->def_dynamic
+ && !h->ref_dynamic
+ && h->root.type != bfd_link_hash_undefweak
+ && h->root.type != bfd_link_hash_undefined)
+ {
+ /* This case can occur if we saw a PLT reloc in an input
+ file, but the symbol was never referred to by a dynamic
+ object. In such a case, we don't actually need to build
+ a procedure linkage table, and we can just do a PCREL
+ reloc instead. */
+ h->plt.offset = (bfd_vma) -1;
+ h->needs_plt = 0;
+ }
return TRUE;
}
&& h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
+ Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h))
- {
- asection *s = htab->root.splt;
-
- /* If this is the first .plt entry, make room for the special
- first entry. */
- if (s->size == 0)
- s->size = PLT_ENTRY_SIZE;
-
- h->plt.offset = s->size;
-
- /* If this symbol is not defined in a regular file, and we are
- not generating a shared library, then set the symbol to this
- location in the .plt. This is required to make function
- pointers compare as equal between the normal executable and
- the shared library. */
- if (! bfd_link_pic (info)
- && !h->def_regular)
- {
- h->root.u.def.section = s;
- h->root.u.def.value = h->plt.offset;
- }
-
- /* Make room for this entry. */
- s->size += PLT_ENTRY_SIZE;
-
- /* We also need to make an entry in the .got.plt section, which
- will be placed in the .got section by the linker script. */
- htab->root.sgotplt->size += 4;
-
- /* We also need to make an entry in the .rel.plt section. */
- htab->root.srelplt->size += sizeof (Elf32_External_Rela);
- }
+ {
+ asection *s = htab->root.splt;
+
+ /* If this is the first .plt entry, make room for the special
+ first entry. */
+ if (s->size == 0)
+ s->size = PLT_ENTRY_SIZE;
+
+ h->plt.offset = s->size;
+
+ /* If this symbol is not defined in a regular file, and we are
+ not generating a shared library, then set the symbol to this
+ location in the .plt. This is required to make function
+ pointers compare as equal between the normal executable and
+ the shared library. */
+ if (! bfd_link_pic (info)
+ && !h->def_regular)
+ {
+ h->root.u.def.section = s;
+ h->root.u.def.value = h->plt.offset;
+ }
+
+ /* Make room for this entry. */
+ s->size += PLT_ENTRY_SIZE;
+
+ /* We also need to make an entry in the .got.plt section, which
+ will be placed in the .got section by the linker script. */
+ htab->root.sgotplt->size += 4;
+
+ /* We also need to make an entry in the .rel.plt section. */
+ htab->root.srelplt->size += sizeof (Elf32_External_Rela);
+ }
else
- {
- h->plt.offset = (bfd_vma) -1;
- h->needs_plt = 0;
- }
+ {
+ h->plt.offset = (bfd_vma) -1;
+ h->needs_plt = 0;
+ }
}
else
{
unsigned char tls_type;
/* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
+ Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
s = htab->root.sgot;
/* TLS GD requires two GOT and two relocs. */
if (tls_type == TLS_GD)
- s->size += 8;
+ s->size += 8;
else
- s->size += 4;
+ s->size += 4;
dyn = htab->root.dynamic_sections_created;
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h))
- {
- if (tls_type == TLS_GD)
- htab->root.srelgot->size += 2 * sizeof (Elf32_External_Rela);
- else
- htab->root.srelgot->size += sizeof (Elf32_External_Rela);
- }
+ {
+ if (tls_type == TLS_GD)
+ htab->root.srelgot->size += 2 * sizeof (Elf32_External_Rela);
+ else
+ htab->root.srelgot->size += sizeof (Elf32_External_Rela);
+ }
}
else
h->got.offset = (bfd_vma) -1;
if (bfd_link_pic (info))
{
if (SYMBOL_CALLS_LOCAL (info, h))
- {
- struct elf_dyn_relocs **pp;
-
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
- {
- p->count -= p->pc_count;
- p->pc_count = 0;
- if (p->count == 0)
- *pp = p->next;
- else
- pp = &p->next;
- }
- }
+ {
+ struct elf_dyn_relocs **pp;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
+ {
+ p->count -= p->pc_count;
+ p->pc_count = 0;
+ if (p->count == 0)
+ *pp = p->next;
+ else
+ pp = &p->next;
+ }
+ }
/* Also discard relocs on undefined weak syms with non-default
- visibility. */
+ visibility. */
if (eh->dyn_relocs != NULL
- && h->root.type == bfd_link_hash_undefweak)
- {
- if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
- eh->dyn_relocs = NULL;
-
- /* Make sure undefined weak symbols are output as a dynamic
- symbol in PIEs. */
- else if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
- }
+ && h->root.type == bfd_link_hash_undefweak)
+ {
+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
+ eh->dyn_relocs = NULL;
+
+ /* Make sure undefined weak symbols are output as a dynamic
+ symbol in PIEs. */
+ else if (h->dynindx == -1
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+ }
}
else
{
/* For the non-shared case, discard space for relocs against
- symbols which turn out to need copy relocs or are not
- dynamic. */
+ symbols which turn out to need copy relocs or are not
+ dynamic. */
if (!h->non_got_ref
- && ((h->def_dynamic
- && !h->def_regular)
- || (htab->root.dynamic_sections_created
- && (h->root.type == bfd_link_hash_undefweak
- || h->root.type == bfd_link_hash_undefined))))
- {
- /* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
- if (h->dynindx == -1
- && !h->forced_local)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
-
- /* If that succeeded, we know we'll be keeping all the
- relocs. */
- if (h->dynindx != -1)
- goto keep;
- }
+ && ((h->def_dynamic
+ && !h->def_regular)
+ || (htab->root.dynamic_sections_created
+ && (h->root.type == bfd_link_hash_undefweak
+ || h->root.type == bfd_link_hash_undefined))))
+ {
+ /* Make sure this symbol is output as a dynamic symbol.
+ Undefined weak syms won't yet be marked as dynamic. */
+ if (h->dynindx == -1
+ && !h->forced_local)
+ {
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+
+ /* If that succeeded, we know we'll be keeping all the
+ relocs. */
+ if (h->dynindx != -1)
+ goto keep;
+ }
eh->dyn_relocs = NULL;
static bfd_boolean
or1k_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
struct elf_or1k_link_hash_table *htab;
bfd *dynobj;
{
/* Set the contents of the .interp section to the interpreter. */
if (bfd_link_executable (info) && !info->nointerp)
- {
- s = bfd_get_section_by_name (dynobj, ".interp");
- BFD_ASSERT (s != NULL);
- s->size = sizeof ELF_DYNAMIC_INTERPRETER;
- s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
- }
+ {
+ s = bfd_get_section_by_name (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->size = sizeof ELF_DYNAMIC_INTERPRETER;
+ s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
+ }
}
/* Set up .got offsets for local syms, and space for local dynamic
asection *srel;
if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour)
- continue;
+ continue;
for (s = ibfd->sections; s != NULL; s = s->next)
- {
- struct elf_dyn_relocs *p;
-
- for (p = ((struct elf_dyn_relocs *)
- elf_section_data (s)->local_dynrel);
- p != NULL;
- p = p->next)
- {
- if (! bfd_is_abs_section (p->sec)
- && bfd_is_abs_section (p->sec->output_section))
- {
- /* Input section has been discarded, either because
- it is a copy of a linkonce section or due to
- linker script /DISCARD/, so we'll be discarding
- the relocs too. */
- }
- else if (p->count != 0)
- {
- srel = elf_section_data (p->sec)->sreloc;
- srel->size += p->count * sizeof (Elf32_External_Rela);
- if ((p->sec->output_section->flags & SEC_READONLY) != 0)
- info->flags |= DF_TEXTREL;
- }
- }
- }
+ {
+ struct elf_dyn_relocs *p;
+
+ for (p = ((struct elf_dyn_relocs *)
+ elf_section_data (s)->local_dynrel);
+ p != NULL;
+ p = p->next)
+ {
+ if (! bfd_is_abs_section (p->sec)
+ && bfd_is_abs_section (p->sec->output_section))
+ {
+ /* Input section has been discarded, either because
+ it is a copy of a linkonce section or due to
+ linker script /DISCARD/, so we'll be discarding
+ the relocs too. */
+ }
+ else if (p->count != 0)
+ {
+ srel = elf_section_data (p->sec)->sreloc;
+ srel->size += p->count * sizeof (Elf32_External_Rela);
+ if ((p->sec->output_section->flags & SEC_READONLY) != 0)
+ info->flags |= DF_TEXTREL;
+ }
+ }
+ }
local_got = elf_local_got_refcounts (ibfd);
if (!local_got)
- continue;
+ continue;
symtab_hdr = &elf_tdata (ibfd)->symtab_hdr;
locsymcount = symtab_hdr->sh_info;
srel = htab->root.srelgot;
local_tls_type = (unsigned char *) elf_or1k_local_tls_type (ibfd);
for (; local_got < end_local_got; ++local_got)
- {
- if (*local_got > 0)
- {
- *local_got = s->size;
-
- /* TLS GD requires two GOT and two relocs. */
- if (local_tls_type != NULL && *local_tls_type == TLS_GD)
- s->size += 8;
- else
- s->size += 4;
- if (bfd_link_pic (info))
- {
- if (local_tls_type != NULL && *local_tls_type == TLS_GD)
- srel->size += 2 * sizeof (Elf32_External_Rela);
- else
- srel->size += sizeof (Elf32_External_Rela);
- }
- }
- else
-
- *local_got = (bfd_vma) -1;
-
- if (local_tls_type)
- ++local_tls_type;
- }
+ {
+ if (*local_got > 0)
+ {
+ *local_got = s->size;
+
+ /* TLS GD requires two GOT and two relocs. */
+ if (local_tls_type != NULL && *local_tls_type == TLS_GD)
+ s->size += 8;
+ else
+ s->size += 4;
+ if (bfd_link_pic (info))
+ {
+ if (local_tls_type != NULL && *local_tls_type == TLS_GD)
+ srel->size += 2 * sizeof (Elf32_External_Rela);
+ else
+ srel->size += sizeof (Elf32_External_Rela);
+ }
+ }
+ else
+
+ *local_got = (bfd_vma) -1;
+
+ if (local_tls_type)
+ ++local_tls_type;
+ }
}
/* Allocate global sym .plt and .got entries, and space for global
for (s = dynobj->sections; s != NULL; s = s->next)
{
if ((s->flags & SEC_LINKER_CREATED) == 0)
- continue;
+ continue;
if (s == htab->root.splt
- || s == htab->root.sgot
- || s == htab->root.sgotplt
+ || s == htab->root.sgot
+ || s == htab->root.sgotplt
|| s == htab->root.sdynbss
|| s == htab->root.sdynrelro)
- {
- /* Strip this section if we don't need it; see the
- comment below. */
- }
+ {
+ /* Strip this section if we don't need it; see the
+ comment below. */
+ }
else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
- {
- if (s->size != 0 && s != htab->root.srelplt)
- relocs = TRUE;
-
- /* We use the reloc_count field as a counter if we need
- to copy relocs into the output file. */
- s->reloc_count = 0;
- }
+ {
+ if (s->size != 0 && s != htab->root.srelplt)
+ relocs = TRUE;
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ s->reloc_count = 0;
+ }
else
- /* It's not one of our sections, so don't allocate space. */
- continue;
+ /* It's not one of our sections, so don't allocate space. */
+ continue;
if (s->size == 0)
- {
- /* If we don't need this section, strip it from the
- output file. This is mostly to handle .rela.bss and
- .rela.plt. We must create both sections in
- create_dynamic_sections, because they must be created
- before the linker maps input sections to output
- sections. The linker does that before
- adjust_dynamic_symbol is called, and it is that
- function which decides whether anything needs to go
- into these sections. */
- s->flags |= SEC_EXCLUDE;
- continue;
- }
+ {
+ /* If we don't need this section, strip it from the
+ output file. This is mostly to handle .rela.bss and
+ .rela.plt. We must create both sections in
+ create_dynamic_sections, because they must be created
+ before the linker maps input sections to output
+ sections. The linker does that before
+ adjust_dynamic_symbol is called, and it is that
+ function which decides whether anything needs to go
+ into these sections. */
+ s->flags |= SEC_EXCLUDE;
+ continue;
+ }
if ((s->flags & SEC_HAS_CONTENTS) == 0)
- continue;
+ continue;
/* Allocate memory for the section contents. We use bfd_zalloc
- here in case unused entries are not reclaimed before the
- section's contents are written out. This should not happen,
- but this way if it does, we get a R_OR1K_NONE reloc instead
- of garbage. */
+ here in case unused entries are not reclaimed before the
+ section's contents are written out. This should not happen,
+ but this way if it does, we get a R_OR1K_NONE reloc instead
+ of garbage. */
s->contents = bfd_zalloc (dynobj, s->size);
if (s->contents == NULL)
- return FALSE;
+ return FALSE;
}
if (htab->root.dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
- values later, in or1k_elf_finish_dynamic_sections, but we
- must add the entries now so that we get the correct size for
- the .dynamic section. The DT_DEBUG entry is filled in by the
- dynamic linker and used by the debugger. */
+ values later, in or1k_elf_finish_dynamic_sections, but we
+ must add the entries now so that we get the correct size for
+ the .dynamic section. The DT_DEBUG entry is filled in by the
+ dynamic linker and used by the debugger. */
#define add_dynamic_entry(TAG, VAL) \
_bfd_elf_add_dynamic_entry (info, TAG, VAL)
if (bfd_link_executable (info))
{
- if (! add_dynamic_entry (DT_DEBUG, 0))
- return FALSE;
+ if (! add_dynamic_entry (DT_DEBUG, 0))
+ return FALSE;
}
if (htab->root.splt->size != 0)
{
- if (! add_dynamic_entry (DT_PLTGOT, 0)
- || ! add_dynamic_entry (DT_PLTRELSZ, 0)
- || ! add_dynamic_entry (DT_PLTREL, DT_RELA)
- || ! add_dynamic_entry (DT_JMPREL, 0))
- return FALSE;
- }
+ if (! add_dynamic_entry (DT_PLTGOT, 0)
+ || ! add_dynamic_entry (DT_PLTRELSZ, 0)
+ || ! add_dynamic_entry (DT_PLTREL, DT_RELA)
+ || ! add_dynamic_entry (DT_JMPREL, 0))
+ return FALSE;
+ }
if (relocs)
{
- if (! add_dynamic_entry (DT_RELA, 0)
- || ! add_dynamic_entry (DT_RELASZ, 0)
- || ! add_dynamic_entry (DT_RELAENT,
- sizeof (Elf32_External_Rela)))
- return FALSE;
-
- /* If any dynamic relocs apply to a read-only section,
- then we need a DT_TEXTREL entry. */
- if ((info->flags & DF_TEXTREL) == 0)
- elf_link_hash_traverse (&htab->root, maybe_set_textrel, info);
-
- if ((info->flags & DF_TEXTREL) != 0)
- {
- if (! add_dynamic_entry (DT_TEXTREL, 0))
- return FALSE;
- }
+ if (! add_dynamic_entry (DT_RELA, 0)
+ || ! add_dynamic_entry (DT_RELASZ, 0)
+ || ! add_dynamic_entry (DT_RELAENT,
+ sizeof (Elf32_External_Rela)))
+ return FALSE;
+
+ /* If any dynamic relocs apply to a read-only section,
+ then we need a DT_TEXTREL entry. */
+ if ((info->flags & DF_TEXTREL) == 0)
+ elf_link_hash_traverse (&htab->root, maybe_set_textrel, info);
+
+ if ((info->flags & DF_TEXTREL) != 0)
+ {
+ if (! add_dynamic_entry (DT_TEXTREL, 0))
+ return FALSE;
+ }
}
}
static void
or1k_elf_copy_indirect_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *dir,
- struct elf_link_hash_entry *ind)
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
struct elf_or1k_link_hash_entry * edir;
struct elf_or1k_link_hash_entry * eind;
if (eind->dyn_relocs != NULL)
{
if (edir->dyn_relocs != NULL)
- {
- struct elf_dyn_relocs **pp;
- struct elf_dyn_relocs *p;
-
- /* Add reloc counts against the indirect sym to the direct sym
- list. Merge any entries against the same section. */
- for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
- {
- struct elf_dyn_relocs *q;
-
- for (q = edir->dyn_relocs; q != NULL; q = q->next)
- if (q->sec == p->sec)
- {
- q->pc_count += p->pc_count;
- q->count += p->count;
- *pp = p->next;
- break;
- }
- if (q == NULL)
- pp = &p->next;
- }
- *pp = edir->dyn_relocs;
- }
+ {
+ struct elf_dyn_relocs **pp;
+ struct elf_dyn_relocs *p;
+
+ /* Add reloc counts against the indirect sym to the direct sym
+ list. Merge any entries against the same section. */
+ for (pp = &eind->dyn_relocs; (p = *pp) != NULL;)
+ {
+ struct elf_dyn_relocs *q;
+
+ for (q = edir->dyn_relocs; q != NULL; q = q->next)
+ if (q->sec == p->sec)
+ {
+ q->pc_count += p->pc_count;
+ q->count += p->count;
+ *pp = p->next;
+ break;
+ }
+ if (q == NULL)
+ pp = &p->next;
+ }
+ *pp = edir->dyn_relocs;
+ }
edir->dyn_relocs = eind->dyn_relocs;
eind->dyn_relocs = NULL;
if (ind->root.type == bfd_link_hash_indirect)
{
if (dir->got.refcount <= 0)
- {
- edir->tls_type = eind->tls_type;
- eind->tls_type = TLS_UNKNOWN;
- }
+ {
+ edir->tls_type = eind->tls_type;
+ eind->tls_type = TLS_UNKNOWN;
+ }
}
_bfd_elf_link_hash_copy_indirect (info, dir, ind);
or1k_elf_set_private_flags (bfd *abfd, flagword flags)
{
BFD_ASSERT (!elf_flags_init (abfd)
- || elf_elfheader (abfd)->e_flags == flags);
+ || elf_elfheader (abfd)->e_flags == flags);
elf_elfheader (abfd)->e_flags = flags;
elf_flags_init (abfd) = TRUE;
}
-#define ELF_ARCH bfd_arch_or1k
-#define ELF_MACHINE_CODE EM_OR1K
-#define ELF_TARGET_ID OR1K_ELF_DATA
-#define ELF_MAXPAGESIZE 0x2000
+#define ELF_ARCH bfd_arch_or1k
+#define ELF_MACHINE_CODE EM_OR1K
+#define ELF_TARGET_ID OR1K_ELF_DATA
+#define ELF_MAXPAGESIZE 0x2000
-#define TARGET_BIG_SYM or1k_elf32_vec
-#define TARGET_BIG_NAME "elf32-or1k"
+#define TARGET_BIG_SYM or1k_elf32_vec
+#define TARGET_BIG_NAME "elf32-or1k"
-#define elf_info_to_howto_rel NULL
-#define elf_info_to_howto or1k_info_to_howto_rela
-#define elf_backend_relocate_section or1k_elf_relocate_section
-#define elf_backend_gc_mark_hook or1k_elf_gc_mark_hook
-#define elf_backend_check_relocs or1k_elf_check_relocs
-#define elf_backend_reloc_type_class or1k_elf_reloc_type_class
-#define elf_backend_can_gc_sections 1
-#define elf_backend_rela_normal 1
+#define elf_info_to_howto_rel NULL
+#define elf_info_to_howto or1k_info_to_howto_rela
+#define elf_backend_relocate_section or1k_elf_relocate_section
+#define elf_backend_gc_mark_hook or1k_elf_gc_mark_hook
+#define elf_backend_check_relocs or1k_elf_check_relocs
+#define elf_backend_reloc_type_class or1k_elf_reloc_type_class
+#define elf_backend_can_gc_sections 1
+#define elf_backend_rela_normal 1
-#define bfd_elf32_mkobject elf_or1k_mkobject
+#define bfd_elf32_mkobject elf_or1k_mkobject
#define bfd_elf32_bfd_merge_private_bfd_data elf32_or1k_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags or1k_elf_set_private_flags
#define bfd_elf32_bfd_reloc_type_lookup or1k_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup or1k_reloc_name_lookup
-#define elf_backend_object_p or1k_elf_object_p
+#define elf_backend_object_p or1k_elf_object_p
#define elf_backend_final_write_processing or1k_elf_final_write_processing
-#define elf_backend_can_refcount 1
+#define elf_backend_can_refcount 1
-#define elf_backend_plt_readonly 1
-#define elf_backend_want_got_plt 1
-#define elf_backend_want_plt_sym 0
-#define elf_backend_got_header_size 12
+#define elf_backend_plt_readonly 1
+#define elf_backend_want_got_plt 1
+#define elf_backend_want_plt_sym 0
+#define elf_backend_got_header_size 12
#define elf_backend_dtrel_excludes_plt 1
#define elf_backend_want_dynrelro 1
-#define bfd_elf32_bfd_link_hash_table_create or1k_elf_link_hash_table_create
-#define elf_backend_copy_indirect_symbol or1k_elf_copy_indirect_symbol
-#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
-#define elf_backend_finish_dynamic_sections or1k_elf_finish_dynamic_sections
-#define elf_backend_size_dynamic_sections or1k_elf_size_dynamic_sections
-#define elf_backend_adjust_dynamic_symbol or1k_elf_adjust_dynamic_symbol
-#define elf_backend_finish_dynamic_symbol or1k_elf_finish_dynamic_symbol
+#define bfd_elf32_bfd_link_hash_table_create or1k_elf_link_hash_table_create
+#define elf_backend_copy_indirect_symbol or1k_elf_copy_indirect_symbol
+#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections
+#define elf_backend_finish_dynamic_sections or1k_elf_finish_dynamic_sections
+#define elf_backend_size_dynamic_sections or1k_elf_size_dynamic_sections
+#define elf_backend_adjust_dynamic_symbol or1k_elf_adjust_dynamic_symbol
+#define elf_backend_finish_dynamic_symbol or1k_elf_finish_dynamic_symbol
#include "elf32-target.h"
case R_PJ_CODE_REL16:
insn = bfd_getb16 (hit_data);
insn += sym_value + reloc_entry->addend
- - (input_section->output_section->vma
- + input_section->output_offset);
+ - (input_section->output_section->vma
+ + input_section->output_offset);
bfd_putb16 ((bfd_vma) insn, hit_data);
break;
case R_PJ_CODE_LO16:
TRUE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy. */
- HOWTO (R_PJ_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_PJ_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_PJ_GNU_VTINHERIT, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_PJ_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage. */
HOWTO (R_PJ_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_PJ_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_PJ_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
/* This structure is used to map BFD reloc codes to PJ ELF relocs. */
static const struct elf_reloc_map pj_reloc_map[] =
{
- { BFD_RELOC_NONE, R_PJ_NONE },
- { BFD_RELOC_32, R_PJ_DATA_DIR32 },
- { BFD_RELOC_PJ_CODE_DIR16, R_PJ_CODE_DIR16 },
- { BFD_RELOC_PJ_CODE_DIR32, R_PJ_CODE_DIR32 },
- { BFD_RELOC_PJ_CODE_LO16, R_PJ_CODE_LO16 },
- { BFD_RELOC_PJ_CODE_HI16, R_PJ_CODE_HI16 },
- { BFD_RELOC_PJ_CODE_REL32, R_PJ_CODE_REL32 },
- { BFD_RELOC_PJ_CODE_REL16, R_PJ_CODE_REL16 },
+ { BFD_RELOC_NONE, R_PJ_NONE },
+ { BFD_RELOC_32, R_PJ_DATA_DIR32 },
+ { BFD_RELOC_PJ_CODE_DIR16, R_PJ_CODE_DIR16 },
+ { BFD_RELOC_PJ_CODE_DIR32, R_PJ_CODE_DIR32 },
+ { BFD_RELOC_PJ_CODE_LO16, R_PJ_CODE_LO16 },
+ { BFD_RELOC_PJ_CODE_HI16, R_PJ_CODE_HI16 },
+ { BFD_RELOC_PJ_CODE_REL32, R_PJ_CODE_REL32 },
+ { BFD_RELOC_PJ_CODE_REL16, R_PJ_CODE_REL16 },
{ BFD_RELOC_VTABLE_INHERIT, R_PJ_GNU_VTINHERIT },
{ BFD_RELOC_VTABLE_ENTRY, R_PJ_GNU_VTENTRY },
};
#define ELF_MAXPAGESIZE 0x1000
#define bfd_elf32_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
-#define bfd_elf32_bfd_reloc_type_lookup pj_elf_reloc_type_lookup
+#define bfd_elf32_bfd_reloc_type_lookup pj_elf_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup pj_elf_reloc_name_lookup
#define elf_backend_final_write_processing pj_elf_final_write_processing
-#define elf_info_to_howto pj_elf_info_to_howto
+#define elf_info_to_howto pj_elf_info_to_howto
#include "elf32-target.h"
static const bfd_vma ppc_elf_vxworks_plt_entry
[VXWORKS_PLT_ENTRY_SIZE / 4] =
{
- 0x3d800000, /* lis r12,0 */
- 0x818c0000, /* lwz r12,0(r12) */
- 0x7d8903a6, /* mtctr r12 */
- 0x4e800420, /* bctr */
- 0x39600000, /* li r11,0 */
- 0x48000000, /* b 14 <.PLT0resolve+0x4> */
- 0x60000000, /* nop */
- 0x60000000, /* nop */
+ 0x3d800000, /* lis r12,0 */
+ 0x818c0000, /* lwz r12,0(r12) */
+ 0x7d8903a6, /* mtctr r12 */
+ 0x4e800420, /* bctr */
+ 0x39600000, /* li r11,0 */
+ 0x48000000, /* b 14 <.PLT0resolve+0x4> */
+ 0x60000000, /* nop */
+ 0x60000000, /* nop */
};
static const bfd_vma ppc_elf_vxworks_pic_plt_entry
[VXWORKS_PLT_ENTRY_SIZE / 4] =
static const bfd_vma ppc_elf_vxworks_plt0_entry
[VXWORKS_PLT_INITIAL_ENTRY_SIZE / 4] =
{
- 0x3d800000, /* lis r12,0 */
- 0x398c0000, /* addi r12,r12,0 */
- 0x800c0008, /* lwz r0,8(r12) */
- 0x7c0903a6, /* mtctr r0 */
- 0x818c0004, /* lwz r12,4(r12) */
- 0x4e800420, /* bctr */
- 0x60000000, /* nop */
- 0x60000000, /* nop */
+ 0x3d800000, /* lis r12,0 */
+ 0x398c0000, /* addi r12,r12,0 */
+ 0x800c0008, /* lwz r0,8(r12) */
+ 0x7c0903a6, /* mtctr r0 */
+ 0x818c0004, /* lwz r12,4(r12) */
+ 0x4e800420, /* bctr */
+ 0x60000000, /* nop */
+ 0x60000000, /* nop */
};
static const bfd_vma ppc_elf_vxworks_pic_plt0_entry
[VXWORKS_PLT_INITIAL_ENTRY_SIZE / 4] =
{
0x819e0008, /* lwz r12,8(r30) */
- 0x7d8903a6, /* mtctr r12 */
+ 0x7d8903a6, /* mtctr r12 */
0x819e0004, /* lwz r12,4(r30) */
- 0x4e800420, /* bctr */
- 0x60000000, /* nop */
- 0x60000000, /* nop */
- 0x60000000, /* nop */
- 0x60000000, /* nop */
+ 0x4e800420, /* bctr */
+ 0x60000000, /* nop */
+ 0x60000000, /* nop */
+ 0x60000000, /* nop */
+ 0x60000000, /* nop */
};
/* For executables, we have some additional relocations in
/* This is what we want for new plt/got. */
static struct bfd_elf_special_section ppc_alt_plt =
- { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC };
+ { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC };
static const struct bfd_elf_special_section *
ppc_elf_get_sec_type_attr (bfd *abfd, asection *sec)
. new_page: new_page:
. */
insn = bfd_get_32 (input_bfd, contents + offset);
- if ((insn & (0x3f << 26)) == (18u << 26) /* b,bl,ba,bla */
- || ((insn & (0x3f << 26)) == (16u << 26) /* bc,bcl,bca,bcla*/
- && (insn & (0x14 << 21)) == (0x14 << 21)) /* with BO=0x14 */
+ if ((insn & (0x3f << 26)) == (18u << 26) /* b,bl,ba,bla */
+ || ((insn & (0x3f << 26)) == (16u << 26) /* bc,bcl,bca,bcla*/
+ && (insn & (0x14 << 21)) == (0x14 << 21)) /* with BO=0x14 */
|| ((insn & (0x3f << 26)) == (19u << 26)
&& (insn & (0x3ff << 1)) == (16u << 1) /* bclr,bclrl */
- && (insn & (0x14 << 21)) == (0x14 << 21)))/* with BO=0x14 */
+ && (insn & (0x14 << 21)) == (0x14 << 21)))/* with BO=0x14 */
continue;
patch_addr = (start_addr + input_section->size
* 1: addi 11,11,(1b-res_0)@l
* mflr 12
* mtlr 0
- * sub 11,11,12 # r11 = index * 4
+ * sub 11,11,12 # r11 = index * 4
* addis 12,12,(got+4-1b)@ha
- * lwz 0,(got+4-1b)@l(12) # got[1] address of dl_runtime_resolve
- * lwz 12,(got+8-1b)@l(12) # got[2] contains the map address
+ * lwz 0,(got+4-1b)@l(12) # got[1] address of dl_runtime_resolve
+ * lwz 12,(got+8-1b)@l(12) # got[2] contains the map address
* mtctr 0
* add 0,11,11
- * add 11,0,11 # r11 = index * 12 = reloc offset.
+ * add 11,0,11 # r11 = index * 12 = reloc offset.
* bctr
*/
static const unsigned int pic_plt_resolve[] =
* PLTresolve:
* lis 12,(got+4)@ha
* addis 11,11,(-res_0)@ha
- * lwz 0,(got+4)@l(12) # got[1] address of dl_runtime_resolve
- * addi 11,11,(-res_0)@l # r11 = index * 4
+ * lwz 0,(got+4)@l(12) # got[1] address of dl_runtime_resolve
+ * addi 11,11,(-res_0)@l # r11 = index * 4
* mtctr 0
* add 0,11,11
- * lwz 12,(got+8)@l(12) # got[2] contains the map address
- * add 11,0,11 # r11 = index * 12 = reloc offset.
+ * lwz 12,(got+8)@l(12) # got[2] contains the map address
+ * add 11,0,11 # r11 = index * 12 = reloc offset.
* bctr
*/
static const unsigned int plt_resolve[] =
bfd_boolean ppc_elf_tls_optimize (bfd *, struct bfd_link_info *);
void ppc_elf_maybe_strip_sdata_syms (struct bfd_link_info *);
extern bfd_boolean ppc_elf_modify_segment_map (bfd *,
- struct bfd_link_info * ATTRIBUTE_UNUSED);
+ struct bfd_link_info * ATTRIBUTE_UNUSED);
extern bfd_boolean ppc_elf_section_processing (bfd *, Elf_Internal_Shdr *);
HOWTO (R_PRU_GNU_DIFF8, /* type */
0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
+ 0, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_pru_diff_relocate, /* special_function */
- "R_PRU_DIFF8", /* name */
+ "R_PRU_DIFF8", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xff, /* dst_mask */
FALSE), /* pcrel_offset */
- HOWTO (R_PRU_GNU_DIFF16, /* type */
+ HOWTO (R_PRU_GNU_DIFF16, /* type */
0, /* rightshift */
1, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_pru_diff_relocate,/* special_function */
- "R_PRU_DIFF16", /* name */
+ "R_PRU_DIFF16", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
FALSE), /* pcrel_offset */
- HOWTO (R_PRU_GNU_DIFF32, /* type */
+ HOWTO (R_PRU_GNU_DIFF32, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_pru_diff_relocate,/* special_function */
- "R_PRU_DIFF32", /* name */
+ "R_PRU_DIFF32", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
- 0xffffffff, /* dst_mask */
+ 0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
HOWTO (R_PRU_GNU_DIFF16_PMEM, /* type */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_pru_diff_relocate,/* special_function */
- "R_PRU_DIFF16_PMEM", /* name */
+ "R_PRU_DIFF16_PMEM", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffff, /* dst_mask */
0, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_pru_diff_relocate,/* special_function */
- "R_PRU_DIFF32_PMEM", /* name */
+ "R_PRU_DIFF32_PMEM", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffffffff, /* dst_mask */
static reloc_howto_type rl78_elf_howto_table [] =
{
- RL78REL (NONE, 3, 0, 0, dont, FALSE),
- RL78REL (DIR32, 2, 32, 0, signed, FALSE),
- RL78REL (DIR24S, 2, 24, 0, signed, FALSE),
- RL78REL (DIR16, 1, 16, 0, dont, FALSE),
- RL78REL (DIR16U, 1, 16, 0, unsigned, FALSE),
- RL78REL (DIR16S, 1, 16, 0, signed, FALSE),
- RL78REL (DIR8, 0, 8, 0, dont, FALSE),
- RL78REL (DIR8U, 0, 8, 0, unsigned, FALSE),
- RL78REL (DIR8S, 0, 8, 0, signed, FALSE),
+ RL78REL (NONE, 3, 0, 0, dont, FALSE),
+ RL78REL (DIR32, 2, 32, 0, signed, FALSE),
+ RL78REL (DIR24S, 2, 24, 0, signed, FALSE),
+ RL78REL (DIR16, 1, 16, 0, dont, FALSE),
+ RL78REL (DIR16U, 1, 16, 0, unsigned, FALSE),
+ RL78REL (DIR16S, 1, 16, 0, signed, FALSE),
+ RL78REL (DIR8, 0, 8, 0, dont, FALSE),
+ RL78REL (DIR8U, 0, 8, 0, unsigned, FALSE),
+ RL78REL (DIR8S, 0, 8, 0, signed, FALSE),
RL78REL (DIR24S_PCREL, 2, 24, 0, signed, TRUE),
RL78REL (DIR16S_PCREL, 1, 16, 0, signed, TRUE),
- RL78REL (DIR8S_PCREL, 0, 8, 0, signed, TRUE),
- RL78REL (DIR16UL, 1, 16, 2, unsigned, FALSE),
- RL78REL (DIR16UW, 1, 16, 1, unsigned, FALSE),
- RL78REL (DIR8UL, 0, 8, 2, unsigned, FALSE),
- RL78REL (DIR8UW, 0, 8, 1, unsigned, FALSE),
- RL78REL (DIR32_REV, 1, 16, 0, dont, FALSE),
- RL78REL (DIR16_REV, 1, 16, 0, dont, FALSE),
- RL78REL (DIR3U_PCREL, 0, 3, 0, dont, TRUE),
+ RL78REL (DIR8S_PCREL, 0, 8, 0, signed, TRUE),
+ RL78REL (DIR16UL, 1, 16, 2, unsigned, FALSE),
+ RL78REL (DIR16UW, 1, 16, 1, unsigned, FALSE),
+ RL78REL (DIR8UL, 0, 8, 2, unsigned, FALSE),
+ RL78REL (DIR8UW, 0, 8, 1, unsigned, FALSE),
+ RL78REL (DIR32_REV, 1, 16, 0, dont, FALSE),
+ RL78REL (DIR16_REV, 1, 16, 0, dont, FALSE),
+ RL78REL (DIR3U_PCREL, 0, 3, 0, dont, TRUE),
EMPTY_HOWTO (0x13),
EMPTY_HOWTO (0x14),
EMPTY_HOWTO (0x2a),
EMPTY_HOWTO (0x2b),
EMPTY_HOWTO (0x2c),
- RL78REL (RH_RELAX, 0, 0, 0, dont, FALSE),
+ RL78REL (RH_RELAX, 0, 0, 0, dont, FALSE),
EMPTY_HOWTO (0x2e),
- RL78REL (RH_SADDR, 0, 0, 0, dont, FALSE),
+ RL78REL (RH_SADDR, 0, 0, 0, dont, FALSE),
EMPTY_HOWTO (0x30),
EMPTY_HOWTO (0x31),
EMPTY_HOWTO (0x32),
EMPTY_HOWTO (0x3f),
EMPTY_HOWTO (0x40),
- RL78_OP_REL (ABS32, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (ABS24S, 2, 24, 0, signed, FALSE),
- RL78_OP_REL (ABS16, 1, 16, 0, dont, FALSE),
- RL78_OP_REL (ABS16U, 1, 16, 0, unsigned, FALSE),
- RL78_OP_REL (ABS16S, 1, 16, 0, signed, FALSE),
- RL78_OP_REL (ABS8, 0, 8, 0, dont, FALSE),
- RL78_OP_REL (ABS8U, 0, 8, 0, unsigned, FALSE),
- RL78_OP_REL (ABS8S, 0, 8, 0, signed, FALSE),
- RL78_OP_REL (ABS24S_PCREL, 2, 24, 0, signed, TRUE),
- RL78_OP_REL (ABS16S_PCREL, 1, 16, 0, signed, TRUE),
- RL78_OP_REL (ABS8S_PCREL, 0, 8, 0, signed, TRUE),
- RL78_OP_REL (ABS16UL, 1, 16, 0, unsigned, FALSE),
- RL78_OP_REL (ABS16UW, 1, 16, 0, unsigned, FALSE),
- RL78_OP_REL (ABS8UL, 0, 8, 0, unsigned, FALSE),
- RL78_OP_REL (ABS8UW, 0, 8, 0, unsigned, FALSE),
- RL78_OP_REL (ABS32_REV, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (ABS16_REV, 1, 16, 0, dont, FALSE),
+ RL78_OP_REL (ABS32, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (ABS24S, 2, 24, 0, signed, FALSE),
+ RL78_OP_REL (ABS16, 1, 16, 0, dont, FALSE),
+ RL78_OP_REL (ABS16U, 1, 16, 0, unsigned, FALSE),
+ RL78_OP_REL (ABS16S, 1, 16, 0, signed, FALSE),
+ RL78_OP_REL (ABS8, 0, 8, 0, dont, FALSE),
+ RL78_OP_REL (ABS8U, 0, 8, 0, unsigned, FALSE),
+ RL78_OP_REL (ABS8S, 0, 8, 0, signed, FALSE),
+ RL78_OP_REL (ABS24S_PCREL, 2, 24, 0, signed, TRUE),
+ RL78_OP_REL (ABS16S_PCREL, 1, 16, 0, signed, TRUE),
+ RL78_OP_REL (ABS8S_PCREL, 0, 8, 0, signed, TRUE),
+ RL78_OP_REL (ABS16UL, 1, 16, 0, unsigned, FALSE),
+ RL78_OP_REL (ABS16UW, 1, 16, 0, unsigned, FALSE),
+ RL78_OP_REL (ABS8UL, 0, 8, 0, unsigned, FALSE),
+ RL78_OP_REL (ABS8UW, 0, 8, 0, unsigned, FALSE),
+ RL78_OP_REL (ABS32_REV, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (ABS16_REV, 1, 16, 0, dont, FALSE),
#define STACK_REL_P(x) ((x) <= R_RL78_ABS16_REV && (x) >= R_RL78_ABS32)
EMPTY_HOWTO (0x7e),
EMPTY_HOWTO (0x7f),
- RL78_OP_REL (SYM, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (OPneg, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (OPadd, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (OPsub, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (OPmul, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (OPdiv, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (OPshla, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (OPshra, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (SYM, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPneg, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPadd, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPsub, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPmul, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPdiv, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPshla, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPshra, 2, 32, 0, dont, FALSE),
RL78_OP_REL (OPsctsize, 2, 32, 0, dont, FALSE),
EMPTY_HOWTO (0x89),
EMPTY_HOWTO (0x8a),
RL78_OP_REL (OPscttop, 2, 32, 0, dont, FALSE),
EMPTY_HOWTO (0x8e),
EMPTY_HOWTO (0x8f),
- RL78_OP_REL (OPand, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (OPor, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (OPxor, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (OPnot, 2, 32, 0, dont, FALSE),
- RL78_OP_REL (OPmod, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPand, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPor, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPxor, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPnot, 2, 32, 0, dont, FALSE),
+ RL78_OP_REL (OPmod, 2, 32, 0, dont, FALSE),
RL78_OP_REL (OPromtop, 2, 32, 0, dont, FALSE),
RL78_OP_REL (OPramtop, 2, 32, 0, dont, FALSE)
};
struct rl78_reloc_map
{
bfd_reloc_code_real_type bfd_reloc_val;
- unsigned int rl78_reloc_val;
+ unsigned int rl78_reloc_val;
};
static const struct rl78_reloc_map rl78_reloc_map [] =
/* Set the howto pointer for an RL78 ELF reloc. */
static void
-rl78_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
- arelent * cache_ptr,
+rl78_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
+ arelent * cache_ptr,
Elf_Internal_Rela * dst)
{
unsigned int r_type;
}
\f
static bfd_vma
-get_symbol_value (const char * name,
+get_symbol_value (const char * name,
struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
+ bfd * input_bfd,
+ asection * input_section,
int offset)
{
struct bfd_link_hash_entry * h;
static bfd_vma
get_romstart (struct bfd_link_info * info,
- bfd * abfd,
- asection * sec,
+ bfd * abfd,
+ asection * sec,
int offset)
{
static bfd_boolean cached = FALSE;
static bfd_vma
get_ramstart (struct bfd_link_info * info,
- bfd * abfd,
- asection * sec,
+ bfd * abfd,
+ asection * sec,
int offset)
{
static bfd_boolean cached = FALSE;
do \
{ \
if (rl78_stack_top < NUM_STACK_ENTRIES) \
- rl78_stack [rl78_stack_top ++] = (val); \
+ rl78_stack [rl78_stack_top ++] = (val); \
else \
_bfd_error_handler (_("Internal Error: RL78 reloc stack overflow")); \
} \
do \
{ \
if (rl78_stack_top > 0) \
- (dest) = rl78_stack [-- rl78_stack_top];\
+ (dest) = rl78_stack [-- rl78_stack_top];\
else \
{ \
- _bfd_error_handler (_("Internal Error: RL78 reloc stack underflow")); \
- (dest) = 0; \
- } \
+ _bfd_error_handler (_("Internal Error: RL78 reloc stack underflow")); \
+ (dest) = 0; \
+ } \
} \
while (0)
static bfd_vma
rl78_compute_complex_reloc (unsigned long r_type,
- bfd_vma symval,
- asection * input_section)
+ bfd_vma symval,
+ asection * input_section)
{
int32_t tmp1, tmp2;
bfd_vma relocation;
bfd * output_bfd ATTRIBUTE_UNUSED,
char ** error_message ATTRIBUTE_UNUSED)
{
- bfd_reloc_status_type r = bfd_reloc_ok;
- bfd_vma relocation = 0;
- unsigned long r_type = reloc->howto->type;
- bfd_byte * contents = data;
+ bfd_reloc_status_type r = bfd_reloc_ok;
+ bfd_vma relocation = 0;
+ unsigned long r_type = reloc->howto->type;
+ bfd_byte * contents = data;
/* If necessary, compute the symbolic value of the relocation. */
switch (r_type)
static bfd_boolean
rl78_elf_relocate_section
- (bfd * output_bfd,
+ (bfd * output_bfd,
struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * relocs,
- Elf_Internal_Sym * local_syms,
- asection ** local_sections)
+ Elf_Internal_Sym * local_syms,
+ asection ** local_sections)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- Elf_Internal_Rela * rel;
- Elf_Internal_Rela * relend;
+ Elf_Internal_Rela * rel;
+ Elf_Internal_Rela * relend;
asection *splt;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
for (rel = relocs; rel < relend; rel ++)
{
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- const char * name = NULL;
- bfd_boolean unresolved_reloc = TRUE;
- int r_type;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char * name = NULL;
+ bfd_boolean unresolved_reloc = TRUE;
+ int r_type;
r_type = ELF32_R_TYPE (rel->r_info);
r_symndx = ELF32_R_SYM (rel->r_info);
howto = rl78_elf_howto_table + ELF32_R_TYPE (rel->r_info);
- h = NULL;
+ h = NULL;
sym = NULL;
sec = NULL;
relocation = 0;
if (bfd_link_relocatable (info))
{
/* This is a relocatable link. We don't have to change
- anything, unless the reloc is against a section symbol,
- in which case we have to adjust according to where the
- section symbol winds up in the output section. */
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
rel->r_addend += sec->output_offset;
continue;
static bfd_boolean
rl78_elf_check_relocs
- (bfd * abfd,
+ (bfd * abfd,
struct bfd_link_info * info,
- asection * sec,
+ asection * sec,
const Elf_Internal_Rela * relocs)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- const Elf_Internal_Rela * rel;
- const Elf_Internal_Rela * rel_end;
+ const Elf_Internal_Rela * rel;
+ const Elf_Internal_Rela * rel_end;
bfd_vma *local_plt_offsets;
asection *splt;
bfd *dynobj;
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
}
switch (ELF32_R_TYPE (rel->r_info))
- {
+ {
/* This relocation describes a 16-bit pointer to a function.
We may need to allocate a thunk in low memory; reserve memory
for it now. */
splt->size += 4;
}
break;
- }
+ }
}
return TRUE;
static bfd_boolean
rl78_elf_finish_dynamic_sections (bfd *abfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *splt;
static bfd_boolean
rl78_elf_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *splt;
static bfd_boolean
rl78_elf_relax_plt_section (bfd *dynobj,
- asection *splt,
- struct bfd_link_info *info,
- bfd_boolean *again)
+ asection *splt,
+ struct bfd_link_info *info,
+ bfd_boolean *again)
{
struct relax_plt_data relax_plt_data;
bfd *ibfd;
for (idx = 0; idx < nlocals; ++idx)
if (local_plt_offsets[idx] != (bfd_vma) -1)
{
- local_plt_offsets[idx] = entry;
+ local_plt_offsets[idx] = entry;
entry += 4;
}
}
Elf_Internal_Rela *alignment_rel, int force_snip)
{
Elf_Internal_Shdr * symtab_hdr;
- unsigned int sec_shndx;
- bfd_byte * contents;
+ unsigned int sec_shndx;
+ bfd_byte * contents;
Elf_Internal_Rela * irel;
Elf_Internal_Rela * irelend;
Elf_Internal_Sym * isym;
Elf_Internal_Sym * isymend;
- bfd_vma toaddr;
- unsigned int symcount;
+ bfd_vma toaddr;
+ unsigned int symcount;
struct elf_link_hash_entry ** sym_hashes;
struct elf_link_hash_entry ** end_hashes;
lrel, abfd, sec, link_info, scale)
static bfd_vma
-rl78_offset_for_reloc (bfd * abfd,
- Elf_Internal_Rela * rel,
- Elf_Internal_Shdr * symtab_hdr,
+rl78_offset_for_reloc (bfd * abfd,
+ Elf_Internal_Rela * rel,
+ Elf_Internal_Shdr * symtab_hdr,
Elf_External_Sym_Shndx * shndx_buf ATTRIBUTE_UNUSED,
- Elf_Internal_Sym * intsyms,
- Elf_Internal_Rela ** lrel,
- bfd * input_bfd,
- asection * input_section,
- struct bfd_link_info * info,
- int * scale)
+ Elf_Internal_Sym * intsyms,
+ Elf_Internal_Rela ** lrel,
+ bfd * input_bfd,
+ asection * input_section,
+ struct bfd_link_info * info,
+ int * scale)
{
bfd_vma symval;
static bfd_boolean
rl78_elf_relax_section
- (bfd * abfd,
- asection * sec,
+ (bfd * abfd,
+ asection * sec,
struct bfd_link_info * link_info,
- bfd_boolean * again)
+ bfd_boolean * again)
{
Elf_Internal_Shdr * symtab_hdr;
Elf_Internal_Shdr * shndx_hdr;
Elf_Internal_Rela * srel;
Elf_Internal_Rela * irelend;
Elf_Internal_Rela * next_alignment;
- bfd_byte * contents = NULL;
- bfd_byte * free_contents = NULL;
+ bfd_byte * contents = NULL;
+ bfd_byte * free_contents = NULL;
Elf_Internal_Sym * intsyms = NULL;
Elf_Internal_Sym * free_intsyms = NULL;
Elf_External_Sym_Shndx * shndx_buf = NULL;
reloc entry (such as gp-rel symbols). */
/* Get the value of the symbol referred to by the reloc. Just
- in case this is the last reloc in the list, use the RL's
- addend to choose between this reloc (no addend) or the next
- (yes addend, which means at least one following reloc). */
+ in case this is the last reloc in the list, use the RL's
+ addend to choose between this reloc (no addend) or the next
+ (yes addend, which means at least one following reloc). */
/* srel points to the "current" reloction for this insn -
actually the last reloc for a given operand, which is the one
elf32_rl78_relax_delete_bytes (abfd, sec, (insn - contents) + offset, nbytes, next_alignment, 0);
#define SNIP(offset, nbytes, newtype) \
- SNIPNR (offset, nbytes); \
+ SNIPNR (offset, nbytes); \
srel->r_info = ELF32_R_INFO (ELF32_R_SYM (srel->r_info), newtype)
/* The order of these bit tests must match the order that the
}
if ((irel->r_addend & RL78_RELAXA_MASK) == RL78_RELAXA_ADDR16
- && nrelocs > 0)
+ && nrelocs > 0)
{
/*----------------------------------------------------------------------*/
/* Some insns have both a 16-bit address operand and an 8-bit
Address 16-bit operand SADDR range SFR range
FFF00-FFFFF 0xff00-0xffff 0x00-0xff
- FFE20-FFF1F 0xfe20-0xff1f 0x00-0xff
+ FFE20-FFF1F 0xfe20-0xff1f 0x00-0xff
The RELAX_ADDR16[] array has the insn encodings for the
16-bit operand version, as well as the SFR and SADDR
#define elf_info_to_howto rl78_info_to_howto_rela
#define elf_backend_object_p rl78_elf_object_p
#define elf_backend_relocate_section rl78_elf_relocate_section
-#define elf_symbol_leading_char ('_')
+#define elf_symbol_leading_char ('_')
#define elf_backend_can_gc_sections 1
#define bfd_elf32_bfd_reloc_type_lookup rl78_reloc_type_lookup
#define bfd_elf32_bfd_print_private_bfd_data rl78_elf_print_private_bfd_data
#define bfd_elf32_bfd_relax_section rl78_elf_relax_section
-#define elf_backend_check_relocs rl78_elf_check_relocs
+#define elf_backend_check_relocs rl78_elf_check_relocs
#define elf_backend_always_size_sections \
rl78_elf_always_size_sections
#define elf_backend_finish_dynamic_sections \
static reloc_howto_type rx_elf_howto_table [] =
{
- RXREL (NONE, 3, 0, 0, dont, FALSE),
- RXREL (DIR32, 2, 32, 0, signed, FALSE),
+ RXREL (NONE, 3, 0, 0, dont, FALSE),
+ RXREL (DIR32, 2, 32, 0, signed, FALSE),
RXREL (DIR24S, 2, 24, 0, signed, FALSE),
- RXREL (DIR16, 1, 16, 0, dont, FALSE),
+ RXREL (DIR16, 1, 16, 0, dont, FALSE),
RXREL (DIR16U, 1, 16, 0, unsigned, FALSE),
RXREL (DIR16S, 1, 16, 0, signed, FALSE),
- RXREL (DIR8, 0, 8, 0, dont, FALSE),
- RXREL (DIR8U, 0, 8, 0, unsigned, FALSE),
- RXREL (DIR8S, 0, 8, 0, signed, FALSE),
+ RXREL (DIR8, 0, 8, 0, dont, FALSE),
+ RXREL (DIR8U, 0, 8, 0, unsigned, FALSE),
+ RXREL (DIR8S, 0, 8, 0, signed, FALSE),
RXREL (DIR24S_PCREL, 2, 24, 0, signed, TRUE),
RXREL (DIR16S_PCREL, 1, 16, 0, signed, TRUE),
RXREL (DIR8S_PCREL, 0, 8, 0, signed, TRUE),
RXREL (DIR16UW, 1, 16, 1, unsigned, FALSE),
RXREL (DIR8UL, 0, 8, 2, unsigned, FALSE),
RXREL (DIR8UW, 0, 8, 1, unsigned, FALSE),
- RXREL (DIR32_REV, 1, 16, 0, dont, FALSE),
- RXREL (DIR16_REV, 1, 16, 0, dont, FALSE),
- RXREL (DIR3U_PCREL, 0, 3, 0, dont, TRUE),
+ RXREL (DIR32_REV, 1, 16, 0, dont, FALSE),
+ RXREL (DIR16_REV, 1, 16, 0, dont, FALSE),
+ RXREL (DIR3U_PCREL, 0, 3, 0, dont, TRUE),
EMPTY_HOWTO (0x13),
EMPTY_HOWTO (0x14),
EMPTY_HOWTO (0x1e),
EMPTY_HOWTO (0x1f),
- RXREL (RH_3_PCREL, 0, 3, 0, signed, TRUE),
- RXREL (RH_16_OP, 1, 16, 0, signed, FALSE),
- RXREL (RH_24_OP, 2, 24, 0, signed, FALSE),
- RXREL (RH_32_OP, 2, 32, 0, signed, FALSE),
+ RXREL (RH_3_PCREL, 0, 3, 0, signed, TRUE),
+ RXREL (RH_16_OP, 1, 16, 0, signed, FALSE),
+ RXREL (RH_24_OP, 2, 24, 0, signed, FALSE),
+ RXREL (RH_32_OP, 2, 32, 0, signed, FALSE),
RXREL (RH_24_UNS, 2, 24, 0, unsigned, FALSE),
- RXREL (RH_8_NEG, 0, 8, 0, signed, FALSE),
- RXREL (RH_16_NEG, 1, 16, 0, signed, FALSE),
- RXREL (RH_24_NEG, 2, 24, 0, signed, FALSE),
- RXREL (RH_32_NEG, 2, 32, 0, signed, FALSE),
- RXREL (RH_DIFF, 2, 32, 0, signed, FALSE),
+ RXREL (RH_8_NEG, 0, 8, 0, signed, FALSE),
+ RXREL (RH_16_NEG, 1, 16, 0, signed, FALSE),
+ RXREL (RH_24_NEG, 2, 24, 0, signed, FALSE),
+ RXREL (RH_32_NEG, 2, 32, 0, signed, FALSE),
+ RXREL (RH_DIFF, 2, 32, 0, signed, FALSE),
RXREL (RH_GPRELB, 1, 16, 0, unsigned, FALSE),
RXREL (RH_GPRELW, 1, 16, 0, unsigned, FALSE),
RXREL (RH_GPRELL, 1, 16, 0, unsigned, FALSE),
- RXREL (RH_RELAX, 0, 0, 0, dont, FALSE),
+ RXREL (RH_RELAX, 0, 0, 0, dont, FALSE),
EMPTY_HOWTO (0x2e),
EMPTY_HOWTO (0x2f),
EMPTY_HOWTO (0x3f),
EMPTY_HOWTO (0x40),
- RXREL (ABS32, 2, 32, 0, dont, FALSE),
+ RXREL (ABS32, 2, 32, 0, dont, FALSE),
RXREL (ABS24S, 2, 24, 0, signed, FALSE),
- RXREL (ABS16, 1, 16, 0, dont, FALSE),
+ RXREL (ABS16, 1, 16, 0, dont, FALSE),
RXREL (ABS16U, 1, 16, 0, unsigned, FALSE),
RXREL (ABS16S, 1, 16, 0, signed, FALSE),
- RXREL (ABS8, 0, 8, 0, dont, FALSE),
- RXREL (ABS8U, 0, 8, 0, unsigned, FALSE),
- RXREL (ABS8S, 0, 8, 0, signed, FALSE),
+ RXREL (ABS8, 0, 8, 0, dont, FALSE),
+ RXREL (ABS8U, 0, 8, 0, unsigned, FALSE),
+ RXREL (ABS8S, 0, 8, 0, signed, FALSE),
RXREL (ABS24S_PCREL, 2, 24, 0, signed, TRUE),
RXREL (ABS16S_PCREL, 1, 16, 0, signed, TRUE),
RXREL (ABS8S_PCREL, 0, 8, 0, signed, TRUE),
RXREL (ABS16UW, 1, 16, 0, unsigned, FALSE),
RXREL (ABS8UL, 0, 8, 0, unsigned, FALSE),
RXREL (ABS8UW, 0, 8, 0, unsigned, FALSE),
- RXREL (ABS32_REV, 2, 32, 0, dont, FALSE),
- RXREL (ABS16_REV, 1, 16, 0, dont, FALSE),
+ RXREL (ABS32_REV, 2, 32, 0, dont, FALSE),
+ RXREL (ABS16_REV, 1, 16, 0, dont, FALSE),
#define STACK_REL_P(x) ((x) <= R_RX_ABS16_REV && (x) >= R_RX_ABS32)
/* A 5-bit unsigned displacement to a B/W/L address, at bit position 8/12. */
/* ---- ---- 4--- 3210. */
#define R_RX_RH_ABS5p8B 0x78
- RXREL (RH_ABS5p8B, 0, 0, 0, dont, FALSE),
+ RXREL (RH_ABS5p8B, 0, 0, 0, dont, FALSE),
#define R_RX_RH_ABS5p8W 0x79
- RXREL (RH_ABS5p8W, 0, 0, 0, dont, FALSE),
+ RXREL (RH_ABS5p8W, 0, 0, 0, dont, FALSE),
#define R_RX_RH_ABS5p8L 0x7a
- RXREL (RH_ABS5p8L, 0, 0, 0, dont, FALSE),
+ RXREL (RH_ABS5p8L, 0, 0, 0, dont, FALSE),
/* A 5-bit unsigned displacement to a B/W/L address, at bit position 5/12. */
/* ---- -432 1--- 0---. */
#define R_RX_RH_ABS5p5B 0x7b
- RXREL (RH_ABS5p5B, 0, 0, 0, dont, FALSE),
+ RXREL (RH_ABS5p5B, 0, 0, 0, dont, FALSE),
#define R_RX_RH_ABS5p5W 0x7c
- RXREL (RH_ABS5p5W, 0, 0, 0, dont, FALSE),
+ RXREL (RH_ABS5p5W, 0, 0, 0, dont, FALSE),
#define R_RX_RH_ABS5p5L 0x7d
- RXREL (RH_ABS5p5L, 0, 0, 0, dont, FALSE),
+ RXREL (RH_ABS5p5L, 0, 0, 0, dont, FALSE),
/* A 4-bit unsigned immediate at bit position 8. */
#define R_RX_RH_UIMM4p8 0x7e
- RXREL (RH_UIMM4p8, 0, 0, 0, dont, FALSE),
+ RXREL (RH_UIMM4p8, 0, 0, 0, dont, FALSE),
/* A 4-bit negative unsigned immediate at bit position 8. */
#define R_RX_RH_UNEG4p8 0x7f
- RXREL (RH_UNEG4p8, 0, 0, 0, dont, FALSE),
+ RXREL (RH_UNEG4p8, 0, 0, 0, dont, FALSE),
/* End of internal relocs. */
- RXREL (SYM, 2, 32, 0, dont, FALSE),
- RXREL (OPneg, 2, 32, 0, dont, FALSE),
- RXREL (OPadd, 2, 32, 0, dont, FALSE),
- RXREL (OPsub, 2, 32, 0, dont, FALSE),
- RXREL (OPmul, 2, 32, 0, dont, FALSE),
- RXREL (OPdiv, 2, 32, 0, dont, FALSE),
+ RXREL (SYM, 2, 32, 0, dont, FALSE),
+ RXREL (OPneg, 2, 32, 0, dont, FALSE),
+ RXREL (OPadd, 2, 32, 0, dont, FALSE),
+ RXREL (OPsub, 2, 32, 0, dont, FALSE),
+ RXREL (OPmul, 2, 32, 0, dont, FALSE),
+ RXREL (OPdiv, 2, 32, 0, dont, FALSE),
RXREL (OPshla, 2, 32, 0, dont, FALSE),
RXREL (OPshra, 2, 32, 0, dont, FALSE),
RXREL (OPsctsize, 2, 32, 0, dont, FALSE),
RXREL (OPscttop, 2, 32, 0, dont, FALSE),
- RXREL (OPand, 2, 32, 0, dont, FALSE),
- RXREL (OPor, 2, 32, 0, dont, FALSE),
- RXREL (OPxor, 2, 32, 0, dont, FALSE),
- RXREL (OPnot, 2, 32, 0, dont, FALSE),
- RXREL (OPmod, 2, 32, 0, dont, FALSE),
+ RXREL (OPand, 2, 32, 0, dont, FALSE),
+ RXREL (OPor, 2, 32, 0, dont, FALSE),
+ RXREL (OPxor, 2, 32, 0, dont, FALSE),
+ RXREL (OPnot, 2, 32, 0, dont, FALSE),
+ RXREL (OPmod, 2, 32, 0, dont, FALSE),
RXREL (OPromtop, 2, 32, 0, dont, FALSE),
RXREL (OPramtop, 2, 32, 0, dont, FALSE)
};
struct rx_reloc_map
{
bfd_reloc_code_real_type bfd_reloc_val;
- unsigned int rx_reloc_val;
+ unsigned int rx_reloc_val;
};
static const struct rx_reloc_map rx_reloc_map [] =
#define BIGE(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
static reloc_howto_type *
-rx_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
+rx_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
bfd_reloc_code_real_type code)
{
unsigned int i;
/* Set the howto pointer for an RX ELF reloc. */
static void
-rx_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
- arelent * cache_ptr,
+rx_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
+ arelent * cache_ptr,
Elf_Internal_Rela * dst)
{
unsigned int r_type;
}
\f
static bfd_vma
-get_symbol_value (const char * name,
+get_symbol_value (const char * name,
struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
+ bfd * input_bfd,
+ asection * input_section,
int offset)
{
bfd_vma value = 0;
}
static bfd_vma
-get_symbol_value_maybe (const char * name,
+get_symbol_value_maybe (const char * name,
struct bfd_link_info * info)
{
bfd_vma value = 0;
}
static bfd_vma
-get_gp (struct bfd_link_info * info,
- bfd * abfd,
- asection * sec,
+get_gp (struct bfd_link_info * info,
+ bfd * abfd,
+ asection * sec,
int offset)
{
static bfd_boolean cached = FALSE;
static bfd_vma
get_romstart (struct bfd_link_info * info,
- bfd * abfd,
- asection * sec,
+ bfd * abfd,
+ asection * sec,
int offset)
{
static bfd_boolean cached = FALSE;
static bfd_vma
get_ramstart (struct bfd_link_info * info,
- bfd * abfd,
- asection * sec,
+ bfd * abfd,
+ asection * sec,
int offset)
{
static bfd_boolean cached = FALSE;
do \
{ \
if (rx_stack_top < NUM_STACK_ENTRIES) \
- rx_stack [rx_stack_top ++] = (val); \
+ rx_stack [rx_stack_top ++] = (val); \
else \
- r = bfd_reloc_dangerous; \
+ r = bfd_reloc_dangerous; \
} \
while (0)
do \
{ \
if (rx_stack_top > 0) \
- (dest) = rx_stack [-- rx_stack_top]; \
+ (dest) = rx_stack [-- rx_stack_top]; \
else \
- (dest) = 0, r = bfd_reloc_dangerous; \
+ (dest) = 0, r = bfd_reloc_dangerous; \
} \
while (0)
static bfd_boolean
rx_elf_relocate_section
- (bfd * output_bfd,
+ (bfd * output_bfd,
struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * relocs,
- Elf_Internal_Sym * local_syms,
- asection ** local_sections)
+ Elf_Internal_Sym * local_syms,
+ asection ** local_sections)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- Elf_Internal_Rela * rel;
- Elf_Internal_Rela * relend;
+ Elf_Internal_Rela * rel;
+ Elf_Internal_Rela * relend;
bfd_boolean pid_mode;
bfd_boolean saw_subtract = FALSE;
const char * table_default_cache = NULL;
relend = relocs + input_section->reloc_count;
for (rel = relocs; rel < relend; rel ++)
{
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- const char * name = NULL;
- bfd_boolean unresolved_reloc = TRUE;
- int r_type;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char * name = NULL;
+ bfd_boolean unresolved_reloc = TRUE;
+ int r_type;
r_type = ELF32_R_TYPE (rel->r_info);
r_symndx = ELF32_R_SYM (rel->r_info);
howto = rx_elf_howto_table + ELF32_R_TYPE (rel->r_info);
- h = NULL;
+ h = NULL;
sym = NULL;
sec = NULL;
relocation = 0;
if (bfd_link_relocatable (info))
{
/* This is a relocatable link. We don't have to change
- anything, unless the reloc is against a section symbol,
- in which case we have to adjust according to where the
- section symbol winds up in the output section. */
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
rel->r_addend += sec->output_offset;
continue;
do \
{ \
if (pid_mode \
- && sec != NULL \
+ && sec != NULL \
&& sec->flags & SEC_READONLY \
&& !(input_section->flags & SEC_DEBUGGING) \
&& strcmp (name, "__pid_base") != 0 \
Elf_Internal_Rela *irelstart)
{
Elf_Internal_Shdr * symtab_hdr;
- unsigned int sec_shndx;
- bfd_byte * contents;
+ unsigned int sec_shndx;
+ bfd_byte * contents;
Elf_Internal_Rela * irel;
Elf_Internal_Rela * irelend;
Elf_Internal_Sym * isym;
Elf_Internal_Sym * isymend;
- bfd_vma toaddr;
- unsigned int symcount;
+ bfd_vma toaddr;
+ unsigned int symcount;
struct elf_link_hash_entry ** sym_hashes;
struct elf_link_hash_entry ** end_hashes;
if (alignment_rel)
toaddr = alignment_rel->r_offset;
- BFD_ASSERT (toaddr > addr);
+ BFD_ASSERT (toaddr > addr);
/* Actually delete the bytes. */
memmove (contents + addr, contents + addr + count,
lrel, abfd, sec, link_info, scale)
static bfd_vma
-rx_offset_for_reloc (bfd * abfd,
+rx_offset_for_reloc (bfd * abfd,
Elf_Internal_Rela * rel,
Elf_Internal_Shdr * symtab_hdr,
Elf_External_Sym_Shndx * shndx_buf ATTRIBUTE_UNUSED,
- Elf_Internal_Sym * intsyms,
+ Elf_Internal_Sym * intsyms,
Elf_Internal_Rela ** lrel,
- bfd * input_bfd,
- asection * input_section,
+ bfd * input_bfd,
+ asection * input_section,
struct bfd_link_info * info,
- int * scale)
+ int * scale)
{
bfd_vma symval;
bfd_reloc_status_type r;
/* Relax one section. */
static bfd_boolean
-elf32_rx_relax_section (bfd * abfd,
- asection * sec,
+elf32_rx_relax_section (bfd * abfd,
+ asection * sec,
struct bfd_link_info * link_info,
- bfd_boolean * again,
- bfd_boolean allow_pcrel3)
+ bfd_boolean * again,
+ bfd_boolean allow_pcrel3)
{
Elf_Internal_Shdr * symtab_hdr;
Elf_Internal_Shdr * shndx_hdr;
Elf_Internal_Rela * irelend;
Elf_Internal_Rela * next_alignment;
Elf_Internal_Rela * prev_alignment;
- bfd_byte * contents = NULL;
- bfd_byte * free_contents = NULL;
+ bfd_byte * contents = NULL;
+ bfd_byte * free_contents = NULL;
Elf_Internal_Sym * intsyms = NULL;
Elf_Internal_Sym * free_intsyms = NULL;
Elf_External_Sym_Shndx * shndx_buf = NULL;
reloc entry (such as gp-rel symbols). */
/* Get the value of the symbol referred to by the reloc. Just
- in case this is the last reloc in the list, use the RL's
- addend to choose between this reloc (no addend) or the next
- (yes addend, which means at least one following reloc). */
+ in case this is the last reloc in the list, use the RL's
+ addend to choose between this reloc (no addend) or the next
+ (yes addend, which means at least one following reloc). */
/* srel points to the "current" reloction for this insn -
actually the last reloc for a given operand, which is the one
#define SNIPNR(offset, nbytes) \
elf32_rx_relax_delete_bytes (abfd, sec, (insn - contents) + offset, nbytes, next_alignment, 0, internal_relocs);
#define SNIP(offset, nbytes, newtype) \
- SNIPNR (offset, nbytes); \
+ SNIPNR (offset, nbytes); \
srel->r_info = ELF32_R_INFO (ELF32_R_SYM (srel->r_info), newtype)
/* The order of these bit tests must match the order that the
}
static bfd_boolean
-elf32_rx_relax_section_wrapper (bfd * abfd,
- asection * sec,
+elf32_rx_relax_section_wrapper (bfd * abfd,
+ asection * sec,
struct bfd_link_info * link_info,
- bfd_boolean * again)
+ bfd_boolean * again)
{
return elf32_rx_relax_section (abfd, sec, link_info, again, FALSE);
}
{
#if 0 /* FIXME: EF_RX_CPU_MASK collides with E_FLAG_RX_...
Need to sort out how these flag bits are used.
- For now we assume that the flags are OK. */
+ For now we assume that the flags are OK. */
if ((elf_elfheader (abfd)->e_flags & EF_RX_CPU_MASK) == EF_RX_CPU_RX)
#endif
return bfd_mach_rx;
what you'd get by default. */
static bfd_boolean
-rx_get_section_contents (bfd * abfd,
+rx_get_section_contents (bfd * abfd,
sec_ptr section,
- void * location,
+ void * location,
file_ptr offset,
bfd_size_type count)
{
/* Fetch and swap unaligned bytes at the beginning. */
if (offset % 4)
- {
+ {
char buf[4];
rv = _bfd_generic_get_section_contents (abfd, section, buf,
- (offset & -4), 4);
+ (offset & -4), 4);
if (!rv)
return FALSE;
/* Fetch the end bytes. */
rv = _bfd_generic_get_section_contents (abfd, section, buf,
- offset + count - end_cnt, 4);
+ offset + count - end_cnt, 4);
if (!rv)
return FALSE;
#ifdef DJDEBUG
static bfd_boolean
-rx2_set_section_contents (bfd * abfd,
+rx2_set_section_contents (bfd * abfd,
sec_ptr section,
const void * location,
file_ptr offset,
#endif
static bfd_boolean
-rx_set_section_contents (bfd * abfd,
+rx_set_section_contents (bfd * abfd,
sec_ptr section,
const void * location,
file_ptr offset,
when we do not want their contents byte reversed. */
static const struct bfd_elf_special_section elf32_rx_special_sections[] =
{
- { STRING_COMMA_LEN (".init_array"), 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_EXECINSTR },
- { STRING_COMMA_LEN (".fini_array"), 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_EXECINSTR },
+ { STRING_COMMA_LEN (".init_array"), 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_EXECINSTR },
+ { STRING_COMMA_LEN (".fini_array"), 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_EXECINSTR },
{ STRING_COMMA_LEN (".preinit_array"), 0, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_EXECINSTR },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
\f
typedef struct {
called once per input object file. */
static bfd_boolean
rx_check_directives
- (bfd * abfd ATTRIBUTE_UNUSED,
+ (bfd * abfd ATTRIBUTE_UNUSED,
struct bfd_link_info * info ATTRIBUTE_UNUSED)
{
RX_Table_Info stuff;
#define elf_info_to_howto rx_info_to_howto_rela
#define elf_backend_object_p rx_elf_object_p
#define elf_backend_relocate_section rx_elf_relocate_section
-#define elf_symbol_leading_char ('_')
+#define elf_symbol_leading_char ('_')
#define elf_backend_can_gc_sections 1
#define elf_backend_modify_program_headers elf32_rx_modify_program_headers
#define bfd_elf32_set_section_contents rx_set_section_contents
#define bfd_elf32_bfd_final_link rx_final_link
#define bfd_elf32_bfd_relax_section elf32_rx_relax_section_wrapper
-#define elf_backend_special_sections elf32_rx_special_sections
+#define elf_backend_special_sections elf32_rx_special_sections
#define elf_backend_check_directives rx_check_directives
#include "elf32-target.h"
section get/set hooks, for times when we want to preserve the
pre-swapped .text sections (like objcopy). */
-#undef TARGET_BIG_SYM
+#undef TARGET_BIG_SYM
#define TARGET_BIG_SYM rx_elf32_be_ns_vec
-#undef TARGET_BIG_NAME
+#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-rx-be-ns"
-#undef TARGET_LITTLE_SYM
+#undef TARGET_LITTLE_SYM
#undef bfd_elf32_get_section_contents
#undef bfd_elf32_set_section_contents
0, /* dst_mask */
FALSE), /* pcrel_offset */
- HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE),
- HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
- bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE),
- HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE),
+ HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE),
+ HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE),
+ HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE),
+ HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE),
HOWTO(R_390_PC32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE),
+ bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE),
HOWTO(R_390_GOT12, 0, 1, 12, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE),
+ bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE),
HOWTO(R_390_GOT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE),
+ bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE),
HOWTO(R_390_PLT32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_COPY, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,0xffffffff, FALSE),
- HOWTO(R_390_GLOB_DAT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE),
+ HOWTO(R_390_COPY, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,0xffffffff, FALSE),
+ HOWTO(R_390_GLOB_DAT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GLOB_DAT", FALSE, 0,0xffffffff, FALSE),
- HOWTO(R_390_JMP_SLOT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_JMP_SLOT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_JMP_SLOT", FALSE, 0,0xffffffff, FALSE),
- HOWTO(R_390_RELATIVE, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_RELATIVE, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_RELATIVE", FALSE, 0,0xffffffff, FALSE),
- HOWTO(R_390_GOTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTOFF32", FALSE, 0,0xffffffff, FALSE),
- HOWTO(R_390_GOTPC, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE),
- HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE),
- HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTPC, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,0xffffffff, TRUE),
+ HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE),
+ HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE),
+ HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE),
+ HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT16DBL", FALSE, 0,0x0000ffff, TRUE),
HOWTO(R_390_PC32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE),
+ bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE),
HOWTO(R_390_PLT32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT32DBL", FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPCDBL", FALSE, 0,0xffffffff, TRUE),
EMPTY_HOWTO (R_390_64), /* Empty entry for R_390_64. */
EMPTY_HOWTO (R_390_PC64), /* Empty entry for R_390_PC64. */
EMPTY_HOWTO (R_390_GOT64), /* Empty entry for R_390_GOT64. */
EMPTY_HOWTO (R_390_PLT64), /* Empty entry for R_390_PLT64. */
HOWTO(R_390_GOTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_GOTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,0xffffffff, TRUE),
+ HOWTO(R_390_GOTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTOFF16", FALSE, 0,0x0000ffff, FALSE),
EMPTY_HOWTO (R_390_GOTOFF64), /* Empty entry for R_390_GOTOFF64. */
- HOWTO(R_390_GOTPLT12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
+ HOWTO(R_390_GOTPLT12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "R_390_GOTPLT12", FALSE, 0,0x00000fff, FALSE),
- HOWTO(R_390_GOTPLT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTPLT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPLT16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_GOTPLT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTPLT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPLT32", FALSE, 0,0xffffffff, FALSE),
EMPTY_HOWTO (R_390_GOTPLT64), /* Empty entry for R_390_GOTPLT64. */
HOWTO(R_390_GOTPLTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPLTENT",FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_PLTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_PLTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLTOFF16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_PLTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_PLTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLTOFF32", FALSE, 0,0xffffffff, FALSE),
EMPTY_HOWTO (R_390_PLTOFF64), /* Empty entry for R_390_PLTOFF64. */
HOWTO(R_390_TLS_LOAD, 0, 0, 0, FALSE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "R_390_TLS_DTPOFF", FALSE, 0, 0xffffffff, FALSE),
HOWTO(R_390_TLS_TPOFF, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_TLS_TPOFF", FALSE, 0, 0xffffffff, FALSE),
- HOWTO(R_390_20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
+ HOWTO(R_390_20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_20", FALSE, 0,0x0fffff00, FALSE),
HOWTO(R_390_GOT20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_GOT20", FALSE, 0,0x0fffff00, FALSE),
- HOWTO(R_390_GOTPLT20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
+ HOWTO(R_390_GOTPLT20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_GOTPLT20", FALSE, 0,0x0fffff00, FALSE),
HOWTO(R_390_TLS_GOTIE20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_TLS_GOTIE20", FALSE, 0,0x0fffff00, FALSE),
HOWTO(R_390_IRELATIVE, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_IRELATIVE", FALSE, 0, 0xffffffff, FALSE),
- HOWTO(R_390_PC12DBL, 1, 1, 12, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC12DBL", FALSE, 0,0x00000fff, TRUE),
+ HOWTO(R_390_PC12DBL, 1, 1, 12, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC12DBL", FALSE, 0,0x00000fff, TRUE),
HOWTO(R_390_PLT12DBL, 1, 1, 12, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT12DBL", FALSE, 0,0x00000fff, TRUE),
- HOWTO(R_390_PC24DBL, 1, 2, 24, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC24DBL", FALSE, 0,0x00ffffff, TRUE),
+ HOWTO(R_390_PC24DBL, 1, 2, 24, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC24DBL", FALSE, 0,0x00ffffff, TRUE),
HOWTO(R_390_PLT24DBL, 1, 2, 24, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT24DBL", FALSE, 0,0x00ffffff, TRUE),
};
and insert the address in the GOT.
Note: 390 can only address +- 64 K relative.
- We check if offset > 65536, then make a relative branch -64xxx
- back to a previous defined branch
-
-PLT1: BASR 1,0 # 2 bytes
- L 1,22(1) # 4 bytes Load offset in GOT in r 1
- L 1,(1,12) # 4 bytes Load address from GOT in r1
- BCR 15,1 # 2 bytes Jump to address
-RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
- L 1,14(1) # 4 bytes Load offset in symol table in r1
+ We check if offset > 65536, then make a relative branch -64xxx
+ back to a previous defined branch
+
+PLT1: BASR 1,0 # 2 bytes
+ L 1,22(1) # 4 bytes Load offset in GOT in r 1
+ L 1,(1,12) # 4 bytes Load address from GOT in r1
+ BCR 15,1 # 2 bytes Jump to address
+RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
+ L 1,14(1) # 4 bytes Load offset in symol table in r1
BRC 15,-x # 4 bytes Jump to start of PLT
- .word 0 # 2 bytes filler
- .long ? # 4 bytes offset in GOT
- .long ? # 4 bytes offset into rela.plt
+ .word 0 # 2 bytes filler
+ .long ? # 4 bytes offset in GOT
+ .long ? # 4 bytes offset into rela.plt
This was the general case. There are two additional, optimizes PLT
definitions. One for GOT offsets < 4096 and one for GOT offsets < 32768.
First the one for GOT offsets < 4096:
-PLT1: L 1,<offset>(12) # 4 bytes Load address from GOT in R1
- BCR 15,1 # 2 bytes Jump to address
- .word 0,0,0 # 6 bytes filler
-RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
- L 1,14(1) # 4 bytes Load offset in rela.plt in r1
- BRC 15,-x # 4 bytes Jump to start of PLT
- .word 0,0,0 # 6 bytes filler
- .long ? # 4 bytes offset into rela.plt
+PLT1: L 1,<offset>(12) # 4 bytes Load address from GOT in R1
+ BCR 15,1 # 2 bytes Jump to address
+ .word 0,0,0 # 6 bytes filler
+RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
+ L 1,14(1) # 4 bytes Load offset in rela.plt in r1
+ BRC 15,-x # 4 bytes Jump to start of PLT
+ .word 0,0,0 # 6 bytes filler
+ .long ? # 4 bytes offset into rela.plt
Second the one for GOT offsets < 32768:
-PLT1: LHI 1,<offset> # 4 bytes Load offset in GOT to r1
- L 1,(1,12) # 4 bytes Load address from GOT to r1
- BCR 15,1 # 2 bytes Jump to address
- .word 0 # 2 bytes filler
-RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
- L 1,14(1) # 4 bytes Load offset in rela.plt in r1
- BRC 15,-x # 4 bytes Jump to start of PLT
- .word 0,0,0 # 6 bytes filler
- .long ? # 4 bytes offset into rela.plt
+PLT1: LHI 1,<offset> # 4 bytes Load offset in GOT to r1
+ L 1,(1,12) # 4 bytes Load address from GOT to r1
+ BCR 15,1 # 2 bytes Jump to address
+ .word 0 # 2 bytes filler
+RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
+ L 1,14(1) # 4 bytes Load offset in rela.plt in r1
+ BRC 15,-x # 4 bytes Jump to start of PLT
+ .word 0,0,0 # 6 bytes filler
+ .long ? # 4 bytes offset into rela.plt
Total = 32 bytes per PLT entry
The code for static build PLT entries looks like this:
-PLT1: BASR 1,0 # 2 bytes
- L 1,22(1) # 4 bytes Load address of GOT entry
- L 1,0(0,1) # 4 bytes Load address from GOT in r1
- BCR 15,1 # 2 bytes Jump to address
-RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
- L 1,14(1) # 4 bytes Load offset in symbol table in r1
+PLT1: BASR 1,0 # 2 bytes
+ L 1,22(1) # 4 bytes Load address of GOT entry
+ L 1,0(0,1) # 4 bytes Load address from GOT in r1
+ BCR 15,1 # 2 bytes Jump to address
+RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
+ L 1,14(1) # 4 bytes Load offset in symbol table in r1
BRC 15,-x # 4 bytes Jump to start of PLT
- .word 0 # 2 bytes filler
- .long ? # 4 bytes address of GOT entry
- .long ? # 4 bytes offset into rela.plt */
+ .word 0 # 2 bytes filler
+ .long ? # 4 bytes address of GOT entry
+ .long ? # 4 bytes offset into rela.plt */
static const bfd_byte elf_s390_plt_entry[PLT_ENTRY_SIZE] =
{
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x16, /* l %r1,22(%r1) */
- 0x58, 0x10, 0x10, 0x00, /* l %r1,0(%r1) */
- 0x07, 0xf1, /* br %r1 */
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
- 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
- 0x00, 0x00, /* padding */
- 0x00, 0x00, 0x00, 0x00, /* GOT offset */
- 0x00, 0x00, 0x00, 0x00 /* rela.plt offset */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x16, /* l %r1,22(%r1) */
+ 0x58, 0x10, 0x10, 0x00, /* l %r1,0(%r1) */
+ 0x07, 0xf1, /* br %r1 */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
+ 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
+ 0x00, 0x00, /* padding */
+ 0x00, 0x00, 0x00, 0x00, /* GOT offset */
+ 0x00, 0x00, 0x00, 0x00 /* rela.plt offset */
};
/* Generic PLT pic entry. */
static const bfd_byte elf_s390_plt_pic_entry[PLT_ENTRY_SIZE] =
{
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x16, /* l %r1,22(%r1) */
- 0x58, 0x11, 0xc0, 0x00, /* l %r1,0(%r1,%r12) */
- 0x07, 0xf1, /* br %r1 */
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
- 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
- 0x00, 0x00, /* padding */
- 0x00, 0x00, 0x00, 0x00, /* GOT offset */
- 0x00, 0x00, 0x00, 0x00 /* rela.plt offset */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x16, /* l %r1,22(%r1) */
+ 0x58, 0x11, 0xc0, 0x00, /* l %r1,0(%r1,%r12) */
+ 0x07, 0xf1, /* br %r1 */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
+ 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
+ 0x00, 0x00, /* padding */
+ 0x00, 0x00, 0x00, 0x00, /* GOT offset */
+ 0x00, 0x00, 0x00, 0x00 /* rela.plt offset */
};
/* Optimized PLT pic entry for GOT offset < 4k. xx will be replaced
when generating the PLT slot with the GOT offset. */
static const bfd_byte elf_s390_plt_pic12_entry[PLT_ENTRY_SIZE] =
{
- 0x58, 0x10, 0xc0, 0x00, /* l %r1,xx(%r12) */
- 0x07, 0xf1, /* br %r1 */
- 0x00, 0x00, 0x00, 0x00, /* padding */
+ 0x58, 0x10, 0xc0, 0x00, /* l %r1,xx(%r12) */
+ 0x07, 0xf1, /* br %r1 */
+ 0x00, 0x00, 0x00, 0x00, /* padding */
0x00, 0x00,
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
- 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
+ 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
when generating the PLT slot with the GOT offset. */
static const bfd_byte elf_s390_plt_pic16_entry[PLT_ENTRY_SIZE] =
{
- 0xa7, 0x18, 0x00, 0x00, /* lhi %r1,xx */
- 0x58, 0x11, 0xc0, 0x00, /* l %r1,0(%r1,%r12) */
- 0x07, 0xf1, /* br %r1 */
+ 0xa7, 0x18, 0x00, 0x00, /* lhi %r1,xx */
+ 0x58, 0x11, 0xc0, 0x00, /* l %r1,0(%r1,%r12) */
+ 0x07, 0xf1, /* br %r1 */
0x00, 0x00,
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
- 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
+ 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00
/* The first entry in the PLT for PIC code:
PLT0:
- ST 1,28(15) # R1 has offset into rela.plt
- L 1,4(12) # Get loader ino(object struct address)
- ST 1,24(15) # Store address
- L 1,8(12) # Entry address of loader in R1
- BR 1 # Jump to loader
+ ST 1,28(15) # R1 has offset into rela.plt
+ L 1,4(12) # Get loader ino(object struct address)
+ ST 1,24(15) # Store address
+ L 1,8(12) # Entry address of loader in R1
+ BR 1 # Jump to loader
The first entry in the PLT for static code:
PLT0:
- ST 1,28(15) # R1 has offset into rela.plt
+ ST 1,28(15) # R1 has offset into rela.plt
BASR 1,0
- L 1,18(0,1) # Get address of GOT
- MVC 24(4,15),4(1) # Move loader ino to stack
- L 1,8(1) # Get address of loader
- BR 1 # Jump to loader
- .word 0 # filler
- .long got # address of GOT */
+ L 1,18(0,1) # Get address of GOT
+ MVC 24(4,15),4(1) # Move loader ino to stack
+ L 1,8(1) # Get address of loader
+ BR 1 # Jump to loader
+ .word 0 # filler
+ .long got # address of GOT */
static const bfd_byte elf_s390_plt_first_entry[PLT_FIRST_ENTRY_SIZE] =
{
- 0x50, 0x10, 0xf0, 0x1c, /* st %r1,28(%r15) */
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x12, /* l %r1,18(%r1) */
- 0xd2, 0x03, 0xf0, 0x18, 0x10, 0x04, /* mvc 24(4,%r15),4(%r1) */
- 0x58, 0x10, 0x10, 0x08, /* l %r1,8(%r1) */
- 0x07, 0xf1, /* br %r1 */
+ 0x50, 0x10, 0xf0, 0x1c, /* st %r1,28(%r15) */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x12, /* l %r1,18(%r1) */
+ 0xd2, 0x03, 0xf0, 0x18, 0x10, 0x04, /* mvc 24(4,%r15),4(%r1) */
+ 0x58, 0x10, 0x10, 0x08, /* l %r1,8(%r1) */
+ 0x07, 0xf1, /* br %r1 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00
static const bfd_byte elf_s390_plt_pic_first_entry[PLT_FIRST_ENTRY_SIZE] =
{
- 0x50, 0x10, 0xf0, 0x1c, /* st %r1,28(%r15) */
- 0x58, 0x10, 0xc0, 0x04, /* l %r1,4(%r12) */
- 0x50, 0x10, 0xf0, 0x18, /* st %r1,24(%r15) */
- 0x58, 0x10, 0xc0, 0x08, /* l %r1,8(%r12) */
- 0x07, 0xf1, /* br %r1 */
+ 0x50, 0x10, 0xf0, 0x1c, /* st %r1,28(%r15) */
+ 0x58, 0x10, 0xc0, 0x04, /* l %r1,4(%r12) */
+ 0x50, 0x10, 0xf0, 0x18, /* st %r1,24(%r15) */
+ 0x58, 0x10, 0xc0, 0x08, /* l %r1,8(%r12) */
+ 0x07, 0xf1, /* br %r1 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
}
else
{
- h->plt.offset = (bfd_vma) -1;
+ h->plt.offset = (bfd_vma) -1;
h->needs_plt = 0;
elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
}
htab->elf.irelplt->size += RELA_ENTRY_SIZE;
}
else
- local_plt[i].plt.offset = (bfd_vma) -1;
+ local_plt[i].plt.offset = (bfd_vma) -1;
}
}
if (s390_is_ifunc_symbol_p (h))
relocation = (htab->elf.iplt->output_section->vma
- + htab->elf.iplt->output_offset
+ + htab->elf.iplt->output_offset
+ h->plt.offset);
else
relocation = (htab->elf.splt->output_section->vma
{
/* GD->IE transition.
brasl %r14,__tls_get_addr@plt ->
- l %r2,0(%r2,%r12) ; bcr 0,0 */
+ l %r2,0(%r2,%r12) ; bcr 0,0 */
insn = 0x5822c000;
bfd_put_16 (output_bfd, 0x0700,
contents + rel->r_offset + 4);
#define elf_backend_grok_psinfo elf_s390_grok_psinfo
#define elf_backend_write_core_note elf_s390_write_core_note
#define elf_backend_plt_sym_val elf_s390_plt_sym_val
-#define elf_backend_add_symbol_hook elf_s390_add_symbol_hook
-#define elf_backend_sort_relocs_p elf_s390_elf_sort_relocs_p
+#define elf_backend_add_symbol_hook elf_s390_add_symbol_hook
+#define elf_backend_sort_relocs_p elf_s390_elf_sort_relocs_p
#define bfd_elf32_mkobject elf_s390_mkobject
#define elf_backend_object_p elf_s390_object_p
(get_elf_backend_data (abfd)->s->arch_size / 8)
#define SCORE_ELF_ADD_DYNAMIC_ENTRY(info, tag, val) \
- (_bfd_elf_add_dynamic_entry (info, (bfd_vma) tag, (bfd_vma) val))
+ (_bfd_elf_add_dynamic_entry (info, (bfd_vma) tag, (bfd_vma) val))
/* The size of an external dynamic table entry. */
#define SCORE_ELF_DYN_SIZE(abfd) \
static bfd_reloc_status_type
score_elf_hi16_reloc (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *reloc_entry,
- asymbol *symbol ATTRIBUTE_UNUSED,
- void * data,
- asection *input_section ATTRIBUTE_UNUSED,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
hi16_rel_addr = (bfd_byte *) data + reloc_entry->address;
return bfd_reloc_ok;
static bfd_reloc_status_type
score_elf_lo16_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol ATTRIBUTE_UNUSED,
- void * data,
- asection *input_section,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma addend = 0, offset = 0;
unsigned long val;
else
{
for (i = 0; i < count; i++, sym++)
- {
- const char *name;
-
- name = bfd_asymbol_name (*sym);
- if (*name == '_' && strcmp (name, "_gp") == 0)
- {
- *pgp = bfd_asymbol_value (*sym);
- _bfd_set_gp_value (output_bfd, *pgp);
- break;
- }
- }
+ {
+ const char *name;
+
+ name = bfd_asymbol_name (*sym);
+ if (*name == '_' && strcmp (name, "_gp") == 0)
+ {
+ *pgp = bfd_asymbol_value (*sym);
+ _bfd_set_gp_value (output_bfd, *pgp);
+ break;
+ }
+ }
}
if (i >= count)
external symbol if we are producing relocatable output. */
static bfd_reloc_status_type
score_elf_final_gp (bfd *output_bfd,
- asymbol *symbol,
- bfd_boolean relocatable,
- char **error_message,
- bfd_vma *pgp)
+ asymbol *symbol,
+ bfd_boolean relocatable,
+ char **error_message,
+ bfd_vma *pgp)
{
if (bfd_is_und_section (symbol->section)
&& ! relocatable)
*pgp = _bfd_get_gp_value (output_bfd);
if (*pgp == 0
&& (! relocatable
- || (symbol->flags & BSF_SECTION_SYM) != 0))
+ || (symbol->flags & BSF_SECTION_SYM) != 0))
{
if (relocatable)
- {
- /* Make up a value. */
- *pgp = symbol->section->output_section->vma + 0x4000;
- _bfd_set_gp_value (output_bfd, *pgp);
- }
+ {
+ /* Make up a value. */
+ *pgp = symbol->section->output_section->vma + 0x4000;
+ _bfd_set_gp_value (output_bfd, *pgp);
+ }
else if (!score_elf_assign_gp (output_bfd, pgp))
- {
- *error_message =
- (char *) _("GP relative relocation when _gp not defined");
- return bfd_reloc_dangerous;
- }
+ {
+ *error_message =
+ (char *) _("GP relative relocation when _gp not defined");
+ return bfd_reloc_dangerous;
+ }
}
return bfd_reloc_ok;
static bfd_reloc_status_type
score_elf_gprel15_with_gp (bfd *abfd,
- asymbol *symbol,
- arelent *reloc_entry,
- asection *input_section,
- bfd_boolean relocateable,
- void * data,
- bfd_vma gp ATTRIBUTE_UNUSED)
+ asymbol *symbol,
+ arelent *reloc_entry,
+ asection *input_section,
+ bfd_boolean relocateable,
+ void * data,
+ bfd_vma gp ATTRIBUTE_UNUSED)
{
bfd_vma relocation;
unsigned long insn;
static bfd_reloc_status_type
gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry,
- asection *input_section, bfd_boolean relocatable,
- void *data, bfd_vma gp)
+ asection *input_section, bfd_boolean relocatable,
+ void *data, bfd_vma gp)
{
bfd_vma relocation;
bfd_vma val;
static bfd_reloc_status_type
score_elf_gprel15_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol,
- void * data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message)
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message)
{
bfd_boolean relocateable;
bfd_reloc_status_type ret;
return ret;
return score_elf_gprel15_with_gp (abfd, symbol, reloc_entry,
- input_section, relocateable, data, gp);
+ input_section, relocateable, data, gp);
}
/* Do a R_SCORE_GPREL32 relocation. This is a 32 bit value which must
static bfd_reloc_status_type
score_elf_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
- void *data, asection *input_section, bfd *output_bfd,
- char **error_message)
+ void *data, asection *input_section, bfd *output_bfd,
+ char **error_message)
{
bfd_boolean relocatable;
bfd_reloc_status_type ret;
&& (symbol->flags & BSF_LOCAL) != 0)
{
*error_message = (char *)
- _("32bits gp relative relocation occurs for an external symbol");
+ _("32bits gp relative relocation occurs for an external symbol");
return bfd_reloc_outofrange;
}
gp = 0;
return gprel32_with_gp (abfd, symbol, reloc_entry, input_section,
- relocatable, data, gp);
+ relocatable, data, gp);
}
/* A howto special_function for R_SCORE_GOT15 relocations. This is just
treated in the same as R_SCORE_HI16 when applied to local symbols. */
static bfd_reloc_status_type
score_elf_got15_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
- void *data, asection *input_section,
- bfd *output_bfd, char **error_message)
+ void *data, asection *input_section,
+ bfd *output_bfd, char **error_message)
{
if ((symbol->flags & (BSF_GLOBAL | BSF_WEAK)) != 0
|| bfd_is_und_section (bfd_get_section (symbol))
|| bfd_is_com_section (bfd_get_section (symbol)))
/* The relocation is against a global symbol. */
return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd,
- error_message);
+ input_section, output_bfd,
+ error_message);
return score_elf_hi16_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message);
+ input_section, output_bfd, error_message);
}
static bfd_reloc_status_type
score_elf_got_lo16_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol ATTRIBUTE_UNUSED,
- void * data,
- asection *input_section,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma addend = 0, offset = 0;
signed long val;
static reloc_howto_type elf32_score_howto_table[] =
{
/* No relocation. */
- HOWTO (R_SCORE_NONE, /* type */
- 0, /* rightshift */
- 3, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_NONE", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_NONE, /* type */
+ 0, /* rightshift */
+ 3, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_NONE", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_HI16 */
- HOWTO (R_SCORE_HI16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_hi16_reloc, /* special_function */
- "R_SCORE_HI16", /* name */
- TRUE, /* partial_inplace */
- 0x37fff, /* src_mask */
- 0x37fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_HI16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_hi16_reloc, /* special_function */
+ "R_SCORE_HI16", /* name */
+ TRUE, /* partial_inplace */
+ 0x37fff, /* src_mask */
+ 0x37fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_LO16 */
- HOWTO (R_SCORE_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_lo16_reloc, /* special_function */
- "R_SCORE_LO16", /* name */
- TRUE, /* partial_inplace */
- 0x37fff, /* src_mask */
- 0x37fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_lo16_reloc, /* special_function */
+ "R_SCORE_LO16", /* name */
+ TRUE, /* partial_inplace */
+ 0x37fff, /* src_mask */
+ 0x37fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_BCMP */
- HOWTO (R_SCORE_BCMP, /* type */
- 1, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- TRUE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_BCMP", /* name */
- FALSE, /* partial_inplace */
- 0x03e00381, /* src_mask */
- 0x03e00381, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_BCMP, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ TRUE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_BCMP", /* name */
+ FALSE, /* partial_inplace */
+ 0x03e00381, /* src_mask */
+ 0x03e00381, /* dst_mask */
+ FALSE), /* pcrel_offset */
/*R_SCORE_24 */
- HOWTO (R_SCORE_24, /* type */
- 1, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 24, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_24", /* name */
- FALSE, /* partial_inplace */
- 0x3ff7fff, /* src_mask */
- 0x3ff7fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_24, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 24, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_24", /* name */
+ FALSE, /* partial_inplace */
+ 0x3ff7fff, /* src_mask */
+ 0x3ff7fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/*R_SCORE_PC19 */
- HOWTO (R_SCORE_PC19, /* type */
- 1, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 19, /* bitsize */
- TRUE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_PC19", /* name */
- FALSE, /* partial_inplace */
- 0x3ff03fe, /* src_mask */
- 0x3ff03fe, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_PC19, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 19, /* bitsize */
+ TRUE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_PC19", /* name */
+ FALSE, /* partial_inplace */
+ 0x3ff03fe, /* src_mask */
+ 0x3ff03fe, /* dst_mask */
+ FALSE), /* pcrel_offset */
/*R_SCORE16_11 */
- HOWTO (R_SCORE16_11, /* type */
- 1, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 11, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE16_11", /* name */
- FALSE, /* partial_inplace */
- 0x000000ffe, /* src_mask */
- 0x000000ffe, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE16_11, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 11, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE16_11", /* name */
+ FALSE, /* partial_inplace */
+ 0x000000ffe, /* src_mask */
+ 0x000000ffe, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE16_PC8 */
- HOWTO (R_SCORE16_PC8, /* type */
- 1, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 9, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE16_PC8", /* name */
- FALSE, /* partial_inplace */
- 0x000001ff, /* src_mask */
- 0x000001ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE16_PC8, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 9, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE16_PC8", /* name */
+ FALSE, /* partial_inplace */
+ 0x000001ff, /* src_mask */
+ 0x000001ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 32 bit absolute */
- HOWTO (R_SCORE_ABS32, /* type 8 */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_ABS32", /* name */
- FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_ABS32, /* type 8 */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_ABS32", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 16 bit absolute */
- HOWTO (R_SCORE_ABS16, /* type 11 */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_ABS16", /* name */
- FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_ABS16, /* type 11 */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_ABS16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_DUMMY2 */
- HOWTO (R_SCORE_DUMMY2, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_DUMMY2", /* name */
- TRUE, /* partial_inplace */
- 0x00007fff, /* src_mask */
- 0x00007fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_DUMMY2, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_DUMMY2", /* name */
+ TRUE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_GP15 */
- HOWTO (R_SCORE_GP15, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_gprel15_reloc,/* special_function */
- "R_SCORE_GP15", /* name */
- TRUE, /* partial_inplace */
- 0x00007fff, /* src_mask */
- 0x00007fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_GP15, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_gprel15_reloc,/* special_function */
+ "R_SCORE_GP15", /* name */
+ TRUE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_SCORE_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- NULL, /* special_function */
- "R_SCORE_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ NULL, /* special_function */
+ "R_SCORE_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage */
- HOWTO (R_SCORE_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_SCORE_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_SCORE_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* Reference to global offset table. */
- HOWTO (R_SCORE_GOT15, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- score_elf_got15_reloc, /* special_function */
- "R_SCORE_GOT15", /* name */
- TRUE, /* partial_inplace */
- 0x00007fff, /* src_mask */
- 0x00007fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_GOT15, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ score_elf_got15_reloc, /* special_function */
+ "R_SCORE_GOT15", /* name */
+ TRUE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* Low 16 bits of displacement in global offset table. */
- HOWTO (R_SCORE_GOT_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_got_lo16_reloc, /* special_function */
- "R_SCORE_GOT_LO16", /* name */
- TRUE, /* partial_inplace */
- 0x37ffe, /* src_mask */
- 0x37ffe, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_GOT_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_got_lo16_reloc, /* special_function */
+ "R_SCORE_GOT_LO16", /* name */
+ TRUE, /* partial_inplace */
+ 0x37ffe, /* src_mask */
+ 0x37ffe, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 15 bit call through global offset table. */
- HOWTO (R_SCORE_CALL15, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_CALL15", /* name */
- TRUE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_CALL15, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_CALL15", /* name */
+ TRUE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 32 bit GP relative reference. */
- HOWTO (R_SCORE_GPREL32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_gprel32_reloc, /* special_function */
- "R_SCORE_GPREL32", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_GPREL32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_gprel32_reloc, /* special_function */
+ "R_SCORE_GPREL32", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 32 bit symbol relative relocation. */
- HOWTO (R_SCORE_REL32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_REL32", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_REL32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_REL32", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_DUMMY_HI16 */
- HOWTO (R_SCORE_DUMMY_HI16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_hi16_reloc, /* special_function */
- "R_SCORE_DUMMY_HI16", /* name */
- TRUE, /* partial_inplace */
- 0x37fff, /* src_mask */
- 0x37fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_DUMMY_HI16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_hi16_reloc, /* special_function */
+ "R_SCORE_DUMMY_HI16", /* name */
+ TRUE, /* partial_inplace */
+ 0x37fff, /* src_mask */
+ 0x37fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_IMM30 */
- HOWTO (R_SCORE_IMM30, /* type */
- 2, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 30, /* bitsize */
- FALSE, /* pc_relative */
- 7, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_IMM30", /* name */
- FALSE, /* partial_inplace */
- 0x7f7fff7f80LL, /* src_mask */
- 0x7f7fff7f80LL, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_IMM30, /* type */
+ 2, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 30, /* bitsize */
+ FALSE, /* pc_relative */
+ 7, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_IMM30", /* name */
+ FALSE, /* partial_inplace */
+ 0x7f7fff7f80LL, /* src_mask */
+ 0x7f7fff7f80LL, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_IMM32 */
- HOWTO (R_SCORE_IMM32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 5, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_IMM32", /* name */
- FALSE, /* partial_inplace */
- 0x7f7fff7fe0LL, /* src_mask */
- 0x7f7fff7fe0LL, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_IMM32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 5, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_IMM32", /* name */
+ FALSE, /* partial_inplace */
+ 0x7f7fff7fe0LL, /* src_mask */
+ 0x7f7fff7fe0LL, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
struct score_reloc_map
static const struct score_reloc_map elf32_score_reloc_map[] =
{
- {BFD_RELOC_NONE, R_SCORE_NONE},
- {BFD_RELOC_HI16_S, R_SCORE_HI16},
- {BFD_RELOC_LO16, R_SCORE_LO16},
- {BFD_RELOC_SCORE_BCMP, R_SCORE_BCMP},
- {BFD_RELOC_SCORE_JMP, R_SCORE_24},
- {BFD_RELOC_SCORE_BRANCH, R_SCORE_PC19},
- {BFD_RELOC_SCORE16_JMP, R_SCORE16_11},
- {BFD_RELOC_SCORE16_BRANCH, R_SCORE16_PC8},
- {BFD_RELOC_32, R_SCORE_ABS32},
- {BFD_RELOC_16, R_SCORE_ABS16},
- {BFD_RELOC_SCORE_DUMMY2, R_SCORE_DUMMY2},
- {BFD_RELOC_SCORE_GPREL15, R_SCORE_GP15},
- {BFD_RELOC_VTABLE_INHERIT, R_SCORE_GNU_VTINHERIT},
- {BFD_RELOC_VTABLE_ENTRY, R_SCORE_GNU_VTENTRY},
- {BFD_RELOC_SCORE_GOT15, R_SCORE_GOT15},
- {BFD_RELOC_SCORE_GOT_LO16, R_SCORE_GOT_LO16},
- {BFD_RELOC_SCORE_CALL15, R_SCORE_CALL15},
- {BFD_RELOC_GPREL32, R_SCORE_GPREL32},
- {BFD_RELOC_32_PCREL, R_SCORE_REL32},
- {BFD_RELOC_SCORE_DUMMY_HI16, R_SCORE_DUMMY_HI16},
- {BFD_RELOC_SCORE_IMM30, R_SCORE_IMM30},
- {BFD_RELOC_SCORE_IMM32, R_SCORE_IMM32},
+ {BFD_RELOC_NONE, R_SCORE_NONE},
+ {BFD_RELOC_HI16_S, R_SCORE_HI16},
+ {BFD_RELOC_LO16, R_SCORE_LO16},
+ {BFD_RELOC_SCORE_BCMP, R_SCORE_BCMP},
+ {BFD_RELOC_SCORE_JMP, R_SCORE_24},
+ {BFD_RELOC_SCORE_BRANCH, R_SCORE_PC19},
+ {BFD_RELOC_SCORE16_JMP, R_SCORE16_11},
+ {BFD_RELOC_SCORE16_BRANCH, R_SCORE16_PC8},
+ {BFD_RELOC_32, R_SCORE_ABS32},
+ {BFD_RELOC_16, R_SCORE_ABS16},
+ {BFD_RELOC_SCORE_DUMMY2, R_SCORE_DUMMY2},
+ {BFD_RELOC_SCORE_GPREL15, R_SCORE_GP15},
+ {BFD_RELOC_VTABLE_INHERIT, R_SCORE_GNU_VTINHERIT},
+ {BFD_RELOC_VTABLE_ENTRY, R_SCORE_GNU_VTENTRY},
+ {BFD_RELOC_SCORE_GOT15, R_SCORE_GOT15},
+ {BFD_RELOC_SCORE_GOT_LO16, R_SCORE_GOT_LO16},
+ {BFD_RELOC_SCORE_CALL15, R_SCORE_CALL15},
+ {BFD_RELOC_GPREL32, R_SCORE_GPREL32},
+ {BFD_RELOC_32_PCREL, R_SCORE_REL32},
+ {BFD_RELOC_SCORE_DUMMY_HI16, R_SCORE_DUMMY_HI16},
+ {BFD_RELOC_SCORE_IMM30, R_SCORE_IMM30},
+ {BFD_RELOC_SCORE_IMM32, R_SCORE_IMM32},
};
/* got_entries only match if they're identical, except for gotidx, so
return e1->abfd == e2->abfd && e1->symndx == e2->symndx
&& (! e1->abfd ? e1->d.address == e2->d.address
- : e1->symndx >= 0 ? e1->d.addend == e2->d.addend
- : e1->d.h == e2->d.h);
+ : e1->symndx >= 0 ? e1->d.addend == e2->d.addend
+ : e1->d.h == e2->d.h);
}
/* If H needs a GOT entry, assign it the highest available dynamic
if (h->root.got.offset == 2)
{
if (hsd->max_unref_got_dynindx == hsd->min_got_dynindx)
- hsd->low = (struct elf_link_hash_entry *) h;
+ hsd->low = (struct elf_link_hash_entry *) h;
h->root.dynindx = hsd->max_unref_got_dynindx++;
}
else if (h->root.got.offset != 1)
section symbols are added and the count is higher. */
static bfd_boolean
score_elf_sort_hash_table (struct bfd_link_info *info,
- unsigned long max_local)
+ unsigned long max_local)
{
struct score_elf_hash_sort_data hsd;
struct score_got_info *g;
accommodate both the GOT and non-GOT symbols. */
BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx);
BFD_ASSERT ((unsigned long)hsd.max_unref_got_dynindx
- <= elf_hash_table (info)->dynsymcount);
+ <= elf_hash_table (info)->dynsymcount);
/* Now we know which dynamic symbol has the lowest dynamic symbol
table index in the GOT. */
static struct bfd_hash_entry *
score_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table,
- const char *string)
+ struct bfd_hash_table *table,
+ const char *string)
{
struct score_elf_link_hash_entry *ret = (struct score_elf_link_hash_entry *) entry;
/* Call the allocation method of the superclass. */
ret = ((struct score_elf_link_hash_entry *)
- _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
if (ret != NULL)
{
RELOCATION. RELEND is one-past-the-end of the relocation table. */
static const Elf_Internal_Rela *
score_elf_next_relocation (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type,
- const Elf_Internal_Rela *relocation,
- const Elf_Internal_Rela *relend)
+ const Elf_Internal_Rela *relocation,
+ const Elf_Internal_Rela *relend)
{
while (relocation < relend)
{
if (ELF32_R_TYPE (relocation->r_info) == r_type)
- return relocation;
+ return relocation;
++relocation;
}
/* Return whether a relocation is against a local symbol. */
static bfd_boolean
score_elf_local_relocation_p (bfd *input_bfd,
- const Elf_Internal_Rela *relocation,
- asection **local_sections,
- bfd_boolean check_forced)
+ const Elf_Internal_Rela *relocation,
+ asection **local_sections,
+ bfd_boolean check_forced)
{
unsigned long r_symndx;
Elf_Internal_Shdr *symtab_hdr;
{
/* Look up the hash table to check whether the symbol was forced local. */
h = (struct score_elf_link_hash_entry *)
- elf_sym_hashes (input_bfd) [r_symndx - extsymoff];
+ elf_sym_hashes (input_bfd) [r_symndx - extsymoff];
/* Find the real hash-table entry for this symbol. */
while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
- h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
if (h->root.forced_local)
- return TRUE;
+ return TRUE;
}
return FALSE;
| SEC_LINKER_CREATED
| SEC_READONLY));
if (sreloc == NULL
- || ! bfd_set_section_alignment (dynobj, sreloc,
- SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
- return NULL;
+ || ! bfd_set_section_alignment (dynobj, sreloc,
+ SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
+ return NULL;
}
return sreloc;
}
caller should store the result in place of the original addend. */
static bfd_boolean
score_elf_create_dynamic_relocation (bfd *output_bfd,
- struct bfd_link_info *info,
- const Elf_Internal_Rela *rel,
- struct score_elf_link_hash_entry *h,
- bfd_vma symbol,
- bfd_vma *addendp, asection *input_section)
+ struct bfd_link_info *info,
+ const Elf_Internal_Rela *rel,
+ struct score_elf_link_hash_entry *h,
+ bfd_vma symbol,
+ bfd_vma *addendp, asection *input_section)
{
Elf_Internal_Rela outrel[3];
asection *sreloc;
if (outrel[0].r_offset == MINUS_TWO)
{
/* The relocation field has been converted into a relative value of
- some sort. Functions like _bfd_elf_write_section_eh_frame expect
- the field to be fully relocated, so add in the symbol's value. */
+ some sort. Functions like _bfd_elf_write_section_eh_frame expect
+ the field to be fully relocated, so add in the symbol's value. */
*addendp += symbol;
return TRUE;
}
if (h != NULL
&& (! info->symbolic || !h->root.def_regular)
/* h->root.dynindx may be -1 if this symbol was marked to
- become local. */
+ become local. */
&& h->root.dynindx != -1)
{
indx = h->root.dynindx;
- /* ??? glibc's ld.so just adds the final GOT entry to the
- relocation field. It therefore treats relocs against
- defined symbols in the same way as relocs against
- undefined symbols. */
+ /* ??? glibc's ld.so just adds the final GOT entry to the
+ relocation field. It therefore treats relocs against
+ defined symbols in the same way as relocs against
+ undefined symbols. */
defined_p = FALSE;
}
else
/* Adjust the output offset of the relocation to reference the
correct location in the output file. */
outrel[0].r_offset += (input_section->output_section->vma
- + input_section->output_offset);
+ + input_section->output_offset);
outrel[1].r_offset += (input_section->output_section->vma
- + input_section->output_offset);
+ + input_section->output_offset);
outrel[2].r_offset += (input_section->output_section->vma
- + input_section->output_offset);
+ + input_section->output_offset);
/* Put the relocation back out. We have to use the special
relocation outputter in the 64-bit case since the 64-bit
static bfd_boolean
score_elf_create_got_section (bfd *abfd,
- struct bfd_link_info *info,
- bfd_boolean maybe_exclude)
+ struct bfd_link_info *info,
+ bfd_boolean maybe_exclude)
{
flagword flags;
asection *s;
if (s)
{
if (! maybe_exclude)
- s->flags &= ~SEC_EXCLUDE;
+ s->flags &= ~SEC_EXCLUDE;
return TRUE;
}
are not creating a global offset table. */
bh = NULL;
if (! (_bfd_generic_link_add_one_symbol
- (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
- 0, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh)))
+ (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
+ 0, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh)))
return FALSE;
h = (struct elf_link_hash_entry *) bh;
g->next = NULL;
g->got_entries = htab_try_create (1, score_elf_got_entry_hash,
- score_elf_got_entry_eq, NULL);
+ score_elf_got_entry_eq, NULL);
if (g->got_entries == NULL)
return FALSE;
score_elf_section_data (s)->u.got_info = g;
or -1 if it could not be created. */
static struct score_got_entry *
score_elf_create_local_got_entry (bfd *abfd,
- bfd *ibfd ATTRIBUTE_UNUSED,
- struct score_got_info *gg,
- asection *sgot, bfd_vma value,
- unsigned long r_symndx ATTRIBUTE_UNUSED,
- struct score_elf_link_hash_entry *h ATTRIBUTE_UNUSED,
- int r_type ATTRIBUTE_UNUSED)
+ bfd *ibfd ATTRIBUTE_UNUSED,
+ struct score_got_info *gg,
+ asection *sgot, bfd_vma value,
+ unsigned long r_symndx ATTRIBUTE_UNUSED,
+ struct score_elf_link_hash_entry *h ATTRIBUTE_UNUSED,
+ int r_type ATTRIBUTE_UNUSED)
{
struct score_got_entry entry, **loc;
struct score_got_info *g;
(*loc)->gotidx = -1;
/* We didn't allocate enough space in the GOT. */
_bfd_error_handler
- (_("not enough GOT space for local GOT entries"));
+ (_("not enough GOT space for local GOT entries"));
bfd_set_error (bfd_error_bad_value);
return NULL;
}
for value. Return the index into the GOT for this entry. */
static bfd_vma
score_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
- bfd_vma value, bfd_boolean external)
+ bfd_vma value, bfd_boolean external)
{
asection *sgot;
struct score_got_info *g;
if (!external)
{
/* Although the ABI says that it is "the high-order 16 bits" that we
- want, it is really the %high value. The complete value is
- calculated with a `addiu' of a LO16 relocation, just as with a
- HI16/LO16 pair. */
+ want, it is really the %high value. The complete value is
+ calculated with a `addiu' of a LO16 relocation, just as with a
+ HI16/LO16 pair. */
value = score_elf_high (value) << 16;
}
g = score_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
entry = score_elf_create_local_got_entry (abfd, ibfd, g, sgot, value, 0, NULL,
- R_SCORE_GOT15);
+ R_SCORE_GOT15);
if (entry)
return entry->gotidx;
else
static void
s3_bfd_score_elf_hide_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *entry,
- bfd_boolean force_local)
+ struct elf_link_hash_entry *entry,
+ bfd_boolean force_local)
{
bfd *dynobj;
asection *got;
{
got = score_elf_got_section (dynobj, FALSE);
if (got == NULL)
- return;
+ return;
g = score_elf_section_data (got)->u.got_info;
if (g->next)
- {
- struct score_got_entry e;
- struct score_got_info *gg = g;
-
- /* Since we're turning what used to be a global symbol into a
- local one, bump up the number of local entries of each GOT
- that had an entry for it. This will automatically decrease
- the number of global entries, since global_gotno is actually
- the upper limit of global entries. */
- e.abfd = dynobj;
- e.symndx = -1;
- e.d.h = h;
-
- for (g = g->next; g != gg; g = g->next)
- if (htab_find (g->got_entries, &e))
- {
- BFD_ASSERT (g->global_gotno > 0);
- g->local_gotno++;
- g->global_gotno--;
- }
-
- /* If this was a global symbol forced into the primary GOT, we
- no longer need an entry for it. We can't release the entry
- at this point, but we must at least stop counting it as one
- of the symbols that required a forced got entry. */
- if (h->root.got.offset == 2)
- {
- BFD_ASSERT (gg->assigned_gotno > 0);
- gg->assigned_gotno--;
- }
- }
+ {
+ struct score_got_entry e;
+ struct score_got_info *gg = g;
+
+ /* Since we're turning what used to be a global symbol into a
+ local one, bump up the number of local entries of each GOT
+ that had an entry for it. This will automatically decrease
+ the number of global entries, since global_gotno is actually
+ the upper limit of global entries. */
+ e.abfd = dynobj;
+ e.symndx = -1;
+ e.d.h = h;
+
+ for (g = g->next; g != gg; g = g->next)
+ if (htab_find (g->got_entries, &e))
+ {
+ BFD_ASSERT (g->global_gotno > 0);
+ g->local_gotno++;
+ g->global_gotno--;
+ }
+
+ /* If this was a global symbol forced into the primary GOT, we
+ no longer need an entry for it. We can't release the entry
+ at this point, but we must at least stop counting it as one
+ of the symbols that required a forced got entry. */
+ if (h->root.got.offset == 2)
+ {
+ BFD_ASSERT (gg->assigned_gotno > 0);
+ gg->assigned_gotno--;
+ }
+ }
else if (g->global_gotno == 0 && g->global_gotsym == NULL)
- /* If we haven't got through GOT allocation yet, just bump up the
- number of local entries, as this symbol won't be counted as
- global. */
- g->local_gotno++;
+ /* If we haven't got through GOT allocation yet, just bump up the
+ number of local entries, as this symbol won't be counted as
+ global. */
+ g->local_gotno++;
else if (h->root.got.offset == 1)
- {
- /* If we're past non-multi-GOT allocation and this symbol had
- been marked for a global got entry, give it a local entry
- instead. */
- BFD_ASSERT (g->global_gotno > 0);
- g->local_gotno++;
- g->global_gotno--;
- }
+ {
+ /* If we're past non-multi-GOT allocation and this symbol had
+ been marked for a global got entry, give it a local entry
+ instead. */
+ BFD_ASSERT (g->global_gotno > 0);
+ g->local_gotno++;
+ g->global_gotno--;
+ }
}
_bfd_elf_link_hash_hide_symbol (info, &h->root, force_local);
posterity. */
static bfd_boolean
score_elf_record_global_got_symbol (struct elf_link_hash_entry *h,
- bfd *abfd,
- struct bfd_link_info *info,
- struct score_got_info *g)
+ bfd *abfd,
+ struct bfd_link_info *info,
+ struct score_got_info *g)
{
struct score_got_entry entry, **loc;
if (h->dynindx == -1)
{
switch (ELF_ST_VISIBILITY (h->other))
- {
- case STV_INTERNAL:
- case STV_HIDDEN:
- s3_bfd_score_elf_hide_symbol (info, h, TRUE);
- break;
- }
+ {
+ case STV_INTERNAL:
+ case STV_HIDDEN:
+ s3_bfd_score_elf_hide_symbol (info, h, TRUE);
+ break;
+ }
if (!bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
+ return FALSE;
}
entry.abfd = abfd;
SYMNDX in input bfd ABDF, plus ADDEND. */
static bfd_boolean
score_elf_record_local_got_symbol (bfd *abfd,
- long symndx,
- bfd_vma addend,
- struct score_got_info *g)
+ long symndx,
+ bfd_vma addend,
+ struct score_got_info *g)
{
struct score_got_entry entry, **loc;
Returns -1 if no satisfactory GOT offset can be found. */
static bfd_vma
score_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
- bfd_vma value, unsigned long r_symndx,
- struct score_elf_link_hash_entry *h, int r_type)
+ bfd_vma value, unsigned long r_symndx,
+ struct score_elf_link_hash_entry *h, int r_type)
{
asection *sgot;
struct score_got_info *g;
g = score_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
entry = score_elf_create_local_got_entry (abfd, ibfd, g, sgot, value,
- r_symndx, h, r_type);
+ r_symndx, h, r_type);
if (!entry)
return MINUS_ONE;
static bfd_vma
score_elf_got_offset_from_index (bfd *dynobj,
bfd *output_bfd,
- bfd *input_bfd ATTRIBUTE_UNUSED,
+ bfd *input_bfd ATTRIBUTE_UNUSED,
bfd_vma got_index)
{
asection *sgot;
struct score_elf_link_hash_entry *h = entry->d.h;
while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
- h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
if (entry->d.h == h)
- return 1;
+ return 1;
entry->d.h = h;
/* If we can't find this entry with the new bfd hash, re-insert
- it, and get the traversal restarted. */
+ it, and get the traversal restarted. */
if (! htab_find (got_entries, entry))
- {
- htab_clear_slot (got_entries, entryp);
- entryp = htab_find_slot (got_entries, entry, INSERT);
- if (! *entryp)
- *entryp = entry;
- /* Abort the traversal, since the whole table may have
- moved, and leave it up to the parent to restart the
- process. */
- *(htab_t *)p = NULL;
- return 0;
- }
+ {
+ htab_clear_slot (got_entries, entryp);
+ entryp = htab_find_slot (got_entries, entry, INSERT);
+ if (! *entryp)
+ *entryp = entry;
+ /* Abort the traversal, since the whole table may have
+ moved, and leave it up to the parent to restart the
+ process. */
+ *(htab_t *)p = NULL;
+ return 0;
+ }
/* We might want to decrement the global_gotno count, but it's
- either too early or too late for that at this point. */
+ either too early or too late for that at this point. */
}
return 1;
got_entries = g->got_entries;
htab_traverse (got_entries,
- score_elf_resolve_final_got_entry,
- &got_entries);
+ score_elf_resolve_final_got_entry,
+ &got_entries);
}
while (got_entries == NULL);
}
/* Add INCREMENT to the reloc (of type HOWTO) at ADDRESS. for -r */
static void
score_elf_add_to_rel (bfd *abfd,
- bfd_byte *address,
- reloc_howto_type *howto,
- bfd_signed_vma increment)
+ bfd_byte *address,
+ reloc_howto_type *howto,
+ bfd_signed_vma increment)
{
bfd_signed_vma addend;
bfd_vma contents;
{
case R_SCORE_PC19:
offset =
- (((contents & howto->src_mask) & 0x3ff0000) >> 6) | ((contents & howto->src_mask) & 0x3ff);
+ (((contents & howto->src_mask) & 0x3ff0000) >> 6) | ((contents & howto->src_mask) & 0x3ff);
offset += increment;
contents =
- (contents & ~howto->
- src_mask) | (((offset << 6) & howto->src_mask) & 0x3ff0000) | (offset & 0x3ff);
+ (contents & ~howto->
+ src_mask) | (((offset << 6) & howto->src_mask) & 0x3ff0000) | (offset & 0x3ff);
score_bfd_put_32 (abfd, contents, address);
break;
case R_SCORE_HI16:
uvalue = increment + offset;
hi16_offset = (uvalue >> 16) << 1;
hi16_value = (hi16_addend & (~(howto->dst_mask)))
- | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
+ | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
score_bfd_put_32 (abfd, hi16_value, address - 4);
offset = (uvalue & 0xffff) << 1;
contents = (contents & (~(howto->dst_mask))) | (offset & 0x7fff) | ((offset << 1) & 0x30000);
break;
case R_SCORE_24:
offset =
- (((contents & howto->src_mask) >> 1) & 0x1ff8000) | ((contents & howto->src_mask) & 0x7fff);
+ (((contents & howto->src_mask) >> 1) & 0x1ff8000) | ((contents & howto->src_mask) & 0x7fff);
offset += increment;
contents =
- (contents & ~howto->
- src_mask) | (((offset << 1) & howto->src_mask) & 0x3ff0000) | (offset & 0x7fff);
+ (contents & ~howto->
+ src_mask) | (((offset << 1) & howto->src_mask) & 0x3ff0000) | (offset & 0x7fff);
score_bfd_put_32 (abfd, contents, address);
break;
/* Perform a relocation as part of a final link. */
static bfd_reloc_status_type
score_elf_final_link_relocate (reloc_howto_type *howto,
- bfd *input_bfd,
- bfd *output_bfd,
- asection *input_section,
- bfd_byte *contents,
- Elf_Internal_Rela *rel,
- Elf_Internal_Rela *relocs,
- bfd_vma symbol,
- struct bfd_link_info *info,
- const char *sym_name ATTRIBUTE_UNUSED,
- int sym_flags ATTRIBUTE_UNUSED,
- struct score_elf_link_hash_entry *h,
- asection **local_sections,
- bfd_boolean gp_disp_p)
+ bfd *input_bfd,
+ bfd *output_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *rel,
+ Elf_Internal_Rela *relocs,
+ bfd_vma symbol,
+ struct bfd_link_info *info,
+ const char *sym_name ATTRIBUTE_UNUSED,
+ int sym_flags ATTRIBUTE_UNUSED,
+ struct score_elf_link_hash_entry *h,
+ asection **local_sections,
+ bfd_boolean gp_disp_p)
{
unsigned long r_type;
unsigned long r_symndx;
bh = bfd_link_hash_lookup (info->hash, "_gp", 0, 0, 1);
if (bh != NULL && bh->type == bfd_link_hash_defined)
- elf_gp (output_bfd) = (bh->u.def.value
- + bh->u.def.section->output_section->vma
- + bh->u.def.section->output_offset);
+ elf_gp (output_bfd) = (bh->u.def.value
+ + bh->u.def.section->output_section->vma
+ + bh->u.def.section->output_offset);
else if (bfd_link_relocatable (info))
- {
- bfd_vma lo = -1;
-
- /* Find the GP-relative section with the lowest offset. */
- for (o = output_bfd->sections; o != NULL; o = o->next)
- if (o->vma < lo)
- lo = o->vma;
- /* And calculate GP relative to that. */
- elf_gp (output_bfd) = lo + ELF_SCORE_GP_OFFSET (input_bfd);
- }
+ {
+ bfd_vma lo = -1;
+
+ /* Find the GP-relative section with the lowest offset. */
+ for (o = output_bfd->sections; o != NULL; o = o->next)
+ if (o->vma < lo)
+ lo = o->vma;
+ /* And calculate GP relative to that. */
+ elf_gp (output_bfd) = lo + ELF_SCORE_GP_OFFSET (input_bfd);
+ }
else
- {
- /* If the relocate_section function needs to do a reloc
- involving the GP value, it should make a reloc_dangerous
- callback to warn that GP is not defined. */
- }
+ {
+ /* If the relocate_section function needs to do a reloc
+ involving the GP value, it should make a reloc_dangerous
+ callback to warn that GP is not defined. */
+ }
}
/* Parse the relocation. */
relend = relocs + input_section->reloc_count;
lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend);
if ((local_p) && (lo16_rel != NULL))
- {
- bfd_vma tmp = 0;
- tmp = score_bfd_get_32 (input_bfd, contents + lo16_rel->r_offset);
- lo_value = (((tmp >> 16) & 0x3) << 14) | ((tmp & 0x7fff) >> 1);
- }
+ {
+ bfd_vma tmp = 0;
+ tmp = score_bfd_get_32 (input_bfd, contents + lo16_rel->r_offset);
+ lo_value = (((tmp >> 16) & 0x3) << 14) | ((tmp & 0x7fff) >> 1);
+ }
addend = lo_value;
}
/* For score3 R_SCORE_ABS32. */
case R_SCORE_CALL15:
case R_SCORE_GOT15:
if (!local_p)
- {
- g = score_elf_global_got_index (elf_hash_table (info)->dynobj,
- (struct elf_link_hash_entry *) h);
- if ((! elf_hash_table (info)->dynamic_sections_created
- || (bfd_link_pic (info)
- && (info->symbolic || h->root.dynindx == -1)
- && h->root.def_regular)))
- {
- /* This is a static link or a -Bsymbolic link. The
- symbol is defined locally, or was forced to be local.
- We must initialize this entry in the GOT. */
- bfd *tmpbfd = elf_hash_table (info)->dynobj;
- asection *sgot = score_elf_got_section (tmpbfd, FALSE);
- score_bfd_put_32 (tmpbfd, value, sgot->contents + g);
- }
- }
+ {
+ g = score_elf_global_got_index (elf_hash_table (info)->dynobj,
+ (struct elf_link_hash_entry *) h);
+ if ((! elf_hash_table (info)->dynamic_sections_created
+ || (bfd_link_pic (info)
+ && (info->symbolic || h->root.dynindx == -1)
+ && h->root.def_regular)))
+ {
+ /* This is a static link or a -Bsymbolic link. The
+ symbol is defined locally, or was forced to be local.
+ We must initialize this entry in the GOT. */
+ bfd *tmpbfd = elf_hash_table (info)->dynobj;
+ asection *sgot = score_elf_got_section (tmpbfd, FALSE);
+ score_bfd_put_32 (tmpbfd, value, sgot->contents + g);
+ }
+ }
else if (r_type == R_SCORE_GOT15 || r_type == R_SCORE_CALL15)
- {
- /* There's no need to create a local GOT entry here; the
- calculation for a local GOT15 entry does not involve G. */
- ;
- }
+ {
+ /* There's no need to create a local GOT entry here; the
+ calculation for a local GOT15 entry does not involve G. */
+ ;
+ }
else
- {
- g = score_elf_local_got_index (output_bfd, input_bfd, info,
- symbol + addend, r_symndx, h, r_type);
- if (g == MINUS_ONE)
- return bfd_reloc_outofrange;
- }
+ {
+ g = score_elf_local_got_index (output_bfd, input_bfd, info,
+ symbol + addend, r_symndx, h, r_type);
+ if (g == MINUS_ONE)
+ return bfd_reloc_outofrange;
+ }
/* Convert GOT indices to actual offsets. */
g = score_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
- output_bfd, input_bfd, g);
+ output_bfd, input_bfd, g);
break;
case R_SCORE_HI16:
case R_SCORE_ABS32:
case R_SCORE_REL32:
if ((bfd_link_pic (info)
- || (elf_hash_table (info)->dynamic_sections_created
- && h != NULL
- && h->root.def_dynamic
- && !h->root.def_regular))
- && r_symndx != STN_UNDEF
- && (input_section->flags & SEC_ALLOC) != 0)
- {
- /* If we're creating a shared library, or this relocation is against a symbol
- in a shared library, then we can't know where the symbol will end up.
- So, we create a relocation record in the output, and leave the job up
- to the dynamic linker. */
- value = addend;
- if (!score_elf_create_dynamic_relocation (output_bfd, info, rel, h,
- symbol, &value,
- input_section))
- return bfd_reloc_undefined;
- }
+ || (elf_hash_table (info)->dynamic_sections_created
+ && h != NULL
+ && h->root.def_dynamic
+ && !h->root.def_regular))
+ && r_symndx != STN_UNDEF
+ && (input_section->flags & SEC_ALLOC) != 0)
+ {
+ /* If we're creating a shared library, or this relocation is against a symbol
+ in a shared library, then we can't know where the symbol will end up.
+ So, we create a relocation record in the output, and leave the job up
+ to the dynamic linker. */
+ value = addend;
+ if (!score_elf_create_dynamic_relocation (output_bfd, info, rel, h,
+ symbol, &value,
+ input_section))
+ return bfd_reloc_undefined;
+ }
else if (r_symndx == STN_UNDEF)
- /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols
- from removed linkonce sections, or sections discarded by
- a linker script. */
- value = 0;
+ /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols
+ from removed linkonce sections, or sections discarded by
+ a linker script. */
+ value = 0;
else
- {
- if (r_type != R_SCORE_REL32)
- value = symbol + addend;
- else
- value = addend;
- }
+ {
+ if (r_type != R_SCORE_REL32)
+ value = symbol + addend;
+ else
+ value = addend;
+ }
value &= howto->dst_mask;
bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
case R_SCORE_ABS16:
value += addend;
if ((long)value > 0x7fff || (long)value < -0x8000)
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
score_bfd_put_16 (input_bfd, value, hit_data);
return bfd_reloc_ok;
addend = score_bfd_get_32 (input_bfd, hit_data);
offset = (((addend & howto->src_mask) >> 1) & 0x1ff8000) | ((addend & howto->src_mask) & 0x7fff);
if ((offset & 0x1000000) != 0)
- offset |= 0xfe000000;
+ offset |= 0xfe000000;
value += offset;
abs_value = value - rel_addr;
if ((abs_value & 0xfe000000) != 0)
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
addend = (addend & ~howto->src_mask)
- | (((value << 1) & howto->src_mask) & 0x3ff0000) | (value & 0x7fff);
+ | (((value << 1) & howto->src_mask) & 0x3ff0000) | (value & 0x7fff);
score_bfd_put_32 (input_bfd, addend, hit_data);
return bfd_reloc_ok;
/* signed imm32. */
case R_SCORE_IMM30:
{
- int not_word_align_p = 0;
- bfd_vma imm_offset = 0;
- addend = score_bfd_get_48 (input_bfd, hit_data);
- imm_offset = ((addend >> 7) & 0xff)
- | (((addend >> 16) & 0x7fff) << 8)
- | (((addend >> 32) & 0x7f) << 23);
- imm_offset <<= howto->rightshift;
- value += imm_offset;
- value &= 0xffffffff;
-
- /* Check lw48/sw48 rd, value/label word align. */
- if ((value & 0x3) != 0)
- not_word_align_p = 1;
-
- value >>= howto->rightshift;
- addend = (addend & ~howto->src_mask)
- | (((value & 0xff) >> 0) << 7)
- | (((value & 0x7fff00) >> 8) << 16)
- | (((value & 0x3f800000) >> 23) << 32);
- score_bfd_put_48 (input_bfd, addend, hit_data);
- if (not_word_align_p)
- return bfd_reloc_other;
- else
- return bfd_reloc_ok;
+ int not_word_align_p = 0;
+ bfd_vma imm_offset = 0;
+ addend = score_bfd_get_48 (input_bfd, hit_data);
+ imm_offset = ((addend >> 7) & 0xff)
+ | (((addend >> 16) & 0x7fff) << 8)
+ | (((addend >> 32) & 0x7f) << 23);
+ imm_offset <<= howto->rightshift;
+ value += imm_offset;
+ value &= 0xffffffff;
+
+ /* Check lw48/sw48 rd, value/label word align. */
+ if ((value & 0x3) != 0)
+ not_word_align_p = 1;
+
+ value >>= howto->rightshift;
+ addend = (addend & ~howto->src_mask)
+ | (((value & 0xff) >> 0) << 7)
+ | (((value & 0x7fff00) >> 8) << 16)
+ | (((value & 0x3f800000) >> 23) << 32);
+ score_bfd_put_48 (input_bfd, addend, hit_data);
+ if (not_word_align_p)
+ return bfd_reloc_other;
+ else
+ return bfd_reloc_ok;
}
case R_SCORE_IMM32:
{
- bfd_vma imm_offset = 0;
- addend = score_bfd_get_48 (input_bfd, hit_data);
- imm_offset = ((addend >> 5) & 0x3ff)
- | (((addend >> 16) & 0x7fff) << 10)
- | (((addend >> 32) & 0x7f) << 25);
- value += imm_offset;
- value &= 0xffffffff;
- addend = (addend & ~howto->src_mask)
- | ((value & 0x3ff) << 5)
- | (((value >> 10) & 0x7fff) << 16)
- | (((value >> 25) & 0x7f) << 32);
- score_bfd_put_48 (input_bfd, addend, hit_data);
- return bfd_reloc_ok;
+ bfd_vma imm_offset = 0;
+ addend = score_bfd_get_48 (input_bfd, hit_data);
+ imm_offset = ((addend >> 5) & 0x3ff)
+ | (((addend >> 16) & 0x7fff) << 10)
+ | (((addend >> 32) & 0x7f) << 25);
+ value += imm_offset;
+ value &= 0xffffffff;
+ addend = (addend & ~howto->src_mask)
+ | ((value & 0x3ff) << 5)
+ | (((value >> 10) & 0x7fff) << 16)
+ | (((value >> 25) & 0x7f) << 32);
+ score_bfd_put_48 (input_bfd, addend, hit_data);
+ return bfd_reloc_ok;
}
case R_SCORE_PC19:
addend = score_bfd_get_32 (input_bfd, hit_data);
offset = (((addend & howto->src_mask) & 0x3ff0000) >> 6) | ((addend & howto->src_mask) & 0x3ff);
if ((offset & 0x80000) != 0)
- offset |= 0xfff00000;
+ offset |= 0xfff00000;
abs_value = value = value - rel_addr + offset;
/* exceed 20 bit : overflow. */
if ((abs_value & 0x80000000) == 0x80000000)
- abs_value = 0xffffffff - value + 1;
+ abs_value = 0xffffffff - value + 1;
if ((abs_value & 0xfff80000) != 0)
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
addend = (addend & ~howto->src_mask)
- | (((value << 6) & howto->src_mask) & 0x3ff0000) | (value & 0x3ff);
+ | (((value << 6) & howto->src_mask) & 0x3ff0000) | (value & 0x3ff);
score_bfd_put_32 (input_bfd, addend, hit_data);
return bfd_reloc_ok;
case R_SCORE16_11:
addend = score_bfd_get_16 (input_bfd, hit_data);
offset = addend & howto->src_mask;
- if ((offset & 0x800) != 0) /* Offset is negative. */
- offset |= 0xfffff000;
+ if ((offset & 0x800) != 0) /* Offset is negative. */
+ offset |= 0xfffff000;
value += offset;
abs_value = value - rel_addr;
if ((abs_value & 0xfffff000) != 0)
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
addend = (addend & ~howto->src_mask) | (value & howto->src_mask);
score_bfd_put_16 (input_bfd, addend, hit_data);
return bfd_reloc_ok;
case R_SCORE16_PC8:
addend = score_bfd_get_16 (input_bfd, hit_data);
offset = (addend & howto->src_mask) << 1;
- if ((offset & 0x200) != 0) /* Offset is negative. */
- offset |= 0xfffffe00;
+ if ((offset & 0x200) != 0) /* Offset is negative. */
+ offset |= 0xfffffe00;
abs_value = value = value - rel_addr + offset;
/* Sign bit + exceed 9 bit. */
if (((value & 0xfffffe00) != 0) && ((value & 0xfffffe00) != 0xfffffe00))
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
value >>= 1;
addend = (addend & ~howto->src_mask) | (value & howto->src_mask);
score_bfd_put_16 (input_bfd, addend, hit_data);
case R_SCORE_BCMP:
addend = score_bfd_get_32 (input_bfd, hit_data);
offset = (addend & howto->src_mask) << howto->rightshift;
- if ((offset & 0x200) != 0) /* Offset is negative. */
- offset |= 0xfffffe00;
+ if ((offset & 0x200) != 0) /* Offset is negative. */
+ offset |= 0xfffffe00;
value = value - rel_addr + offset;
/* Sign bit + exceed 9 bit. */
if (((value & 0xfffffe00) != 0) && ((value & 0xfffffe00) != 0xfffffe00))
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
value >>= howto->rightshift;
addend = (addend & ~howto->src_mask)
- | (value & 0x1)
- | (((value >> 1) & 0x7) << 7)
- | (((value >> 4) & 0x1f) << 21);
+ | (value & 0x1)
+ | (((value >> 1) & 0x7) << 7)
+ | (((value >> 4) & 0x1f) << 21);
score_bfd_put_32 (input_bfd, addend, hit_data);
return bfd_reloc_ok;
offset = (hi16_offset << 16) | (offset & 0xffff);
if (!gp_disp_p)
- uvalue = value + offset;
+ uvalue = value + offset;
else
- uvalue = offset + gp - rel_addr + 4;
+ uvalue = offset + gp - rel_addr + 4;
hi16_offset = (uvalue >> 16) << 1;
hi16_value = (hi16_addend & (~(howto->dst_mask)))
- | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
+ | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
score_bfd_put_32 (input_bfd, hi16_value, hit_data - 4);
offset = (uvalue & 0xffff) << 1;
value = (addend & (~(howto->dst_mask))) | (offset & 0x7fff) | ((offset << 1) & 0x30000);
addend = score_bfd_get_32 (input_bfd, hit_data);
offset = addend & 0x7fff;
if ((offset & 0x4000) == 0x4000)
- offset |= 0xffffc000;
+ offset |= 0xffffc000;
value = value + offset - gp;
if (((value & 0xffffc000) != 0) && ((value & 0xffffc000) != 0xffffc000))
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
value = (addend & ~howto->src_mask) | (value & howto->src_mask);
score_bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
case R_SCORE_GOT15:
case R_SCORE_CALL15:
if (local_p)
- {
- bfd_boolean forced;
-
- /* The special case is when the symbol is forced to be local. We need the
- full address in the GOT since no R_SCORE_GOT_LO16 relocation follows. */
- forced = ! score_elf_local_relocation_p (input_bfd, rel,
- local_sections, FALSE);
- value = score_elf_got16_entry (output_bfd, input_bfd, info,
- symbol + addend, forced);
- if (value == MINUS_ONE)
- return bfd_reloc_outofrange;
- value = score_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
- output_bfd, input_bfd, value);
- }
+ {
+ bfd_boolean forced;
+
+ /* The special case is when the symbol is forced to be local. We need the
+ full address in the GOT since no R_SCORE_GOT_LO16 relocation follows. */
+ forced = ! score_elf_local_relocation_p (input_bfd, rel,
+ local_sections, FALSE);
+ value = score_elf_got16_entry (output_bfd, input_bfd, info,
+ symbol + addend, forced);
+ if (value == MINUS_ONE)
+ return bfd_reloc_outofrange;
+ value = score_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
+ output_bfd, input_bfd, value);
+ }
else
- {
- value = g;
- }
+ {
+ value = g;
+ }
if ((long) value > 0x3fff || (long) value < -0x4000)
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
addend = score_bfd_get_32 (input_bfd, hit_data);
value = (addend & ~howto->dst_mask) | (value & howto->dst_mask);
value = (((addend >> 16) & 0x3) << 14) | ((addend & 0x7fff) >> 1);
value += symbol;
value = (addend & (~(howto->dst_mask))) | ((value & 0x3fff) << 1)
- | (((value >> 14) & 0x3) << 16);
+ | (((value >> 14) & 0x3) << 16);
score_bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
/* Score backend functions. */
static void
s3_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *bfd_reloc,
- Elf_Internal_Rela *elf_reloc)
+ arelent *bfd_reloc,
+ Elf_Internal_Rela *elf_reloc)
{
unsigned int r_type;
/* Relocate an score ELF section. */
static bfd_boolean
s3_bfd_score_elf_relocate_section (bfd *output_bfd,
- struct bfd_link_info *info,
- bfd *input_bfd,
- asection *input_section,
- bfd_byte *contents,
- Elf_Internal_Rela *relocs,
- Elf_Internal_Sym *local_syms,
- asection **local_sections)
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *rel;
{
bfd_size_type dynsecsymcount = 0;
if (bfd_link_pic (info))
- {
- asection * p;
- const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
+ {
+ asection * p;
+ const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
- for (p = output_bfd->sections; p ; p = p->next)
- if ((p->flags & SEC_EXCLUDE) == 0
- && (p->flags & SEC_ALLOC) != 0
- && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p))
- ++ dynsecsymcount;
- }
+ for (p = output_bfd->sections; p ; p = p->next)
+ if ((p->flags & SEC_EXCLUDE) == 0
+ && (p->flags & SEC_ALLOC) != 0
+ && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p))
+ ++ dynsecsymcount;
+ }
if (!score_elf_sort_hash_table (info, dynsecsymcount + 1))
- return FALSE;
+ return FALSE;
}
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
sec = NULL;
if (r_symndx < extsymoff)
- {
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
- relocation = (sec->output_section->vma
- + sec->output_offset
- + sym->st_value);
- name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, sec);
-
- if (!bfd_link_relocatable (info)
- && (sec->flags & SEC_MERGE)
- && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
- {
- asection *msec;
- bfd_vma addend, value;
-
- switch (r_type)
- {
- case R_SCORE_HI16:
- break;
- case R_SCORE_LO16:
- hi16_addend = score_bfd_get_32 (input_bfd, contents + rel->r_offset - 4);
- hi16_offset = ((((hi16_addend >> 16) & 0x3) << 15) | (hi16_addend & 0x7fff)) >> 1;
- value = score_bfd_get_32 (input_bfd, contents + rel->r_offset);
- offset = ((((value >> 16) & 0x3) << 15) | (value & 0x7fff)) >> 1;
- addend = (hi16_offset << 16) | (offset & 0xffff);
- msec = sec;
- addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend);
- addend -= relocation;
- addend += msec->output_section->vma + msec->output_offset;
- uvalue = addend;
- hi16_offset = (uvalue >> 16) << 1;
- hi16_value = (hi16_addend & (~(howto->dst_mask)))
- | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
- score_bfd_put_32 (input_bfd, hi16_value, contents + rel->r_offset - 4);
- offset = (uvalue & 0xffff) << 1;
- value = (value & (~(howto->dst_mask)))
- | (offset & 0x7fff) | ((offset << 1) & 0x30000);
- score_bfd_put_32 (input_bfd, value, contents + rel->r_offset);
- break;
-
- case R_SCORE_IMM32:
- {
- value = score_bfd_get_48 (input_bfd, contents + rel->r_offset);
- addend = ((value >> 5) & 0x3ff)
- | (((value >> 16) & 0x7fff) << 10)
- | (((value >> 32) & 0x7f) << 25);
- msec = sec;
- addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend);
- addend -= relocation;
- addend += msec->output_section->vma + msec->output_offset;
- addend &= 0xffffffff;
- value = (value & ~howto->src_mask)
- | ((addend & 0x3ff) << 5)
- | (((addend >> 10) & 0x7fff) << 16)
- | (((addend >> 25) & 0x7f) << 32);
- score_bfd_put_48 (input_bfd, value, contents + rel->r_offset);
- break;
- }
-
- case R_SCORE_IMM30:
- {
- int not_word_align_p = 0;
- value = score_bfd_get_48 (input_bfd, contents + rel->r_offset);
- addend = ((value >> 7) & 0xff)
- | (((value >> 16) & 0x7fff) << 8)
- | (((value >> 32) & 0x7f) << 23);
- addend <<= howto->rightshift;
- msec = sec;
- addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend);
- addend -= relocation;
- addend += msec->output_section->vma + msec->output_offset;
- addend &= 0xffffffff;
-
- /* Check lw48/sw48 rd, value/label word align. */
- if ((addend & 0x3) != 0)
- not_word_align_p = 1;
-
- addend >>= howto->rightshift;
- value = (value & ~howto->src_mask)
- | (((addend & 0xff) >> 0) << 7)
- | (((addend & 0x7fff00) >> 8) << 16)
- | (((addend & 0x3f800000) >> 23) << 32);
- score_bfd_put_48 (input_bfd, value, contents + rel->r_offset);
-
- if (not_word_align_p)
- return bfd_reloc_other;
- else
- break;
- }
-
- case R_SCORE_GOT_LO16:
- value = score_bfd_get_32 (input_bfd, contents + rel->r_offset);
- addend = (((value >> 16) & 0x3) << 14) | ((value & 0x7fff) >> 1);
- msec = sec;
- addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation;
- addend += msec->output_section->vma + msec->output_offset;
- value = (value & (~(howto->dst_mask))) | ((addend & 0x3fff) << 1)
- | (((addend >> 14) & 0x3) << 16);
-
- score_bfd_put_32 (input_bfd, value, contents + rel->r_offset);
- break;
-
- case R_SCORE_ABS32:
- case R_SCORE_REL32:
- value = bfd_get_32 (input_bfd, contents + rel->r_offset);
- /* Get the (signed) value from the instruction. */
- addend = value & howto->src_mask;
- if (addend & ((howto->src_mask + 1) >> 1))
- {
- bfd_signed_vma mask;
-
- mask = -1;
- mask &= ~howto->src_mask;
- addend |= mask;
- }
- msec = sec;
- addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation;
- addend += msec->output_section->vma + msec->output_offset;
- value = (value & ~howto->dst_mask) | (addend & howto->dst_mask);
- bfd_put_32 (input_bfd, value, contents + rel->r_offset);
- break;
-
- default:
- value = score_bfd_get_32 (input_bfd, contents + rel->r_offset);
- /* Get the (signed) value from the instruction. */
- addend = value & howto->src_mask;
- if (addend & ((howto->src_mask + 1) >> 1))
- {
- bfd_signed_vma mask;
-
- mask = -1;
- mask &= ~howto->src_mask;
- addend |= mask;
- }
- msec = sec;
- addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation;
- addend += msec->output_section->vma + msec->output_offset;
- value = (value & ~howto->dst_mask) | (addend & howto->dst_mask);
- score_bfd_put_32 (input_bfd, value, contents + rel->r_offset);
- break;
- }
- }
- }
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+ relocation = (sec->output_section->vma
+ + sec->output_offset
+ + sym->st_value);
+ name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, sec);
+
+ if (!bfd_link_relocatable (info)
+ && (sec->flags & SEC_MERGE)
+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ asection *msec;
+ bfd_vma addend, value;
+
+ switch (r_type)
+ {
+ case R_SCORE_HI16:
+ break;
+ case R_SCORE_LO16:
+ hi16_addend = score_bfd_get_32 (input_bfd, contents + rel->r_offset - 4);
+ hi16_offset = ((((hi16_addend >> 16) & 0x3) << 15) | (hi16_addend & 0x7fff)) >> 1;
+ value = score_bfd_get_32 (input_bfd, contents + rel->r_offset);
+ offset = ((((value >> 16) & 0x3) << 15) | (value & 0x7fff)) >> 1;
+ addend = (hi16_offset << 16) | (offset & 0xffff);
+ msec = sec;
+ addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend);
+ addend -= relocation;
+ addend += msec->output_section->vma + msec->output_offset;
+ uvalue = addend;
+ hi16_offset = (uvalue >> 16) << 1;
+ hi16_value = (hi16_addend & (~(howto->dst_mask)))
+ | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
+ score_bfd_put_32 (input_bfd, hi16_value, contents + rel->r_offset - 4);
+ offset = (uvalue & 0xffff) << 1;
+ value = (value & (~(howto->dst_mask)))
+ | (offset & 0x7fff) | ((offset << 1) & 0x30000);
+ score_bfd_put_32 (input_bfd, value, contents + rel->r_offset);
+ break;
+
+ case R_SCORE_IMM32:
+ {
+ value = score_bfd_get_48 (input_bfd, contents + rel->r_offset);
+ addend = ((value >> 5) & 0x3ff)
+ | (((value >> 16) & 0x7fff) << 10)
+ | (((value >> 32) & 0x7f) << 25);
+ msec = sec;
+ addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend);
+ addend -= relocation;
+ addend += msec->output_section->vma + msec->output_offset;
+ addend &= 0xffffffff;
+ value = (value & ~howto->src_mask)
+ | ((addend & 0x3ff) << 5)
+ | (((addend >> 10) & 0x7fff) << 16)
+ | (((addend >> 25) & 0x7f) << 32);
+ score_bfd_put_48 (input_bfd, value, contents + rel->r_offset);
+ break;
+ }
+
+ case R_SCORE_IMM30:
+ {
+ int not_word_align_p = 0;
+ value = score_bfd_get_48 (input_bfd, contents + rel->r_offset);
+ addend = ((value >> 7) & 0xff)
+ | (((value >> 16) & 0x7fff) << 8)
+ | (((value >> 32) & 0x7f) << 23);
+ addend <<= howto->rightshift;
+ msec = sec;
+ addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend);
+ addend -= relocation;
+ addend += msec->output_section->vma + msec->output_offset;
+ addend &= 0xffffffff;
+
+ /* Check lw48/sw48 rd, value/label word align. */
+ if ((addend & 0x3) != 0)
+ not_word_align_p = 1;
+
+ addend >>= howto->rightshift;
+ value = (value & ~howto->src_mask)
+ | (((addend & 0xff) >> 0) << 7)
+ | (((addend & 0x7fff00) >> 8) << 16)
+ | (((addend & 0x3f800000) >> 23) << 32);
+ score_bfd_put_48 (input_bfd, value, contents + rel->r_offset);
+
+ if (not_word_align_p)
+ return bfd_reloc_other;
+ else
+ break;
+ }
+
+ case R_SCORE_GOT_LO16:
+ value = score_bfd_get_32 (input_bfd, contents + rel->r_offset);
+ addend = (((value >> 16) & 0x3) << 14) | ((value & 0x7fff) >> 1);
+ msec = sec;
+ addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation;
+ addend += msec->output_section->vma + msec->output_offset;
+ value = (value & (~(howto->dst_mask))) | ((addend & 0x3fff) << 1)
+ | (((addend >> 14) & 0x3) << 16);
+
+ score_bfd_put_32 (input_bfd, value, contents + rel->r_offset);
+ break;
+
+ case R_SCORE_ABS32:
+ case R_SCORE_REL32:
+ value = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ /* Get the (signed) value from the instruction. */
+ addend = value & howto->src_mask;
+ if (addend & ((howto->src_mask + 1) >> 1))
+ {
+ bfd_signed_vma mask;
+
+ mask = -1;
+ mask &= ~howto->src_mask;
+ addend |= mask;
+ }
+ msec = sec;
+ addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation;
+ addend += msec->output_section->vma + msec->output_offset;
+ value = (value & ~howto->dst_mask) | (addend & howto->dst_mask);
+ bfd_put_32 (input_bfd, value, contents + rel->r_offset);
+ break;
+
+ default:
+ value = score_bfd_get_32 (input_bfd, contents + rel->r_offset);
+ /* Get the (signed) value from the instruction. */
+ addend = value & howto->src_mask;
+ if (addend & ((howto->src_mask + 1) >> 1))
+ {
+ bfd_signed_vma mask;
+
+ mask = -1;
+ mask &= ~howto->src_mask;
+ addend |= mask;
+ }
+ msec = sec;
+ addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation;
+ addend += msec->output_section->vma + msec->output_offset;
+ value = (value & ~howto->dst_mask) | (addend & howto->dst_mask);
+ score_bfd_put_32 (input_bfd, value, contents + rel->r_offset);
+ break;
+ }
+ }
+ }
else
- {
- /* For global symbols we look up the symbol in the hash-table. */
- h = ((struct score_elf_link_hash_entry *)
- elf_sym_hashes (input_bfd) [r_symndx - extsymoff]);
+ {
+ /* For global symbols we look up the symbol in the hash-table. */
+ h = ((struct score_elf_link_hash_entry *)
+ elf_sym_hashes (input_bfd) [r_symndx - extsymoff]);
if (info->wrap_hash != NULL
&& (input_section->flags & SEC_DEBUGGING) != 0)
h = ((struct score_elf_link_hash_entry *)
unwrap_hash_lookup (info, input_bfd, &h->root.root));
- /* Find the real hash-table entry for this symbol. */
- while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
- h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
-
- /* Record the name of this symbol, for our caller. */
- name = h->root.root.root.string;
-
- /* See if this is the special GP_DISP_LABEL symbol. Note that such a
- symbol must always be a global symbol. */
- if (strcmp (name, GP_DISP_LABEL) == 0)
- {
- /* Relocations against GP_DISP_LABEL are permitted only with
- R_SCORE_HI16 and R_SCORE_LO16 relocations. */
- if (r_type != R_SCORE_HI16 && r_type != R_SCORE_LO16)
- return bfd_reloc_notsupported;
-
- gp_disp_p = TRUE;
- }
-
- /* If this symbol is defined, calculate its address. Note that
- GP_DISP_LABEL is a magic symbol, always implicitly defined by the
- linker, so it's inappropriate to check to see whether or not
- its defined. */
- else if ((h->root.root.type == bfd_link_hash_defined
- || h->root.root.type == bfd_link_hash_defweak)
- && h->root.root.u.def.section)
- {
- sec = h->root.root.u.def.section;
- if (sec->output_section)
- relocation = (h->root.root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- else
- {
- relocation = h->root.root.u.def.value;
- }
- }
- else if (h->root.root.type == bfd_link_hash_undefweak)
- /* We allow relocations against undefined weak symbols, giving
- it the value zero, so that you can undefined weak functions
- and check to see if they exist by looking at their addresses. */
- relocation = 0;
- else if (info->unresolved_syms_in_objects == RM_IGNORE
- && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
- relocation = 0;
- else if (strcmp (name, "_DYNAMIC_LINK") == 0)
- {
- /* If this is a dynamic link, we should have created a _DYNAMIC_LINK symbol
- in s3_bfd_score_elf_create_dynamic_sections. Otherwise, we should define
- the symbol with a value of 0. */
- BFD_ASSERT (! bfd_link_pic (info));
- BFD_ASSERT (bfd_get_section_by_name (output_bfd, ".dynamic") == NULL);
- relocation = 0;
- }
- else if (!bfd_link_relocatable (info))
- {
+ /* Find the real hash-table entry for this symbol. */
+ while (h->root.root.type == bfd_link_hash_indirect
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
+
+ /* Record the name of this symbol, for our caller. */
+ name = h->root.root.root.string;
+
+ /* See if this is the special GP_DISP_LABEL symbol. Note that such a
+ symbol must always be a global symbol. */
+ if (strcmp (name, GP_DISP_LABEL) == 0)
+ {
+ /* Relocations against GP_DISP_LABEL are permitted only with
+ R_SCORE_HI16 and R_SCORE_LO16 relocations. */
+ if (r_type != R_SCORE_HI16 && r_type != R_SCORE_LO16)
+ return bfd_reloc_notsupported;
+
+ gp_disp_p = TRUE;
+ }
+
+ /* If this symbol is defined, calculate its address. Note that
+ GP_DISP_LABEL is a magic symbol, always implicitly defined by the
+ linker, so it's inappropriate to check to see whether or not
+ its defined. */
+ else if ((h->root.root.type == bfd_link_hash_defined
+ || h->root.root.type == bfd_link_hash_defweak)
+ && h->root.root.u.def.section)
+ {
+ sec = h->root.root.u.def.section;
+ if (sec->output_section)
+ relocation = (h->root.root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset);
+ else
+ {
+ relocation = h->root.root.u.def.value;
+ }
+ }
+ else if (h->root.root.type == bfd_link_hash_undefweak)
+ /* We allow relocations against undefined weak symbols, giving
+ it the value zero, so that you can undefined weak functions
+ and check to see if they exist by looking at their addresses. */
+ relocation = 0;
+ else if (info->unresolved_syms_in_objects == RM_IGNORE
+ && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
+ relocation = 0;
+ else if (strcmp (name, "_DYNAMIC_LINK") == 0)
+ {
+ /* If this is a dynamic link, we should have created a _DYNAMIC_LINK symbol
+ in s3_bfd_score_elf_create_dynamic_sections. Otherwise, we should define
+ the symbol with a value of 0. */
+ BFD_ASSERT (! bfd_link_pic (info));
+ BFD_ASSERT (bfd_get_section_by_name (output_bfd, ".dynamic") == NULL);
+ relocation = 0;
+ }
+ else if (!bfd_link_relocatable (info))
+ {
(*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
input_section, rel->r_offset,
(info->unresolved_syms_in_objects == RM_GENERATE_ERROR)
|| ELF_ST_VISIBILITY (h->root.other));
- relocation = 0;
- }
- }
+ relocation = 0;
+ }
+ }
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
rel, 1, relend, howto, 0, contents);
if (bfd_link_relocatable (info))
- {
- /* This is a relocatable link. We don't have to change
- anything, unless the reloc is against a section symbol,
- in which case we have to adjust according to where the
- section symbol winds up in the output section. */
- if (r_symndx < symtab_hdr->sh_info)
- {
- sym = local_syms + r_symndx;
- if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
- {
- sec = local_sections[r_symndx];
- score_elf_add_to_rel (input_bfd, contents + rel->r_offset,
- howto, (bfd_signed_vma) (sec->output_offset + sym->st_value));
- }
- }
- continue;
- }
+ {
+ /* This is a relocatable link. We don't have to change
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ sec = local_sections[r_symndx];
+ score_elf_add_to_rel (input_bfd, contents + rel->r_offset,
+ howto, (bfd_signed_vma) (sec->output_offset + sym->st_value));
+ }
+ }
+ continue;
+ }
/* This is a final link. */
r = score_elf_final_link_relocate (howto, input_bfd, output_bfd,
- input_section, contents, rel, relocs,
- relocation, info, name,
- (h ? ELF_ST_TYPE ((unsigned int)h->root.root.type) :
- ELF_ST_TYPE ((unsigned int)sym->st_info)), h, local_sections,
- gp_disp_p);
+ input_section, contents, rel, relocs,
+ relocation, info, name,
+ (h ? ELF_ST_TYPE ((unsigned int)h->root.root.type) :
+ ELF_ST_TYPE ((unsigned int)sym->st_info)), h, local_sections,
+ gp_disp_p);
if (r != bfd_reloc_ok)
- {
- const char *msg = (const char *)0;
-
- switch (r)
- {
- case bfd_reloc_overflow:
- /* If the overflowing reloc was to an undefined symbol,
- we have already printed one error message and there
- is no point complaining again. */
+ {
+ const char *msg = (const char *)0;
+
+ switch (r)
+ {
+ case bfd_reloc_overflow:
+ /* If the overflowing reloc was to an undefined symbol,
+ we have already printed one error message and there
+ is no point complaining again. */
if (!h || h->root.root.type != bfd_link_hash_undefined)
(*info->callbacks->reloc_overflow)
(info, NULL, name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset);
- break;
- case bfd_reloc_undefined:
+ break;
+ case bfd_reloc_undefined:
(*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE);
- break;
+ break;
- case bfd_reloc_outofrange:
- msg = _("internal error: out of range error");
- goto common_error;
+ case bfd_reloc_outofrange:
+ msg = _("internal error: out of range error");
+ goto common_error;
- case bfd_reloc_notsupported:
- msg = _("internal error: unsupported relocation error");
- goto common_error;
+ case bfd_reloc_notsupported:
+ msg = _("internal error: unsupported relocation error");
+ goto common_error;
- case bfd_reloc_dangerous:
- msg = _("internal error: dangerous error");
- goto common_error;
+ case bfd_reloc_dangerous:
+ msg = _("internal error: dangerous error");
+ goto common_error;
- /* Use bfd_reloc_other to check lw48, sw48 word align. */
- case bfd_reloc_other:
- msg = _("address not word align");
- goto common_error;
+ /* Use bfd_reloc_other to check lw48, sw48 word align. */
+ case bfd_reloc_other:
+ msg = _("address not word align");
+ goto common_error;
- default:
- msg = _("internal error: unknown error");
- /* Fall through. */
+ default:
+ msg = _("internal error: unknown error");
+ /* Fall through. */
- common_error:
+ common_error:
(*info->callbacks->warning) (info, msg, name, input_bfd,
input_section, rel->r_offset);
- break;
- }
- }
+ break;
+ }
+ }
}
return TRUE;
allocate space in the global offset table. */
static bfd_boolean
s3_bfd_score_elf_check_relocs (bfd *abfd,
- struct bfd_link_info *info,
- asection *sec,
- const Elf_Internal_Rela *relocs)
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
bfd *dynobj;
Elf_Internal_Shdr *symtab_hdr;
{
sgot = score_elf_got_section (dynobj, FALSE);
if (sgot == NULL)
- g = NULL;
+ g = NULL;
else
- {
- BFD_ASSERT (score_elf_section_data (sgot) != NULL);
- g = score_elf_section_data (sgot)->u.got_info;
- BFD_ASSERT (g != NULL);
- }
+ {
+ BFD_ASSERT (score_elf_section_data (sgot) != NULL);
+ g = score_elf_section_data (sgot)->u.got_info;
+ BFD_ASSERT (g != NULL);
+ }
}
sreloc = NULL;
r_type = ELF32_R_TYPE (rel->r_info);
if (r_symndx < extsymoff)
- {
- h = NULL;
- }
+ {
+ h = NULL;
+ }
else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr))
- {
+ {
_bfd_error_handler
/* xgettext:c-format */
(_("%B: Malformed reloc detected for section %A"), abfd, sec);
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
else
- {
- h = sym_hashes[r_symndx - extsymoff];
+ {
+ h = sym_hashes[r_symndx - extsymoff];
- /* This may be an indirect symbol created because of a version. */
- if (h != NULL)
- {
- while (h->root.type == bfd_link_hash_indirect)
- h = (struct elf_link_hash_entry *)h->root.u.i.link;
- }
- }
+ /* This may be an indirect symbol created because of a version. */
+ if (h != NULL)
+ {
+ while (h->root.type == bfd_link_hash_indirect)
+ h = (struct elf_link_hash_entry *)h->root.u.i.link;
+ }
+ }
/* Some relocs require a global offset table. */
if (dynobj == NULL || sgot == NULL)
- {
- switch (r_type)
- {
- case R_SCORE_GOT15:
- case R_SCORE_CALL15:
- if (dynobj == NULL)
- elf_hash_table (info)->dynobj = dynobj = abfd;
- if (!score_elf_create_got_section (dynobj, info, FALSE))
- return FALSE;
- g = score_elf_got_info (dynobj, &sgot);
- break;
- case R_SCORE_ABS32:
- case R_SCORE_REL32:
- if (dynobj == NULL
+ {
+ switch (r_type)
+ {
+ case R_SCORE_GOT15:
+ case R_SCORE_CALL15:
+ if (dynobj == NULL)
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ if (!score_elf_create_got_section (dynobj, info, FALSE))
+ return FALSE;
+ g = score_elf_got_info (dynobj, &sgot);
+ break;
+ case R_SCORE_ABS32:
+ case R_SCORE_REL32:
+ if (dynobj == NULL
&& (bfd_link_pic (info) || h != NULL)
&& (sec->flags & SEC_ALLOC) != 0)
- elf_hash_table (info)->dynobj = dynobj = abfd;
- break;
- default:
- break;
- }
- }
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ break;
+ default:
+ break;
+ }
+ }
if (!h && (r_type == R_SCORE_GOT_LO16))
- {
- if (! score_elf_record_local_got_symbol (abfd, r_symndx, rel->r_addend, g))
- return FALSE;
- }
+ {
+ if (! score_elf_record_local_got_symbol (abfd, r_symndx, rel->r_addend, g))
+ return FALSE;
+ }
switch (r_type)
- {
- case R_SCORE_CALL15:
- if (h == NULL)
- {
+ {
+ case R_SCORE_CALL15:
+ if (h == NULL)
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: CALL15 reloc at %#Lx not against global symbol"),
- abfd, rel->r_offset);
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
- else
- {
- /* This symbol requires a global offset table entry. */
- if (! score_elf_record_global_got_symbol (h, abfd, info, g))
- return FALSE;
-
- /* We need a stub, not a plt entry for the undefined function. But we record
- it as if it needs plt. See _bfd_elf_adjust_dynamic_symbol. */
- h->needs_plt = 1;
- h->type = STT_FUNC;
- }
- break;
- case R_SCORE_GOT15:
- if (h && ! score_elf_record_global_got_symbol (h, abfd, info, g))
- return FALSE;
- break;
- case R_SCORE_ABS32:
- case R_SCORE_REL32:
- if ((bfd_link_pic (info) || h != NULL)
+ (_("%B: CALL15 reloc at %#Lx not against global symbol"),
+ abfd, rel->r_offset);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ else
+ {
+ /* This symbol requires a global offset table entry. */
+ if (! score_elf_record_global_got_symbol (h, abfd, info, g))
+ return FALSE;
+
+ /* We need a stub, not a plt entry for the undefined function. But we record
+ it as if it needs plt. See _bfd_elf_adjust_dynamic_symbol. */
+ h->needs_plt = 1;
+ h->type = STT_FUNC;
+ }
+ break;
+ case R_SCORE_GOT15:
+ if (h && ! score_elf_record_global_got_symbol (h, abfd, info, g))
+ return FALSE;
+ break;
+ case R_SCORE_ABS32:
+ case R_SCORE_REL32:
+ if ((bfd_link_pic (info) || h != NULL)
&& (sec->flags & SEC_ALLOC) != 0)
- {
- if (sreloc == NULL)
- {
- sreloc = score_elf_rel_dyn_section (dynobj, TRUE);
- if (sreloc == NULL)
- return FALSE;
- }
+ {
+ if (sreloc == NULL)
+ {
+ sreloc = score_elf_rel_dyn_section (dynobj, TRUE);
+ if (sreloc == NULL)
+ return FALSE;
+ }
#define SCORE_READONLY_SECTION (SEC_ALLOC | SEC_LOAD | SEC_READONLY)
- if (bfd_link_pic (info))
- {
- /* When creating a shared object, we must copy these reloc types into
- the output file as R_SCORE_REL32 relocs. We make room for this reloc
- in the .rel.dyn reloc section. */
- score_elf_allocate_dynamic_relocations (dynobj, 1);
- if ((sec->flags & SCORE_READONLY_SECTION)
- == SCORE_READONLY_SECTION)
- /* We tell the dynamic linker that there are
- relocations against the text segment. */
- info->flags |= DF_TEXTREL;
- }
- else
- {
- struct score_elf_link_hash_entry *hscore;
-
- /* We only need to copy this reloc if the symbol is
- defined in a dynamic object. */
- hscore = (struct score_elf_link_hash_entry *)h;
- ++hscore->possibly_dynamic_relocs;
- if ((sec->flags & SCORE_READONLY_SECTION)
- == SCORE_READONLY_SECTION)
- /* We need it to tell the dynamic linker if there
- are relocations against the text segment. */
- hscore->readonly_reloc = TRUE;
- }
-
- /* Even though we don't directly need a GOT entry for this symbol,
- a symbol must have a dynamic symbol table index greater that
- DT_SCORE_GOTSYM if there are dynamic relocations against it. */
- if (h != NULL)
- {
- if (dynobj == NULL)
- elf_hash_table (info)->dynobj = dynobj = abfd;
- if (! score_elf_create_got_section (dynobj, info, TRUE))
- return FALSE;
- g = score_elf_got_info (dynobj, &sgot);
- if (! score_elf_record_global_got_symbol (h, abfd, info, g))
- return FALSE;
- }
- }
- break;
-
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_SCORE_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_SCORE_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
- default:
- break;
- }
+ if (bfd_link_pic (info))
+ {
+ /* When creating a shared object, we must copy these reloc types into
+ the output file as R_SCORE_REL32 relocs. We make room for this reloc
+ in the .rel.dyn reloc section. */
+ score_elf_allocate_dynamic_relocations (dynobj, 1);
+ if ((sec->flags & SCORE_READONLY_SECTION)
+ == SCORE_READONLY_SECTION)
+ /* We tell the dynamic linker that there are
+ relocations against the text segment. */
+ info->flags |= DF_TEXTREL;
+ }
+ else
+ {
+ struct score_elf_link_hash_entry *hscore;
+
+ /* We only need to copy this reloc if the symbol is
+ defined in a dynamic object. */
+ hscore = (struct score_elf_link_hash_entry *)h;
+ ++hscore->possibly_dynamic_relocs;
+ if ((sec->flags & SCORE_READONLY_SECTION)
+ == SCORE_READONLY_SECTION)
+ /* We need it to tell the dynamic linker if there
+ are relocations against the text segment. */
+ hscore->readonly_reloc = TRUE;
+ }
+
+ /* Even though we don't directly need a GOT entry for this symbol,
+ a symbol must have a dynamic symbol table index greater that
+ DT_SCORE_GOTSYM if there are dynamic relocations against it. */
+ if (h != NULL)
+ {
+ if (dynobj == NULL)
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ if (! score_elf_create_got_section (dynobj, info, TRUE))
+ return FALSE;
+ g = score_elf_got_info (dynobj, &sgot);
+ if (! score_elf_record_global_got_symbol (h, abfd, info, g))
+ return FALSE;
+ }
+ }
+ break;
+
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_SCORE_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_SCORE_GNU_VTENTRY:
+ if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+ default:
+ break;
+ }
/* We must not create a stub for a symbol that has relocations
- related to taking the function's address. */
+ related to taking the function's address. */
switch (r_type)
- {
- default:
- if (h != NULL)
- {
- struct score_elf_link_hash_entry *sh;
-
- sh = (struct score_elf_link_hash_entry *) h;
- sh->no_fn_stub = TRUE;
- }
- break;
- case R_SCORE_CALL15:
- break;
- }
+ {
+ default:
+ if (h != NULL)
+ {
+ struct score_elf_link_hash_entry *sh;
+
+ sh = (struct score_elf_link_hash_entry *) h;
+ sh->no_fn_stub = TRUE;
+ }
+ break;
+ case R_SCORE_CALL15:
+ break;
+ }
}
return TRUE;
static bfd_boolean
s3_bfd_score_elf_add_symbol_hook (bfd *abfd,
- struct bfd_link_info *info ATTRIBUTE_UNUSED,
- Elf_Internal_Sym *sym,
- const char **namep ATTRIBUTE_UNUSED,
- flagword *flagsp ATTRIBUTE_UNUSED,
- asection **secp,
- bfd_vma *valp)
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym,
+ const char **namep ATTRIBUTE_UNUSED,
+ flagword *flagsp ATTRIBUTE_UNUSED,
+ asection **secp,
+ bfd_vma *valp)
{
switch (sym->st_shndx)
{
case SHN_COMMON:
if (sym->st_size > elf_gp_size (abfd))
- break;
+ break;
/* Fall through. */
case SHN_SCORE_SCOMMON:
*secp = bfd_make_section_old_way (abfd, ".scommon");
{
case SHN_COMMON:
if (asym->value > elf_gp_size (abfd))
- break;
+ break;
/* Fall through. */
case SHN_SCORE_SCOMMON:
if (score_elf_scom_section.name == NULL)
- {
- /* Initialize the small common section. */
- score_elf_scom_section.name = ".scommon";
- score_elf_scom_section.flags = SEC_IS_COMMON;
- score_elf_scom_section.output_section = &score_elf_scom_section;
- score_elf_scom_section.symbol = &score_elf_scom_symbol;
- score_elf_scom_section.symbol_ptr_ptr = &score_elf_scom_symbol_ptr;
- score_elf_scom_symbol.name = ".scommon";
- score_elf_scom_symbol.flags = BSF_SECTION_SYM;
- score_elf_scom_symbol.section = &score_elf_scom_section;
- score_elf_scom_symbol_ptr = &score_elf_scom_symbol;
- }
+ {
+ /* Initialize the small common section. */
+ score_elf_scom_section.name = ".scommon";
+ score_elf_scom_section.flags = SEC_IS_COMMON;
+ score_elf_scom_section.output_section = &score_elf_scom_section;
+ score_elf_scom_section.symbol = &score_elf_scom_symbol;
+ score_elf_scom_section.symbol_ptr_ptr = &score_elf_scom_symbol_ptr;
+ score_elf_scom_symbol.name = ".scommon";
+ score_elf_scom_symbol.flags = BSF_SECTION_SYM;
+ score_elf_scom_symbol.section = &score_elf_scom_section;
+ score_elf_scom_symbol_ptr = &score_elf_scom_symbol;
+ }
asym->section = &score_elf_scom_section;
asym->value = elfsym->internal_elf_sym.st_size;
break;
static int
s3_bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
- const char *name ATTRIBUTE_UNUSED,
- Elf_Internal_Sym *sym,
- asection *input_sec,
- struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
+ const char *name ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym,
+ asection *input_sec,
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
{
/* If we see a common symbol, which implies a relocatable link, then
if a symbol was small common in an input file, mark it as small
static bfd_boolean
s3_bfd_score_elf_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED,
- asection *sec,
- int *retval)
+ asection *sec,
+ int *retval)
{
if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0)
{
change the definition to something the rest of the link can understand. */
static bfd_boolean
s3_bfd_score_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *h)
+ struct elf_link_hash_entry *h)
{
bfd *dynobj;
struct score_elf_link_hash_entry *hscore;
/* Make sure we know what is going on here. */
BFD_ASSERT (dynobj != NULL
- && (h->needs_plt
- || h->is_weakalias
- || (h->def_dynamic && h->ref_regular && !h->def_regular)));
+ && (h->needs_plt
+ || h->is_weakalias
+ || (h->def_dynamic && h->ref_regular && !h->def_regular)));
/* If this symbol is defined in a dynamic object, we need to copy
any R_SCORE_ABS32 or R_SCORE_REL32 relocs against it into the output
{
score_elf_allocate_dynamic_relocations (dynobj, hscore->possibly_dynamic_relocs);
if (hscore->readonly_reloc)
- /* We tell the dynamic linker that there are relocations
- against the text segment. */
- info->flags |= DF_TEXTREL;
+ /* We tell the dynamic linker that there are relocations
+ against the text segment. */
+ info->flags |= DF_TEXTREL;
}
/* For a function, create a stub, if allowed. */
if (!hscore->no_fn_stub && h->needs_plt)
{
if (!elf_hash_table (info)->dynamic_sections_created)
- return TRUE;
+ return TRUE;
/* If this symbol is not defined in a regular file, then set
- the symbol to the stub location. This is required to make
- function pointers compare as equal between the normal
- executable and the shared library. */
+ the symbol to the stub location. This is required to make
+ function pointers compare as equal between the normal
+ executable and the shared library. */
if (!h->def_regular)
- {
- /* We need .stub section. */
- s = bfd_get_linker_section (dynobj, SCORE_ELF_STUB_SECTION_NAME);
- BFD_ASSERT (s != NULL);
+ {
+ /* We need .stub section. */
+ s = bfd_get_linker_section (dynobj, SCORE_ELF_STUB_SECTION_NAME);
+ BFD_ASSERT (s != NULL);
- h->root.u.def.section = s;
- h->root.u.def.value = s->size;
+ h->root.u.def.section = s;
+ h->root.u.def.value = s->size;
- /* XXX Write this stub address somewhere. */
- h->plt.offset = s->size;
+ /* XXX Write this stub address somewhere. */
+ h->plt.offset = s->size;
- /* Make room for this stub code. */
- s->size += SCORE_FUNCTION_STUB_SIZE;
+ /* Make room for this stub code. */
+ s->size += SCORE_FUNCTION_STUB_SIZE;
- /* The last half word of the stub will be filled with the index
- of this symbol in .dynsym section. */
- return TRUE;
- }
+ /* The last half word of the stub will be filled with the index
+ of this symbol in .dynsym section. */
+ return TRUE;
+ }
}
else if ((h->type == STT_FUNC) && !h->needs_plt)
{
/* This will set the entry for this symbol in the GOT to 0, and
- the dynamic linker will take care of this. */
+ the dynamic linker will take care of this. */
h->root.u.def.value = 0;
return TRUE;
}
and the input sections have been assigned to output sections. */
static bfd_boolean
s3_bfd_score_elf_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
asection *subsection;
for (subsection = sub->sections;
- subsection;
- subsection = subsection->next)
- {
- if ((subsection->flags & SEC_ALLOC) == 0)
- continue;
- loadable_size += ((subsection->size + 0xf)
- &~ (bfd_size_type) 0xf);
- }
+ subsection;
+ subsection = subsection->next)
+ {
+ if ((subsection->flags & SEC_ALLOC) == 0)
+ continue;
+ loadable_size += ((subsection->size + 0xf)
+ &~ (bfd_size_type) 0xf);
+ }
}
/* There has to be a global GOT entry for every symbol with
{
/* Set the contents of the .interp section to the interpreter. */
if (bfd_link_executable (info) && !info->nointerp)
- {
- s = bfd_get_linker_section (dynobj, ".interp");
- BFD_ASSERT (s != NULL);
- s->size = strlen (ELF_DYNAMIC_INTERPRETER) + 1;
- s->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER;
- }
+ {
+ s = bfd_get_linker_section (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->size = strlen (ELF_DYNAMIC_INTERPRETER) + 1;
+ s->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER;
+ }
}
/* The check_relocs and adjust_dynamic_symbol entry points have
const char *name;
if ((s->flags & SEC_LINKER_CREATED) == 0)
- continue;
+ continue;
/* It's OK to base decisions on the section name, because none
- of the dynobj section names depend upon the input files. */
+ of the dynobj section names depend upon the input files. */
name = bfd_get_section_name (dynobj, s);
if (CONST_STRNEQ (name, ".rel"))
- {
- if (s->size == 0)
- {
- /* We only strip the section if the output section name
- has the same name. Otherwise, there might be several
- input sections for this output section. FIXME: This
- code is probably not needed these days anyhow, since
- the linker now does not create empty output sections. */
- if (s->output_section != NULL
- && strcmp (name,
- bfd_get_section_name (s->output_section->owner,
- s->output_section)) == 0)
- s->flags |= SEC_EXCLUDE;
- }
- else
- {
- const char *outname;
- asection *target;
-
- /* If this relocation section applies to a read only
- section, then we probably need a DT_TEXTREL entry.
- If the relocation section is .rel.dyn, we always
- assert a DT_TEXTREL entry rather than testing whether
- there exists a relocation to a read only section or
- not. */
- outname = bfd_get_section_name (output_bfd, s->output_section);
- target = bfd_get_section_by_name (output_bfd, outname + 4);
- if ((target != NULL
- && (target->flags & SEC_READONLY) != 0
- && (target->flags & SEC_ALLOC) != 0) || strcmp (outname, ".rel.dyn") == 0)
- reltext = TRUE;
-
- /* We use the reloc_count field as a counter if we need
- to copy relocs into the output file. */
- if (strcmp (name, ".rel.dyn") != 0)
- s->reloc_count = 0;
- }
- }
+ {
+ if (s->size == 0)
+ {
+ /* We only strip the section if the output section name
+ has the same name. Otherwise, there might be several
+ input sections for this output section. FIXME: This
+ code is probably not needed these days anyhow, since
+ the linker now does not create empty output sections. */
+ if (s->output_section != NULL
+ && strcmp (name,
+ bfd_get_section_name (s->output_section->owner,
+ s->output_section)) == 0)
+ s->flags |= SEC_EXCLUDE;
+ }
+ else
+ {
+ const char *outname;
+ asection *target;
+
+ /* If this relocation section applies to a read only
+ section, then we probably need a DT_TEXTREL entry.
+ If the relocation section is .rel.dyn, we always
+ assert a DT_TEXTREL entry rather than testing whether
+ there exists a relocation to a read only section or
+ not. */
+ outname = bfd_get_section_name (output_bfd, s->output_section);
+ target = bfd_get_section_by_name (output_bfd, outname + 4);
+ if ((target != NULL
+ && (target->flags & SEC_READONLY) != 0
+ && (target->flags & SEC_ALLOC) != 0) || strcmp (outname, ".rel.dyn") == 0)
+ reltext = TRUE;
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ if (strcmp (name, ".rel.dyn") != 0)
+ s->reloc_count = 0;
+ }
+ }
else if (CONST_STRNEQ (name, ".got"))
- {
- /* s3_bfd_score_elf_always_size_sections() has already done
- most of the work, but some symbols may have been mapped
- to versions that we must now resolve in the got_entries
- hash tables. */
- }
+ {
+ /* s3_bfd_score_elf_always_size_sections() has already done
+ most of the work, but some symbols may have been mapped
+ to versions that we must now resolve in the got_entries
+ hash tables. */
+ }
else if (strcmp (name, SCORE_ELF_STUB_SECTION_NAME) == 0)
- {
- /* IRIX rld assumes that the function stub isn't at the end
- of .text section. So put a dummy. XXX */
- s->size += SCORE_FUNCTION_STUB_SIZE;
- }
+ {
+ /* IRIX rld assumes that the function stub isn't at the end
+ of .text section. So put a dummy. XXX */
+ s->size += SCORE_FUNCTION_STUB_SIZE;
+ }
else if (! CONST_STRNEQ (name, ".init"))
- {
- /* It's not one of our sections, so don't allocate space. */
- continue;
- }
+ {
+ /* It's not one of our sections, so don't allocate space. */
+ continue;
+ }
/* Allocate memory for the section contents. */
s->contents = bfd_zalloc (dynobj, s->size);
if (s->contents == NULL && s->size != 0)
- {
- bfd_set_error (bfd_error_no_memory);
- return FALSE;
- }
+ {
+ bfd_set_error (bfd_error_no_memory);
+ return FALSE;
+ }
}
if (elf_hash_table (info)->dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
- values later, in s3_bfd_score_elf_finish_dynamic_sections, but we
- must add the entries now so that we get the correct size for
- the .dynamic section. The DT_DEBUG entry is filled in by the
- dynamic linker and used by the debugger. */
+ values later, in s3_bfd_score_elf_finish_dynamic_sections, but we
+ must add the entries now so that we get the correct size for
+ the .dynamic section. The DT_DEBUG entry is filled in by the
+ dynamic linker and used by the debugger. */
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0))
- return FALSE;
+ return FALSE;
if (reltext)
- info->flags |= DF_TEXTREL;
+ info->flags |= DF_TEXTREL;
if ((info->flags & DF_TEXTREL) != 0)
- {
- if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_TEXTREL, 0))
- return FALSE;
- }
+ {
+ if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_TEXTREL, 0))
+ return FALSE;
+ }
if (! SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTGOT, 0))
- return FALSE;
+ return FALSE;
if (score_elf_rel_dyn_section (dynobj, FALSE))
- {
- if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0))
- return FALSE;
+ {
+ if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0))
+ return FALSE;
- if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0))
- return FALSE;
+ if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0))
+ return FALSE;
- if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0))
- return FALSE;
- }
+ if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0))
+ return FALSE;
+ }
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_BASE_ADDRESS, 0))
- return FALSE;
+ return FALSE;
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_LOCAL_GOTNO, 0))
- return FALSE;
+ return FALSE;
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_SYMTABNO, 0))
- return FALSE;
+ return FALSE;
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_UNREFEXTNO, 0))
- return FALSE;
+ return FALSE;
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_GOTSYM, 0))
- return FALSE;
+ return FALSE;
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_HIPAGENO, 0))
- return FALSE;
+ return FALSE;
}
return TRUE;
asection *s;
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
- | SEC_LINKER_CREATED | SEC_READONLY);
+ | SEC_LINKER_CREATED | SEC_READONLY);
/* ABI requests the .dynamic section to be read only. */
s = bfd_get_linker_section (abfd, ".dynamic");
if (s != NULL)
{
if (!bfd_set_section_flags (abfd, s, flags))
- return FALSE;
+ return FALSE;
}
/* We need to create .got section. */
s = bfd_make_section_anyway_with_flags (abfd, SCORE_ELF_STUB_SECTION_NAME,
flags | SEC_CODE);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (abfd, s, 2))
- return FALSE;
+ return FALSE;
}
if (!bfd_link_pic (info))
name = "_DYNAMIC_LINK";
bh = NULL;
if (!(_bfd_generic_link_add_one_symbol
- (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr,
- (bfd_vma) 0, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh)))
- return FALSE;
+ (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr,
+ (bfd_vma) 0, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh)))
+ return FALSE;
h = (struct elf_link_hash_entry *)bh;
h->non_elf = 0;
h->type = STT_SECTION;
if (!bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
+ return FALSE;
}
return TRUE;
dynamic sections here. */
static bfd_boolean
s3_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd,
- struct bfd_link_info *info,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
bfd *dynobj;
asection *sgot;
/* FIXME: Can h->dynindex be more than 64K? */
if (h->dynindx & 0xffff0000)
- return FALSE;
+ return FALSE;
/* Fill the stub. */
score_bfd_put_32 (output_bfd, STUB_LW, stub);
memcpy (s->contents + h->plt.offset, stub, SCORE_FUNCTION_STUB_SIZE);
/* Mark the symbol as undefined. plt.offset != -1 occurs
- only for the referenced symbol. */
+ only for the referenced symbol. */
sym->st_shndx = SHN_UNDEF;
/* The run-time linker uses the st_value field of the symbol
- to reset the global offset table entry for this external
- to its stub address when unlinking a shared object. */
+ to reset the global offset table entry for this external
+ to its stub address when unlinking a shared object. */
sym->st_value = (s->output_section->vma + s->output_offset + h->plt.offset);
}
/* Finish up the dynamic sections. */
static bfd_boolean
s3_bfd_score_elf_finish_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *sdyn;
BFD_ASSERT (g != NULL);
for (b = sdyn->contents;
- b < sdyn->contents + sdyn->size;
- b += SCORE_ELF_DYN_SIZE (dynobj))
- {
- Elf_Internal_Dyn dyn;
- const char *name;
- size_t elemsize;
- bfd_boolean swap_out_p;
-
- /* Read in the current dynamic entry. */
- (*get_elf_backend_data (dynobj)->s->swap_dyn_in) (dynobj, b, &dyn);
-
- /* Assume that we're going to modify it and write it out. */
- swap_out_p = TRUE;
-
- switch (dyn.d_tag)
- {
- case DT_RELENT:
- dyn.d_un.d_val = SCORE_ELF_REL_SIZE (dynobj);
- break;
-
- case DT_STRSZ:
- /* Rewrite DT_STRSZ. */
- dyn.d_un.d_val
- = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr);
- break;
-
- case DT_PLTGOT:
- s = elf_hash_table (info)->sgot;
- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
- break;
-
- case DT_SCORE_BASE_ADDRESS:
- s = output_bfd->sections;
- BFD_ASSERT (s != NULL);
- dyn.d_un.d_ptr = s->vma & ~(bfd_vma) 0xffff;
- break;
-
- case DT_SCORE_LOCAL_GOTNO:
- dyn.d_un.d_val = g->local_gotno;
- break;
-
- case DT_SCORE_UNREFEXTNO:
- /* The index into the dynamic symbol table which is the
- entry of the first external symbol that is not
- referenced within the same object. */
- dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1;
- break;
-
- case DT_SCORE_GOTSYM:
- if (g->global_gotsym)
- {
- dyn.d_un.d_val = g->global_gotsym->dynindx;
- break;
- }
- /* In case if we don't have global got symbols we default
- to setting DT_SCORE_GOTSYM to the same value as
- DT_SCORE_SYMTABNO. */
+ b < sdyn->contents + sdyn->size;
+ b += SCORE_ELF_DYN_SIZE (dynobj))
+ {
+ Elf_Internal_Dyn dyn;
+ const char *name;
+ size_t elemsize;
+ bfd_boolean swap_out_p;
+
+ /* Read in the current dynamic entry. */
+ (*get_elf_backend_data (dynobj)->s->swap_dyn_in) (dynobj, b, &dyn);
+
+ /* Assume that we're going to modify it and write it out. */
+ swap_out_p = TRUE;
+
+ switch (dyn.d_tag)
+ {
+ case DT_RELENT:
+ dyn.d_un.d_val = SCORE_ELF_REL_SIZE (dynobj);
+ break;
+
+ case DT_STRSZ:
+ /* Rewrite DT_STRSZ. */
+ dyn.d_un.d_val
+ = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr);
+ break;
+
+ case DT_PLTGOT:
+ s = elf_hash_table (info)->sgot;
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ break;
+
+ case DT_SCORE_BASE_ADDRESS:
+ s = output_bfd->sections;
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_ptr = s->vma & ~(bfd_vma) 0xffff;
+ break;
+
+ case DT_SCORE_LOCAL_GOTNO:
+ dyn.d_un.d_val = g->local_gotno;
+ break;
+
+ case DT_SCORE_UNREFEXTNO:
+ /* The index into the dynamic symbol table which is the
+ entry of the first external symbol that is not
+ referenced within the same object. */
+ dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1;
+ break;
+
+ case DT_SCORE_GOTSYM:
+ if (g->global_gotsym)
+ {
+ dyn.d_un.d_val = g->global_gotsym->dynindx;
+ break;
+ }
+ /* In case if we don't have global got symbols we default
+ to setting DT_SCORE_GOTSYM to the same value as
+ DT_SCORE_SYMTABNO. */
/* Fall through. */
- case DT_SCORE_SYMTABNO:
- name = ".dynsym";
- elemsize = SCORE_ELF_SYM_SIZE (output_bfd);
- s = bfd_get_linker_section (dynobj, name);
- dyn.d_un.d_val = s->size / elemsize;
- break;
-
- case DT_SCORE_HIPAGENO:
- dyn.d_un.d_val = g->local_gotno - SCORE_RESERVED_GOTNO;
- break;
-
- default:
- swap_out_p = FALSE;
- break;
- }
-
- if (swap_out_p)
- (*get_elf_backend_data (dynobj)->s->swap_dyn_out) (dynobj, &dyn, b);
- }
+ case DT_SCORE_SYMTABNO:
+ name = ".dynsym";
+ elemsize = SCORE_ELF_SYM_SIZE (output_bfd);
+ s = bfd_get_linker_section (dynobj, name);
+ dyn.d_un.d_val = s->size / elemsize;
+ break;
+
+ case DT_SCORE_HIPAGENO:
+ dyn.d_un.d_val = g->local_gotno - SCORE_RESERVED_GOTNO;
+ break;
+
+ default:
+ swap_out_p = FALSE;
+ break;
+ }
+
+ if (swap_out_p)
+ (*get_elf_backend_data (dynobj)->s->swap_dyn_out) (dynobj, &dyn, b);
+ }
}
/* The first entry of the global offset table will be filled at
{
reldyn_sorting_bfd = output_bfd;
qsort ((Elf32_External_Rel *) s->contents + 1, s->reloc_count - 1,
- sizeof (Elf32_External_Rel), score_elf_sort_dynamic_relocs);
+ sizeof (Elf32_External_Rel), score_elf_sort_dynamic_relocs);
}
return TRUE;
it out. This is where the flags and type fields are set for unusual sections. */
static bfd_boolean
s3_bfd_score_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
- Elf_Internal_Shdr *hdr,
- asection *sec)
+ Elf_Internal_Shdr *hdr,
+ asection *sec)
{
const char *name;
const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
if (strcmp (name, ".sdata") == 0)
- {
- hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL;
- hdr->sh_type = SHT_PROGBITS;
- }
+ {
+ hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL;
+ hdr->sh_type = SHT_PROGBITS;
+ }
else if (strcmp (name, ".sbss") == 0)
- {
- hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL;
- hdr->sh_type = SHT_NOBITS;
- }
+ {
+ hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL;
+ hdr->sh_type = SHT_NOBITS;
+ }
else if (strcmp (name, ".srdata") == 0)
- {
- hdr->sh_flags |= SHF_ALLOC | SHF_SCORE_GPREL;
- hdr->sh_type = SHT_PROGBITS;
- }
+ {
+ hdr->sh_flags |= SHF_ALLOC | SHF_SCORE_GPREL;
+ hdr->sh_type = SHT_PROGBITS;
+ }
}
return TRUE;
for (from = contents, i = 0; from < end; from += PDR_SIZE, i++)
{
if ((score_elf_section_data (sec)->u.tdata)[i] == 1)
- continue;
+ continue;
if (to != from)
- memcpy (to, from, PDR_SIZE);
+ memcpy (to, from, PDR_SIZE);
to += PDR_SIZE;
}
bfd_set_section_contents (output_bfd, sec->output_section, contents,
- (file_ptr) sec->output_offset, sec->size);
+ (file_ptr) sec->output_offset, sec->size);
return TRUE;
}
indirect symbol. Process additional relocation information. */
static void
s3_bfd_score_elf_copy_indirect_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *dir,
- struct elf_link_hash_entry *ind)
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
struct score_elf_link_hash_entry *dirscore, *indscore;
/* Remove information about discarded functions from other sections which mention them. */
static bfd_boolean
s3_bfd_score_elf_discard_info (bfd *abfd, struct elf_reloc_cookie *cookie,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
asection *o;
bfd_boolean ret = FALSE;
for (i = 0, skip = 0; i < o->size; i++)
{
if (bfd_elf_reloc_symbol_deleted_p (i * PDR_SIZE, cookie))
- {
- tdata[i] = 1;
- skip++;
- }
+ {
+ tdata[i] = 1;
+ skip++;
+ }
}
if (skip != 0)
relocation. */
static asection *
s3_bfd_score_elf_gc_mark_hook (asection *sec,
- struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct bfd_link_info *info,
+ Elf_Internal_Rela *rel,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
if (h != NULL)
switch (ELF32_R_TYPE (rel->r_info))
{
case R_SCORE_GNU_VTINHERIT:
case R_SCORE_GNU_VTENTRY:
- return NULL;
+ return NULL;
}
return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
default:
return FALSE;
- case 148: /* Linux/Score 32-bit. */
+ case 148: /* Linux/Score 32-bit. */
/* pr_cursig */
elf_tdata (abfd)->core->signal
= score_bfd_get_16 (abfd, note->descdata + 12);
default:
return FALSE;
- case 124: /* Linux/Score elf_prpsinfo. */
+ case 124: /* Linux/Score elf_prpsinfo. */
elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
elf_tdata (abfd)->core->command
static reloc_howto_type *
elf32_score_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- const char *r_name)
+ const char *r_name)
{
unsigned int i;
for (i = 0;
i < (sizeof (elf32_score_howto_table)
- / sizeof (elf32_score_howto_table[0]));
+ / sizeof (elf32_score_howto_table[0]));
i++)
if (elf32_score_howto_table[i].name != NULL
- && strcasecmp (elf32_score_howto_table[i].name, r_name) == 0)
+ && strcasecmp (elf32_score_howto_table[i].name, r_name) == 0)
return &elf32_score_howto_table[i];
return NULL;
elf_elfheader (obfd)->e_flags = in_flags;
if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
- && bfd_get_arch_info (obfd)->the_default)
- {
- return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd));
- }
+ && bfd_get_arch_info (obfd)->the_default)
+ {
+ return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd));
+ }
return TRUE;
}
/* s3_s7: backend hooks. */
static void
_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *bfd_reloc,
- Elf_Internal_Rela *elf_reloc)
+ arelent *bfd_reloc,
+ Elf_Internal_Rela *elf_reloc)
{
if (bfd_get_mach (abfd) == bfd_mach_score3)
return s3_bfd_score_info_to_howto (abfd, bfd_reloc, elf_reloc);
static bfd_boolean
_bfd_score_elf_relocate_section (bfd *output_bfd,
- struct bfd_link_info *info,
- bfd *input_bfd,
- asection *input_section,
- bfd_byte *contents,
- Elf_Internal_Rela *relocs,
- Elf_Internal_Sym *local_syms,
- asection **local_sections)
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
if (bfd_get_mach (output_bfd) == bfd_mach_score3)
return s3_bfd_score_elf_relocate_section (output_bfd,
- info, input_bfd, input_section, contents, relocs,
- local_syms, local_sections);
+ info, input_bfd, input_section, contents, relocs,
+ local_syms, local_sections);
else
return s7_bfd_score_elf_relocate_section (output_bfd,
- info, input_bfd, input_section, contents, relocs,
- local_syms, local_sections);
+ info, input_bfd, input_section, contents, relocs,
+ local_syms, local_sections);
}
static bfd_boolean
_bfd_score_elf_check_relocs (bfd *abfd,
- struct bfd_link_info *info,
- asection *sec,
- const Elf_Internal_Rela *relocs)
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
if (bfd_get_mach (abfd) == bfd_mach_score3)
return s3_bfd_score_elf_check_relocs (abfd, info, sec, relocs);
static bfd_boolean
_bfd_score_elf_add_symbol_hook (bfd *abfd,
- struct bfd_link_info *info ATTRIBUTE_UNUSED,
- Elf_Internal_Sym *sym,
- const char **namep ATTRIBUTE_UNUSED,
- flagword *flagsp ATTRIBUTE_UNUSED,
- asection **secp,
- bfd_vma *valp)
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym,
+ const char **namep ATTRIBUTE_UNUSED,
+ flagword *flagsp ATTRIBUTE_UNUSED,
+ asection **secp,
+ bfd_vma *valp)
{
if (bfd_get_mach (abfd) == bfd_mach_score3)
return s3_bfd_score_elf_add_symbol_hook (abfd, info, sym, namep, flagsp,
- secp, valp);
+ secp, valp);
else
return s7_bfd_score_elf_add_symbol_hook (abfd, info, sym, namep, flagsp,
- secp, valp);
+ secp, valp);
}
static void
if (info->input_bfds == NULL)
{
/* If we see a common symbol, which implies a relocatable link, then
- if a symbol was small common in an input file, mark it as small
- common in the output file. */
+ if a symbol was small common in an input file, mark it as small
+ common in the output file. */
if (sym->st_shndx == SHN_COMMON && strcmp (input_sec->name, ".scommon") == 0)
- sym->st_shndx = SHN_SCORE_SCOMMON;
+ sym->st_shndx = SHN_SCORE_SCOMMON;
return 1;
}
static bfd_boolean
_bfd_score_elf_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED,
- asection *sec,
- int *retval)
+ asection *sec,
+ int *retval)
{
if (bfd_get_mach (abfd) == bfd_mach_score3)
return s3_bfd_score_elf_section_from_bfd_section (abfd, sec, retval);
static bfd_boolean
_bfd_score_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *h)
+ struct elf_link_hash_entry *h)
{
if (bfd_get_mach (info->input_bfds) == bfd_mach_score3)
return s3_bfd_score_elf_adjust_dynamic_symbol (info, h);
static bfd_boolean
_bfd_score_elf_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
if (bfd_get_mach (output_bfd) == bfd_mach_score3)
return s3_bfd_score_elf_always_size_sections (output_bfd, info);
static bfd_boolean
_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd,
- struct bfd_link_info *info,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
if (bfd_get_mach (output_bfd) == bfd_mach_score3)
return s3_bfd_score_elf_finish_dynamic_symbol (output_bfd, info, h, sym);
static bfd_boolean
_bfd_score_elf_finish_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
if (bfd_get_mach (output_bfd) == bfd_mach_score3)
return s3_bfd_score_elf_finish_dynamic_sections (output_bfd, info);
static bfd_boolean
_bfd_score_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
- Elf_Internal_Shdr *hdr,
- asection *sec)
+ Elf_Internal_Shdr *hdr,
+ asection *sec)
{
if (bfd_get_mach (abfd) == bfd_mach_score3)
return s3_bfd_score_elf_fake_sections (abfd, hdr, sec);
static bfd_boolean
_bfd_score_elf_write_section (bfd *output_bfd,
- struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
- asection *sec, bfd_byte *contents)
+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
+ asection *sec, bfd_byte *contents)
{
if (bfd_get_mach (output_bfd) == bfd_mach_score3)
return s3_bfd_score_elf_write_section (output_bfd, sec, contents);
static void
_bfd_score_elf_copy_indirect_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *dir,
- struct elf_link_hash_entry *ind)
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
if (bfd_get_mach (info->input_bfds) == bfd_mach_score3)
return s3_bfd_score_elf_copy_indirect_symbol (info, dir, ind);
static void
_bfd_score_elf_hide_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *entry,
- bfd_boolean force_local)
+ struct elf_link_hash_entry *entry,
+ bfd_boolean force_local)
{
if (bfd_get_mach (info->input_bfds) == bfd_mach_score3)
return s3_bfd_score_elf_hide_symbol (info, entry, force_local);
static bfd_boolean
_bfd_score_elf_discard_info (bfd *abfd, struct elf_reloc_cookie *cookie,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
if (bfd_get_mach (abfd) == bfd_mach_score3)
return s3_bfd_score_elf_discard_info (abfd, cookie, info);
static asection *
_bfd_score_elf_gc_mark_hook (asection *sec,
- struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct bfd_link_info *info,
+ Elf_Internal_Rela *rel,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
if (bfd_get_mach (info->input_bfds) == bfd_mach_score3)
return s3_bfd_score_elf_gc_mark_hook (sec, info, rel, h, sym);
return NULL;
if (!_bfd_elf_link_hash_table_init (ret, abfd, score_elf_link_hash_newfunc,
- sizeof (struct score_elf_link_hash_entry),
+ sizeof (struct score_elf_link_hash_entry),
GENERIC_ELF_DATA))
{
free (ret);
{
int e_mach = elf_elfheader (abfd)->e_flags & EF_SCORE_MACH & EF_OMIT_PIC_FIXDD;
switch (e_mach)
- {
- /* Set default target is score7. */
- default:
- case E_SCORE_MACH_SCORE7:
- e_set = bfd_mach_score7;
- break;
-
- case E_SCORE_MACH_SCORE3:
- e_set = bfd_mach_score3;
- break;
- }
+ {
+ /* Set default target is score7. */
+ default:
+ case E_SCORE_MACH_SCORE7:
+ e_set = bfd_mach_score7;
+ break;
+
+ case E_SCORE_MACH_SCORE3:
+ e_set = bfd_mach_score3;
+ break;
+ }
}
return bfd_default_set_arch_mach (abfd, bfd_arch_score, e_set);
/*****************************************************************************/
-#define USE_REL 1
-#define TARGET_LITTLE_SYM score_elf32_le_vec
-#define TARGET_LITTLE_NAME "elf32-littlescore"
-#define TARGET_BIG_SYM score_elf32_be_vec
-#define TARGET_BIG_NAME "elf32-bigscore"
-#define ELF_ARCH bfd_arch_score
-#define ELF_MACHINE_CODE EM_SCORE
-#define ELF_MACHINE_ALT1 EM_SCORE_OLD
-#define ELF_MAXPAGESIZE 0x8000
-
-#define elf_info_to_howto 0
-#define elf_info_to_howto_rel _bfd_score_info_to_howto
-#define elf_backend_relocate_section _bfd_score_elf_relocate_section
-#define elf_backend_check_relocs _bfd_score_elf_check_relocs
-#define elf_backend_add_symbol_hook _bfd_score_elf_add_symbol_hook
-#define elf_backend_symbol_processing _bfd_score_elf_symbol_processing
+#define USE_REL 1
+#define TARGET_LITTLE_SYM score_elf32_le_vec
+#define TARGET_LITTLE_NAME "elf32-littlescore"
+#define TARGET_BIG_SYM score_elf32_be_vec
+#define TARGET_BIG_NAME "elf32-bigscore"
+#define ELF_ARCH bfd_arch_score
+#define ELF_MACHINE_CODE EM_SCORE
+#define ELF_MACHINE_ALT1 EM_SCORE_OLD
+#define ELF_MAXPAGESIZE 0x8000
+
+#define elf_info_to_howto 0
+#define elf_info_to_howto_rel _bfd_score_info_to_howto
+#define elf_backend_relocate_section _bfd_score_elf_relocate_section
+#define elf_backend_check_relocs _bfd_score_elf_check_relocs
+#define elf_backend_add_symbol_hook _bfd_score_elf_add_symbol_hook
+#define elf_backend_symbol_processing _bfd_score_elf_symbol_processing
#define elf_backend_link_output_symbol_hook \
_bfd_score_elf_link_output_symbol_hook
#define elf_backend_section_from_bfd_section \
_bfd_score_elf_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections \
_bfd_score_elf_finish_dynamic_sections
-#define elf_backend_fake_sections _bfd_score_elf_fake_sections
-#define elf_backend_section_processing _bfd_score_elf_section_processing
-#define elf_backend_write_section _bfd_score_elf_write_section
+#define elf_backend_fake_sections _bfd_score_elf_fake_sections
+#define elf_backend_section_processing _bfd_score_elf_section_processing
+#define elf_backend_write_section _bfd_score_elf_write_section
#define elf_backend_copy_indirect_symbol _bfd_score_elf_copy_indirect_symbol
-#define elf_backend_hide_symbol _bfd_score_elf_hide_symbol
-#define elf_backend_discard_info _bfd_score_elf_discard_info
+#define elf_backend_hide_symbol _bfd_score_elf_hide_symbol
+#define elf_backend_discard_info _bfd_score_elf_discard_info
#define elf_backend_ignore_discarded_relocs \
_bfd_score_elf_ignore_discarded_relocs
-#define elf_backend_gc_mark_hook _bfd_score_elf_gc_mark_hook
-#define elf_backend_grok_prstatus _bfd_score_elf_grok_prstatus
-#define elf_backend_grok_psinfo _bfd_score_elf_grok_psinfo
-#define elf_backend_can_gc_sections 1
-#define elf_backend_want_plt_sym 0
-#define elf_backend_got_header_size (4 * SCORE_RESERVED_GOTNO)
-#define elf_backend_plt_header_size 0
-#define elf_backend_collect TRUE
-#define elf_backend_type_change_ok TRUE
-#define elf_backend_object_p _bfd_score_elf_score_object_p
-
-#define bfd_elf32_bfd_reloc_type_lookup elf32_score_reloc_type_lookup
+#define elf_backend_gc_mark_hook _bfd_score_elf_gc_mark_hook
+#define elf_backend_grok_prstatus _bfd_score_elf_grok_prstatus
+#define elf_backend_grok_psinfo _bfd_score_elf_grok_psinfo
+#define elf_backend_can_gc_sections 1
+#define elf_backend_want_plt_sym 0
+#define elf_backend_got_header_size (4 * SCORE_RESERVED_GOTNO)
+#define elf_backend_plt_header_size 0
+#define elf_backend_collect TRUE
+#define elf_backend_type_change_ok TRUE
+#define elf_backend_object_p _bfd_score_elf_score_object_p
+
+#define bfd_elf32_bfd_reloc_type_lookup elf32_score_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup \
elf32_score_reloc_name_lookup
#define bfd_elf32_bfd_link_hash_table_create elf32_score_link_hash_table_create
#define bfd_elf32_bfd_print_private_bfd_data elf32_score_print_private_bfd_data
#define bfd_elf32_bfd_merge_private_bfd_data elf32_score_merge_private_bfd_data
-#define bfd_elf32_new_section_hook elf32_score_new_section_hook
+#define bfd_elf32_new_section_hook elf32_score_new_section_hook
#include "elf32-target.h"
extern void
s7_bfd_score_elf_hide_symbol (struct bfd_link_info *,
- struct elf_link_hash_entry *,
- bfd_boolean);
+ struct elf_link_hash_entry *,
+ bfd_boolean);
extern void
s7_bfd_score_info_to_howto (bfd *, arelent *, Elf_Internal_Rela *);
extern bfd_boolean
s7_bfd_score_elf_relocate_section (bfd *,
- struct bfd_link_info *,
- bfd *,
- asection *,
- bfd_byte *,
- Elf_Internal_Rela *,
- Elf_Internal_Sym *,
- asection **);
+ struct bfd_link_info *,
+ bfd *,
+ asection *,
+ bfd_byte *,
+ Elf_Internal_Rela *,
+ Elf_Internal_Sym *,
+ asection **);
extern bfd_boolean
s7_bfd_score_elf_check_relocs (bfd *,
- struct bfd_link_info *,
- asection *,
- const Elf_Internal_Rela *);
+ struct bfd_link_info *,
+ asection *,
+ const Elf_Internal_Rela *);
extern bfd_boolean
s7_bfd_score_elf_add_symbol_hook (bfd *,
- struct bfd_link_info *,
- Elf_Internal_Sym *,
- const char **,
- flagword *,
- asection **,
- bfd_vma *);
+ struct bfd_link_info *,
+ Elf_Internal_Sym *,
+ const char **,
+ flagword *,
+ asection **,
+ bfd_vma *);
extern void
s7_bfd_score_elf_symbol_processing (bfd *, asymbol *);
extern int
s7_bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *,
- const char *,
- Elf_Internal_Sym *,
- asection *,
- struct elf_link_hash_entry *);
+ const char *,
+ Elf_Internal_Sym *,
+ asection *,
+ struct elf_link_hash_entry *);
extern bfd_boolean
s7_bfd_score_elf_section_from_bfd_section (bfd *,
- asection *,
- int *);
+ asection *,
+ int *);
extern bfd_boolean
s7_bfd_score_elf_adjust_dynamic_symbol (struct bfd_link_info *,
- struct elf_link_hash_entry *);
+ struct elf_link_hash_entry *);
extern bfd_boolean
s7_bfd_score_elf_always_size_sections (bfd *, struct bfd_link_info *);
extern bfd_boolean
s7_bfd_score_elf_finish_dynamic_symbol (bfd *,
- struct bfd_link_info *,
- struct elf_link_hash_entry *,
- Elf_Internal_Sym *);
+ struct bfd_link_info *,
+ struct elf_link_hash_entry *,
+ Elf_Internal_Sym *);
extern bfd_boolean
s7_bfd_score_elf_finish_dynamic_sections (bfd *, struct bfd_link_info *);
extern bfd_boolean
s7_bfd_score_elf_fake_sections (bfd *,
- Elf_Internal_Shdr *,
- asection *);
+ Elf_Internal_Shdr *,
+ asection *);
extern bfd_boolean
s7_bfd_score_elf_section_processing (bfd *, Elf_Internal_Shdr *);
extern void
s7_bfd_score_elf_copy_indirect_symbol (struct bfd_link_info *,
- struct elf_link_hash_entry *,
- struct elf_link_hash_entry *);
+ struct elf_link_hash_entry *,
+ struct elf_link_hash_entry *);
extern bfd_boolean
s7_bfd_score_elf_discard_info (bfd *, struct elf_reloc_cookie *,
- struct bfd_link_info *);
+ struct bfd_link_info *);
extern bfd_boolean
s7_bfd_score_elf_ignore_discarded_relocs (asection *);
extern asection *
s7_bfd_score_elf_gc_mark_hook (asection *,
- struct bfd_link_info *,
- Elf_Internal_Rela *,
- struct elf_link_hash_entry *,
- Elf_Internal_Sym *);
+ struct bfd_link_info *,
+ Elf_Internal_Rela *,
+ struct elf_link_hash_entry *,
+ Elf_Internal_Sym *);
extern bfd_boolean
s7_bfd_score_elf_grok_prstatus (bfd *, Elf_Internal_Note *);
/* The number of local .got entries we reserve. */
-#define SCORE_RESERVED_GOTNO (2)
+#define SCORE_RESERVED_GOTNO (2)
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
/* The offset of $gp from the beginning of the .got section. */
static bfd_reloc_status_type
score_elf_hi16_reloc (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *reloc_entry,
- asymbol *symbol ATTRIBUTE_UNUSED,
- void * data,
- asection *input_section ATTRIBUTE_UNUSED,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data,
+ asection *input_section ATTRIBUTE_UNUSED,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
hi16_rel_addr = (bfd_byte *) data + reloc_entry->address;
return bfd_reloc_ok;
static bfd_reloc_status_type
score_elf_lo16_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol ATTRIBUTE_UNUSED,
- void * data,
- asection *input_section,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma addend = 0, offset = 0;
unsigned long val;
else
{
for (i = 0; i < count; i++, sym++)
- {
- const char *name;
-
- name = bfd_asymbol_name (*sym);
- if (*name == '_' && strcmp (name, "_gp") == 0)
- {
- *pgp = bfd_asymbol_value (*sym);
- _bfd_set_gp_value (output_bfd, *pgp);
- break;
- }
- }
+ {
+ const char *name;
+
+ name = bfd_asymbol_name (*sym);
+ if (*name == '_' && strcmp (name, "_gp") == 0)
+ {
+ *pgp = bfd_asymbol_value (*sym);
+ _bfd_set_gp_value (output_bfd, *pgp);
+ break;
+ }
+ }
}
if (i >= count)
static bfd_reloc_status_type
score_elf_final_gp (bfd *output_bfd,
- asymbol *symbol,
- bfd_boolean relocatable,
- char **error_message,
- bfd_vma *pgp)
+ asymbol *symbol,
+ bfd_boolean relocatable,
+ char **error_message,
+ bfd_vma *pgp)
{
if (bfd_is_und_section (symbol->section)
&& ! relocatable)
*pgp = _bfd_get_gp_value (output_bfd);
if (*pgp == 0
&& (! relocatable
- || (symbol->flags & BSF_SECTION_SYM) != 0))
+ || (symbol->flags & BSF_SECTION_SYM) != 0))
{
if (relocatable)
- {
- /* Make up a value. */
- *pgp = symbol->section->output_section->vma + 0x4000;
- _bfd_set_gp_value (output_bfd, *pgp);
- }
+ {
+ /* Make up a value. */
+ *pgp = symbol->section->output_section->vma + 0x4000;
+ _bfd_set_gp_value (output_bfd, *pgp);
+ }
else if (!score_elf_assign_gp (output_bfd, pgp))
- {
- *error_message =
- (char *) _("GP relative relocation when _gp not defined");
- return bfd_reloc_dangerous;
- }
+ {
+ *error_message =
+ (char *) _("GP relative relocation when _gp not defined");
+ return bfd_reloc_dangerous;
+ }
}
return bfd_reloc_ok;
static bfd_reloc_status_type
score_elf_gprel15_with_gp (bfd *abfd,
- asymbol *symbol,
- arelent *reloc_entry,
- asection *input_section,
- bfd_boolean relocateable,
- void * data,
- bfd_vma gp ATTRIBUTE_UNUSED)
+ asymbol *symbol,
+ arelent *reloc_entry,
+ asection *input_section,
+ bfd_boolean relocateable,
+ void * data,
+ bfd_vma gp ATTRIBUTE_UNUSED)
{
bfd_vma relocation;
unsigned long insn;
static bfd_reloc_status_type
gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry,
- asection *input_section, bfd_boolean relocatable,
- void *data, bfd_vma gp)
+ asection *input_section, bfd_boolean relocatable,
+ void *data, bfd_vma gp)
{
bfd_vma relocation;
bfd_vma val;
static bfd_reloc_status_type
score_elf_gprel15_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol,
- void * data,
- asection *input_section,
- bfd *output_bfd,
- char **error_message)
+ arelent *reloc_entry,
+ asymbol *symbol,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd,
+ char **error_message)
{
bfd_boolean relocateable;
bfd_reloc_status_type ret;
return ret;
return score_elf_gprel15_with_gp (abfd, symbol, reloc_entry,
- input_section, relocateable, data, gp);
+ input_section, relocateable, data, gp);
}
/* Do a R_SCORE_GPREL32 relocation. This is a 32 bit value which must
static bfd_reloc_status_type
score_elf_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
- void *data, asection *input_section, bfd *output_bfd,
- char **error_message)
+ void *data, asection *input_section, bfd *output_bfd,
+ char **error_message)
{
bfd_boolean relocatable;
bfd_reloc_status_type ret;
&& (symbol->flags & BSF_LOCAL) != 0)
{
*error_message = (char *)
- _("32bits gp relative relocation occurs for an external symbol");
+ _("32bits gp relative relocation occurs for an external symbol");
return bfd_reloc_outofrange;
}
gp = 0;
return gprel32_with_gp (abfd, symbol, reloc_entry, input_section,
- relocatable, data, gp);
+ relocatable, data, gp);
}
/* A howto special_function for R_SCORE_GOT15 relocations. This is just
static bfd_reloc_status_type
score_elf_got15_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
- void *data, asection *input_section,
- bfd *output_bfd, char **error_message)
+ void *data, asection *input_section,
+ bfd *output_bfd, char **error_message)
{
if ((symbol->flags & (BSF_GLOBAL | BSF_WEAK)) != 0
|| bfd_is_und_section (bfd_get_section (symbol))
|| bfd_is_com_section (bfd_get_section (symbol)))
/* The relocation is against a global symbol. */
return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd,
- error_message);
+ input_section, output_bfd,
+ error_message);
return score_elf_hi16_reloc (abfd, reloc_entry, symbol, data,
- input_section, output_bfd, error_message);
+ input_section, output_bfd, error_message);
}
static bfd_reloc_status_type
score_elf_got_lo16_reloc (bfd *abfd,
- arelent *reloc_entry,
- asymbol *symbol ATTRIBUTE_UNUSED,
- void * data,
- asection *input_section,
- bfd *output_bfd ATTRIBUTE_UNUSED,
- char **error_message ATTRIBUTE_UNUSED)
+ arelent *reloc_entry,
+ asymbol *symbol ATTRIBUTE_UNUSED,
+ void * data,
+ asection *input_section,
+ bfd *output_bfd ATTRIBUTE_UNUSED,
+ char **error_message ATTRIBUTE_UNUSED)
{
bfd_vma addend = 0, offset = 0;
signed long val;
static reloc_howto_type elf32_score_howto_table[] =
{
/* No relocation. */
- HOWTO (R_SCORE_NONE, /* type */
- 0, /* rightshift */
- 3, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_NONE", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_NONE, /* type */
+ 0, /* rightshift */
+ 3, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_NONE", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_HI16 */
- HOWTO (R_SCORE_HI16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_hi16_reloc, /* special_function */
- "R_SCORE_HI16", /* name */
- TRUE, /* partial_inplace */
- 0x37fff, /* src_mask */
- 0x37fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_HI16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_hi16_reloc, /* special_function */
+ "R_SCORE_HI16", /* name */
+ TRUE, /* partial_inplace */
+ 0x37fff, /* src_mask */
+ 0x37fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_LO16 */
- HOWTO (R_SCORE_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_lo16_reloc, /* special_function */
- "R_SCORE_LO16", /* name */
- TRUE, /* partial_inplace */
- 0x37fff, /* src_mask */
- 0x37fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_lo16_reloc, /* special_function */
+ "R_SCORE_LO16", /* name */
+ TRUE, /* partial_inplace */
+ 0x37fff, /* src_mask */
+ 0x37fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_BCMP */
- HOWTO (R_SCORE_BCMP, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_BCMP", /* name */
- TRUE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
-
- HOWTO (R_SCORE_24, /* type */
- 1, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 24, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_24", /* name */
- FALSE, /* partial_inplace */
- 0x3ff7fff, /* src_mask */
- 0x3ff7fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_BCMP, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_BCMP", /* name */
+ TRUE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_SCORE_24, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 24, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_24", /* name */
+ FALSE, /* partial_inplace */
+ 0x3ff7fff, /* src_mask */
+ 0x3ff7fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/*R_SCORE_PC19 */
- HOWTO (R_SCORE_PC19, /* type */
- 1, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 19, /* bitsize */
- TRUE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_PC19", /* name */
- FALSE, /* partial_inplace */
- 0x3ff03fe, /* src_mask */
- 0x3ff03fe, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_PC19, /* type */
+ 1, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 19, /* bitsize */
+ TRUE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_PC19", /* name */
+ FALSE, /* partial_inplace */
+ 0x3ff03fe, /* src_mask */
+ 0x3ff03fe, /* dst_mask */
+ FALSE), /* pcrel_offset */
/*R_SCORE16_11 */
- HOWTO (R_SCORE16_11, /* type */
- 1, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 11, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE16_11", /* name */
- FALSE, /* partial_inplace */
- 0x000000ffe, /* src_mask */
- 0x000000ffe, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE16_11, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 11, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE16_11", /* name */
+ FALSE, /* partial_inplace */
+ 0x000000ffe, /* src_mask */
+ 0x000000ffe, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE16_PC8 */
- HOWTO (R_SCORE16_PC8, /* type */
- 1, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 8, /* bitsize */
- TRUE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE16_PC8", /* name */
- FALSE, /* partial_inplace */
- 0x000000ff, /* src_mask */
- 0x000000ff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE16_PC8, /* type */
+ 1, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ TRUE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE16_PC8", /* name */
+ FALSE, /* partial_inplace */
+ 0x000000ff, /* src_mask */
+ 0x000000ff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 32 bit absolute */
- HOWTO (R_SCORE_ABS32, /* type 8 */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_ABS32", /* name */
- FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_ABS32, /* type 8 */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_ABS32", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 16 bit absolute */
- HOWTO (R_SCORE_ABS16, /* type 11 */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_ABS16", /* name */
- FALSE, /* partial_inplace */
- 0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_ABS16, /* type 11 */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_ABS16", /* name */
+ FALSE, /* partial_inplace */
+ 0x0000ffff, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_DUMMY2 */
- HOWTO (R_SCORE_DUMMY2, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_DUMMY2", /* name */
- TRUE, /* partial_inplace */
- 0x00007fff, /* src_mask */
- 0x00007fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_DUMMY2, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_DUMMY2", /* name */
+ TRUE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_GP15 */
- HOWTO (R_SCORE_GP15, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_gprel15_reloc,/* special_function */
- "R_SCORE_GP15", /* name */
- TRUE, /* partial_inplace */
- 0x00007fff, /* src_mask */
- 0x00007fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_GP15, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_gprel15_reloc,/* special_function */
+ "R_SCORE_GP15", /* name */
+ TRUE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_SCORE_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- NULL, /* special_function */
- "R_SCORE_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ NULL, /* special_function */
+ "R_SCORE_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage */
- HOWTO (R_SCORE_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_SCORE_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_SCORE_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* Reference to global offset table. */
- HOWTO (R_SCORE_GOT15, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- score_elf_got15_reloc, /* special_function */
- "R_SCORE_GOT15", /* name */
- TRUE, /* partial_inplace */
- 0x00007fff, /* src_mask */
- 0x00007fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_GOT15, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ score_elf_got15_reloc, /* special_function */
+ "R_SCORE_GOT15", /* name */
+ TRUE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* Low 16 bits of displacement in global offset table. */
- HOWTO (R_SCORE_GOT_LO16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_got_lo16_reloc, /* special_function */
- "R_SCORE_GOT_LO16", /* name */
- TRUE, /* partial_inplace */
- 0x37ffe, /* src_mask */
- 0x37ffe, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_GOT_LO16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_got_lo16_reloc, /* special_function */
+ "R_SCORE_GOT_LO16", /* name */
+ TRUE, /* partial_inplace */
+ 0x37ffe, /* src_mask */
+ 0x37ffe, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 15 bit call through global offset table. */
- HOWTO (R_SCORE_CALL15, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_CALL15", /* name */
- TRUE, /* partial_inplace */
- 0x00007fff, /* src_mask */
- 0x00007fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_CALL15, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_CALL15", /* name */
+ TRUE, /* partial_inplace */
+ 0x00007fff, /* src_mask */
+ 0x00007fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 32 bit GP relative reference. */
- HOWTO (R_SCORE_GPREL32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_gprel32_reloc, /* special_function */
- "R_SCORE_GPREL32", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_GPREL32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_gprel32_reloc, /* special_function */
+ "R_SCORE_GPREL32", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 32 bit symbol relative relocation. */
- HOWTO (R_SCORE_REL32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_SCORE_REL32", /* name */
- TRUE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_REL32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_SCORE_REL32", /* name */
+ TRUE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* R_SCORE_DUMMY_HI16 */
- HOWTO (R_SCORE_DUMMY_HI16, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 1, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- score_elf_hi16_reloc, /* special_function */
- "R_SCORE_DUMMY_HI16", /* name */
- TRUE, /* partial_inplace */
- 0x37fff, /* src_mask */
- 0x37fff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_SCORE_DUMMY_HI16, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 1, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ score_elf_hi16_reloc, /* special_function */
+ "R_SCORE_DUMMY_HI16", /* name */
+ TRUE, /* partial_inplace */
+ 0x37fff, /* src_mask */
+ 0x37fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
struct score_reloc_map
static const struct score_reloc_map elf32_score_reloc_map[] =
{
- {BFD_RELOC_NONE, R_SCORE_NONE},
- {BFD_RELOC_HI16_S, R_SCORE_HI16},
- {BFD_RELOC_LO16, R_SCORE_LO16},
- {BFD_RELOC_SCORE_BCMP, R_SCORE_BCMP},
- {BFD_RELOC_SCORE_JMP, R_SCORE_24},
- {BFD_RELOC_SCORE_BRANCH, R_SCORE_PC19},
- {BFD_RELOC_SCORE16_JMP, R_SCORE16_11},
- {BFD_RELOC_SCORE16_BRANCH, R_SCORE16_PC8},
- {BFD_RELOC_32, R_SCORE_ABS32},
- {BFD_RELOC_16, R_SCORE_ABS16},
- {BFD_RELOC_SCORE_DUMMY2, R_SCORE_DUMMY2},
- {BFD_RELOC_SCORE_GPREL15, R_SCORE_GP15},
- {BFD_RELOC_VTABLE_INHERIT, R_SCORE_GNU_VTINHERIT},
- {BFD_RELOC_VTABLE_ENTRY, R_SCORE_GNU_VTENTRY},
- {BFD_RELOC_SCORE_GOT15, R_SCORE_GOT15},
- {BFD_RELOC_SCORE_GOT_LO16, R_SCORE_GOT_LO16},
- {BFD_RELOC_SCORE_CALL15, R_SCORE_CALL15},
- {BFD_RELOC_GPREL32, R_SCORE_GPREL32},
- {BFD_RELOC_32_PCREL, R_SCORE_REL32},
- {BFD_RELOC_SCORE_DUMMY_HI16, R_SCORE_DUMMY_HI16},
+ {BFD_RELOC_NONE, R_SCORE_NONE},
+ {BFD_RELOC_HI16_S, R_SCORE_HI16},
+ {BFD_RELOC_LO16, R_SCORE_LO16},
+ {BFD_RELOC_SCORE_BCMP, R_SCORE_BCMP},
+ {BFD_RELOC_SCORE_JMP, R_SCORE_24},
+ {BFD_RELOC_SCORE_BRANCH, R_SCORE_PC19},
+ {BFD_RELOC_SCORE16_JMP, R_SCORE16_11},
+ {BFD_RELOC_SCORE16_BRANCH, R_SCORE16_PC8},
+ {BFD_RELOC_32, R_SCORE_ABS32},
+ {BFD_RELOC_16, R_SCORE_ABS16},
+ {BFD_RELOC_SCORE_DUMMY2, R_SCORE_DUMMY2},
+ {BFD_RELOC_SCORE_GPREL15, R_SCORE_GP15},
+ {BFD_RELOC_VTABLE_INHERIT, R_SCORE_GNU_VTINHERIT},
+ {BFD_RELOC_VTABLE_ENTRY, R_SCORE_GNU_VTENTRY},
+ {BFD_RELOC_SCORE_GOT15, R_SCORE_GOT15},
+ {BFD_RELOC_SCORE_GOT_LO16, R_SCORE_GOT_LO16},
+ {BFD_RELOC_SCORE_CALL15, R_SCORE_CALL15},
+ {BFD_RELOC_GPREL32, R_SCORE_GPREL32},
+ {BFD_RELOC_32_PCREL, R_SCORE_REL32},
+ {BFD_RELOC_SCORE_DUMMY_HI16, R_SCORE_DUMMY_HI16},
};
static INLINE hashval_t
return entry->symndx
+ (! entry->abfd ? score_elf_hash_bfd_vma (entry->d.address)
: entry->abfd->id
- + (entry->symndx >= 0 ? score_elf_hash_bfd_vma (entry->d.addend)
- : entry->d.h->root.root.root.hash));
+ + (entry->symndx >= 0 ? score_elf_hash_bfd_vma (entry->d.addend)
+ : entry->d.h->root.root.root.hash));
}
static int
return e1->abfd == e2->abfd && e1->symndx == e2->symndx
&& (! e1->abfd ? e1->d.address == e2->d.address
- : e1->symndx >= 0 ? e1->d.addend == e2->d.addend
- : e1->d.h == e2->d.h);
+ : e1->symndx >= 0 ? e1->d.addend == e2->d.addend
+ : e1->d.h == e2->d.h);
}
/* If H needs a GOT entry, assign it the highest available dynamic
if (h->root.got.offset == 2)
{
if (hsd->max_unref_got_dynindx == hsd->min_got_dynindx)
- hsd->low = (struct elf_link_hash_entry *) h;
+ hsd->low = (struct elf_link_hash_entry *) h;
h->root.dynindx = hsd->max_unref_got_dynindx++;
}
else if (h->root.got.offset != 1)
static bfd_boolean
score_elf_sort_hash_table (struct bfd_link_info *info,
- unsigned long max_local)
+ unsigned long max_local)
{
struct score_elf_hash_sort_data hsd;
struct score_got_info *g;
accommodate both the GOT and non-GOT symbols. */
BFD_ASSERT (hsd.max_non_got_dynindx <= hsd.min_got_dynindx);
BFD_ASSERT ((unsigned long) hsd.max_unref_got_dynindx
- <= elf_hash_table (info)->dynsymcount);
+ <= elf_hash_table (info)->dynsymcount);
/* Now we know which dynamic symbol has the lowest dynamic symbol
table index in the GOT. */
static const Elf_Internal_Rela *
score_elf_next_relocation (bfd *abfd ATTRIBUTE_UNUSED, unsigned int r_type,
- const Elf_Internal_Rela *relocation,
- const Elf_Internal_Rela *relend)
+ const Elf_Internal_Rela *relocation,
+ const Elf_Internal_Rela *relend)
{
while (relocation < relend)
{
if (ELF32_R_TYPE (relocation->r_info) == r_type)
- return relocation;
+ return relocation;
++relocation;
}
/* Return whether a relocation is against a local symbol. */
static bfd_boolean
score_elf_local_relocation_p (bfd *input_bfd,
- const Elf_Internal_Rela *relocation,
- asection **local_sections,
- bfd_boolean check_forced)
+ const Elf_Internal_Rela *relocation,
+ asection **local_sections,
+ bfd_boolean check_forced)
{
unsigned long r_symndx;
Elf_Internal_Shdr *symtab_hdr;
{
/* Look up the hash table to check whether the symbol was forced local. */
h = (struct score_elf_link_hash_entry *)
- elf_sym_hashes (input_bfd) [r_symndx - extsymoff];
+ elf_sym_hashes (input_bfd) [r_symndx - extsymoff];
/* Find the real hash-table entry for this symbol. */
while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
- h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
if (h->root.forced_local)
- return TRUE;
+ return TRUE;
}
return FALSE;
| SEC_LINKER_CREATED
| SEC_READONLY));
if (sreloc == NULL
- || ! bfd_set_section_alignment (dynobj, sreloc,
- SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
- return NULL;
+ || ! bfd_set_section_alignment (dynobj, sreloc,
+ SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
+ return NULL;
}
return sreloc;
}
static bfd_boolean
score_elf_create_dynamic_relocation (bfd *output_bfd,
- struct bfd_link_info *info,
- const Elf_Internal_Rela *rel,
- struct score_elf_link_hash_entry *h,
- bfd_vma symbol,
- bfd_vma *addendp, asection *input_section)
+ struct bfd_link_info *info,
+ const Elf_Internal_Rela *rel,
+ struct score_elf_link_hash_entry *h,
+ bfd_vma symbol,
+ bfd_vma *addendp, asection *input_section)
{
Elf_Internal_Rela outrel[3];
asection *sreloc;
if (outrel[0].r_offset == MINUS_TWO)
{
/* The relocation field has been converted into a relative value of
- some sort. Functions like _bfd_elf_write_section_eh_frame expect
- the field to be fully relocated, so add in the symbol's value. */
+ some sort. Functions like _bfd_elf_write_section_eh_frame expect
+ the field to be fully relocated, so add in the symbol's value. */
*addendp += symbol;
return TRUE;
}
if (h != NULL
&& (! info->symbolic || !h->root.def_regular)
/* h->root.dynindx may be -1 if this symbol was marked to
- become local. */
+ become local. */
&& h->root.dynindx != -1)
{
indx = h->root.dynindx;
- /* ??? glibc's ld.so just adds the final GOT entry to the
- relocation field. It therefore treats relocs against
- defined symbols in the same way as relocs against
- undefined symbols. */
+ /* ??? glibc's ld.so just adds the final GOT entry to the
+ relocation field. It therefore treats relocs against
+ defined symbols in the same way as relocs against
+ undefined symbols. */
defined_p = FALSE;
}
else
/* Adjust the output offset of the relocation to reference the
correct location in the output file. */
outrel[0].r_offset += (input_section->output_section->vma
- + input_section->output_offset);
+ + input_section->output_offset);
outrel[1].r_offset += (input_section->output_section->vma
- + input_section->output_offset);
+ + input_section->output_offset);
outrel[2].r_offset += (input_section->output_section->vma
- + input_section->output_offset);
+ + input_section->output_offset);
/* Put the relocation back out. We have to use the special
relocation outputter in the 64-bit case since the 64-bit
static bfd_boolean
score_elf_create_got_section (bfd *abfd,
- struct bfd_link_info *info,
- bfd_boolean maybe_exclude)
+ struct bfd_link_info *info,
+ bfd_boolean maybe_exclude)
{
flagword flags;
asection *s;
if (s)
{
if (! maybe_exclude)
- s->flags &= ~SEC_EXCLUDE;
+ s->flags &= ~SEC_EXCLUDE;
return TRUE;
}
are not creating a global offset table. */
bh = NULL;
if (! (_bfd_generic_link_add_one_symbol
- (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
- 0, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh)))
+ (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
+ 0, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh)))
return FALSE;
h = (struct elf_link_hash_entry *) bh;
g->next = NULL;
g->got_entries = htab_try_create (1, score_elf_got_entry_hash,
- score_elf_got_entry_eq, NULL);
+ score_elf_got_entry_eq, NULL);
if (g->got_entries == NULL)
return FALSE;
score_elf_section_data (s)->u.got_info = g;
static struct score_got_entry *
score_elf_create_local_got_entry (bfd *abfd,
- bfd *ibfd ATTRIBUTE_UNUSED,
- struct score_got_info *gg,
- asection *sgot, bfd_vma value,
- unsigned long r_symndx ATTRIBUTE_UNUSED,
- struct score_elf_link_hash_entry *h ATTRIBUTE_UNUSED,
- int r_type ATTRIBUTE_UNUSED)
+ bfd *ibfd ATTRIBUTE_UNUSED,
+ struct score_got_info *gg,
+ asection *sgot, bfd_vma value,
+ unsigned long r_symndx ATTRIBUTE_UNUSED,
+ struct score_elf_link_hash_entry *h ATTRIBUTE_UNUSED,
+ int r_type ATTRIBUTE_UNUSED)
{
struct score_got_entry entry, **loc;
struct score_got_info *g;
(*loc)->gotidx = -1;
/* We didn't allocate enough space in the GOT. */
_bfd_error_handler
- (_("not enough GOT space for local GOT entries"));
+ (_("not enough GOT space for local GOT entries"));
bfd_set_error (bfd_error_bad_value);
return NULL;
}
static bfd_vma
score_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
- bfd_vma value, bfd_boolean external)
+ bfd_vma value, bfd_boolean external)
{
asection *sgot;
struct score_got_info *g;
if (!external)
{
/* Although the ABI says that it is "the high-order 16 bits" that we
- want, it is really the %high value. The complete value is
- calculated with a `addiu' of a LO16 relocation, just as with a
- HI16/LO16 pair. */
+ want, it is really the %high value. The complete value is
+ calculated with a `addiu' of a LO16 relocation, just as with a
+ HI16/LO16 pair. */
value = score_elf_high (value) << 16;
}
g = score_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
entry = score_elf_create_local_got_entry (abfd, ibfd, g, sgot, value, 0, NULL,
- R_SCORE_GOT15);
+ R_SCORE_GOT15);
if (entry)
return entry->gotidx;
else
void
s7_bfd_score_elf_hide_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *entry,
- bfd_boolean force_local)
+ struct elf_link_hash_entry *entry,
+ bfd_boolean force_local)
{
bfd *dynobj;
asection *got;
{
got = score_elf_got_section (dynobj, FALSE);
if (got == NULL)
- return;
+ return;
g = score_elf_section_data (got)->u.got_info;
if (g->next)
- {
- struct score_got_entry e;
- struct score_got_info *gg = g;
-
- /* Since we're turning what used to be a global symbol into a
- local one, bump up the number of local entries of each GOT
- that had an entry for it. This will automatically decrease
- the number of global entries, since global_gotno is actually
- the upper limit of global entries. */
- e.abfd = dynobj;
- e.symndx = -1;
- e.d.h = h;
-
- for (g = g->next; g != gg; g = g->next)
- if (htab_find (g->got_entries, &e))
- {
- BFD_ASSERT (g->global_gotno > 0);
- g->local_gotno++;
- g->global_gotno--;
- }
-
- /* If this was a global symbol forced into the primary GOT, we
- no longer need an entry for it. We can't release the entry
- at this point, but we must at least stop counting it as one
- of the symbols that required a forced got entry. */
- if (h->root.got.offset == 2)
- {
- BFD_ASSERT (gg->assigned_gotno > 0);
- gg->assigned_gotno--;
- }
- }
+ {
+ struct score_got_entry e;
+ struct score_got_info *gg = g;
+
+ /* Since we're turning what used to be a global symbol into a
+ local one, bump up the number of local entries of each GOT
+ that had an entry for it. This will automatically decrease
+ the number of global entries, since global_gotno is actually
+ the upper limit of global entries. */
+ e.abfd = dynobj;
+ e.symndx = -1;
+ e.d.h = h;
+
+ for (g = g->next; g != gg; g = g->next)
+ if (htab_find (g->got_entries, &e))
+ {
+ BFD_ASSERT (g->global_gotno > 0);
+ g->local_gotno++;
+ g->global_gotno--;
+ }
+
+ /* If this was a global symbol forced into the primary GOT, we
+ no longer need an entry for it. We can't release the entry
+ at this point, but we must at least stop counting it as one
+ of the symbols that required a forced got entry. */
+ if (h->root.got.offset == 2)
+ {
+ BFD_ASSERT (gg->assigned_gotno > 0);
+ gg->assigned_gotno--;
+ }
+ }
else if (g->global_gotno == 0 && g->global_gotsym == NULL)
- /* If we haven't got through GOT allocation yet, just bump up the
- number of local entries, as this symbol won't be counted as
- global. */
- g->local_gotno++;
+ /* If we haven't got through GOT allocation yet, just bump up the
+ number of local entries, as this symbol won't be counted as
+ global. */
+ g->local_gotno++;
else if (h->root.got.offset == 1)
- {
- /* If we're past non-multi-GOT allocation and this symbol had
- been marked for a global got entry, give it a local entry
- instead. */
- BFD_ASSERT (g->global_gotno > 0);
- g->local_gotno++;
- g->global_gotno--;
- }
+ {
+ /* If we're past non-multi-GOT allocation and this symbol had
+ been marked for a global got entry, give it a local entry
+ instead. */
+ BFD_ASSERT (g->global_gotno > 0);
+ g->local_gotno++;
+ g->global_gotno--;
+ }
}
_bfd_elf_link_hash_hide_symbol (info, &h->root, force_local);
static bfd_boolean
score_elf_record_global_got_symbol (struct elf_link_hash_entry *h,
- bfd *abfd,
- struct bfd_link_info *info,
- struct score_got_info *g)
+ bfd *abfd,
+ struct bfd_link_info *info,
+ struct score_got_info *g)
{
struct score_got_entry entry, **loc;
if (h->dynindx == -1)
{
switch (ELF_ST_VISIBILITY (h->other))
- {
- case STV_INTERNAL:
- case STV_HIDDEN:
- s7_bfd_score_elf_hide_symbol (info, h, TRUE);
- break;
- }
+ {
+ case STV_INTERNAL:
+ case STV_HIDDEN:
+ s7_bfd_score_elf_hide_symbol (info, h, TRUE);
+ break;
+ }
if (!bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
+ return FALSE;
}
entry.abfd = abfd;
static bfd_boolean
score_elf_record_local_got_symbol (bfd *abfd,
- long symndx,
- bfd_vma addend,
- struct score_got_info *g)
+ long symndx,
+ bfd_vma addend,
+ struct score_got_info *g)
{
struct score_got_entry entry, **loc;
static bfd_vma
score_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
- bfd_vma value, unsigned long r_symndx,
- struct score_elf_link_hash_entry *h, int r_type)
+ bfd_vma value, unsigned long r_symndx,
+ struct score_elf_link_hash_entry *h, int r_type)
{
asection *sgot;
struct score_got_info *g;
g = score_elf_got_info (elf_hash_table (info)->dynobj, &sgot);
entry = score_elf_create_local_got_entry (abfd, ibfd, g, sgot, value,
- r_symndx, h, r_type);
+ r_symndx, h, r_type);
if (!entry)
return MINUS_ONE;
static bfd_vma
score_elf_got_offset_from_index (bfd *dynobj,
bfd *output_bfd,
- bfd *input_bfd ATTRIBUTE_UNUSED,
+ bfd *input_bfd ATTRIBUTE_UNUSED,
bfd_vma got_index)
{
asection *sgot;
struct score_elf_link_hash_entry *h = entry->d.h;
while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
- h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
if (entry->d.h == h)
- return 1;
+ return 1;
entry->d.h = h;
/* If we can't find this entry with the new bfd hash, re-insert
- it, and get the traversal restarted. */
+ it, and get the traversal restarted. */
if (! htab_find (got_entries, entry))
- {
- htab_clear_slot (got_entries, entryp);
- entryp = htab_find_slot (got_entries, entry, INSERT);
- if (! *entryp)
- *entryp = entry;
- /* Abort the traversal, since the whole table may have
- moved, and leave it up to the parent to restart the
- process. */
- *(htab_t *) p = NULL;
- return 0;
- }
+ {
+ htab_clear_slot (got_entries, entryp);
+ entryp = htab_find_slot (got_entries, entry, INSERT);
+ if (! *entryp)
+ *entryp = entry;
+ /* Abort the traversal, since the whole table may have
+ moved, and leave it up to the parent to restart the
+ process. */
+ *(htab_t *) p = NULL;
+ return 0;
+ }
/* We might want to decrement the global_gotno count, but it's
- either too early or too late for that at this point. */
+ either too early or too late for that at this point. */
}
return 1;
got_entries = g->got_entries;
htab_traverse (got_entries,
- score_elf_resolve_final_got_entry,
- &got_entries);
+ score_elf_resolve_final_got_entry,
+ &got_entries);
}
while (got_entries == NULL);
}
static void
score_elf_add_to_rel (bfd *abfd,
- bfd_byte *address,
- reloc_howto_type *howto,
- bfd_signed_vma increment)
+ bfd_byte *address,
+ reloc_howto_type *howto,
+ bfd_signed_vma increment)
{
bfd_signed_vma addend;
bfd_vma contents;
{
case R_SCORE_PC19:
offset =
- (((contents & howto->src_mask) & 0x3ff0000) >> 6) | ((contents & howto->src_mask) & 0x3ff);
+ (((contents & howto->src_mask) & 0x3ff0000) >> 6) | ((contents & howto->src_mask) & 0x3ff);
offset += increment;
contents =
- (contents & ~howto->
- src_mask) | (((offset << 6) & howto->src_mask) & 0x3ff0000) | (offset & 0x3ff);
+ (contents & ~howto->
+ src_mask) | (((offset << 6) & howto->src_mask) & 0x3ff0000) | (offset & 0x3ff);
bfd_put_32 (abfd, contents, address);
break;
case R_SCORE_HI16:
uvalue = increment + offset;
hi16_offset = (uvalue >> 16) << 1;
hi16_value = (hi16_addend & (~(howto->dst_mask)))
- | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
+ | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
bfd_put_32 (abfd, hi16_value, address - 4);
offset = (uvalue & 0xffff) << 1;
contents = (contents & (~(howto->dst_mask))) | (offset & 0x7fff) | ((offset << 1) & 0x30000);
break;
case R_SCORE_24:
offset =
- (((contents & howto->src_mask) >> 1) & 0x1ff8000) | ((contents & howto->src_mask) & 0x7fff);
+ (((contents & howto->src_mask) >> 1) & 0x1ff8000) | ((contents & howto->src_mask) & 0x7fff);
offset += increment;
contents =
- (contents & ~howto->
- src_mask) | (((offset << 1) & howto->src_mask) & 0x3ff0000) | (offset & 0x7fff);
+ (contents & ~howto->
+ src_mask) | (((offset << 1) & howto->src_mask) & 0x3ff0000) | (offset & 0x7fff);
bfd_put_32 (abfd, contents, address);
break;
case R_SCORE16_11:
static bfd_reloc_status_type
score_elf_final_link_relocate (reloc_howto_type *howto,
- bfd *input_bfd,
- bfd *output_bfd,
- asection *input_section,
- bfd_byte *contents,
- Elf_Internal_Rela *rel,
- Elf_Internal_Rela *relocs,
- bfd_vma symbol,
- struct bfd_link_info *info,
- const char *sym_name ATTRIBUTE_UNUSED,
- int sym_flags ATTRIBUTE_UNUSED,
- struct score_elf_link_hash_entry *h,
- Elf_Internal_Sym *local_syms,
- asection **local_sections,
- bfd_boolean gp_disp_p)
+ bfd *input_bfd,
+ bfd *output_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *rel,
+ Elf_Internal_Rela *relocs,
+ bfd_vma symbol,
+ struct bfd_link_info *info,
+ const char *sym_name ATTRIBUTE_UNUSED,
+ int sym_flags ATTRIBUTE_UNUSED,
+ struct score_elf_link_hash_entry *h,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections,
+ bfd_boolean gp_disp_p)
{
unsigned long r_type;
unsigned long r_symndx;
elf_gp (output_bfd) += bh->u.def.section->output_section->vma;
}
else if (bfd_link_relocatable (info))
- {
- bfd_vma lo = -1;
-
- /* Find the GP-relative section with the lowest offset. */
- for (o = output_bfd->sections; o != NULL; o = o->next)
- if (o->vma < lo)
- lo = o->vma;
- /* And calculate GP relative to that. */
- elf_gp (output_bfd) = lo + ELF_SCORE_GP_OFFSET (input_bfd);
- }
+ {
+ bfd_vma lo = -1;
+
+ /* Find the GP-relative section with the lowest offset. */
+ for (o = output_bfd->sections; o != NULL; o = o->next)
+ if (o->vma < lo)
+ lo = o->vma;
+ /* And calculate GP relative to that. */
+ elf_gp (output_bfd) = lo + ELF_SCORE_GP_OFFSET (input_bfd);
+ }
else
- {
- /* If the relocate_section function needs to do a reloc
- involving the GP value, it should make a reloc_dangerous
- callback to warn that GP is not defined. */
- }
+ {
+ /* If the relocate_section function needs to do a reloc
+ involving the GP value, it should make a reloc_dangerous
+ callback to warn that GP is not defined. */
+ }
}
/* Parse the relocation. */
symbol = sec->output_section->vma + sec->output_offset;
if (ELF_ST_TYPE (sym->st_info) != STT_SECTION
- || (sec->flags & SEC_MERGE))
- symbol += sym->st_value;
+ || (sec->flags & SEC_MERGE))
+ symbol += sym->st_value;
if ((sec->flags & SEC_MERGE)
- && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
- merge_p = 1;
+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ merge_p = 1;
}
if (r_type == R_SCORE_GOT15)
relend = relocs + input_section->reloc_count;
lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend);
if ((local_p) && (lo16_rel != NULL))
- {
- bfd_vma tmp = 0;
- tmp = bfd_get_32 (input_bfd, contents + lo16_rel->r_offset);
- lo_value = (((tmp >> 16) & 0x3) << 14) | ((tmp & 0x7fff) >> 1);
- if (merge_p)
- {
- asection *msec = sec;
- lo_value = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, lo_value);
- lo_value -= symbol;
- lo_value += msec->output_section->vma + msec->output_offset;
- }
- }
+ {
+ bfd_vma tmp = 0;
+ tmp = bfd_get_32 (input_bfd, contents + lo16_rel->r_offset);
+ lo_value = (((tmp >> 16) & 0x3) << 14) | ((tmp & 0x7fff) >> 1);
+ if (merge_p)
+ {
+ asection *msec = sec;
+ lo_value = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, lo_value);
+ lo_value -= symbol;
+ lo_value += msec->output_section->vma + msec->output_offset;
+ }
+ }
addend = lo_value;
}
else
if (local_p && !merge_p)
{
if (r_type == R_SCORE_GOT15)
- {
- const Elf_Internal_Rela *relend;
- const Elf_Internal_Rela *lo16_rel;
- bfd_vma lo_value = 0;
-
- value = bfd_get_32 (input_bfd, contents + rel->r_offset);
- addend = value & 0x7fff;
- if ((addend & 0x4000) == 0x4000)
- addend |= 0xffffc000;
-
- relend = relocs + input_section->reloc_count;
- lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend);
- if ((local_p) && (lo16_rel != NULL))
- {
- bfd_vma tmp = 0;
- tmp = bfd_get_32 (input_bfd, contents + lo16_rel->r_offset);
- lo_value = (((tmp >> 16) & 0x3) << 14) | ((tmp & 0x7fff) >> 1);
- }
-
- addend <<= 16;
- addend += lo_value;
- }
+ {
+ const Elf_Internal_Rela *relend;
+ const Elf_Internal_Rela *lo16_rel;
+ bfd_vma lo_value = 0;
+
+ value = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ addend = value & 0x7fff;
+ if ((addend & 0x4000) == 0x4000)
+ addend |= 0xffffc000;
+
+ relend = relocs + input_section->reloc_count;
+ lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend);
+ if ((local_p) && (lo16_rel != NULL))
+ {
+ bfd_vma tmp = 0;
+ tmp = bfd_get_32 (input_bfd, contents + lo16_rel->r_offset);
+ lo_value = (((tmp >> 16) & 0x3) << 14) | ((tmp & 0x7fff) >> 1);
+ }
+
+ addend <<= 16;
+ addend += lo_value;
+ }
}
local_p = score_elf_local_relocation_p (input_bfd, rel, local_sections, TRUE);
case R_SCORE_CALL15:
case R_SCORE_GOT15:
if (!local_p)
- {
- g = score_elf_global_got_index (elf_hash_table (info)->dynobj,
- (struct elf_link_hash_entry *) h);
- if ((! elf_hash_table(info)->dynamic_sections_created
- || (bfd_link_pic (info)
- && (info->symbolic || h->root.dynindx == -1)
- && h->root.def_regular)))
- {
- /* This is a static link or a -Bsymbolic link. The
- symbol is defined locally, or was forced to be local.
- We must initialize this entry in the GOT. */
- bfd *tmpbfd = elf_hash_table (info)->dynobj;
- asection *sgot = score_elf_got_section (tmpbfd, FALSE);
- bfd_put_32 (tmpbfd, value, sgot->contents + g);
- }
- }
+ {
+ g = score_elf_global_got_index (elf_hash_table (info)->dynobj,
+ (struct elf_link_hash_entry *) h);
+ if ((! elf_hash_table(info)->dynamic_sections_created
+ || (bfd_link_pic (info)
+ && (info->symbolic || h->root.dynindx == -1)
+ && h->root.def_regular)))
+ {
+ /* This is a static link or a -Bsymbolic link. The
+ symbol is defined locally, or was forced to be local.
+ We must initialize this entry in the GOT. */
+ bfd *tmpbfd = elf_hash_table (info)->dynobj;
+ asection *sgot = score_elf_got_section (tmpbfd, FALSE);
+ bfd_put_32 (tmpbfd, value, sgot->contents + g);
+ }
+ }
else if (r_type == R_SCORE_GOT15 || r_type == R_SCORE_CALL15)
- {
- /* There's no need to create a local GOT entry here; the
- calculation for a local GOT15 entry does not involve G. */
- ;
- }
+ {
+ /* There's no need to create a local GOT entry here; the
+ calculation for a local GOT15 entry does not involve G. */
+ ;
+ }
else
- {
- g = score_elf_local_got_index (output_bfd, input_bfd, info,
- symbol + addend, r_symndx, h, r_type);
- if (g == MINUS_ONE)
- return bfd_reloc_outofrange;
- }
+ {
+ g = score_elf_local_got_index (output_bfd, input_bfd, info,
+ symbol + addend, r_symndx, h, r_type);
+ if (g == MINUS_ONE)
+ return bfd_reloc_outofrange;
+ }
/* Convert GOT indices to actual offsets. */
g = score_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
- output_bfd, input_bfd, g);
+ output_bfd, input_bfd, g);
break;
case R_SCORE_HI16:
case R_SCORE_ABS32:
case R_SCORE_REL32:
if ((bfd_link_pic (info)
- || (elf_hash_table (info)->dynamic_sections_created
- && h != NULL
- && h->root.def_dynamic
- && !h->root.def_regular))
- && r_symndx != STN_UNDEF
- && (input_section->flags & SEC_ALLOC) != 0)
- {
- /* If we're creating a shared library, or this relocation is against a symbol
- in a shared library, then we can't know where the symbol will end up.
- So, we create a relocation record in the output, and leave the job up
- to the dynamic linker. */
- value = addend;
- if (!score_elf_create_dynamic_relocation (output_bfd, info, rel, h,
- symbol, &value,
- input_section))
- return bfd_reloc_undefined;
- }
+ || (elf_hash_table (info)->dynamic_sections_created
+ && h != NULL
+ && h->root.def_dynamic
+ && !h->root.def_regular))
+ && r_symndx != STN_UNDEF
+ && (input_section->flags & SEC_ALLOC) != 0)
+ {
+ /* If we're creating a shared library, or this relocation is against a symbol
+ in a shared library, then we can't know where the symbol will end up.
+ So, we create a relocation record in the output, and leave the job up
+ to the dynamic linker. */
+ value = addend;
+ if (!score_elf_create_dynamic_relocation (output_bfd, info, rel, h,
+ symbol, &value,
+ input_section))
+ return bfd_reloc_undefined;
+ }
else if (r_symndx == STN_UNDEF)
- /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols
- from removed linkonce sections, or sections discarded by
- a linker script. */
- value = 0;
+ /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols
+ from removed linkonce sections, or sections discarded by
+ a linker script. */
+ value = 0;
else
- {
- if (r_type != R_SCORE_REL32)
- value = symbol + addend;
- else
- value = addend;
- }
+ {
+ if (r_type != R_SCORE_REL32)
+ value = symbol + addend;
+ else
+ value = addend;
+ }
value &= howto->dst_mask;
bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
case R_SCORE_ABS16:
value += addend;
if ((long) value > 0x7fff || (long) value < -0x8000)
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
bfd_put_16 (input_bfd, value, hit_data);
return bfd_reloc_ok;
addend = bfd_get_32 (input_bfd, hit_data);
offset = (((addend & howto->src_mask) >> 1) & 0x1ff8000) | ((addend & howto->src_mask) & 0x7fff);
if ((offset & 0x1000000) != 0)
- offset |= 0xfe000000;
+ offset |= 0xfe000000;
value += offset;
abs_value = value - rel_addr;
if ((abs_value & 0xfe000000) != 0)
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
addend = (addend & ~howto->src_mask)
- | (((value << 1) & howto->src_mask) & 0x3ff0000) | (value & 0x7fff);
+ | (((value << 1) & howto->src_mask) & 0x3ff0000) | (value & 0x7fff);
bfd_put_32 (input_bfd, addend, hit_data);
return bfd_reloc_ok;
addend = bfd_get_32 (input_bfd, hit_data);
offset = (((addend & howto->src_mask) & 0x3ff0000) >> 6) | ((addend & howto->src_mask) & 0x3ff);
if ((offset & 0x80000) != 0)
- offset |= 0xfff00000;
+ offset |= 0xfff00000;
abs_value = value = value - rel_addr + offset;
/* exceed 20 bit : overflow. */
if ((abs_value & 0x80000000) == 0x80000000)
- abs_value = 0xffffffff - value + 1;
+ abs_value = 0xffffffff - value + 1;
if ((abs_value & 0xfff80000) != 0)
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
addend = (addend & ~howto->src_mask)
- | (((value << 6) & howto->src_mask) & 0x3ff0000) | (value & 0x3ff);
+ | (((value << 6) & howto->src_mask) & 0x3ff0000) | (value & 0x3ff);
bfd_put_32 (input_bfd, addend, hit_data);
return bfd_reloc_ok;
case R_SCORE16_11:
addend = bfd_get_16 (input_bfd, hit_data);
offset = addend & howto->src_mask;
- if ((offset & 0x800) != 0) /* Offset is negative. */
- offset |= 0xfffff000;
+ if ((offset & 0x800) != 0) /* Offset is negative. */
+ offset |= 0xfffff000;
value += offset;
abs_value = value - rel_addr;
if ((abs_value & 0xfffff000) != 0)
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
addend = (addend & ~howto->src_mask) | (value & howto->src_mask);
bfd_put_16 (input_bfd, addend, hit_data);
return bfd_reloc_ok;
case R_SCORE16_PC8:
addend = bfd_get_16 (input_bfd, hit_data);
offset = (addend & howto->src_mask) << 1;
- if ((offset & 0x100) != 0) /* Offset is negative. */
- offset |= 0xfffffe00;
+ if ((offset & 0x100) != 0) /* Offset is negative. */
+ offset |= 0xfffffe00;
abs_value = value = value - rel_addr + offset;
/* Sign bit + exceed 9 bit. */
if (((value & 0xffffff00) != 0) && ((value & 0xffffff00) != 0xffffff00))
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
value >>= 1;
addend = (addend & ~howto->src_mask) | (value & howto->src_mask);
bfd_put_16 (input_bfd, addend, hit_data);
offset = (hi16_offset << 16) | (offset & 0xffff);
if (!gp_disp_p)
- uvalue = value + offset;
+ uvalue = value + offset;
else
- uvalue = offset + gp - rel_addr + 4;
+ uvalue = offset + gp - rel_addr + 4;
hi16_offset = (uvalue >> 16) << 1;
hi16_value = (hi16_addend & (~(howto->dst_mask)))
- | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
+ | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
bfd_put_32 (input_bfd, hi16_value, hit_data - 4);
offset = (uvalue & 0xffff) << 1;
value = (addend & (~(howto->dst_mask))) | (offset & 0x7fff) | ((offset << 1) & 0x30000);
addend = bfd_get_32 (input_bfd, hit_data);
offset = addend & 0x7fff;
if ((offset & 0x4000) == 0x4000)
- offset |= 0xffffc000;
+ offset |= 0xffffc000;
value = value + offset - gp;
if (((value & 0xffffc000) != 0) && ((value & 0xffffc000) != 0xffffc000))
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
value = (addend & ~howto->src_mask) | (value & howto->src_mask);
bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
case R_SCORE_GOT15:
case R_SCORE_CALL15:
if (local_p)
- {
- bfd_boolean forced;
-
- /* The special case is when the symbol is forced to be local. We need the
- full address in the GOT since no R_SCORE_GOT_LO16 relocation follows. */
- forced = ! score_elf_local_relocation_p (input_bfd, rel,
- local_sections, FALSE);
- value = score_elf_got16_entry (output_bfd, input_bfd, info,
- symbol + addend, forced);
- if (value == MINUS_ONE)
- return bfd_reloc_outofrange;
- value = score_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
- output_bfd, input_bfd, value);
- }
+ {
+ bfd_boolean forced;
+
+ /* The special case is when the symbol is forced to be local. We need the
+ full address in the GOT since no R_SCORE_GOT_LO16 relocation follows. */
+ forced = ! score_elf_local_relocation_p (input_bfd, rel,
+ local_sections, FALSE);
+ value = score_elf_got16_entry (output_bfd, input_bfd, info,
+ symbol + addend, forced);
+ if (value == MINUS_ONE)
+ return bfd_reloc_outofrange;
+ value = score_elf_got_offset_from_index (elf_hash_table (info)->dynobj,
+ output_bfd, input_bfd, value);
+ }
else
- {
- value = g;
- }
+ {
+ value = g;
+ }
if ((long) value > 0x3fff || (long) value < -0x4000)
- return bfd_reloc_overflow;
+ return bfd_reloc_overflow;
addend = bfd_get_32 (input_bfd, hit_data);
value = (addend & ~howto->dst_mask) | (value & howto->dst_mask);
value = (((addend >> 16) & 0x3) << 14) | ((addend & 0x7fff) >> 1);
value += symbol;
value = (addend & (~(howto->dst_mask))) | ((value & 0x3fff) << 1)
- | (((value >> 14) & 0x3) << 16);
+ | (((value >> 14) & 0x3) << 16);
bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
void
s7_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *bfd_reloc,
- Elf_Internal_Rela *elf_reloc)
+ arelent *bfd_reloc,
+ Elf_Internal_Rela *elf_reloc)
{
unsigned int r_type;
bfd_boolean
s7_bfd_score_elf_relocate_section (bfd *output_bfd,
- struct bfd_link_info *info,
- bfd *input_bfd,
- asection *input_section,
- bfd_byte *contents,
- Elf_Internal_Rela *relocs,
- Elf_Internal_Sym *local_syms,
- asection **local_sections)
+ struct bfd_link_info *info,
+ bfd *input_bfd,
+ asection *input_section,
+ bfd_byte *contents,
+ Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *rel;
{
bfd_size_type dynsecsymcount = 0;
if (bfd_link_pic (info))
- {
- asection * p;
- const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
-
- for (p = output_bfd->sections; p ; p = p->next)
- if ((p->flags & SEC_EXCLUDE) == 0
- && (p->flags & SEC_ALLOC) != 0
- && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p))
- ++ dynsecsymcount;
- }
+ {
+ asection * p;
+ const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
+
+ for (p = output_bfd->sections; p ; p = p->next)
+ if ((p->flags & SEC_EXCLUDE) == 0
+ && (p->flags & SEC_ALLOC) != 0
+ && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p))
+ ++ dynsecsymcount;
+ }
if (!score_elf_sort_hash_table (info, dynsecsymcount + 1))
- return FALSE;
+ return FALSE;
}
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
sec = NULL;
if (r_symndx < extsymoff)
- {
- sym = local_syms + r_symndx;
- sec = local_sections[r_symndx];
- relocation = sec->output_section->vma + sec->output_offset;
- name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, sec);
-
- if (!bfd_link_relocatable (info))
- {
- if (ELF_ST_TYPE (sym->st_info) != STT_SECTION
- || (sec->flags & SEC_MERGE))
- {
- relocation += sym->st_value;
- }
-
- if ((sec->flags & SEC_MERGE)
- && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
- {
- asection *msec;
- bfd_vma addend, value;
-
- switch (r_type)
- {
- case R_SCORE_HI16:
- break;
- case R_SCORE_LO16:
- hi16_addend = bfd_get_32 (input_bfd, contents + rel->r_offset - 4);
- hi16_offset = ((((hi16_addend >> 16) & 0x3) << 15) | (hi16_addend & 0x7fff)) >> 1;
- value = bfd_get_32 (input_bfd, contents + rel->r_offset);
- offset = ((((value >> 16) & 0x3) << 15) | (value & 0x7fff)) >> 1;
- addend = (hi16_offset << 16) | (offset & 0xffff);
- msec = sec;
- addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend);
- addend -= relocation;
- addend += msec->output_section->vma + msec->output_offset;
- uvalue = addend;
- hi16_offset = (uvalue >> 16) << 1;
- hi16_value = (hi16_addend & (~(howto->dst_mask)))
- | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
- bfd_put_32 (input_bfd, hi16_value, contents + rel->r_offset - 4);
- offset = (uvalue & 0xffff) << 1;
- value = (value & (~(howto->dst_mask)))
- | (offset & 0x7fff) | ((offset << 1) & 0x30000);
- bfd_put_32 (input_bfd, value, contents + rel->r_offset);
- break;
- case R_SCORE_GOT_LO16:
- value = bfd_get_32 (input_bfd, contents + rel->r_offset);
- addend = (((value >> 16) & 0x3) << 14) | ((value & 0x7fff) >> 1);
- msec = sec;
- addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation;
- addend += msec->output_section->vma + msec->output_offset;
- value = (value & (~(howto->dst_mask))) | ((addend & 0x3fff) << 1)
- | (((addend >> 14) & 0x3) << 16);
-
- bfd_put_32 (input_bfd, value, contents + rel->r_offset);
- break;
- default:
- value = bfd_get_32 (input_bfd, contents + rel->r_offset);
- /* Get the (signed) value from the instruction. */
- addend = value & howto->src_mask;
- if (addend & ((howto->src_mask + 1) >> 1))
- {
- bfd_signed_vma mask;
-
- mask = -1;
- mask &= ~howto->src_mask;
- addend |= mask;
- }
- msec = sec;
- addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation;
- addend += msec->output_section->vma + msec->output_offset;
- value = (value & ~howto->dst_mask) | (addend & howto->dst_mask);
- bfd_put_32 (input_bfd, value, contents + rel->r_offset);
- break;
- }
- }
- }
- }
+ {
+ sym = local_syms + r_symndx;
+ sec = local_sections[r_symndx];
+ relocation = sec->output_section->vma + sec->output_offset;
+ name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, sec);
+
+ if (!bfd_link_relocatable (info))
+ {
+ if (ELF_ST_TYPE (sym->st_info) != STT_SECTION
+ || (sec->flags & SEC_MERGE))
+ {
+ relocation += sym->st_value;
+ }
+
+ if ((sec->flags & SEC_MERGE)
+ && ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ asection *msec;
+ bfd_vma addend, value;
+
+ switch (r_type)
+ {
+ case R_SCORE_HI16:
+ break;
+ case R_SCORE_LO16:
+ hi16_addend = bfd_get_32 (input_bfd, contents + rel->r_offset - 4);
+ hi16_offset = ((((hi16_addend >> 16) & 0x3) << 15) | (hi16_addend & 0x7fff)) >> 1;
+ value = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ offset = ((((value >> 16) & 0x3) << 15) | (value & 0x7fff)) >> 1;
+ addend = (hi16_offset << 16) | (offset & 0xffff);
+ msec = sec;
+ addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend);
+ addend -= relocation;
+ addend += msec->output_section->vma + msec->output_offset;
+ uvalue = addend;
+ hi16_offset = (uvalue >> 16) << 1;
+ hi16_value = (hi16_addend & (~(howto->dst_mask)))
+ | (hi16_offset & 0x7fff) | ((hi16_offset << 1) & 0x30000);
+ bfd_put_32 (input_bfd, hi16_value, contents + rel->r_offset - 4);
+ offset = (uvalue & 0xffff) << 1;
+ value = (value & (~(howto->dst_mask)))
+ | (offset & 0x7fff) | ((offset << 1) & 0x30000);
+ bfd_put_32 (input_bfd, value, contents + rel->r_offset);
+ break;
+ case R_SCORE_GOT_LO16:
+ value = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ addend = (((value >> 16) & 0x3) << 14) | ((value & 0x7fff) >> 1);
+ msec = sec;
+ addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation;
+ addend += msec->output_section->vma + msec->output_offset;
+ value = (value & (~(howto->dst_mask))) | ((addend & 0x3fff) << 1)
+ | (((addend >> 14) & 0x3) << 16);
+
+ bfd_put_32 (input_bfd, value, contents + rel->r_offset);
+ break;
+ default:
+ value = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ /* Get the (signed) value from the instruction. */
+ addend = value & howto->src_mask;
+ if (addend & ((howto->src_mask + 1) >> 1))
+ {
+ bfd_signed_vma mask;
+
+ mask = -1;
+ mask &= ~howto->src_mask;
+ addend |= mask;
+ }
+ msec = sec;
+ addend = _bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend) - relocation;
+ addend += msec->output_section->vma + msec->output_offset;
+ value = (value & ~howto->dst_mask) | (addend & howto->dst_mask);
+ bfd_put_32 (input_bfd, value, contents + rel->r_offset);
+ break;
+ }
+ }
+ }
+ }
else
- {
- /* For global symbols we look up the symbol in the hash-table. */
- h = ((struct score_elf_link_hash_entry *)
- elf_sym_hashes (input_bfd) [r_symndx - extsymoff]);
+ {
+ /* For global symbols we look up the symbol in the hash-table. */
+ h = ((struct score_elf_link_hash_entry *)
+ elf_sym_hashes (input_bfd) [r_symndx - extsymoff]);
if (info->wrap_hash != NULL
&& (input_section->flags & SEC_DEBUGGING) != 0)
h = ((struct score_elf_link_hash_entry *)
unwrap_hash_lookup (info, input_bfd, &h->root.root));
- /* Find the real hash-table entry for this symbol. */
- while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
- h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
-
- /* Record the name of this symbol, for our caller. */
- name = h->root.root.root.string;
-
- /* See if this is the special GP_DISP_LABEL symbol. Note that such a
- symbol must always be a global symbol. */
- if (strcmp (name, GP_DISP_LABEL) == 0)
- {
- /* Relocations against GP_DISP_LABEL are permitted only with
- R_SCORE_HI16 and R_SCORE_LO16 relocations. */
- if (r_type != R_SCORE_HI16 && r_type != R_SCORE_LO16)
- return bfd_reloc_notsupported;
-
- gp_disp_p = TRUE;
- }
-
- /* If this symbol is defined, calculate its address. Note that
- GP_DISP_LABEL is a magic symbol, always implicitly defined by the
- linker, so it's inappropriate to check to see whether or not
- its defined. */
- else if ((h->root.root.type == bfd_link_hash_defined
- || h->root.root.type == bfd_link_hash_defweak)
- && h->root.root.u.def.section)
- {
- sec = h->root.root.u.def.section;
- if (sec->output_section)
- relocation = (h->root.root.u.def.value
- + sec->output_section->vma
- + sec->output_offset);
- else
- {
- relocation = h->root.root.u.def.value;
- }
- }
- else if (h->root.root.type == bfd_link_hash_undefweak)
- /* We allow relocations against undefined weak symbols, giving
- it the value zero, so that you can undefined weak functions
- and check to see if they exist by looking at their addresses. */
- relocation = 0;
- else if (info->unresolved_syms_in_objects == RM_IGNORE
- && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
- relocation = 0;
- else if (strcmp (name, "_DYNAMIC_LINK") == 0)
- {
- /* If this is a dynamic link, we should have created a _DYNAMIC_LINK symbol
- in s7_bfd_score_elf_create_dynamic_sections. Otherwise, we should define
- the symbol with a value of 0. */
- BFD_ASSERT (! bfd_link_pic (info));
- BFD_ASSERT (bfd_get_section_by_name (output_bfd, ".dynamic") == NULL);
- relocation = 0;
- }
- else if (!bfd_link_relocatable (info))
- {
+ /* Find the real hash-table entry for this symbol. */
+ while (h->root.root.type == bfd_link_hash_indirect
+ || h->root.root.type == bfd_link_hash_warning)
+ h = (struct score_elf_link_hash_entry *) h->root.root.u.i.link;
+
+ /* Record the name of this symbol, for our caller. */
+ name = h->root.root.root.string;
+
+ /* See if this is the special GP_DISP_LABEL symbol. Note that such a
+ symbol must always be a global symbol. */
+ if (strcmp (name, GP_DISP_LABEL) == 0)
+ {
+ /* Relocations against GP_DISP_LABEL are permitted only with
+ R_SCORE_HI16 and R_SCORE_LO16 relocations. */
+ if (r_type != R_SCORE_HI16 && r_type != R_SCORE_LO16)
+ return bfd_reloc_notsupported;
+
+ gp_disp_p = TRUE;
+ }
+
+ /* If this symbol is defined, calculate its address. Note that
+ GP_DISP_LABEL is a magic symbol, always implicitly defined by the
+ linker, so it's inappropriate to check to see whether or not
+ its defined. */
+ else if ((h->root.root.type == bfd_link_hash_defined
+ || h->root.root.type == bfd_link_hash_defweak)
+ && h->root.root.u.def.section)
+ {
+ sec = h->root.root.u.def.section;
+ if (sec->output_section)
+ relocation = (h->root.root.u.def.value
+ + sec->output_section->vma
+ + sec->output_offset);
+ else
+ {
+ relocation = h->root.root.u.def.value;
+ }
+ }
+ else if (h->root.root.type == bfd_link_hash_undefweak)
+ /* We allow relocations against undefined weak symbols, giving
+ it the value zero, so that you can undefined weak functions
+ and check to see if they exist by looking at their addresses. */
+ relocation = 0;
+ else if (info->unresolved_syms_in_objects == RM_IGNORE
+ && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
+ relocation = 0;
+ else if (strcmp (name, "_DYNAMIC_LINK") == 0)
+ {
+ /* If this is a dynamic link, we should have created a _DYNAMIC_LINK symbol
+ in s7_bfd_score_elf_create_dynamic_sections. Otherwise, we should define
+ the symbol with a value of 0. */
+ BFD_ASSERT (! bfd_link_pic (info));
+ BFD_ASSERT (bfd_get_section_by_name (output_bfd, ".dynamic") == NULL);
+ relocation = 0;
+ }
+ else if (!bfd_link_relocatable (info))
+ {
(*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
input_section, rel->r_offset,
(info->unresolved_syms_in_objects == RM_GENERATE_ERROR)
|| ELF_ST_VISIBILITY (h->root.other));
- relocation = 0;
- }
- }
+ relocation = 0;
+ }
+ }
if (sec != NULL && discarded_section (sec))
RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
rel, 1, relend, howto, 0, contents);
if (bfd_link_relocatable (info))
- {
- /* This is a relocatable link. We don't have to change
- anything, unless the reloc is against a section symbol,
- in which case we have to adjust according to where the
- section symbol winds up in the output section. */
- if (r_symndx < symtab_hdr->sh_info)
- {
- sym = local_syms + r_symndx;
-
- if (r_type == R_SCORE_GOT15)
- {
- const Elf_Internal_Rela *lo16_rel;
- bfd_vma lo_addend = 0, lo_value = 0;
- bfd_vma addend, value;
-
- value = bfd_get_32 (input_bfd, contents + rel->r_offset);
- addend = value & 0x7fff;
- if ((addend & 0x4000) == 0x4000)
- addend |= 0xffffc000;
-
- relend = relocs + input_section->reloc_count;
- lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend);
- if (lo16_rel != NULL)
- {
- lo_value = bfd_get_32 (input_bfd, contents + lo16_rel->r_offset);
- lo_addend = (((lo_value >> 16) & 0x3) << 14) | ((lo_value & 0x7fff) >> 1);
- }
-
- addend <<= 16;
- addend += lo_addend;
-
- if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
- addend += local_sections[r_symndx]->output_offset;
-
- lo_addend = addend & 0xffff;
- lo_value = (lo_value & (~(howto->dst_mask))) | ((lo_addend & 0x3fff) << 1)
- | (((lo_addend >> 14) & 0x3) << 16);
- bfd_put_32 (input_bfd, lo_value, contents + lo16_rel->r_offset);
-
- addend = addend >> 16;
- value = (value & ~howto->src_mask) | (addend & howto->src_mask);
- bfd_put_32 (input_bfd, value, contents + rel->r_offset);
- }
- else if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
- {
- sec = local_sections[r_symndx];
- score_elf_add_to_rel (input_bfd, contents + rel->r_offset,
- howto, (bfd_signed_vma) (sec->output_offset + sym->st_value));
- }
- }
- continue;
- }
+ {
+ /* This is a relocatable link. We don't have to change
+ anything, unless the reloc is against a section symbol,
+ in which case we have to adjust according to where the
+ section symbol winds up in the output section. */
+ if (r_symndx < symtab_hdr->sh_info)
+ {
+ sym = local_syms + r_symndx;
+
+ if (r_type == R_SCORE_GOT15)
+ {
+ const Elf_Internal_Rela *lo16_rel;
+ bfd_vma lo_addend = 0, lo_value = 0;
+ bfd_vma addend, value;
+
+ value = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ addend = value & 0x7fff;
+ if ((addend & 0x4000) == 0x4000)
+ addend |= 0xffffc000;
+
+ relend = relocs + input_section->reloc_count;
+ lo16_rel = score_elf_next_relocation (input_bfd, R_SCORE_GOT_LO16, rel, relend);
+ if (lo16_rel != NULL)
+ {
+ lo_value = bfd_get_32 (input_bfd, contents + lo16_rel->r_offset);
+ lo_addend = (((lo_value >> 16) & 0x3) << 14) | ((lo_value & 0x7fff) >> 1);
+ }
+
+ addend <<= 16;
+ addend += lo_addend;
+
+ if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ addend += local_sections[r_symndx]->output_offset;
+
+ lo_addend = addend & 0xffff;
+ lo_value = (lo_value & (~(howto->dst_mask))) | ((lo_addend & 0x3fff) << 1)
+ | (((lo_addend >> 14) & 0x3) << 16);
+ bfd_put_32 (input_bfd, lo_value, contents + lo16_rel->r_offset);
+
+ addend = addend >> 16;
+ value = (value & ~howto->src_mask) | (addend & howto->src_mask);
+ bfd_put_32 (input_bfd, value, contents + rel->r_offset);
+ }
+ else if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+ {
+ sec = local_sections[r_symndx];
+ score_elf_add_to_rel (input_bfd, contents + rel->r_offset,
+ howto, (bfd_signed_vma) (sec->output_offset + sym->st_value));
+ }
+ }
+ continue;
+ }
/* This is a final link. */
r = score_elf_final_link_relocate (howto, input_bfd, output_bfd,
- input_section, contents, rel, relocs,
- relocation, info, name,
- (h ? ELF_ST_TYPE ((unsigned int) h->root.root.type) :
- ELF_ST_TYPE ((unsigned int) sym->st_info)), h, local_syms,
- local_sections, gp_disp_p);
+ input_section, contents, rel, relocs,
+ relocation, info, name,
+ (h ? ELF_ST_TYPE ((unsigned int) h->root.root.type) :
+ ELF_ST_TYPE ((unsigned int) sym->st_info)), h, local_syms,
+ local_sections, gp_disp_p);
if (r != bfd_reloc_ok)
- {
- const char *msg = (const char *)0;
-
- switch (r)
- {
- case bfd_reloc_overflow:
- /* If the overflowing reloc was to an undefined symbol,
- we have already printed one error message and there
- is no point complaining again. */
- if (!h || h->root.root.type != bfd_link_hash_undefined)
+ {
+ const char *msg = (const char *)0;
+
+ switch (r)
+ {
+ case bfd_reloc_overflow:
+ /* If the overflowing reloc was to an undefined symbol,
+ we have already printed one error message and there
+ is no point complaining again. */
+ if (!h || h->root.root.type != bfd_link_hash_undefined)
(*info->callbacks->reloc_overflow)
(info, NULL, name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset);
- break;
- case bfd_reloc_undefined:
+ break;
+ case bfd_reloc_undefined:
(*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section, rel->r_offset, TRUE);
- break;
+ break;
- case bfd_reloc_outofrange:
- msg = _("internal error: out of range error");
- goto common_error;
+ case bfd_reloc_outofrange:
+ msg = _("internal error: out of range error");
+ goto common_error;
- case bfd_reloc_notsupported:
- msg = _("internal error: unsupported relocation error");
- goto common_error;
+ case bfd_reloc_notsupported:
+ msg = _("internal error: unsupported relocation error");
+ goto common_error;
- case bfd_reloc_dangerous:
- msg = _("internal error: dangerous error");
- goto common_error;
+ case bfd_reloc_dangerous:
+ msg = _("internal error: dangerous error");
+ goto common_error;
- default:
- msg = _("internal error: unknown error");
- /* Fall through. */
+ default:
+ msg = _("internal error: unknown error");
+ /* Fall through. */
- common_error:
+ common_error:
(*info->callbacks->warning) (info, msg, name, input_bfd,
input_section, rel->r_offset);
- break;
- }
- }
+ break;
+ }
+ }
}
return TRUE;
bfd_boolean
s7_bfd_score_elf_check_relocs (bfd *abfd,
- struct bfd_link_info *info,
- asection *sec,
- const Elf_Internal_Rela *relocs)
+ struct bfd_link_info *info,
+ asection *sec,
+ const Elf_Internal_Rela *relocs)
{
bfd *dynobj;
Elf_Internal_Shdr *symtab_hdr;
{
sgot = score_elf_got_section (dynobj, FALSE);
if (sgot == NULL)
- g = NULL;
+ g = NULL;
else
- {
- BFD_ASSERT (score_elf_section_data (sgot) != NULL);
- g = score_elf_section_data (sgot)->u.got_info;
- BFD_ASSERT (g != NULL);
- }
+ {
+ BFD_ASSERT (score_elf_section_data (sgot) != NULL);
+ g = score_elf_section_data (sgot)->u.got_info;
+ BFD_ASSERT (g != NULL);
+ }
}
sreloc = NULL;
r_type = ELF32_R_TYPE (rel->r_info);
if (r_symndx < extsymoff)
- {
- h = NULL;
- }
+ {
+ h = NULL;
+ }
else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr))
- {
+ {
_bfd_error_handler
/* xgettext:c-format */
(_("%B: Malformed reloc detected for section %A"), abfd, sec);
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
else
- {
- h = sym_hashes[r_symndx - extsymoff];
-
- /* This may be an indirect symbol created because of a version. */
- if (h != NULL)
- {
- while (h->root.type == bfd_link_hash_indirect)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
- }
- }
+ {
+ h = sym_hashes[r_symndx - extsymoff];
+
+ /* This may be an indirect symbol created because of a version. */
+ if (h != NULL)
+ {
+ while (h->root.type == bfd_link_hash_indirect)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ }
+ }
/* Some relocs require a global offset table. */
if (dynobj == NULL || sgot == NULL)
- {
- switch (r_type)
- {
- case R_SCORE_GOT15:
- case R_SCORE_CALL15:
- if (dynobj == NULL)
- elf_hash_table (info)->dynobj = dynobj = abfd;
- if (!score_elf_create_got_section (dynobj, info, FALSE))
- return FALSE;
- g = score_elf_got_info (dynobj, &sgot);
- break;
- case R_SCORE_ABS32:
- case R_SCORE_REL32:
- if (dynobj == NULL
+ {
+ switch (r_type)
+ {
+ case R_SCORE_GOT15:
+ case R_SCORE_CALL15:
+ if (dynobj == NULL)
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ if (!score_elf_create_got_section (dynobj, info, FALSE))
+ return FALSE;
+ g = score_elf_got_info (dynobj, &sgot);
+ break;
+ case R_SCORE_ABS32:
+ case R_SCORE_REL32:
+ if (dynobj == NULL
&& (bfd_link_pic (info) || h != NULL)
&& (sec->flags & SEC_ALLOC) != 0)
- elf_hash_table (info)->dynobj = dynobj = abfd;
- break;
- default:
- break;
- }
- }
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ break;
+ default:
+ break;
+ }
+ }
if (!h && (r_type == R_SCORE_GOT_LO16))
- {
- if (! score_elf_record_local_got_symbol (abfd, r_symndx, rel->r_addend, g))
- return FALSE;
- }
+ {
+ if (! score_elf_record_local_got_symbol (abfd, r_symndx, rel->r_addend, g))
+ return FALSE;
+ }
switch (r_type)
- {
- case R_SCORE_CALL15:
- if (h == NULL)
- {
+ {
+ case R_SCORE_CALL15:
+ if (h == NULL)
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: CALL15 reloc at %#Lx not against global symbol"),
- abfd, rel->r_offset);
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
- else
- {
- /* This symbol requires a global offset table entry. */
- if (! score_elf_record_global_got_symbol (h, abfd, info, g))
- return FALSE;
-
- /* We need a stub, not a plt entry for the undefined function. But we record
- it as if it needs plt. See _bfd_elf_adjust_dynamic_symbol. */
- h->needs_plt = 1;
- h->type = STT_FUNC;
- }
- break;
- case R_SCORE_GOT15:
- if (h && ! score_elf_record_global_got_symbol (h, abfd, info, g))
- return FALSE;
- break;
- case R_SCORE_ABS32:
- case R_SCORE_REL32:
- if ((bfd_link_pic (info) || h != NULL)
+ (_("%B: CALL15 reloc at %#Lx not against global symbol"),
+ abfd, rel->r_offset);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ else
+ {
+ /* This symbol requires a global offset table entry. */
+ if (! score_elf_record_global_got_symbol (h, abfd, info, g))
+ return FALSE;
+
+ /* We need a stub, not a plt entry for the undefined function. But we record
+ it as if it needs plt. See _bfd_elf_adjust_dynamic_symbol. */
+ h->needs_plt = 1;
+ h->type = STT_FUNC;
+ }
+ break;
+ case R_SCORE_GOT15:
+ if (h && ! score_elf_record_global_got_symbol (h, abfd, info, g))
+ return FALSE;
+ break;
+ case R_SCORE_ABS32:
+ case R_SCORE_REL32:
+ if ((bfd_link_pic (info) || h != NULL)
&& (sec->flags & SEC_ALLOC) != 0)
- {
- if (sreloc == NULL)
- {
- sreloc = score_elf_rel_dyn_section (dynobj, TRUE);
- if (sreloc == NULL)
- return FALSE;
- }
+ {
+ if (sreloc == NULL)
+ {
+ sreloc = score_elf_rel_dyn_section (dynobj, TRUE);
+ if (sreloc == NULL)
+ return FALSE;
+ }
#define SCORE_READONLY_SECTION (SEC_ALLOC | SEC_LOAD | SEC_READONLY)
- if (bfd_link_pic (info))
- {
- /* When creating a shared object, we must copy these reloc types into
- the output file as R_SCORE_REL32 relocs. We make room for this reloc
- in the .rel.dyn reloc section. */
- score_elf_allocate_dynamic_relocations (dynobj, 1);
- if ((sec->flags & SCORE_READONLY_SECTION)
- == SCORE_READONLY_SECTION)
- /* We tell the dynamic linker that there are
- relocations against the text segment. */
- info->flags |= DF_TEXTREL;
- }
- else
- {
- struct score_elf_link_hash_entry *hscore;
-
- /* We only need to copy this reloc if the symbol is
- defined in a dynamic object. */
- hscore = (struct score_elf_link_hash_entry *) h;
- ++hscore->possibly_dynamic_relocs;
- if ((sec->flags & SCORE_READONLY_SECTION)
- == SCORE_READONLY_SECTION)
- /* We need it to tell the dynamic linker if there
- are relocations against the text segment. */
- hscore->readonly_reloc = TRUE;
- }
-
- /* Even though we don't directly need a GOT entry for this symbol,
- a symbol must have a dynamic symbol table index greater that
- DT_SCORE_GOTSYM if there are dynamic relocations against it. */
- if (h != NULL)
- {
- if (dynobj == NULL)
- elf_hash_table (info)->dynobj = dynobj = abfd;
- if (! score_elf_create_got_section (dynobj, info, TRUE))
- return FALSE;
- g = score_elf_got_info (dynobj, &sgot);
- if (! score_elf_record_global_got_symbol (h, abfd, info, g))
- return FALSE;
- }
- }
- break;
-
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_SCORE_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_SCORE_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
- default:
- break;
- }
+ if (bfd_link_pic (info))
+ {
+ /* When creating a shared object, we must copy these reloc types into
+ the output file as R_SCORE_REL32 relocs. We make room for this reloc
+ in the .rel.dyn reloc section. */
+ score_elf_allocate_dynamic_relocations (dynobj, 1);
+ if ((sec->flags & SCORE_READONLY_SECTION)
+ == SCORE_READONLY_SECTION)
+ /* We tell the dynamic linker that there are
+ relocations against the text segment. */
+ info->flags |= DF_TEXTREL;
+ }
+ else
+ {
+ struct score_elf_link_hash_entry *hscore;
+
+ /* We only need to copy this reloc if the symbol is
+ defined in a dynamic object. */
+ hscore = (struct score_elf_link_hash_entry *) h;
+ ++hscore->possibly_dynamic_relocs;
+ if ((sec->flags & SCORE_READONLY_SECTION)
+ == SCORE_READONLY_SECTION)
+ /* We need it to tell the dynamic linker if there
+ are relocations against the text segment. */
+ hscore->readonly_reloc = TRUE;
+ }
+
+ /* Even though we don't directly need a GOT entry for this symbol,
+ a symbol must have a dynamic symbol table index greater that
+ DT_SCORE_GOTSYM if there are dynamic relocations against it. */
+ if (h != NULL)
+ {
+ if (dynobj == NULL)
+ elf_hash_table (info)->dynobj = dynobj = abfd;
+ if (! score_elf_create_got_section (dynobj, info, TRUE))
+ return FALSE;
+ g = score_elf_got_info (dynobj, &sgot);
+ if (! score_elf_record_global_got_symbol (h, abfd, info, g))
+ return FALSE;
+ }
+ }
+ break;
+
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_SCORE_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_SCORE_GNU_VTENTRY:
+ if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+ default:
+ break;
+ }
/* We must not create a stub for a symbol that has relocations
- related to taking the function's address. */
+ related to taking the function's address. */
switch (r_type)
- {
- default:
- if (h != NULL)
- {
- struct score_elf_link_hash_entry *sh;
-
- sh = (struct score_elf_link_hash_entry *) h;
- sh->no_fn_stub = TRUE;
- }
- break;
- case R_SCORE_CALL15:
- break;
- }
+ {
+ default:
+ if (h != NULL)
+ {
+ struct score_elf_link_hash_entry *sh;
+
+ sh = (struct score_elf_link_hash_entry *) h;
+ sh->no_fn_stub = TRUE;
+ }
+ break;
+ case R_SCORE_CALL15:
+ break;
+ }
}
return TRUE;
bfd_boolean
s7_bfd_score_elf_add_symbol_hook (bfd *abfd,
- struct bfd_link_info *info ATTRIBUTE_UNUSED,
- Elf_Internal_Sym *sym,
- const char **namep ATTRIBUTE_UNUSED,
- flagword *flagsp ATTRIBUTE_UNUSED,
- asection **secp,
- bfd_vma *valp)
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym,
+ const char **namep ATTRIBUTE_UNUSED,
+ flagword *flagsp ATTRIBUTE_UNUSED,
+ asection **secp,
+ bfd_vma *valp)
{
switch (sym->st_shndx)
{
case SHN_COMMON:
if (sym->st_size > elf_gp_size (abfd))
- break;
+ break;
/* Fall through. */
case SHN_SCORE_SCOMMON:
*secp = bfd_make_section_old_way (abfd, ".scommon");
{
case SHN_COMMON:
if (asym->value > elf_gp_size (abfd))
- break;
+ break;
/* Fall through. */
case SHN_SCORE_SCOMMON:
if (score_elf_scom_section.name == NULL)
- {
- /* Initialize the small common section. */
- score_elf_scom_section.name = ".scommon";
- score_elf_scom_section.flags = SEC_IS_COMMON;
- score_elf_scom_section.output_section = &score_elf_scom_section;
- score_elf_scom_section.symbol = &score_elf_scom_symbol;
- score_elf_scom_section.symbol_ptr_ptr = &score_elf_scom_symbol_ptr;
- score_elf_scom_symbol.name = ".scommon";
- score_elf_scom_symbol.flags = BSF_SECTION_SYM;
- score_elf_scom_symbol.section = &score_elf_scom_section;
- score_elf_scom_symbol_ptr = &score_elf_scom_symbol;
- }
+ {
+ /* Initialize the small common section. */
+ score_elf_scom_section.name = ".scommon";
+ score_elf_scom_section.flags = SEC_IS_COMMON;
+ score_elf_scom_section.output_section = &score_elf_scom_section;
+ score_elf_scom_section.symbol = &score_elf_scom_symbol;
+ score_elf_scom_section.symbol_ptr_ptr = &score_elf_scom_symbol_ptr;
+ score_elf_scom_symbol.name = ".scommon";
+ score_elf_scom_symbol.flags = BSF_SECTION_SYM;
+ score_elf_scom_symbol.section = &score_elf_scom_section;
+ score_elf_scom_symbol_ptr = &score_elf_scom_symbol;
+ }
asym->section = &score_elf_scom_section;
asym->value = elfsym->internal_elf_sym.st_size;
break;
int
s7_bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
- const char *name ATTRIBUTE_UNUSED,
- Elf_Internal_Sym *sym,
- asection *input_sec,
- struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
+ const char *name ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym,
+ asection *input_sec,
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
{
/* If we see a common symbol, which implies a relocatable link, then
if a symbol was small common in an input file, mark it as small
bfd_boolean
s7_bfd_score_elf_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED,
- asection *sec,
- int *retval)
+ asection *sec,
+ int *retval)
{
if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0)
{
bfd_boolean
s7_bfd_score_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *h)
+ struct elf_link_hash_entry *h)
{
bfd *dynobj;
struct score_elf_link_hash_entry *hscore;
/* Make sure we know what is going on here. */
BFD_ASSERT (dynobj != NULL
- && (h->needs_plt
- || h->is_weakalias
- || (h->def_dynamic && h->ref_regular && !h->def_regular)));
+ && (h->needs_plt
+ || h->is_weakalias
+ || (h->def_dynamic && h->ref_regular && !h->def_regular)));
/* If this symbol is defined in a dynamic object, we need to copy
any R_SCORE_ABS32 or R_SCORE_REL32 relocs against it into the output
{
score_elf_allocate_dynamic_relocations (dynobj, hscore->possibly_dynamic_relocs);
if (hscore->readonly_reloc)
- /* We tell the dynamic linker that there are relocations
- against the text segment. */
- info->flags |= DF_TEXTREL;
+ /* We tell the dynamic linker that there are relocations
+ against the text segment. */
+ info->flags |= DF_TEXTREL;
}
/* For a function, create a stub, if allowed. */
if (!hscore->no_fn_stub && h->needs_plt)
{
if (!elf_hash_table (info)->dynamic_sections_created)
- return TRUE;
+ return TRUE;
/* If this symbol is not defined in a regular file, then set
- the symbol to the stub location. This is required to make
- function pointers compare as equal between the normal
- executable and the shared library. */
+ the symbol to the stub location. This is required to make
+ function pointers compare as equal between the normal
+ executable and the shared library. */
if (!h->def_regular)
- {
- /* We need .stub section. */
- s = bfd_get_linker_section (dynobj, SCORE_ELF_STUB_SECTION_NAME);
- BFD_ASSERT (s != NULL);
+ {
+ /* We need .stub section. */
+ s = bfd_get_linker_section (dynobj, SCORE_ELF_STUB_SECTION_NAME);
+ BFD_ASSERT (s != NULL);
- h->root.u.def.section = s;
- h->root.u.def.value = s->size;
+ h->root.u.def.section = s;
+ h->root.u.def.value = s->size;
- /* XXX Write this stub address somewhere. */
- h->plt.offset = s->size;
+ /* XXX Write this stub address somewhere. */
+ h->plt.offset = s->size;
- /* Make room for this stub code. */
- s->size += SCORE_FUNCTION_STUB_SIZE;
+ /* Make room for this stub code. */
+ s->size += SCORE_FUNCTION_STUB_SIZE;
- /* The last half word of the stub will be filled with the index
- of this symbol in .dynsym section. */
- return TRUE;
- }
+ /* The last half word of the stub will be filled with the index
+ of this symbol in .dynsym section. */
+ return TRUE;
+ }
}
else if ((h->type == STT_FUNC) && !h->needs_plt)
{
/* This will set the entry for this symbol in the GOT to 0, and
- the dynamic linker will take care of this. */
+ the dynamic linker will take care of this. */
h->root.u.def.value = 0;
return TRUE;
}
bfd_boolean
s7_bfd_score_elf_always_size_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *s;
asection *subsection;
for (subsection = sub->sections;
- subsection;
- subsection = subsection->next)
- {
- if ((subsection->flags & SEC_ALLOC) == 0)
- continue;
- loadable_size += ((subsection->size + 0xf)
- &~ (bfd_size_type) 0xf);
- }
+ subsection;
+ subsection = subsection->next)
+ {
+ if ((subsection->flags & SEC_ALLOC) == 0)
+ continue;
+ loadable_size += ((subsection->size + 0xf)
+ &~ (bfd_size_type) 0xf);
+ }
}
/* There has to be a global GOT entry for every symbol with
{
/* Set the contents of the .interp section to the interpreter. */
if (bfd_link_executable (info) && !info->nointerp)
- {
- s = bfd_get_linker_section (dynobj, ".interp");
- BFD_ASSERT (s != NULL);
- s->size = strlen (ELF_DYNAMIC_INTERPRETER) + 1;
- s->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER;
- }
+ {
+ s = bfd_get_linker_section (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->size = strlen (ELF_DYNAMIC_INTERPRETER) + 1;
+ s->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER;
+ }
}
/* The check_relocs and adjust_dynamic_symbol entry points have
const char *name;
if ((s->flags & SEC_LINKER_CREATED) == 0)
- continue;
+ continue;
/* It's OK to base decisions on the section name, because none
- of the dynobj section names depend upon the input files. */
+ of the dynobj section names depend upon the input files. */
name = bfd_get_section_name (dynobj, s);
if (CONST_STRNEQ (name, ".rel"))
- {
- if (s->size == 0)
- {
- /* We only strip the section if the output section name
- has the same name. Otherwise, there might be several
- input sections for this output section. FIXME: This
- code is probably not needed these days anyhow, since
- the linker now does not create empty output sections. */
- if (s->output_section != NULL
- && strcmp (name,
- bfd_get_section_name (s->output_section->owner,
- s->output_section)) == 0)
- s->flags |= SEC_EXCLUDE;
- }
- else
- {
- const char *outname;
- asection *target;
-
- /* If this relocation section applies to a read only
- section, then we probably need a DT_TEXTREL entry.
- If the relocation section is .rel.dyn, we always
- assert a DT_TEXTREL entry rather than testing whether
- there exists a relocation to a read only section or
- not. */
- outname = bfd_get_section_name (output_bfd, s->output_section);
- target = bfd_get_section_by_name (output_bfd, outname + 4);
- if ((target != NULL
- && (target->flags & SEC_READONLY) != 0
- && (target->flags & SEC_ALLOC) != 0) || strcmp (outname, ".rel.dyn") == 0)
- reltext = TRUE;
-
- /* We use the reloc_count field as a counter if we need
- to copy relocs into the output file. */
- if (strcmp (name, ".rel.dyn") != 0)
- s->reloc_count = 0;
- }
- }
+ {
+ if (s->size == 0)
+ {
+ /* We only strip the section if the output section name
+ has the same name. Otherwise, there might be several
+ input sections for this output section. FIXME: This
+ code is probably not needed these days anyhow, since
+ the linker now does not create empty output sections. */
+ if (s->output_section != NULL
+ && strcmp (name,
+ bfd_get_section_name (s->output_section->owner,
+ s->output_section)) == 0)
+ s->flags |= SEC_EXCLUDE;
+ }
+ else
+ {
+ const char *outname;
+ asection *target;
+
+ /* If this relocation section applies to a read only
+ section, then we probably need a DT_TEXTREL entry.
+ If the relocation section is .rel.dyn, we always
+ assert a DT_TEXTREL entry rather than testing whether
+ there exists a relocation to a read only section or
+ not. */
+ outname = bfd_get_section_name (output_bfd, s->output_section);
+ target = bfd_get_section_by_name (output_bfd, outname + 4);
+ if ((target != NULL
+ && (target->flags & SEC_READONLY) != 0
+ && (target->flags & SEC_ALLOC) != 0) || strcmp (outname, ".rel.dyn") == 0)
+ reltext = TRUE;
+
+ /* We use the reloc_count field as a counter if we need
+ to copy relocs into the output file. */
+ if (strcmp (name, ".rel.dyn") != 0)
+ s->reloc_count = 0;
+ }
+ }
else if (CONST_STRNEQ (name, ".got"))
- {
- /* s7_bfd_score_elf_always_size_sections() has already done
- most of the work, but some symbols may have been mapped
- to versions that we must now resolve in the got_entries
- hash tables. */
- }
+ {
+ /* s7_bfd_score_elf_always_size_sections() has already done
+ most of the work, but some symbols may have been mapped
+ to versions that we must now resolve in the got_entries
+ hash tables. */
+ }
else if (strcmp (name, SCORE_ELF_STUB_SECTION_NAME) == 0)
- {
- /* IRIX rld assumes that the function stub isn't at the end
- of .text section. So put a dummy. XXX */
- s->size += SCORE_FUNCTION_STUB_SIZE;
- }
+ {
+ /* IRIX rld assumes that the function stub isn't at the end
+ of .text section. So put a dummy. XXX */
+ s->size += SCORE_FUNCTION_STUB_SIZE;
+ }
else if (! CONST_STRNEQ (name, ".init"))
- {
- /* It's not one of our sections, so don't allocate space. */
- continue;
- }
+ {
+ /* It's not one of our sections, so don't allocate space. */
+ continue;
+ }
/* Allocate memory for the section contents. */
s->contents = bfd_zalloc (dynobj, s->size);
if (s->contents == NULL && s->size != 0)
- {
- bfd_set_error (bfd_error_no_memory);
- return FALSE;
- }
+ {
+ bfd_set_error (bfd_error_no_memory);
+ return FALSE;
+ }
}
if (elf_hash_table (info)->dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
- values later, in s7_bfd_score_elf_finish_dynamic_sections, but we
- must add the entries now so that we get the correct size for
- the .dynamic section. The DT_DEBUG entry is filled in by the
- dynamic linker and used by the debugger. */
+ values later, in s7_bfd_score_elf_finish_dynamic_sections, but we
+ must add the entries now so that we get the correct size for
+ the .dynamic section. The DT_DEBUG entry is filled in by the
+ dynamic linker and used by the debugger. */
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_DEBUG, 0))
- return FALSE;
+ return FALSE;
if (reltext)
- info->flags |= DF_TEXTREL;
+ info->flags |= DF_TEXTREL;
if ((info->flags & DF_TEXTREL) != 0)
- {
- if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_TEXTREL, 0))
- return FALSE;
- }
+ {
+ if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_TEXTREL, 0))
+ return FALSE;
+ }
if (! SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_PLTGOT, 0))
- return FALSE;
+ return FALSE;
if (score_elf_rel_dyn_section (dynobj, FALSE))
- {
- if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0))
- return FALSE;
+ {
+ if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_REL, 0))
+ return FALSE;
- if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0))
- return FALSE;
+ if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELSZ, 0))
+ return FALSE;
- if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0))
- return FALSE;
- }
+ if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_RELENT, 0))
+ return FALSE;
+ }
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_BASE_ADDRESS, 0))
- return FALSE;
+ return FALSE;
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_LOCAL_GOTNO, 0))
- return FALSE;
+ return FALSE;
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_SYMTABNO, 0))
- return FALSE;
+ return FALSE;
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_UNREFEXTNO, 0))
- return FALSE;
+ return FALSE;
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_GOTSYM, 0))
- return FALSE;
+ return FALSE;
if (!SCORE_ELF_ADD_DYNAMIC_ENTRY (info, DT_SCORE_HIPAGENO, 0))
- return FALSE;
+ return FALSE;
}
return TRUE;
asection *s;
flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
- | SEC_LINKER_CREATED | SEC_READONLY);
+ | SEC_LINKER_CREATED | SEC_READONLY);
/* ABI requests the .dynamic section to be read only. */
s = bfd_get_linker_section (abfd, ".dynamic");
if (s != NULL)
{
if (!bfd_set_section_flags (abfd, s, flags))
- return FALSE;
+ return FALSE;
}
/* We need to create .got section. */
s = bfd_make_section_anyway_with_flags (abfd, SCORE_ELF_STUB_SECTION_NAME,
flags | SEC_CODE);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (abfd, s, 2))
- return FALSE;
+ return FALSE;
}
if (!bfd_link_pic (info))
name = "_DYNAMIC_LINK";
bh = NULL;
if (!(_bfd_generic_link_add_one_symbol
- (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr,
- (bfd_vma) 0, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh)))
- return FALSE;
+ (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr,
+ (bfd_vma) 0, NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh)))
+ return FALSE;
h = (struct elf_link_hash_entry *) bh;
h->non_elf = 0;
h->type = STT_SECTION;
if (!bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
+ return FALSE;
}
return TRUE;
bfd_boolean
s7_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd,
- struct bfd_link_info *info,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct bfd_link_info *info,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
bfd *dynobj;
asection *sgot;
/* FIXME: Can h->dynindex be more than 64K? */
if (h->dynindx & 0xffff0000)
- return FALSE;
+ return FALSE;
/* Fill the stub. */
bfd_put_32 (output_bfd, STUB_LW, stub);
memcpy (s->contents + h->plt.offset, stub, SCORE_FUNCTION_STUB_SIZE);
/* Mark the symbol as undefined. plt.offset != -1 occurs
- only for the referenced symbol. */
+ only for the referenced symbol. */
sym->st_shndx = SHN_UNDEF;
/* The run-time linker uses the st_value field of the symbol
- to reset the global offset table entry for this external
- to its stub address when unlinking a shared object. */
+ to reset the global offset table entry for this external
+ to its stub address when unlinking a shared object. */
sym->st_value = (s->output_section->vma + s->output_offset + h->plt.offset);
}
bfd_boolean
s7_bfd_score_elf_finish_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *sdyn;
BFD_ASSERT (g != NULL);
for (b = sdyn->contents;
- b < sdyn->contents + sdyn->size;
- b += SCORE_ELF_DYN_SIZE (dynobj))
- {
- Elf_Internal_Dyn dyn;
- const char *name;
- size_t elemsize;
- bfd_boolean swap_out_p;
-
- /* Read in the current dynamic entry. */
- (*get_elf_backend_data (dynobj)->s->swap_dyn_in) (dynobj, b, &dyn);
-
- /* Assume that we're going to modify it and write it out. */
- swap_out_p = TRUE;
-
- switch (dyn.d_tag)
- {
- case DT_RELENT:
- dyn.d_un.d_val = SCORE_ELF_REL_SIZE (dynobj);
- break;
-
- case DT_STRSZ:
- /* Rewrite DT_STRSZ. */
- dyn.d_un.d_val
- = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr);
- break;
-
- case DT_PLTGOT:
- s = elf_hash_table (info)->sgot;
- dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
- break;
-
- case DT_SCORE_BASE_ADDRESS:
- s = output_bfd->sections;
- BFD_ASSERT (s != NULL);
- dyn.d_un.d_ptr = s->vma & ~(bfd_vma) 0xffff;
- break;
-
- case DT_SCORE_LOCAL_GOTNO:
- dyn.d_un.d_val = g->local_gotno;
- break;
-
- case DT_SCORE_UNREFEXTNO:
- /* The index into the dynamic symbol table which is the
- entry of the first external symbol that is not
- referenced within the same object. */
- dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1;
- break;
-
- case DT_SCORE_GOTSYM:
- if (g->global_gotsym)
- {
- dyn.d_un.d_val = g->global_gotsym->dynindx;
- break;
- }
- /* In case if we don't have global got symbols we default
- to setting DT_SCORE_GOTSYM to the same value as
- DT_SCORE_SYMTABNO. */
+ b < sdyn->contents + sdyn->size;
+ b += SCORE_ELF_DYN_SIZE (dynobj))
+ {
+ Elf_Internal_Dyn dyn;
+ const char *name;
+ size_t elemsize;
+ bfd_boolean swap_out_p;
+
+ /* Read in the current dynamic entry. */
+ (*get_elf_backend_data (dynobj)->s->swap_dyn_in) (dynobj, b, &dyn);
+
+ /* Assume that we're going to modify it and write it out. */
+ swap_out_p = TRUE;
+
+ switch (dyn.d_tag)
+ {
+ case DT_RELENT:
+ dyn.d_un.d_val = SCORE_ELF_REL_SIZE (dynobj);
+ break;
+
+ case DT_STRSZ:
+ /* Rewrite DT_STRSZ. */
+ dyn.d_un.d_val
+ = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr);
+ break;
+
+ case DT_PLTGOT:
+ s = elf_hash_table (info)->sgot;
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
+ break;
+
+ case DT_SCORE_BASE_ADDRESS:
+ s = output_bfd->sections;
+ BFD_ASSERT (s != NULL);
+ dyn.d_un.d_ptr = s->vma & ~(bfd_vma) 0xffff;
+ break;
+
+ case DT_SCORE_LOCAL_GOTNO:
+ dyn.d_un.d_val = g->local_gotno;
+ break;
+
+ case DT_SCORE_UNREFEXTNO:
+ /* The index into the dynamic symbol table which is the
+ entry of the first external symbol that is not
+ referenced within the same object. */
+ dyn.d_un.d_val = bfd_count_sections (output_bfd) + 1;
+ break;
+
+ case DT_SCORE_GOTSYM:
+ if (g->global_gotsym)
+ {
+ dyn.d_un.d_val = g->global_gotsym->dynindx;
+ break;
+ }
+ /* In case if we don't have global got symbols we default
+ to setting DT_SCORE_GOTSYM to the same value as
+ DT_SCORE_SYMTABNO. */
/* Fall through. */
- case DT_SCORE_SYMTABNO:
- name = ".dynsym";
- elemsize = SCORE_ELF_SYM_SIZE (output_bfd);
- s = bfd_get_linker_section (dynobj, name);
- dyn.d_un.d_val = s->size / elemsize;
- break;
+ case DT_SCORE_SYMTABNO:
+ name = ".dynsym";
+ elemsize = SCORE_ELF_SYM_SIZE (output_bfd);
+ s = bfd_get_linker_section (dynobj, name);
+ dyn.d_un.d_val = s->size / elemsize;
+ break;
- case DT_SCORE_HIPAGENO:
- dyn.d_un.d_val = g->local_gotno - SCORE_RESERVED_GOTNO;
- break;
+ case DT_SCORE_HIPAGENO:
+ dyn.d_un.d_val = g->local_gotno - SCORE_RESERVED_GOTNO;
+ break;
- default:
- swap_out_p = FALSE;
- break;
- }
+ default:
+ swap_out_p = FALSE;
+ break;
+ }
- if (swap_out_p)
- (*get_elf_backend_data (dynobj)->s->swap_dyn_out) (dynobj, &dyn, b);
- }
+ if (swap_out_p)
+ (*get_elf_backend_data (dynobj)->s->swap_dyn_out) (dynobj, &dyn, b);
+ }
}
/* The first entry of the global offset table will be filled at
{
reldyn_sorting_bfd = output_bfd;
qsort ((Elf32_External_Rel *) s->contents + 1, s->reloc_count - 1,
- sizeof (Elf32_External_Rel), score_elf_sort_dynamic_relocs);
+ sizeof (Elf32_External_Rel), score_elf_sort_dynamic_relocs);
}
return TRUE;
bfd_boolean
s7_bfd_score_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
- Elf_Internal_Shdr *hdr,
- asection *sec)
+ Elf_Internal_Shdr *hdr,
+ asection *sec)
{
const char *name;
const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
if (strcmp (name, ".sdata") == 0)
- {
- hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL;
- hdr->sh_type = SHT_PROGBITS;
- }
+ {
+ hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL;
+ hdr->sh_type = SHT_PROGBITS;
+ }
else if (strcmp (name, ".sbss") == 0)
- {
- hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL;
- hdr->sh_type = SHT_NOBITS;
- }
+ {
+ hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_SCORE_GPREL;
+ hdr->sh_type = SHT_NOBITS;
+ }
else if (strcmp (name, ".srdata") == 0)
- {
- hdr->sh_flags |= SHF_ALLOC | SHF_SCORE_GPREL;
- hdr->sh_type = SHT_PROGBITS;
- }
+ {
+ hdr->sh_flags |= SHF_ALLOC | SHF_SCORE_GPREL;
+ hdr->sh_type = SHT_PROGBITS;
+ }
}
return TRUE;
for (from = contents, i = 0; from < end; from += PDR_SIZE, i++)
{
if ((score_elf_section_data (sec)->u.tdata)[i] == 1)
- continue;
+ continue;
if (to != from)
- memcpy (to, from, PDR_SIZE);
+ memcpy (to, from, PDR_SIZE);
to += PDR_SIZE;
}
bfd_set_section_contents (output_bfd, sec->output_section, contents,
- (file_ptr) sec->output_offset, sec->size);
+ (file_ptr) sec->output_offset, sec->size);
return TRUE;
}
void
s7_bfd_score_elf_copy_indirect_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *dir,
- struct elf_link_hash_entry *ind)
+ struct elf_link_hash_entry *dir,
+ struct elf_link_hash_entry *ind)
{
struct score_elf_link_hash_entry *dirscore, *indscore;
bfd_boolean
s7_bfd_score_elf_discard_info (bfd *abfd,
- struct elf_reloc_cookie *cookie,
- struct bfd_link_info *info)
+ struct elf_reloc_cookie *cookie,
+ struct bfd_link_info *info)
{
asection *o;
bfd_boolean ret = FALSE;
for (i = 0, skip = 0; i < o->size; i++)
{
if (bfd_elf_reloc_symbol_deleted_p (i * PDR_SIZE, cookie))
- {
- tdata[i] = 1;
- skip++;
- }
+ {
+ tdata[i] = 1;
+ skip++;
+ }
}
if (skip != 0)
asection *
s7_bfd_score_elf_gc_mark_hook (asection *sec,
- struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct bfd_link_info *info,
+ Elf_Internal_Rela *rel,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
if (h != NULL)
switch (ELF32_R_TYPE (rel->r_info))
{
case R_SCORE_GNU_VTINHERIT:
case R_SCORE_GNU_VTENTRY:
- return NULL;
+ return NULL;
}
return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym);
{
default:
return FALSE;
- case 272: /* Linux/Score elf_prstatus */
+ case 272: /* Linux/Score elf_prstatus */
/* pr_cursig */
elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
default:
return FALSE;
- case 128: /* Linux/Score elf_prpsinfo. */
+ case 128: /* Linux/Score elf_prpsinfo. */
/* pr_fname */
elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
elf_elfheader (obfd)->e_flags = in_flags;
if (bfd_get_arch (obfd) == bfd_get_arch (ibfd)
- && bfd_get_arch_info (obfd)->the_default)
- {
- return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd));
- }
+ && bfd_get_arch_info (obfd)->the_default)
+ {
+ return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd));
+ }
return TRUE;
}
/* Stop elf32-sh.c from defining any target vectors. */
#define SH_TARGET_ALREADY_DEFINED
-#define sh_find_elf_flags sh_symbian_find_elf_flags
+#define sh_find_elf_flags sh_symbian_find_elf_flags
#define sh_elf_get_flags_from_mach sh_symbian_elf_get_flags_from_mach
#include "elf32-sh.c"
++ s; \
if (s >= e) \
{ \
- if (SYMBIAN_DEBUG) \
+ if (SYMBIAN_DEBUG) \
fprintf (stderr, "Corrupt directive: %s\n", m); \
result = FALSE; \
} \
++ s; \
if (s >= e) \
{ \
- if (SYMBIAN_DEBUG) \
+ if (SYMBIAN_DEBUG) \
fprintf (stderr, "Corrupt directive: %s\n", m); \
result = FALSE; \
} \
++ s; \
if (s >= e) \
{ \
- if (SYMBIAN_DEBUG) \
+ if (SYMBIAN_DEBUG) \
fprintf (stderr, "Corrupt directive: %s\n", m); \
result = FALSE; \
} \
typedef struct symbol_rename
{
struct symbol_rename * next;
- char * current_name;
- char * new_name;
+ char * current_name;
+ char * new_name;
struct elf_link_hash_entry * current_hash;
- unsigned long new_symndx;
+ unsigned long new_symndx;
}
symbol_rename;
and magle the relocs to allow for symbol renaming. */
static bfd_boolean
-sh_symbian_relocate_section (bfd * output_bfd,
+sh_symbian_relocate_section (bfd * output_bfd,
struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
Elf_Internal_Rela * relocs,
- Elf_Internal_Sym * local_syms,
- asection ** local_sections)
+ Elf_Internal_Sym * local_syms,
+ asection ** local_sections)
{
/* When performing a final link we implement the IMPORT AS directives. */
if (!bfd_link_relocatable (info))
{
- Elf_Internal_Rela * rel;
- Elf_Internal_Rela * relend;
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Rela * rel;
+ Elf_Internal_Rela * relend;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
struct elf_link_hash_entry ** sym_hashes_end;
struct elf_link_hash_table * hash_table;
- symbol_rename * ptr;
- bfd_size_type num_global_syms;
+ symbol_rename * ptr;
+ bfd_size_type num_global_syms;
unsigned long num_local_syms;
BFD_ASSERT (! elf_bad_symtab (input_bfd));
rel < relend;
rel ++)
{
- int r_type;
- unsigned long r_symndx;
+ int r_type;
+ unsigned long r_symndx;
struct elf_link_hash_entry * h;
r_symndx = ELF32_R_SYM (rel->r_info);
if (local_got_refcounts == NULL)
return FALSE;
elf_local_got_refcounts (abfd) = local_got_refcounts;
-#ifdef INCLUDE_SHMEDIA
+#ifdef INCLUDE_SHMEDIA
/* Take care of both the datalabel and codelabel local
GOT offsets. */
sh_elf_local_got_type (abfd)
#define elf_backend_link_output_symbol_hook \
sh64_elf_link_output_symbol_hook
#define elf_backend_merge_symbol_attribute sh64_elf_merge_symbol_attribute
-#define elf_backend_final_write_processing sh64_elf_final_write_processing
+#define elf_backend_final_write_processing sh64_elf_final_write_processing
#define elf_backend_section_from_shdr sh64_backend_section_from_shdr
#define elf_backend_special_sections sh64_elf_special_sections
#define elf_backend_section_flags sh64_elf_section_flags
static const struct bfd_elf_special_section sh64_elf_special_sections[] =
{
{ STRING_COMMA_LEN (".cranges"), 0, SHT_PROGBITS, 0 },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
#undef TARGET_BIG_SYM
#define elf_backend_gc_mark_hook _bfd_sparc_elf_gc_mark_hook
#define elf_backend_plt_sym_val _bfd_sparc_elf_plt_sym_val
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
-#define elf_backend_fixup_symbol _bfd_sparc_elf_fixup_symbol
+#define elf_backend_fixup_symbol _bfd_sparc_elf_fixup_symbol
#define elf_backend_can_gc_sections 1
#define elf_backend_can_refcount 1
/* The 32-bit static TLS arena size is rounded to the nearest 8-byte
boundary. */
-#undef elf_backend_static_tls_alignment
+#undef elf_backend_static_tls_alignment
#define elf_backend_static_tls_alignment 8
-#undef elf_backend_strtab_flags
+#undef elf_backend_strtab_flags
#define elf_backend_strtab_flags SHF_STRINGS
static bfd_boolean
array, so it must be declared in the order of that type. */
static reloc_howto_type elf_howto_table[] = {
- HOWTO (R_SPU_NONE, 0, 3, 0, FALSE, 0, complain_overflow_dont,
+ HOWTO (R_SPU_NONE, 0, 3, 0, FALSE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "SPU_NONE",
FALSE, 0, 0x00000000, FALSE),
- HOWTO (R_SPU_ADDR10, 4, 2, 10, FALSE, 14, complain_overflow_bitfield,
+ HOWTO (R_SPU_ADDR10, 4, 2, 10, FALSE, 14, complain_overflow_bitfield,
bfd_elf_generic_reloc, "SPU_ADDR10",
FALSE, 0, 0x00ffc000, FALSE),
- HOWTO (R_SPU_ADDR16, 2, 2, 16, FALSE, 7, complain_overflow_bitfield,
+ HOWTO (R_SPU_ADDR16, 2, 2, 16, FALSE, 7, complain_overflow_bitfield,
bfd_elf_generic_reloc, "SPU_ADDR16",
FALSE, 0, 0x007fff80, FALSE),
HOWTO (R_SPU_ADDR16_HI, 16, 2, 16, FALSE, 7, complain_overflow_bitfield,
HOWTO (R_SPU_ADDR16_LO, 0, 2, 16, FALSE, 7, complain_overflow_dont,
bfd_elf_generic_reloc, "SPU_ADDR16_LO",
FALSE, 0, 0x007fff80, FALSE),
- HOWTO (R_SPU_ADDR18, 0, 2, 18, FALSE, 7, complain_overflow_bitfield,
+ HOWTO (R_SPU_ADDR18, 0, 2, 18, FALSE, 7, complain_overflow_bitfield,
bfd_elf_generic_reloc, "SPU_ADDR18",
FALSE, 0, 0x01ffff80, FALSE),
- HOWTO (R_SPU_ADDR32, 0, 2, 32, FALSE, 0, complain_overflow_dont,
+ HOWTO (R_SPU_ADDR32, 0, 2, 32, FALSE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "SPU_ADDR32",
FALSE, 0, 0xffffffff, FALSE),
- HOWTO (R_SPU_REL16, 2, 2, 16, TRUE, 7, complain_overflow_bitfield,
+ HOWTO (R_SPU_REL16, 2, 2, 16, TRUE, 7, complain_overflow_bitfield,
bfd_elf_generic_reloc, "SPU_REL16",
FALSE, 0, 0x007fff80, TRUE),
- HOWTO (R_SPU_ADDR7, 0, 2, 7, FALSE, 14, complain_overflow_dont,
+ HOWTO (R_SPU_ADDR7, 0, 2, 7, FALSE, 14, complain_overflow_dont,
bfd_elf_generic_reloc, "SPU_ADDR7",
FALSE, 0, 0x001fc000, FALSE),
- HOWTO (R_SPU_REL9, 2, 2, 9, TRUE, 0, complain_overflow_signed,
- spu_elf_rel9, "SPU_REL9",
+ HOWTO (R_SPU_REL9, 2, 2, 9, TRUE, 0, complain_overflow_signed,
+ spu_elf_rel9, "SPU_REL9",
FALSE, 0, 0x0180007f, TRUE),
- HOWTO (R_SPU_REL9I, 2, 2, 9, TRUE, 0, complain_overflow_signed,
- spu_elf_rel9, "SPU_REL9I",
+ HOWTO (R_SPU_REL9I, 2, 2, 9, TRUE, 0, complain_overflow_signed,
+ spu_elf_rel9, "SPU_REL9I",
FALSE, 0, 0x0000c07f, TRUE),
- HOWTO (R_SPU_ADDR10I, 0, 2, 10, FALSE, 14, complain_overflow_signed,
+ HOWTO (R_SPU_ADDR10I, 0, 2, 10, FALSE, 14, complain_overflow_signed,
bfd_elf_generic_reloc, "SPU_ADDR10I",
FALSE, 0, 0x00ffc000, FALSE),
- HOWTO (R_SPU_ADDR16I, 0, 2, 16, FALSE, 7, complain_overflow_signed,
+ HOWTO (R_SPU_ADDR16I, 0, 2, 16, FALSE, 7, complain_overflow_signed,
bfd_elf_generic_reloc, "SPU_ADDR16I",
FALSE, 0, 0x007fff80, FALSE),
- HOWTO (R_SPU_REL32, 0, 2, 32, TRUE, 0, complain_overflow_dont,
+ HOWTO (R_SPU_REL32, 0, 2, 32, TRUE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "SPU_REL32",
FALSE, 0, 0xffffffff, TRUE),
- HOWTO (R_SPU_ADDR16X, 0, 2, 16, FALSE, 7, complain_overflow_bitfield,
+ HOWTO (R_SPU_ADDR16X, 0, 2, 16, FALSE, 7, complain_overflow_bitfield,
bfd_elf_generic_reloc, "SPU_ADDR16X",
FALSE, 0, 0x007fff80, FALSE),
- HOWTO (R_SPU_PPU32, 0, 2, 32, FALSE, 0, complain_overflow_dont,
+ HOWTO (R_SPU_PPU32, 0, 2, 32, FALSE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "SPU_PPU32",
FALSE, 0, 0xffffffff, FALSE),
- HOWTO (R_SPU_PPU64, 0, 4, 64, FALSE, 0, complain_overflow_dont,
+ HOWTO (R_SPU_PPU64, 0, 4, 64, FALSE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "SPU_PPU64",
FALSE, 0, -1, FALSE),
- HOWTO (R_SPU_ADD_PIC, 0, 0, 0, FALSE, 0, complain_overflow_dont,
+ HOWTO (R_SPU_ADD_PIC, 0, 0, 0, FALSE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "SPU_ADD_PIC",
FALSE, 0, 0x00000000, FALSE),
};
bfd_vma base_end;
/* If there aren't any relocs, then there's nothing more
- to do. */
+ to do. */
if ((isec->flags & SEC_ALLOC) == 0
|| (isec->flags & SEC_RELOC) == 0
|| isec->reloc_count == 0)
return FALSE;
/* 1 quadword can contain up to 4 R_SPU_ADDR32
- relocations. They are stored in a single word by
- saving the upper 28 bits of the address and setting the
- lower 4 bits to a bit mask of the words that have the
- relocation. BASE_END keeps track of the next quadword. */
+ relocations. They are stored in a single word by
+ saving the upper 28 bits of the address and setting the
+ lower 4 bits to a bit mask of the words that have the
+ relocation. BASE_END keeps track of the next quadword. */
irela = internal_relocs;
irelaend = irela + isec->reloc_count;
base_end = 0;
#define ELF_MACHINE_CODE EM_SPU
/* This matches the alignment need for DMA. */
#define ELF_MAXPAGESIZE 0x80
-#define elf_backend_rela_normal 1
+#define elf_backend_rela_normal 1
#define elf_backend_can_gc_sections 1
#define bfd_elf32_bfd_reloc_type_lookup spu_elf_reloc_type_lookup
#define elf_backend_additional_program_headers spu_elf_additional_program_headers
#define elf_backend_modify_segment_map spu_elf_modify_segment_map
#define elf_backend_modify_program_headers spu_elf_modify_program_headers
-#define elf_backend_post_process_headers spu_elf_post_process_headers
+#define elf_backend_post_process_headers spu_elf_post_process_headers
#define elf_backend_fake_sections spu_elf_fake_sections
#define elf_backend_special_sections spu_elf_special_sections
#define bfd_elf32_bfd_final_link spu_elf_final_link
/* 32-bit ELF support for TI C6X
Copyright (C) 2010-2017 Free Software Foundation, Inc.
Contributed by Joseph Myers <joseph@codesourcery.com>
- Bernd Schmidt <bernds@codesourcery.com>
+ Bernd Schmidt <bernds@codesourcery.com>
This file is part of BFD, the Binary File Descriptor library.
asection *srela;
/* This symbol has an entry in the global offset table.
- Set it up. */
+ Set it up. */
sgot = htab->elf.sgot;
srela = htab->elf.srelgot;
BFD_ASSERT (sgot != NULL && srela != NULL);
/* If this is a -Bsymbolic link, and the symbol is defined
- locally, we just want to emit a RELATIVE reloc. Likewise if
- the symbol was forced to be local because of a version file.
- The entry in the global offset table will already have been
- initialized in the relocate_section function. */
+ locally, we just want to emit a RELATIVE reloc. Likewise if
+ the symbol was forced to be local because of a version file.
+ The entry in the global offset table will already have been
+ initialized in the relocate_section function. */
if (bfd_link_pic (info)
&& (SYMBOLIC_BIND (info, h)
|| h->dynindx == -1 || h->forced_local) && h->def_regular)
{
case SHN_TIC6X_SCOMMON:
if (tic6x_elf_scom_section.name == NULL)
- {
- /* Initialize the small common section. */
- tic6x_elf_scom_section.name = ".scommon";
- tic6x_elf_scom_section.flags = SEC_IS_COMMON;
- tic6x_elf_scom_section.output_section = &tic6x_elf_scom_section;
- tic6x_elf_scom_section.symbol = &tic6x_elf_scom_symbol;
- tic6x_elf_scom_section.symbol_ptr_ptr = &tic6x_elf_scom_symbol_ptr;
- tic6x_elf_scom_symbol.name = ".scommon";
- tic6x_elf_scom_symbol.flags = BSF_SECTION_SYM;
- tic6x_elf_scom_symbol.section = &tic6x_elf_scom_section;
- tic6x_elf_scom_symbol_ptr = &tic6x_elf_scom_symbol;
- }
+ {
+ /* Initialize the small common section. */
+ tic6x_elf_scom_section.name = ".scommon";
+ tic6x_elf_scom_section.flags = SEC_IS_COMMON;
+ tic6x_elf_scom_section.output_section = &tic6x_elf_scom_section;
+ tic6x_elf_scom_section.symbol = &tic6x_elf_scom_symbol;
+ tic6x_elf_scom_section.symbol_ptr_ptr = &tic6x_elf_scom_symbol_ptr;
+ tic6x_elf_scom_symbol.name = ".scommon";
+ tic6x_elf_scom_symbol.flags = BSF_SECTION_SYM;
+ tic6x_elf_scom_symbol.section = &tic6x_elf_scom_section;
+ tic6x_elf_scom_symbol_ptr = &tic6x_elf_scom_symbol;
+ }
asym->section = &tic6x_elf_scom_section;
asym->value = elfsym->internal_elf_sym.st_size;
break;
1. Regions without unwind data are marked with EXIDX_CANTUNWIND entries.
2. Duplicate entries are merged together (EXIDX_CANTUNWIND, or unwind
- codes which have been inlined into the index).
+ codes which have been inlined into the index).
If MERGE_EXIDX_ENTRIES is false, duplicate entries are not merged.
asection *sec;
for (sec = inp->sections; sec != NULL; sec = sec->next)
- {
+ {
struct bfd_elf_section_data *elf_sec = elf_section_data (sec);
Elf_Internal_Shdr *hdr = &elf_sec->this_hdr;
if (elf_sec->linked_to)
{
Elf_Internal_Shdr *linked_hdr
- = &elf_section_data (elf_sec->linked_to)->this_hdr;
+ = &elf_section_data (elf_sec->linked_to)->this_hdr;
struct _tic6x_elf_section_data *linked_sec_tic6x_data
- = get_tic6x_elf_section_data (linked_hdr->bfd_section);
+ = get_tic6x_elf_section_data (linked_hdr->bfd_section);
if (linked_sec_tic6x_data == NULL)
- continue;
+ continue;
/* Link this .c6xabi.exidx section back from the
text section it describes. */
asection *sec = text_section_order[i];
asection *exidx_sec;
struct _tic6x_elf_section_data *tic6x_data
- = get_tic6x_elf_section_data (sec);
+ = get_tic6x_elf_section_data (sec);
struct _tic6x_elf_section_data *exidx_data;
bfd_byte *contents = NULL;
int deleted_exidx_bytes = 0;
bfd *ibfd;
if (tic6x_data == NULL)
- continue;
+ continue;
exidx_sec = tic6x_data->u.text.tic6x_exidx_sec;
if (exidx_sec == NULL)
hdr = &elf_section_data (exidx_sec)->this_hdr;
if (hdr->sh_type != SHT_C6000_UNWIND)
- continue;
+ continue;
exidx_data = get_tic6x_elf_section_data (exidx_sec);
if (exidx_data == NULL)
- continue;
+ continue;
ibfd = exidx_sec->owner;
/* Free contents if we allocated it ourselves. */
if (contents != hdr->contents)
- free (contents);
+ free (contents);
/* Record edits to be applied later (in elf32_tic6x_write_section). */
exidx_data->u.exidx.unwind_edit_list = unwind_edit_head;
elf32_tic6x_create_dynamic_sections
#define elf_backend_adjust_dynamic_symbol \
elf32_tic6x_adjust_dynamic_symbol
-#define elf_backend_check_relocs elf32_tic6x_check_relocs
+#define elf_backend_check_relocs elf32_tic6x_check_relocs
#define elf_backend_add_symbol_hook elf32_tic6x_add_symbol_hook
#define elf_backend_symbol_processing elf32_tic6x_symbol_processing
#define elf_backend_link_output_symbol_hook \
#define ELF_MAXPAGESIZE 0x10000
#define ELF_COMMONPAGESIZE 0x10000
-#define TARGET_BIG_SYM tilegx_elf32_be_vec
-#define TARGET_BIG_NAME "elf32-tilegx-be"
-#define TARGET_LITTLE_SYM tilegx_elf32_le_vec
-#define TARGET_LITTLE_NAME "elf32-tilegx-le"
+#define TARGET_BIG_SYM tilegx_elf32_be_vec
+#define TARGET_BIG_NAME "elf32-tilegx-be"
+#define TARGET_LITTLE_SYM tilegx_elf32_le_vec
+#define TARGET_LITTLE_NAME "elf32-tilegx-le"
#define elf_backend_reloc_type_class tilegx_reloc_type_class
-#define bfd_elf32_bfd_reloc_name_lookup tilegx_reloc_name_lookup
+#define bfd_elf32_bfd_reloc_name_lookup tilegx_reloc_name_lookup
#define bfd_elf32_bfd_link_hash_table_create tilegx_elf_link_hash_table_create
#define bfd_elf32_bfd_reloc_type_lookup tilegx_reloc_type_lookup
#define bfd_elf32_bfd_merge_private_bfd_data \
#define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections
#define elf_backend_gc_mark_hook tilegx_elf_gc_mark_hook
#define elf_backend_plt_sym_val tilegx_elf_plt_sym_val
-#define elf_info_to_howto_rel NULL
-#define elf_info_to_howto tilegx_info_to_howto_rela
-#define elf_backend_grok_prstatus tilegx_elf_grok_prstatus
-#define elf_backend_grok_psinfo tilegx_elf_grok_psinfo
+#define elf_info_to_howto_rel NULL
+#define elf_info_to_howto tilegx_info_to_howto_rela
+#define elf_backend_grok_prstatus tilegx_elf_grok_prstatus
+#define elf_backend_grok_psinfo tilegx_elf_grok_psinfo
#define elf_backend_additional_program_headers tilegx_additional_program_headers
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
/* This file contains sizes and offsets of Linux data structures. */
-#define TILEGX_PRSTATUS_SIZEOF 592
+#define TILEGX_PRSTATUS_SIZEOF 592
#define TILEGX_PRSTATUS_OFFSET_PR_CURSIG 12
-#define TILEGX_PRSTATUS_OFFSET_PR_PID 24
-#define TILEGX_PRSTATUS_OFFSET_PR_REG 72
+#define TILEGX_PRSTATUS_OFFSET_PR_PID 24
+#define TILEGX_PRSTATUS_OFFSET_PR_REG 72
-#define TILEGX_PRPSINFO_SIZEOF 128
-#define TILEGX_PRPSINFO_OFFSET_PR_FNAME 32
+#define TILEGX_PRPSINFO_SIZEOF 128
+#define TILEGX_PRPSINFO_OFFSET_PR_FNAME 32
#define TILEGX_PRPSINFO_OFFSET_PR_PSARGS 48
-#define ELF_PR_PSARGS_SIZE 80
+#define ELF_PR_PSARGS_SIZE 80
-#define TILEGX_GREGSET_T_SIZE 512
+#define TILEGX_GREGSET_T_SIZE 512
#endif /* _ELF32_TILEGX_H */
FALSE, /* partial_inplace */
0, /* src_mask */
-1, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
HOWTO (R_TILEPRO_JOFFLONG_X1_PLT, /* type */
TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES, /* rightshift */
FALSE, /* partial_inplace */
0, /* src_mask */
-1, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
#define TILEPRO_IMM_HOWTO(name, size, bitsize) \
HOWTO (name, 0, size, bitsize, FALSE, 0, \
- complain_overflow_signed, bfd_elf_generic_reloc, \
- #name, FALSE, 0, -1, FALSE)
+ complain_overflow_signed, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, -1, FALSE)
#define TILEPRO_UIMM_HOWTO(name, size, bitsize) \
HOWTO (name, 0, size, bitsize, FALSE, 0, \
- complain_overflow_unsigned, bfd_elf_generic_reloc, \
- #name, FALSE, 0, -1, FALSE)
+ complain_overflow_unsigned, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, -1, FALSE)
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_X0, 0, 8),
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_Y0, 0, 8),
#define TILEPRO_IMM16_HOWTO(name, rshift) \
HOWTO (name, rshift, 1, 16, FALSE, 0, \
- complain_overflow_dont, bfd_elf_generic_reloc, \
- #name, FALSE, 0, 0xffff, FALSE)
+ complain_overflow_dont, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, 0xffff, FALSE)
TILEPRO_IMM16_HOWTO (R_TILEPRO_IMM16_X0_LO, 0),
TILEPRO_IMM16_HOWTO (R_TILEPRO_IMM16_X1_LO, 0),
#define TILEPRO_IMM16_HOWTO_PCREL(name, rshift) \
HOWTO (name, rshift, 1, 16, TRUE, 0, \
- complain_overflow_dont, bfd_elf_generic_reloc, \
- #name, FALSE, 0, 0xffff, TRUE)
+ complain_overflow_dont, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, 0xffff, TRUE)
TILEPRO_IMM16_HOWTO_PCREL (R_TILEPRO_IMM16_X0_LO_PCREL, 0),
TILEPRO_IMM16_HOWTO_PCREL (R_TILEPRO_IMM16_X1_LO_PCREL, 0),
FALSE, /* partial_inplace */
0, /* src_mask */
-1, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_X0_TLS_GD_ADD, 0, 8),
TILEPRO_IMM_HOWTO(R_TILEPRO_IMM8_X1_TLS_GD_ADD, 0, 8),
/* These are common with the Solaris TLS implementation. */
HOWTO(R_TILEPRO_TLS_DTPMOD32, 0, 0, 0, FALSE, 0, complain_overflow_dont,
- bfd_elf_generic_reloc, "R_TILEPRO_TLS_DTPMOD32",
- FALSE, 0, 0, TRUE),
+ bfd_elf_generic_reloc, "R_TILEPRO_TLS_DTPMOD32",
+ FALSE, 0, 0, TRUE),
HOWTO(R_TILEPRO_TLS_DTPOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_TILEPRO_TLS_DTPOFF32",
- FALSE, 0, 0xFFFFFFFF, TRUE),
+ bfd_elf_generic_reloc, "R_TILEPRO_TLS_DTPOFF32",
+ FALSE, 0, 0xFFFFFFFF, TRUE),
HOWTO(R_TILEPRO_TLS_TPOFF32, 0, 0, 0, FALSE, 0, complain_overflow_dont,
- bfd_elf_generic_reloc, "R_TILEPRO_TLS_TPOFF32",
- FALSE, 0, 0, TRUE),
+ bfd_elf_generic_reloc, "R_TILEPRO_TLS_TPOFF32",
+ FALSE, 0, 0, TRUE),
HOWTO (R_TILEPRO_IMM16_X0_TLS_LE,/* type */
0, /* rightshift */
{
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_TILEPRO_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_TILEPRO_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_TILEPRO_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage */
- HOWTO (R_TILEPRO_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_TILEPRO_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_TILEPRO_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_TILEPRO_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
\f
typedef struct tilepro_reloc_map
{
bfd_reloc_code_real_type bfd_reloc_val;
- unsigned int tilepro_reloc_val;
- reloc_howto_type * table;
+ unsigned int tilepro_reloc_val;
+ reloc_howto_type * table;
} reloc_map;
static const reloc_map tilepro_reloc_map [] =
{ bfd, tilepro, tilepro_elf_howto_table },
/* Standard relocations. */
- TH_REMAP (BFD_RELOC_NONE, R_TILEPRO_NONE)
- TH_REMAP (BFD_RELOC_32, R_TILEPRO_32)
- TH_REMAP (BFD_RELOC_16, R_TILEPRO_16)
- TH_REMAP (BFD_RELOC_8, R_TILEPRO_8)
- TH_REMAP (BFD_RELOC_32_PCREL, R_TILEPRO_32_PCREL)
- TH_REMAP (BFD_RELOC_16_PCREL, R_TILEPRO_16_PCREL)
- TH_REMAP (BFD_RELOC_8_PCREL, R_TILEPRO_8_PCREL)
- TH_REMAP (BFD_RELOC_LO16, R_TILEPRO_LO16)
- TH_REMAP (BFD_RELOC_HI16, R_TILEPRO_HI16)
- TH_REMAP (BFD_RELOC_HI16_S, R_TILEPRO_HA16)
+ TH_REMAP (BFD_RELOC_NONE, R_TILEPRO_NONE)
+ TH_REMAP (BFD_RELOC_32, R_TILEPRO_32)
+ TH_REMAP (BFD_RELOC_16, R_TILEPRO_16)
+ TH_REMAP (BFD_RELOC_8, R_TILEPRO_8)
+ TH_REMAP (BFD_RELOC_32_PCREL, R_TILEPRO_32_PCREL)
+ TH_REMAP (BFD_RELOC_16_PCREL, R_TILEPRO_16_PCREL)
+ TH_REMAP (BFD_RELOC_8_PCREL, R_TILEPRO_8_PCREL)
+ TH_REMAP (BFD_RELOC_LO16, R_TILEPRO_LO16)
+ TH_REMAP (BFD_RELOC_HI16, R_TILEPRO_HI16)
+ TH_REMAP (BFD_RELOC_HI16_S, R_TILEPRO_HA16)
/* Custom relocations. */
- TH_REMAP (BFD_RELOC_TILEPRO_COPY, R_TILEPRO_COPY)
- TH_REMAP (BFD_RELOC_TILEPRO_GLOB_DAT, R_TILEPRO_GLOB_DAT)
- TH_REMAP (BFD_RELOC_TILEPRO_JMP_SLOT, R_TILEPRO_JMP_SLOT)
- TH_REMAP (BFD_RELOC_TILEPRO_RELATIVE, R_TILEPRO_RELATIVE)
- TH_REMAP (BFD_RELOC_TILEPRO_BROFF_X1, R_TILEPRO_BROFF_X1)
+ TH_REMAP (BFD_RELOC_TILEPRO_COPY, R_TILEPRO_COPY)
+ TH_REMAP (BFD_RELOC_TILEPRO_GLOB_DAT, R_TILEPRO_GLOB_DAT)
+ TH_REMAP (BFD_RELOC_TILEPRO_JMP_SLOT, R_TILEPRO_JMP_SLOT)
+ TH_REMAP (BFD_RELOC_TILEPRO_RELATIVE, R_TILEPRO_RELATIVE)
+ TH_REMAP (BFD_RELOC_TILEPRO_BROFF_X1, R_TILEPRO_BROFF_X1)
TH_REMAP (BFD_RELOC_TILEPRO_JOFFLONG_X1, R_TILEPRO_JOFFLONG_X1)
TH_REMAP (BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT, R_TILEPRO_JOFFLONG_X1_PLT)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X0, R_TILEPRO_IMM8_X0)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y0, R_TILEPRO_IMM8_Y0)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X1, R_TILEPRO_IMM8_X1)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y1, R_TILEPRO_IMM8_Y1)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X0, R_TILEPRO_IMM8_X0)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y0, R_TILEPRO_IMM8_Y0)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X1, R_TILEPRO_IMM8_X1)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y1, R_TILEPRO_IMM8_Y1)
TH_REMAP (BFD_RELOC_TILEPRO_DEST_IMM8_X1, R_TILEPRO_DEST_IMM8_X1)
TH_REMAP (BFD_RELOC_TILEPRO_MT_IMM15_X1, R_TILEPRO_MT_IMM15_X1)
TH_REMAP (BFD_RELOC_TILEPRO_MF_IMM15_X1, R_TILEPRO_MF_IMM15_X1)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0, R_TILEPRO_IMM16_X0)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1, R_TILEPRO_IMM16_X1)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0, R_TILEPRO_IMM16_X0)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1, R_TILEPRO_IMM16_X1)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_LO, R_TILEPRO_IMM16_X0_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_LO, R_TILEPRO_IMM16_X1_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_HI, R_TILEPRO_IMM16_X0_HI)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_HA, R_TILEPRO_IMM16_X0_HA)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_HA, R_TILEPRO_IMM16_X1_HA)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_PCREL, R_TILEPRO_IMM16_X0_PCREL)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_PCREL, R_TILEPRO_IMM16_X1_PCREL)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_PCREL, R_TILEPRO_IMM16_X0_PCREL)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_PCREL, R_TILEPRO_IMM16_X1_PCREL)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL, R_TILEPRO_IMM16_X0_LO_PCREL)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL, R_TILEPRO_IMM16_X1_LO_PCREL)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL, R_TILEPRO_IMM16_X0_HI_PCREL)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA, R_TILEPRO_IMM16_X1_GOT_HA)
TH_REMAP (BFD_RELOC_TILEPRO_MMSTART_X0, R_TILEPRO_MMSTART_X0)
- TH_REMAP (BFD_RELOC_TILEPRO_MMEND_X0, R_TILEPRO_MMEND_X0)
+ TH_REMAP (BFD_RELOC_TILEPRO_MMEND_X0, R_TILEPRO_MMEND_X0)
TH_REMAP (BFD_RELOC_TILEPRO_MMSTART_X1, R_TILEPRO_MMSTART_X1)
- TH_REMAP (BFD_RELOC_TILEPRO_MMEND_X1, R_TILEPRO_MMEND_X1)
- TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_X0, R_TILEPRO_SHAMT_X0)
- TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_X1, R_TILEPRO_SHAMT_X1)
- TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_Y0, R_TILEPRO_SHAMT_Y0)
- TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_Y1, R_TILEPRO_SHAMT_Y1)
+ TH_REMAP (BFD_RELOC_TILEPRO_MMEND_X1, R_TILEPRO_MMEND_X1)
+ TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_X0, R_TILEPRO_SHAMT_X0)
+ TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_X1, R_TILEPRO_SHAMT_X1)
+ TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_Y0, R_TILEPRO_SHAMT_Y0)
+ TH_REMAP (BFD_RELOC_TILEPRO_SHAMT_Y1, R_TILEPRO_SHAMT_Y1)
- TH_REMAP (BFD_RELOC_TILEPRO_TLS_GD_CALL, R_TILEPRO_TLS_GD_CALL)
+ TH_REMAP (BFD_RELOC_TILEPRO_TLS_GD_CALL, R_TILEPRO_TLS_GD_CALL)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD, R_TILEPRO_IMM8_X0_TLS_GD_ADD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD, R_TILEPRO_IMM8_X1_TLS_GD_ADD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD, R_TILEPRO_IMM8_Y0_TLS_GD_ADD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD, R_TILEPRO_IMM8_Y1_TLS_GD_ADD)
- TH_REMAP (BFD_RELOC_TILEPRO_TLS_IE_LOAD, R_TILEPRO_TLS_IE_LOAD)
+ TH_REMAP (BFD_RELOC_TILEPRO_TLS_IE_LOAD, R_TILEPRO_TLS_IE_LOAD)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD, R_TILEPRO_IMM16_X0_TLS_GD)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD, R_TILEPRO_IMM16_X1_TLS_GD)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD, R_TILEPRO_IMM16_X0_TLS_GD)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD, R_TILEPRO_IMM16_X1_TLS_GD)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO, R_TILEPRO_IMM16_X0_TLS_GD_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO, R_TILEPRO_IMM16_X1_TLS_GD_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI, R_TILEPRO_IMM16_X0_TLS_GD_HI)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA, R_TILEPRO_IMM16_X0_TLS_GD_HA)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA, R_TILEPRO_IMM16_X1_TLS_GD_HA)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE, R_TILEPRO_IMM16_X0_TLS_IE)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE, R_TILEPRO_IMM16_X1_TLS_IE)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE, R_TILEPRO_IMM16_X0_TLS_IE)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE, R_TILEPRO_IMM16_X1_TLS_IE)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO, R_TILEPRO_IMM16_X0_TLS_IE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO, R_TILEPRO_IMM16_X1_TLS_IE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI, R_TILEPRO_IMM16_X0_TLS_IE_HI)
TH_REMAP (BFD_RELOC_TILEPRO_TLS_DTPOFF32, R_TILEPRO_TLS_DTPOFF32)
TH_REMAP (BFD_RELOC_TILEPRO_TLS_TPOFF32, R_TILEPRO_TLS_TPOFF32)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE, R_TILEPRO_IMM16_X0_TLS_LE)
- TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE, R_TILEPRO_IMM16_X1_TLS_LE)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE, R_TILEPRO_IMM16_X0_TLS_LE)
+ TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE, R_TILEPRO_IMM16_X1_TLS_LE)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO, R_TILEPRO_IMM16_X0_TLS_LE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO, R_TILEPRO_IMM16_X1_TLS_LE_LO)
TH_REMAP (BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI, R_TILEPRO_IMM16_X0_TLS_LE_HI)
static reloc_howto_type *
tilepro_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
unsigned int i;
for (i = 0;
i < (sizeof (tilepro_elf_howto_table)
- / sizeof (tilepro_elf_howto_table[0]));
+ / sizeof (tilepro_elf_howto_table[0]));
i++)
if (tilepro_elf_howto_table[i].name != NULL
- && strcasecmp (tilepro_elf_howto_table[i].name, r_name) == 0)
+ && strcasecmp (tilepro_elf_howto_table[i].name, r_name) == 0)
return &tilepro_elf_howto_table[i];
return NULL;
static void
tilepro_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED,
- arelent * cache_ptr,
- Elf_Internal_Rela * dst)
+ arelent * cache_ptr,
+ Elf_Internal_Rela * dst)
{
unsigned int r_type = ELF32_R_TYPE (dst->r_info);
/* The procedure linkage table starts with the following header:
{
- rli r29, r29, 16
+ rli r29, r29, 16
lwadd r28, r27, 4
}
- lw r27, r27
+ lw r27, r27
{
- info 10 ## SP not offset, return PC in LR
- jr r27
+ info 10 ## SP not offset, return PC in LR
+ jr r27
}
Subsequent entries are the following, jumping to the header at the end:
- lnk r28
+ lnk r28
1:
{
auli r28, r28, <_GLOBAL_OFFSET_TABLE_ - 1b + MY_GOT_OFFSET>
}
{
auli r29, zero, MY_PLT_INDEX
- lw r28, r28
+ lw r28, r28
}
{
- info 10 ## SP not offset, return PC in LR
- jr r28
+ info 10 ## SP not offset, return PC in LR
+ jr r28
}
We initially store MY_PLT_INDEX in the high bits so that we can use the all
if (entry == NULL)
{
entry =
- bfd_hash_allocate (table,
- sizeof (struct tilepro_elf_link_hash_entry));
+ bfd_hash_allocate (table,
+ sizeof (struct tilepro_elf_link_hash_entry));
if (entry == NULL)
return entry;
}
r_type = tilepro_elf_tls_transition (info, r_type, h == NULL);
switch (r_type)
{
- case R_TILEPRO_IMM16_X0_TLS_LE:
- case R_TILEPRO_IMM16_X1_TLS_LE:
- case R_TILEPRO_IMM16_X0_TLS_LE_LO:
- case R_TILEPRO_IMM16_X1_TLS_LE_LO:
- case R_TILEPRO_IMM16_X0_TLS_LE_HI:
- case R_TILEPRO_IMM16_X1_TLS_LE_HI:
- case R_TILEPRO_IMM16_X0_TLS_LE_HA:
- case R_TILEPRO_IMM16_X1_TLS_LE_HA:
+ case R_TILEPRO_IMM16_X0_TLS_LE:
+ case R_TILEPRO_IMM16_X1_TLS_LE:
+ case R_TILEPRO_IMM16_X0_TLS_LE_LO:
+ case R_TILEPRO_IMM16_X1_TLS_LE_LO:
+ case R_TILEPRO_IMM16_X0_TLS_LE_HI:
+ case R_TILEPRO_IMM16_X1_TLS_LE_HI:
+ case R_TILEPRO_IMM16_X0_TLS_LE_HA:
+ case R_TILEPRO_IMM16_X1_TLS_LE_HA:
if (!bfd_link_executable (info))
goto r_tilepro_plt32;
break;
- case R_TILEPRO_IMM16_X0_TLS_GD:
- case R_TILEPRO_IMM16_X1_TLS_GD:
- case R_TILEPRO_IMM16_X0_TLS_GD_LO:
- case R_TILEPRO_IMM16_X1_TLS_GD_LO:
- case R_TILEPRO_IMM16_X0_TLS_GD_HI:
- case R_TILEPRO_IMM16_X1_TLS_GD_HI:
- case R_TILEPRO_IMM16_X0_TLS_GD_HA:
- case R_TILEPRO_IMM16_X1_TLS_GD_HA:
+ case R_TILEPRO_IMM16_X0_TLS_GD:
+ case R_TILEPRO_IMM16_X1_TLS_GD:
+ case R_TILEPRO_IMM16_X0_TLS_GD_LO:
+ case R_TILEPRO_IMM16_X1_TLS_GD_LO:
+ case R_TILEPRO_IMM16_X0_TLS_GD_HI:
+ case R_TILEPRO_IMM16_X1_TLS_GD_HI:
+ case R_TILEPRO_IMM16_X0_TLS_GD_HA:
+ case R_TILEPRO_IMM16_X1_TLS_GD_HA:
BFD_ASSERT (bfd_link_pic (info));
tls_type = GOT_TLS_GD;
- goto have_got_reference;
-
- case R_TILEPRO_IMM16_X0_TLS_IE:
- case R_TILEPRO_IMM16_X1_TLS_IE:
- case R_TILEPRO_IMM16_X0_TLS_IE_LO:
- case R_TILEPRO_IMM16_X1_TLS_IE_LO:
- case R_TILEPRO_IMM16_X0_TLS_IE_HI:
- case R_TILEPRO_IMM16_X1_TLS_IE_HI:
- case R_TILEPRO_IMM16_X0_TLS_IE_HA:
- case R_TILEPRO_IMM16_X1_TLS_IE_HA:
- tls_type = GOT_TLS_IE;
- if (!bfd_link_executable (info))
- info->flags |= DF_STATIC_TLS;
- goto have_got_reference;
-
- case R_TILEPRO_IMM16_X0_GOT:
- case R_TILEPRO_IMM16_X1_GOT:
- case R_TILEPRO_IMM16_X0_GOT_LO:
- case R_TILEPRO_IMM16_X1_GOT_LO:
- case R_TILEPRO_IMM16_X0_GOT_HI:
- case R_TILEPRO_IMM16_X1_GOT_HI:
- case R_TILEPRO_IMM16_X0_GOT_HA:
- case R_TILEPRO_IMM16_X1_GOT_HA:
- tls_type = GOT_NORMAL;
- /* Fall Through */
-
- have_got_reference:
+ goto have_got_reference;
+
+ case R_TILEPRO_IMM16_X0_TLS_IE:
+ case R_TILEPRO_IMM16_X1_TLS_IE:
+ case R_TILEPRO_IMM16_X0_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X1_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HA:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HA:
+ tls_type = GOT_TLS_IE;
+ if (!bfd_link_executable (info))
+ info->flags |= DF_STATIC_TLS;
+ goto have_got_reference;
+
+ case R_TILEPRO_IMM16_X0_GOT:
+ case R_TILEPRO_IMM16_X1_GOT:
+ case R_TILEPRO_IMM16_X0_GOT_LO:
+ case R_TILEPRO_IMM16_X1_GOT_LO:
+ case R_TILEPRO_IMM16_X0_GOT_HI:
+ case R_TILEPRO_IMM16_X1_GOT_HI:
+ case R_TILEPRO_IMM16_X0_GOT_HA:
+ case R_TILEPRO_IMM16_X1_GOT_HA:
+ tls_type = GOT_NORMAL;
+ /* Fall Through */
+
+ have_got_reference:
/* This symbol requires a global offset table entry. */
{
- int old_tls_type;
+ int old_tls_type;
if (h != NULL)
{
break;
/* Fall through */
- case R_TILEPRO_JOFFLONG_X1_PLT:
+ case R_TILEPRO_JOFFLONG_X1_PLT:
/* This symbol requires a procedure linkage table entry. We
actually build the entry in adjust_dynamic_symbol,
because this might be a case of linking PIC code without
need to generate a procedure linkage table after all. */
if (h != NULL)
- {
- h->needs_plt = 1;
- h->plt.refcount += 1;
- }
+ {
+ h->needs_plt = 1;
+ h->plt.refcount += 1;
+ }
break;
- case R_TILEPRO_32_PCREL:
- case R_TILEPRO_16_PCREL:
- case R_TILEPRO_8_PCREL:
- case R_TILEPRO_IMM16_X0_PCREL:
- case R_TILEPRO_IMM16_X1_PCREL:
- case R_TILEPRO_IMM16_X0_LO_PCREL:
- case R_TILEPRO_IMM16_X1_LO_PCREL:
- case R_TILEPRO_IMM16_X0_HI_PCREL:
- case R_TILEPRO_IMM16_X1_HI_PCREL:
- case R_TILEPRO_IMM16_X0_HA_PCREL:
- case R_TILEPRO_IMM16_X1_HA_PCREL:
+ case R_TILEPRO_32_PCREL:
+ case R_TILEPRO_16_PCREL:
+ case R_TILEPRO_8_PCREL:
+ case R_TILEPRO_IMM16_X0_PCREL:
+ case R_TILEPRO_IMM16_X1_PCREL:
+ case R_TILEPRO_IMM16_X0_LO_PCREL:
+ case R_TILEPRO_IMM16_X1_LO_PCREL:
+ case R_TILEPRO_IMM16_X0_HI_PCREL:
+ case R_TILEPRO_IMM16_X1_HI_PCREL:
+ case R_TILEPRO_IMM16_X0_HA_PCREL:
+ case R_TILEPRO_IMM16_X1_HA_PCREL:
if (h != NULL)
h->non_got_ref = 1;
break;
/* Fall through. */
- case R_TILEPRO_32:
- case R_TILEPRO_16:
- case R_TILEPRO_8:
- case R_TILEPRO_LO16:
- case R_TILEPRO_HI16:
- case R_TILEPRO_HA16:
- case R_TILEPRO_COPY:
- case R_TILEPRO_GLOB_DAT:
- case R_TILEPRO_JMP_SLOT:
- case R_TILEPRO_RELATIVE:
- case R_TILEPRO_BROFF_X1:
- case R_TILEPRO_JOFFLONG_X1:
- case R_TILEPRO_IMM8_X0:
- case R_TILEPRO_IMM8_Y0:
- case R_TILEPRO_IMM8_X1:
- case R_TILEPRO_IMM8_Y1:
- case R_TILEPRO_DEST_IMM8_X1:
- case R_TILEPRO_MT_IMM15_X1:
- case R_TILEPRO_MF_IMM15_X1:
- case R_TILEPRO_IMM16_X0:
- case R_TILEPRO_IMM16_X1:
- case R_TILEPRO_IMM16_X0_LO:
- case R_TILEPRO_IMM16_X1_LO:
- case R_TILEPRO_IMM16_X0_HI:
- case R_TILEPRO_IMM16_X1_HI:
- case R_TILEPRO_IMM16_X0_HA:
- case R_TILEPRO_IMM16_X1_HA:
- case R_TILEPRO_MMSTART_X0:
- case R_TILEPRO_MMEND_X0:
- case R_TILEPRO_MMSTART_X1:
- case R_TILEPRO_MMEND_X1:
- case R_TILEPRO_SHAMT_X0:
- case R_TILEPRO_SHAMT_X1:
- case R_TILEPRO_SHAMT_Y0:
- case R_TILEPRO_SHAMT_Y1:
+ case R_TILEPRO_32:
+ case R_TILEPRO_16:
+ case R_TILEPRO_8:
+ case R_TILEPRO_LO16:
+ case R_TILEPRO_HI16:
+ case R_TILEPRO_HA16:
+ case R_TILEPRO_COPY:
+ case R_TILEPRO_GLOB_DAT:
+ case R_TILEPRO_JMP_SLOT:
+ case R_TILEPRO_RELATIVE:
+ case R_TILEPRO_BROFF_X1:
+ case R_TILEPRO_JOFFLONG_X1:
+ case R_TILEPRO_IMM8_X0:
+ case R_TILEPRO_IMM8_Y0:
+ case R_TILEPRO_IMM8_X1:
+ case R_TILEPRO_IMM8_Y1:
+ case R_TILEPRO_DEST_IMM8_X1:
+ case R_TILEPRO_MT_IMM15_X1:
+ case R_TILEPRO_MF_IMM15_X1:
+ case R_TILEPRO_IMM16_X0:
+ case R_TILEPRO_IMM16_X1:
+ case R_TILEPRO_IMM16_X0_LO:
+ case R_TILEPRO_IMM16_X1_LO:
+ case R_TILEPRO_IMM16_X0_HI:
+ case R_TILEPRO_IMM16_X1_HI:
+ case R_TILEPRO_IMM16_X0_HA:
+ case R_TILEPRO_IMM16_X1_HA:
+ case R_TILEPRO_MMSTART_X0:
+ case R_TILEPRO_MMEND_X0:
+ case R_TILEPRO_MMSTART_X1:
+ case R_TILEPRO_MMEND_X1:
+ case R_TILEPRO_SHAMT_X0:
+ case R_TILEPRO_SHAMT_X1:
+ case R_TILEPRO_SHAMT_Y0:
+ case R_TILEPRO_SHAMT_Y1:
if (h != NULL)
- h->non_got_ref = 1;
+ h->non_got_ref = 1;
r_tilepro_plt32:
if (h != NULL && !bfd_link_pic (info))
/* We may need a .plt entry if the function this reloc
refers to is in a shared lib. */
h->plt.refcount += 1;
- }
+ }
/* If we are creating a shared library, and this is a reloc
against a global symbol, or a non PC relative reloc
relocations we need for this symbol. */
if (h != NULL)
head =
- &((struct tilepro_elf_link_hash_entry *) h)->dyn_relocs;
+ &((struct tilepro_elf_link_hash_entry *) h)->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too.
\f
static asection *
tilepro_elf_gc_mark_hook (asection *sec,
- struct bfd_link_info *info,
- Elf_Internal_Rela *rel,
- struct elf_link_hash_entry *h,
- Elf_Internal_Sym *sym)
+ struct bfd_link_info *info,
+ Elf_Internal_Rela *rel,
+ struct elf_link_hash_entry *h,
+ Elf_Internal_Sym *sym)
{
if (h != NULL)
{
&& h->root.type == bfd_link_hash_undefweak))
{
/* This case can occur if we saw a R_TILEPRO_JOFFLONG_X1_PLT
- reloc in an input file, but the symbol was never referred
- to by a dynamic object, or if all references were garbage
- collected. In such a case, we don't actually need to build
- a procedure linkage table, and we can just do a
- R_TILEPRO_JOFFLONG_X1 relocation instead. */
+ reloc in an input file, but the symbol was never referred
+ to by a dynamic object, or if all references were garbage
+ collected. In such a case, we don't actually need to build
+ a procedure linkage table, and we can just do a
+ R_TILEPRO_JOFFLONG_X1 relocation instead. */
h->plt.offset = (bfd_vma) -1;
h->needs_plt = 0;
}
s->size = PLT_ENTRY_SIZE;
}
- h->plt.offset = s->size;
+ h->plt.offset = s->size;
/* If this symbol is not defined in a regular file, and we are
not generating a shared library, then set the symbol to this
FALSE, FALSE, FALSE);
/* Don't allocate .got.plt section if there are no GOT nor PLT
- entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. */
+ entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. */
if ((got == NULL
|| !got->ref_regular_nonweak)
&& (htab->elf.sgotplt->size
static bfd_boolean
tilepro_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
- bfd *input_bfd, asection *input_section,
- bfd_byte *contents, Elf_Internal_Rela *relocs,
- Elf_Internal_Sym *local_syms,
- asection **local_sections)
+ bfd *input_bfd, asection *input_section,
+ bfd_byte *contents, Elf_Internal_Rela *relocs,
+ Elf_Internal_Sym *local_syms,
+ asection **local_sections)
{
struct tilepro_elf_link_hash_table *htab;
Elf_Internal_Shdr *symtab_hdr;
switch (r_type)
{
- case R_TILEPRO_IMM16_X0_GOT:
- case R_TILEPRO_IMM16_X1_GOT:
- case R_TILEPRO_IMM16_X0_GOT_LO:
- case R_TILEPRO_IMM16_X1_GOT_LO:
- case R_TILEPRO_IMM16_X0_GOT_HI:
- case R_TILEPRO_IMM16_X1_GOT_HI:
- case R_TILEPRO_IMM16_X0_GOT_HA:
- case R_TILEPRO_IMM16_X1_GOT_HA:
+ case R_TILEPRO_IMM16_X0_GOT:
+ case R_TILEPRO_IMM16_X1_GOT:
+ case R_TILEPRO_IMM16_X0_GOT_LO:
+ case R_TILEPRO_IMM16_X1_GOT_LO:
+ case R_TILEPRO_IMM16_X0_GOT_HI:
+ case R_TILEPRO_IMM16_X1_GOT_HI:
+ case R_TILEPRO_IMM16_X0_GOT_HA:
+ case R_TILEPRO_IMM16_X1_GOT_HA:
/* Relocation is to the entry for this symbol in the global
offset table. */
if (htab->elf.sgot == NULL)
off = local_got_offsets[r_symndx];
/* The offset must always be a multiple of 4 on 32-bit.
- We use the least significant bit to record
+ We use the least significant bit to record
whether we have already processed this entry. */
if ((off & 1) != 0)
off &= ~1;
relocation = off - got_base;
break;
- case R_TILEPRO_JOFFLONG_X1_PLT:
+ case R_TILEPRO_JOFFLONG_X1_PLT:
/* Relocation is to the entry for this symbol in the
procedure linkage table. */
- BFD_ASSERT (h != NULL);
+ BFD_ASSERT (h != NULL);
if (h->plt.offset == (bfd_vma) -1 || htab->elf.splt == NULL)
{
unresolved_reloc = FALSE;
break;
- case R_TILEPRO_32_PCREL:
- case R_TILEPRO_16_PCREL:
- case R_TILEPRO_8_PCREL:
- case R_TILEPRO_IMM16_X0_PCREL:
- case R_TILEPRO_IMM16_X1_PCREL:
- case R_TILEPRO_IMM16_X0_LO_PCREL:
- case R_TILEPRO_IMM16_X1_LO_PCREL:
- case R_TILEPRO_IMM16_X0_HI_PCREL:
- case R_TILEPRO_IMM16_X1_HI_PCREL:
- case R_TILEPRO_IMM16_X0_HA_PCREL:
- case R_TILEPRO_IMM16_X1_HA_PCREL:
+ case R_TILEPRO_32_PCREL:
+ case R_TILEPRO_16_PCREL:
+ case R_TILEPRO_8_PCREL:
+ case R_TILEPRO_IMM16_X0_PCREL:
+ case R_TILEPRO_IMM16_X1_PCREL:
+ case R_TILEPRO_IMM16_X0_LO_PCREL:
+ case R_TILEPRO_IMM16_X1_LO_PCREL:
+ case R_TILEPRO_IMM16_X0_HI_PCREL:
+ case R_TILEPRO_IMM16_X1_HI_PCREL:
+ case R_TILEPRO_IMM16_X0_HA_PCREL:
+ case R_TILEPRO_IMM16_X1_HA_PCREL:
if (h != NULL
&& strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
break;
/* Fall through. */
- case R_TILEPRO_32:
- case R_TILEPRO_16:
- case R_TILEPRO_8:
- case R_TILEPRO_LO16:
- case R_TILEPRO_HI16:
- case R_TILEPRO_HA16:
- case R_TILEPRO_COPY:
- case R_TILEPRO_GLOB_DAT:
- case R_TILEPRO_JMP_SLOT:
- case R_TILEPRO_RELATIVE:
- case R_TILEPRO_BROFF_X1:
- case R_TILEPRO_JOFFLONG_X1:
- case R_TILEPRO_IMM8_X0:
- case R_TILEPRO_IMM8_Y0:
- case R_TILEPRO_IMM8_X1:
- case R_TILEPRO_IMM8_Y1:
- case R_TILEPRO_DEST_IMM8_X1:
- case R_TILEPRO_MT_IMM15_X1:
- case R_TILEPRO_MF_IMM15_X1:
- case R_TILEPRO_IMM16_X0:
- case R_TILEPRO_IMM16_X1:
- case R_TILEPRO_IMM16_X0_LO:
- case R_TILEPRO_IMM16_X1_LO:
- case R_TILEPRO_IMM16_X0_HI:
- case R_TILEPRO_IMM16_X1_HI:
- case R_TILEPRO_IMM16_X0_HA:
- case R_TILEPRO_IMM16_X1_HA:
- case R_TILEPRO_MMSTART_X0:
- case R_TILEPRO_MMEND_X0:
- case R_TILEPRO_MMSTART_X1:
- case R_TILEPRO_MMEND_X1:
- case R_TILEPRO_SHAMT_X0:
- case R_TILEPRO_SHAMT_X1:
- case R_TILEPRO_SHAMT_Y0:
- case R_TILEPRO_SHAMT_Y1:
+ case R_TILEPRO_32:
+ case R_TILEPRO_16:
+ case R_TILEPRO_8:
+ case R_TILEPRO_LO16:
+ case R_TILEPRO_HI16:
+ case R_TILEPRO_HA16:
+ case R_TILEPRO_COPY:
+ case R_TILEPRO_GLOB_DAT:
+ case R_TILEPRO_JMP_SLOT:
+ case R_TILEPRO_RELATIVE:
+ case R_TILEPRO_BROFF_X1:
+ case R_TILEPRO_JOFFLONG_X1:
+ case R_TILEPRO_IMM8_X0:
+ case R_TILEPRO_IMM8_Y0:
+ case R_TILEPRO_IMM8_X1:
+ case R_TILEPRO_IMM8_Y1:
+ case R_TILEPRO_DEST_IMM8_X1:
+ case R_TILEPRO_MT_IMM15_X1:
+ case R_TILEPRO_MF_IMM15_X1:
+ case R_TILEPRO_IMM16_X0:
+ case R_TILEPRO_IMM16_X1:
+ case R_TILEPRO_IMM16_X0_LO:
+ case R_TILEPRO_IMM16_X1_LO:
+ case R_TILEPRO_IMM16_X0_HI:
+ case R_TILEPRO_IMM16_X1_HI:
+ case R_TILEPRO_IMM16_X0_HA:
+ case R_TILEPRO_IMM16_X1_HA:
+ case R_TILEPRO_MMSTART_X0:
+ case R_TILEPRO_MMEND_X0:
+ case R_TILEPRO_MMSTART_X1:
+ case R_TILEPRO_MMEND_X1:
+ case R_TILEPRO_SHAMT_X0:
+ case R_TILEPRO_SHAMT_X1:
+ case R_TILEPRO_SHAMT_Y0:
+ case R_TILEPRO_SHAMT_Y1:
if ((input_section->flags & SEC_ALLOC) == 0)
break;
switch (r_type)
{
- case R_TILEPRO_32_PCREL:
- case R_TILEPRO_16_PCREL:
- case R_TILEPRO_8_PCREL:
+ case R_TILEPRO_32_PCREL:
+ case R_TILEPRO_16_PCREL:
+ case R_TILEPRO_8_PCREL:
/* If the symbol is not dynamic, we should not keep
a dynamic relocation. But an .rela.* slot has been
allocated for it, output R_TILEPRO_NONE.
}
break;
- case R_TILEPRO_IMM16_X0_TLS_LE:
- case R_TILEPRO_IMM16_X1_TLS_LE:
- case R_TILEPRO_IMM16_X0_TLS_LE_LO:
- case R_TILEPRO_IMM16_X1_TLS_LE_LO:
- case R_TILEPRO_IMM16_X0_TLS_LE_HI:
- case R_TILEPRO_IMM16_X1_TLS_LE_HI:
- case R_TILEPRO_IMM16_X0_TLS_LE_HA:
- case R_TILEPRO_IMM16_X1_TLS_LE_HA:
+ case R_TILEPRO_IMM16_X0_TLS_LE:
+ case R_TILEPRO_IMM16_X1_TLS_LE:
+ case R_TILEPRO_IMM16_X0_TLS_LE_LO:
+ case R_TILEPRO_IMM16_X1_TLS_LE_LO:
+ case R_TILEPRO_IMM16_X0_TLS_LE_HI:
+ case R_TILEPRO_IMM16_X1_TLS_LE_HI:
+ case R_TILEPRO_IMM16_X0_TLS_LE_HA:
+ case R_TILEPRO_IMM16_X1_TLS_LE_HA:
if (!bfd_link_executable (info))
{
Elf_Internal_Rela outrel;
relocation = tpoff (info, relocation);
break;
- case R_TILEPRO_IMM16_X0_TLS_GD:
- case R_TILEPRO_IMM16_X1_TLS_GD:
- case R_TILEPRO_IMM16_X0_TLS_GD_LO:
- case R_TILEPRO_IMM16_X1_TLS_GD_LO:
- case R_TILEPRO_IMM16_X0_TLS_GD_HI:
- case R_TILEPRO_IMM16_X1_TLS_GD_HI:
- case R_TILEPRO_IMM16_X0_TLS_GD_HA:
- case R_TILEPRO_IMM16_X1_TLS_GD_HA:
- case R_TILEPRO_IMM16_X0_TLS_IE:
- case R_TILEPRO_IMM16_X1_TLS_IE:
- case R_TILEPRO_IMM16_X0_TLS_IE_LO:
- case R_TILEPRO_IMM16_X1_TLS_IE_LO:
- case R_TILEPRO_IMM16_X0_TLS_IE_HI:
- case R_TILEPRO_IMM16_X1_TLS_IE_HI:
- case R_TILEPRO_IMM16_X0_TLS_IE_HA:
- case R_TILEPRO_IMM16_X1_TLS_IE_HA:
+ case R_TILEPRO_IMM16_X0_TLS_GD:
+ case R_TILEPRO_IMM16_X1_TLS_GD:
+ case R_TILEPRO_IMM16_X0_TLS_GD_LO:
+ case R_TILEPRO_IMM16_X1_TLS_GD_LO:
+ case R_TILEPRO_IMM16_X0_TLS_GD_HI:
+ case R_TILEPRO_IMM16_X1_TLS_GD_HI:
+ case R_TILEPRO_IMM16_X0_TLS_GD_HA:
+ case R_TILEPRO_IMM16_X1_TLS_GD_HA:
+ case R_TILEPRO_IMM16_X0_TLS_IE:
+ case R_TILEPRO_IMM16_X1_TLS_IE:
+ case R_TILEPRO_IMM16_X0_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X1_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HA:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HA:
r_type = tilepro_elf_tls_transition (info, r_type, h == NULL);
- tls_type = GOT_UNKNOWN;
+ tls_type = GOT_UNKNOWN;
if (h == NULL && local_got_offsets)
tls_type
= _bfd_tilepro_elf_local_got_tls_type (input_bfd) [r_symndx];
if (h != NULL)
{
- bfd_boolean dyn;
- dyn = htab->elf.dynamic_sections_created;
+ bfd_boolean dyn;
+ dyn = htab->elf.dynamic_sections_created;
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
bfd_link_pic (info),
}
/* The GOT entries have not been initialized yet. Do it
- now, and emit any relocations. */
+ now, and emit any relocations. */
if ((bfd_link_pic (info) || indx != 0)
&& (h == NULL
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak))
need_relocs = TRUE;
- switch (r_type)
- {
- case R_TILEPRO_IMM16_X0_TLS_IE:
- case R_TILEPRO_IMM16_X1_TLS_IE:
- case R_TILEPRO_IMM16_X0_TLS_IE_LO:
- case R_TILEPRO_IMM16_X1_TLS_IE_LO:
- case R_TILEPRO_IMM16_X0_TLS_IE_HI:
- case R_TILEPRO_IMM16_X1_TLS_IE_HI:
- case R_TILEPRO_IMM16_X0_TLS_IE_HA:
- case R_TILEPRO_IMM16_X1_TLS_IE_HA:
+ switch (r_type)
+ {
+ case R_TILEPRO_IMM16_X0_TLS_IE:
+ case R_TILEPRO_IMM16_X1_TLS_IE:
+ case R_TILEPRO_IMM16_X0_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X1_TLS_IE_LO:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HI:
+ case R_TILEPRO_IMM16_X0_TLS_IE_HA:
+ case R_TILEPRO_IMM16_X1_TLS_IE_HA:
if (need_relocs) {
- bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off);
- outrel.r_offset = (htab->elf.sgot->output_section->vma
+ bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off);
+ outrel.r_offset = (htab->elf.sgot->output_section->vma
+ htab->elf.sgot->output_offset + off);
- outrel.r_addend = 0;
+ outrel.r_addend = 0;
if (indx == 0)
- outrel.r_addend = relocation - dtpoff_base (info);
+ outrel.r_addend = relocation - dtpoff_base (info);
outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_TPOFF32);
tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot,
&outrel);
- } else {
+ } else {
bfd_put_32 (output_bfd, tpoff (info, relocation),
htab->elf.sgot->contents + off);
- }
- break;
+ }
+ break;
case R_TILEPRO_IMM16_X0_TLS_GD:
case R_TILEPRO_IMM16_X1_TLS_GD:
case R_TILEPRO_IMM16_X0_TLS_GD_HA:
case R_TILEPRO_IMM16_X1_TLS_GD_HA:
if (need_relocs) {
- outrel.r_offset = (htab->elf.sgot->output_section->vma
+ outrel.r_offset = (htab->elf.sgot->output_section->vma
+ htab->elf.sgot->output_offset + off);
- outrel.r_addend = 0;
- outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_DTPMOD32);
- bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off);
- tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot,
+ outrel.r_addend = 0;
+ outrel.r_info = ELF32_R_INFO (indx, R_TILEPRO_TLS_DTPMOD32);
+ bfd_put_32 (output_bfd, 0, htab->elf.sgot->contents + off);
+ tilepro_elf_append_rela_32 (output_bfd, htab->elf.srelgot,
&outrel);
if (indx == 0)
- {
- BFD_ASSERT (! unresolved_reloc);
- bfd_put_32 (output_bfd,
+ {
+ BFD_ASSERT (! unresolved_reloc);
+ bfd_put_32 (output_bfd,
relocation - dtpoff_base (info),
(htab->elf.sgot->contents + off +
TILEPRO_BYTES_PER_WORD));
- }
+ }
else
- {
- bfd_put_32 (output_bfd, 0,
+ {
+ bfd_put_32 (output_bfd, 0,
(htab->elf.sgot->contents + off +
TILEPRO_BYTES_PER_WORD));
- outrel.r_info = ELF32_R_INFO (indx,
+ outrel.r_info = ELF32_R_INFO (indx,
R_TILEPRO_TLS_DTPOFF32);
outrel.r_offset += TILEPRO_BYTES_PER_WORD;
- tilepro_elf_append_rela_32 (output_bfd,
+ tilepro_elf_append_rela_32 (output_bfd,
htab->elf.srelgot, &outrel);
- }
- }
+ }
+ }
else {
/* If we are not emitting relocations for a
- general dynamic reference, then we must be in a
- static link or an executable link with the
- symbol binding locally. Mark it as belonging
- to module 1, the executable. */
+ general dynamic reference, then we must be in a
+ static link or an executable link with the
+ symbol binding locally. Mark it as belonging
+ to module 1, the executable. */
bfd_put_32 (output_bfd, 1,
htab->elf.sgot->contents + off );
bfd_put_32 (output_bfd, relocation - dtpoff_base (info),
htab->elf.sgot->contents + off +
TILEPRO_BYTES_PER_WORD);
}
- break;
- }
+ break;
+ }
}
if (off >= (bfd_vma) -2)
case R_TILEPRO_IMM16_X1_TLS_GD_HA:
case R_TILEPRO_IMM16_X0_TLS_IE_HA:
case R_TILEPRO_IMM16_X1_TLS_IE_HA:
- relocation += 0x8000;
- break;
+ relocation += 0x8000;
+ break;
}
/* Get the operand creation function, if any. */
create_func = reloc_to_create_func[r_type];
if (create_func == NULL)
{
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, rel->r_addend);
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset,
+ relocation, rel->r_addend);
}
else
{
- if (howto->pc_relative)
- {
- relocation -=
- input_section->output_section->vma + input_section->output_offset;
- if (howto->pcrel_offset)
- relocation -= rel->r_offset;
- }
-
- bfd_byte *data;
-
- /* Add the relocation addend if any to the final target value */
- relocation += rel->r_addend;
-
- /* Do basic range checking */
- r = bfd_check_overflow (howto->complain_on_overflow,
- howto->bitsize,
- howto->rightshift,
- 32,
- relocation);
-
- /*
- * Write the relocated value out into the raw section data.
- * Don't put a relocation out in the .rela section.
- */
- tilepro_bundle_bits mask = create_func(-1);
- tilepro_bundle_bits value = create_func(relocation >> howto->rightshift);
-
- /* Only touch bytes while the mask is not 0, so we
- don't write to out of bounds memory if this is actually
- a 16-bit switch instruction. */
- for (data = contents + rel->r_offset; mask != 0; data++)
- {
- bfd_byte byte_mask = (bfd_byte)mask;
- *data = (*data & ~byte_mask) | ((bfd_byte)value & byte_mask);
- mask >>= 8;
- value >>= 8;
- }
+ if (howto->pc_relative)
+ {
+ relocation -=
+ input_section->output_section->vma + input_section->output_offset;
+ if (howto->pcrel_offset)
+ relocation -= rel->r_offset;
+ }
+
+ bfd_byte *data;
+
+ /* Add the relocation addend if any to the final target value */
+ relocation += rel->r_addend;
+
+ /* Do basic range checking */
+ r = bfd_check_overflow (howto->complain_on_overflow,
+ howto->bitsize,
+ howto->rightshift,
+ 32,
+ relocation);
+
+ /*
+ * Write the relocated value out into the raw section data.
+ * Don't put a relocation out in the .rela section.
+ */
+ tilepro_bundle_bits mask = create_func(-1);
+ tilepro_bundle_bits value = create_func(relocation >> howto->rightshift);
+
+ /* Only touch bytes while the mask is not 0, so we
+ don't write to out of bounds memory if this is actually
+ a 16-bit switch instruction. */
+ for (data = contents + rel->r_offset; mask != 0; data++)
+ {
+ bfd_byte byte_mask = (bfd_byte)mask;
+ *data = (*data & ~byte_mask) | ((bfd_byte)value & byte_mask);
+ mask >>= 8;
+ value >>= 8;
+ }
}
if (r != bfd_reloc_ok)
static bfd_boolean
tilepro_elf_finish_dynamic_sections (bfd *output_bfd,
- struct bfd_link_info *info)
+ struct bfd_link_info *info)
{
bfd *dynobj;
asection *sdyn;
static bfd_vma
tilepro_elf_plt_sym_val (bfd_vma i, const asection *plt,
- const arelent *rel ATTRIBUTE_UNUSED)
+ const arelent *rel ATTRIBUTE_UNUSED)
{
return plt->vma + (i + 1) * PLT_ENTRY_SIZE;
}
static int
tilepro_additional_program_headers (bfd *abfd,
- struct bfd_link_info *info ATTRIBUTE_UNUSED)
+ struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
/* Each .intrpt section specified by the user adds another PT_LOAD
header since the sections are discontiguous. */
#define elf_backend_reloc_type_class tilepro_reloc_type_class
-#define bfd_elf32_bfd_reloc_name_lookup tilepro_reloc_name_lookup
+#define bfd_elf32_bfd_reloc_name_lookup tilepro_reloc_name_lookup
#define bfd_elf32_bfd_link_hash_table_create tilepro_elf_link_hash_table_create
#define bfd_elf32_bfd_reloc_type_lookup tilepro_reloc_type_lookup
#define elf_backend_finish_dynamic_sections tilepro_elf_finish_dynamic_sections
#define elf_backend_gc_mark_hook tilepro_elf_gc_mark_hook
#define elf_backend_plt_sym_val tilepro_elf_plt_sym_val
-#define elf_info_to_howto_rel NULL
-#define elf_info_to_howto tilepro_info_to_howto_rela
-#define elf_backend_grok_prstatus tilepro_elf_grok_prstatus
-#define elf_backend_grok_psinfo tilepro_elf_grok_psinfo
+#define elf_info_to_howto_rel NULL
+#define elf_info_to_howto tilepro_info_to_howto_rela
+#define elf_backend_grok_prstatus tilepro_elf_grok_prstatus
+#define elf_backend_grok_psinfo tilepro_elf_grok_psinfo
#define elf_backend_additional_program_headers tilepro_additional_program_headers
#define bfd_elf32_mkobject tilepro_elf_mkobject
/* This file contains sizes and offsets of Linux data structures. */
-#define TILEPRO_PRSTATUS_SIZEOF 332
+#define TILEPRO_PRSTATUS_SIZEOF 332
#define TILEPRO_PRSTATUS_OFFSET_PR_CURSIG 12
-#define TILEPRO_PRSTATUS_OFFSET_PR_PID 24
-#define TILEPRO_PRSTATUS_OFFSET_PR_REG 72
+#define TILEPRO_PRSTATUS_OFFSET_PR_PID 24
+#define TILEPRO_PRSTATUS_OFFSET_PR_REG 72
-#define TILEPRO_PRPSINFO_SIZEOF 128
+#define TILEPRO_PRPSINFO_SIZEOF 128
#define TILEPRO_PRPSINFO_OFFSET_PR_FNAME 32
#define TILEPRO_PRPSINFO_OFFSET_PR_PSARGS 48
-#define ELF_PR_PSARGS_SIZE 80
+#define ELF_PR_PSARGS_SIZE 80
-#define TILEPRO_GREGSET_T_SIZE 256
+#define TILEPRO_GREGSET_T_SIZE 256
#endif /* _ELF32_TILEPRO_H */
default:
break;
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_V850_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_V850_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries
are actually used. Record for later use during GC. */
- case R_V850_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
+ case R_V850_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
case R_V850_SDA_16_16_SPLIT_OFFSET:
case R_V850_SDA_16_16_OFFSET:
typedef struct hi16s_location
{
- bfd_vma addend;
- bfd_byte * address;
- unsigned long counter;
- bfd_boolean found;
+ bfd_vma addend;
+ bfd_byte * address;
+ unsigned long counter;
+ bfd_boolean found;
struct hi16s_location * next;
}
hi16s_location;
return bfd_reloc_overflow;
if (addend & 1)
- return bfd_reloc_dangerous;
+ return bfd_reloc_dangerous;
insn = (addend &~ (bfd_vma) 1) | (insn & 1);
break;
0xffff, /* Dst_mask. */
FALSE), /* PCrel_offset. */
- /* Simple 8bit reloc. */
+ /* Simple 8bit reloc. */
HOWTO (R_V850_8, /* Type. */
0, /* Rightshift. */
0, /* Size (0 = byte, 1 = short, 2 = long). */
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_V850_GNU_VTINHERIT, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 0, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 0, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
- NULL, /* Special_function. */
+ NULL, /* Special_function. */
"R_V850_GNU_VTINHERIT", /* Name. */
- FALSE, /* Partial_inplace. */
- 0, /* Src_mask. */
- 0, /* Dst_mask. */
- FALSE), /* PCrel_offset. */
+ FALSE, /* Partial_inplace. */
+ 0, /* Src_mask. */
+ 0, /* Dst_mask. */
+ FALSE), /* PCrel_offset. */
/* GNU extension to record C++ vtable member usage. */
- HOWTO (R_V850_GNU_VTENTRY, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 0, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (R_V850_GNU_VTENTRY, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 0, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
- _bfd_elf_rel_vtable_reloc_fn, /* Special_function. */
- "R_V850_GNU_VTENTRY", /* Name. */
- FALSE, /* Partial_inplace. */
- 0, /* Src_mask. */
- 0, /* Dst_mask. */
- FALSE), /* PCrel_offset. */
+ _bfd_elf_rel_vtable_reloc_fn, /* Special_function. */
+ "R_V850_GNU_VTENTRY", /* Name. */
+ FALSE, /* Partial_inplace. */
+ 0, /* Src_mask. */
+ 0, /* Dst_mask. */
+ FALSE), /* PCrel_offset. */
/* Indicates a .longcall pseudo-op. The compiler will generate a .longcall
pseudo-op when it finds a function call which can be relaxed. */
HOWTO (R_V850_LONGCALL, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
v850_elf_ignore_reloc, /* Special_function. */
- "R_V850_LONGCALL", /* Name. */
- FALSE, /* Partial_inplace. */
- 0, /* Src_mask. */
- 0, /* Dst_mask. */
- TRUE), /* PCrel_offset. */
+ "R_V850_LONGCALL", /* Name. */
+ FALSE, /* Partial_inplace. */
+ 0, /* Src_mask. */
+ 0, /* Dst_mask. */
+ TRUE), /* PCrel_offset. */
/* Indicates a .longjump pseudo-op. The compiler will generate a
.longjump pseudo-op when it finds a branch which can be relaxed. */
HOWTO (R_V850_LONGJUMP, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- TRUE, /* PC_relative. */
- 0, /* Bitpos. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ TRUE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
v850_elf_ignore_reloc, /* Special_function. */
- "R_V850_LONGJUMP", /* Name. */
- FALSE, /* Partial_inplace. */
- 0, /* Src_mask. */
- 0, /* Dst_mask. */
- TRUE), /* PCrel_offset. */
-
- HOWTO (R_V850_ALIGN, /* Type. */
- 0, /* Rightshift. */
- 1, /* Size (0 = byte, 1 = short, 2 = long). */
- 0, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ "R_V850_LONGJUMP", /* Name. */
+ FALSE, /* Partial_inplace. */
+ 0, /* Src_mask. */
+ 0, /* Dst_mask. */
+ TRUE), /* PCrel_offset. */
+
+ HOWTO (R_V850_ALIGN, /* Type. */
+ 0, /* Rightshift. */
+ 1, /* Size (0 = byte, 1 = short, 2 = long). */
+ 0, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_unsigned, /* Complain_on_overflow. */
v850_elf_ignore_reloc, /* Special_function. */
- "R_V850_ALIGN", /* Name. */
- FALSE, /* Partial_inplace. */
- 0, /* Src_mask. */
- 0, /* Dst_mask. */
- TRUE), /* PCrel_offset. */
+ "R_V850_ALIGN", /* Name. */
+ FALSE, /* Partial_inplace. */
+ 0, /* Src_mask. */
+ 0, /* Dst_mask. */
+ TRUE), /* PCrel_offset. */
/* Simple pc-relative 32bit reloc. */
HOWTO (R_V850_REL32, /* Type. */
0xfffffffe, /* dst_mask. */
TRUE), /* pcrel_offset. */
- /* A absolute 32 bit branch. */
+ /* A absolute 32 bit branch. */
HOWTO (R_V850_32_ABS, /* type. */
1, /* rightshift. */
2, /* size (0 = byte, 1 = short, 2 = long). */
static const struct v850_elf_reloc_map v850_elf_reloc_map[] =
{
- { BFD_RELOC_NONE, R_V850_NONE },
- { BFD_RELOC_V850_9_PCREL, R_V850_9_PCREL },
- { BFD_RELOC_V850_22_PCREL, R_V850_22_PCREL },
- { BFD_RELOC_HI16_S, R_V850_HI16_S },
- { BFD_RELOC_HI16, R_V850_HI16 },
- { BFD_RELOC_LO16, R_V850_LO16 },
- { BFD_RELOC_32, R_V850_ABS32 },
- { BFD_RELOC_32_PCREL, R_V850_REL32 },
- { BFD_RELOC_16, R_V850_16 },
- { BFD_RELOC_8, R_V850_8 },
- { BFD_RELOC_V850_SDA_16_16_OFFSET, R_V850_SDA_16_16_OFFSET },
- { BFD_RELOC_V850_SDA_15_16_OFFSET, R_V850_SDA_15_16_OFFSET },
- { BFD_RELOC_V850_ZDA_16_16_OFFSET, R_V850_ZDA_16_16_OFFSET },
- { BFD_RELOC_V850_ZDA_15_16_OFFSET, R_V850_ZDA_15_16_OFFSET },
- { BFD_RELOC_V850_TDA_6_8_OFFSET, R_V850_TDA_6_8_OFFSET },
- { BFD_RELOC_V850_TDA_7_8_OFFSET, R_V850_TDA_7_8_OFFSET },
- { BFD_RELOC_V850_TDA_7_7_OFFSET, R_V850_TDA_7_7_OFFSET },
- { BFD_RELOC_V850_TDA_16_16_OFFSET, R_V850_TDA_16_16_OFFSET },
- { BFD_RELOC_V850_TDA_4_5_OFFSET, R_V850_TDA_4_5_OFFSET },
- { BFD_RELOC_V850_TDA_4_4_OFFSET, R_V850_TDA_4_4_OFFSET },
- { BFD_RELOC_V850_LO16_SPLIT_OFFSET, R_V850_LO16_SPLIT_OFFSET },
+ { BFD_RELOC_NONE, R_V850_NONE },
+ { BFD_RELOC_V850_9_PCREL, R_V850_9_PCREL },
+ { BFD_RELOC_V850_22_PCREL, R_V850_22_PCREL },
+ { BFD_RELOC_HI16_S, R_V850_HI16_S },
+ { BFD_RELOC_HI16, R_V850_HI16 },
+ { BFD_RELOC_LO16, R_V850_LO16 },
+ { BFD_RELOC_32, R_V850_ABS32 },
+ { BFD_RELOC_32_PCREL, R_V850_REL32 },
+ { BFD_RELOC_16, R_V850_16 },
+ { BFD_RELOC_8, R_V850_8 },
+ { BFD_RELOC_V850_SDA_16_16_OFFSET, R_V850_SDA_16_16_OFFSET },
+ { BFD_RELOC_V850_SDA_15_16_OFFSET, R_V850_SDA_15_16_OFFSET },
+ { BFD_RELOC_V850_ZDA_16_16_OFFSET, R_V850_ZDA_16_16_OFFSET },
+ { BFD_RELOC_V850_ZDA_15_16_OFFSET, R_V850_ZDA_15_16_OFFSET },
+ { BFD_RELOC_V850_TDA_6_8_OFFSET, R_V850_TDA_6_8_OFFSET },
+ { BFD_RELOC_V850_TDA_7_8_OFFSET, R_V850_TDA_7_8_OFFSET },
+ { BFD_RELOC_V850_TDA_7_7_OFFSET, R_V850_TDA_7_7_OFFSET },
+ { BFD_RELOC_V850_TDA_16_16_OFFSET, R_V850_TDA_16_16_OFFSET },
+ { BFD_RELOC_V850_TDA_4_5_OFFSET, R_V850_TDA_4_5_OFFSET },
+ { BFD_RELOC_V850_TDA_4_4_OFFSET, R_V850_TDA_4_4_OFFSET },
+ { BFD_RELOC_V850_LO16_SPLIT_OFFSET, R_V850_LO16_SPLIT_OFFSET },
{ BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET, R_V850_SDA_16_16_SPLIT_OFFSET },
{ BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET, R_V850_ZDA_16_16_SPLIT_OFFSET },
- { BFD_RELOC_V850_CALLT_6_7_OFFSET, R_V850_CALLT_6_7_OFFSET },
- { BFD_RELOC_V850_CALLT_16_16_OFFSET, R_V850_CALLT_16_16_OFFSET },
- { BFD_RELOC_VTABLE_INHERIT, R_V850_GNU_VTINHERIT },
- { BFD_RELOC_VTABLE_ENTRY, R_V850_GNU_VTENTRY },
- { BFD_RELOC_V850_LONGCALL, R_V850_LONGCALL },
- { BFD_RELOC_V850_LONGJUMP, R_V850_LONGJUMP },
- { BFD_RELOC_V850_ALIGN, R_V850_ALIGN },
- { BFD_RELOC_V850_16_PCREL, R_V850_16_PCREL },
- { BFD_RELOC_V850_17_PCREL, R_V850_17_PCREL },
- { BFD_RELOC_V850_23, R_V850_23 },
- { BFD_RELOC_V850_32_PCREL, R_V850_32_PCREL },
- { BFD_RELOC_V850_32_ABS, R_V850_32_ABS },
- { BFD_RELOC_V850_16_SPLIT_OFFSET, R_V850_HI16 },
- { BFD_RELOC_V850_16_S1, R_V850_16_S1 },
- { BFD_RELOC_V850_LO16_S1, R_V850_LO16_S1 },
- { BFD_RELOC_V850_CALLT_15_16_OFFSET, R_V850_CALLT_15_16_OFFSET },
- { BFD_RELOC_V850_32_GOTPCREL, R_V850_32_GOTPCREL },
- { BFD_RELOC_V850_16_GOT, R_V850_16_GOT },
- { BFD_RELOC_V850_32_GOT, R_V850_32_GOT },
- { BFD_RELOC_V850_22_PLT_PCREL, R_V850_22_PLT },
- { BFD_RELOC_V850_32_PLT_PCREL, R_V850_32_PLT },
- { BFD_RELOC_V850_COPY, R_V850_COPY },
- { BFD_RELOC_V850_GLOB_DAT, R_V850_GLOB_DAT },
- { BFD_RELOC_V850_JMP_SLOT, R_V850_JMP_SLOT },
- { BFD_RELOC_V850_RELATIVE, R_V850_RELATIVE },
- { BFD_RELOC_V850_16_GOTOFF, R_V850_16_GOTOFF },
- { BFD_RELOC_V850_32_GOTOFF, R_V850_32_GOTOFF },
- { BFD_RELOC_V850_CODE, R_V850_CODE },
- { BFD_RELOC_V850_DATA, R_V850_DATA },
+ { BFD_RELOC_V850_CALLT_6_7_OFFSET, R_V850_CALLT_6_7_OFFSET },
+ { BFD_RELOC_V850_CALLT_16_16_OFFSET, R_V850_CALLT_16_16_OFFSET },
+ { BFD_RELOC_VTABLE_INHERIT, R_V850_GNU_VTINHERIT },
+ { BFD_RELOC_VTABLE_ENTRY, R_V850_GNU_VTENTRY },
+ { BFD_RELOC_V850_LONGCALL, R_V850_LONGCALL },
+ { BFD_RELOC_V850_LONGJUMP, R_V850_LONGJUMP },
+ { BFD_RELOC_V850_ALIGN, R_V850_ALIGN },
+ { BFD_RELOC_V850_16_PCREL, R_V850_16_PCREL },
+ { BFD_RELOC_V850_17_PCREL, R_V850_17_PCREL },
+ { BFD_RELOC_V850_23, R_V850_23 },
+ { BFD_RELOC_V850_32_PCREL, R_V850_32_PCREL },
+ { BFD_RELOC_V850_32_ABS, R_V850_32_ABS },
+ { BFD_RELOC_V850_16_SPLIT_OFFSET, R_V850_HI16 },
+ { BFD_RELOC_V850_16_S1, R_V850_16_S1 },
+ { BFD_RELOC_V850_LO16_S1, R_V850_LO16_S1 },
+ { BFD_RELOC_V850_CALLT_15_16_OFFSET, R_V850_CALLT_15_16_OFFSET },
+ { BFD_RELOC_V850_32_GOTPCREL, R_V850_32_GOTPCREL },
+ { BFD_RELOC_V850_16_GOT, R_V850_16_GOT },
+ { BFD_RELOC_V850_32_GOT, R_V850_32_GOT },
+ { BFD_RELOC_V850_22_PLT_PCREL, R_V850_22_PLT },
+ { BFD_RELOC_V850_32_PLT_PCREL, R_V850_32_PLT },
+ { BFD_RELOC_V850_COPY, R_V850_COPY },
+ { BFD_RELOC_V850_GLOB_DAT, R_V850_GLOB_DAT },
+ { BFD_RELOC_V850_JMP_SLOT, R_V850_JMP_SLOT },
+ { BFD_RELOC_V850_RELATIVE, R_V850_RELATIVE },
+ { BFD_RELOC_V850_16_GOTOFF, R_V850_16_GOTOFF },
+ { BFD_RELOC_V850_32_GOTOFF, R_V850_32_GOTOFF },
+ { BFD_RELOC_V850_CODE, R_V850_CODE },
+ { BFD_RELOC_V850_DATA, R_V850_DATA },
};
#define V800_RELOC(name,sz,bit,shift,complain,pcrel,resolver) \
case R_V850_SDA_16_16_SPLIT_OFFSET:
case R_V810_GPWLO_1:
{
- unsigned long gp;
+ unsigned long gp;
struct bfd_link_hash_entry * h;
if (sym_sec == NULL)
case R_V850_TDA_6_8_OFFSET:
case R_V850_TDA_16_16_OFFSET:
{
- unsigned long ep;
+ unsigned long ep;
struct bfd_link_hash_entry * h;
/* Get the value of __ep. */
case R_V850_CALLT_6_7_OFFSET:
{
- unsigned long ctbp;
+ unsigned long ctbp;
struct bfd_link_hash_entry * h;
/* Get the value of __ctbp. */
case R_V850_CALLT_15_16_OFFSET:
case R_V850_CALLT_16_16_OFFSET:
{
- unsigned long ctbp;
+ unsigned long ctbp;
struct bfd_link_hash_entry * h;
if (sym_sec == NULL)
r_type = ELF32_R_TYPE (rel->r_info);
if (r_type == R_V850_GNU_VTENTRY
- || r_type == R_V850_GNU_VTINHERIT)
- continue;
+ || r_type == R_V850_GNU_VTINHERIT)
+ continue;
if (bfd_get_arch (input_bfd) == bfd_arch_v850_rh850)
howto = v800_elf_howto_table + (r_type - R_V810_NONE);
&& (in_flags & EF_V850_ARCH) != E_V850_ARCH)
{
/* Allow earlier architecture binaries to be linked with later binaries.
- Set the output binary to the later architecture, except for v850e1,
- which we set to v850e. */
+ Set the output binary to the later architecture, except for v850e1,
+ which we set to v850e. */
if ( (in_flags & EF_V850_ARCH) == E_V850E1_ARCH
- && (out_flags & EF_V850_ARCH) == E_V850E_ARCH)
- return result;
+ && (out_flags & EF_V850_ARCH) == E_V850E_ARCH)
+ return result;
if ( (in_flags & EF_V850_ARCH) == E_V850_ARCH
&& (out_flags & EF_V850_ARCH) == E_V850E_ARCH)
if (( (in_flags & EF_V850_ARCH) == E_V850_ARCH
|| (in_flags & EF_V850_ARCH) == E_V850E_ARCH
|| (in_flags & EF_V850_ARCH) == E_V850E2_ARCH
- || (in_flags & EF_V850_ARCH) == E_V850E2V3_ARCH)
+ || (in_flags & EF_V850_ARCH) == E_V850E2V3_ARCH)
&& (out_flags & EF_V850_ARCH) == E_V850E3V5_ARCH)
{
elf_elfheader (obfd)->e_flags =
if (v850_elf_scom_section.name == NULL)
{
/* Initialize the small common section. */
- v850_elf_scom_section.name = ".scommon";
- v850_elf_scom_section.flags = SEC_IS_COMMON | SEC_ALLOC | SEC_DATA;
+ v850_elf_scom_section.name = ".scommon";
+ v850_elf_scom_section.flags = SEC_IS_COMMON | SEC_ALLOC | SEC_DATA;
v850_elf_scom_section.output_section = & v850_elf_scom_section;
- v850_elf_scom_section.symbol = & v850_elf_scom_symbol;
+ v850_elf_scom_section.symbol = & v850_elf_scom_symbol;
v850_elf_scom_section.symbol_ptr_ptr = & v850_elf_scom_symbol_ptr;
- v850_elf_scom_symbol.name = ".scommon";
- v850_elf_scom_symbol.flags = BSF_SECTION_SYM;
- v850_elf_scom_symbol.section = & v850_elf_scom_section;
- v850_elf_scom_symbol_ptr = & v850_elf_scom_symbol;
+ v850_elf_scom_symbol.name = ".scommon";
+ v850_elf_scom_symbol.flags = BSF_SECTION_SYM;
+ v850_elf_scom_symbol.section = & v850_elf_scom_section;
+ v850_elf_scom_symbol_ptr = & v850_elf_scom_symbol;
}
asym->section = & v850_elf_scom_section;
asym->value = elfsym->internal_elf_sym.st_size;
if (v850_elf_tcom_section.name == NULL)
{
/* Initialize the tcommon section. */
- v850_elf_tcom_section.name = ".tcommon";
- v850_elf_tcom_section.flags = SEC_IS_COMMON;
+ v850_elf_tcom_section.name = ".tcommon";
+ v850_elf_tcom_section.flags = SEC_IS_COMMON;
v850_elf_tcom_section.output_section = & v850_elf_tcom_section;
- v850_elf_tcom_section.symbol = & v850_elf_tcom_symbol;
+ v850_elf_tcom_section.symbol = & v850_elf_tcom_symbol;
v850_elf_tcom_section.symbol_ptr_ptr = & v850_elf_tcom_symbol_ptr;
- v850_elf_tcom_symbol.name = ".tcommon";
- v850_elf_tcom_symbol.flags = BSF_SECTION_SYM;
- v850_elf_tcom_symbol.section = & v850_elf_tcom_section;
- v850_elf_tcom_symbol_ptr = & v850_elf_tcom_symbol;
+ v850_elf_tcom_symbol.name = ".tcommon";
+ v850_elf_tcom_symbol.flags = BSF_SECTION_SYM;
+ v850_elf_tcom_symbol.section = & v850_elf_tcom_section;
+ v850_elf_tcom_symbol_ptr = & v850_elf_tcom_symbol;
}
asym->section = & v850_elf_tcom_section;
asym->value = elfsym->internal_elf_sym.st_size;
if (v850_elf_zcom_section.name == NULL)
{
/* Initialize the zcommon section. */
- v850_elf_zcom_section.name = ".zcommon";
- v850_elf_zcom_section.flags = SEC_IS_COMMON;
+ v850_elf_zcom_section.name = ".zcommon";
+ v850_elf_zcom_section.flags = SEC_IS_COMMON;
v850_elf_zcom_section.output_section = & v850_elf_zcom_section;
- v850_elf_zcom_section.symbol = & v850_elf_zcom_symbol;
+ v850_elf_zcom_section.symbol = & v850_elf_zcom_symbol;
v850_elf_zcom_section.symbol_ptr_ptr = & v850_elf_zcom_symbol_ptr;
- v850_elf_zcom_symbol.name = ".zcommon";
- v850_elf_zcom_symbol.flags = BSF_SECTION_SYM;
- v850_elf_zcom_symbol.section = & v850_elf_zcom_section;
- v850_elf_zcom_symbol_ptr = & v850_elf_zcom_symbol;
+ v850_elf_zcom_symbol.name = ".zcommon";
+ v850_elf_zcom_symbol.flags = BSF_SECTION_SYM;
+ v850_elf_zcom_symbol.section = & v850_elf_zcom_section;
+ v850_elf_zcom_symbol_ptr = & v850_elf_zcom_symbol;
}
asym->section = & v850_elf_zcom_section;
asym->value = elfsym->internal_elf_sym.st_size;
#if (DEBUG_RELAX & 2)
{
char * name = bfd_elf_string_from_elf_section
- (abfd, symtab_hdr->sh_link, isym.st_name);
+ (abfd, symtab_hdr->sh_link, isym.st_name);
fprintf (stderr,
"relax_delete: local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n",
sec->name, name, isym.st_name,
&& (paddr < addr + count || paddr >= toaddr))
irel->r_addend += count;
else if ( (symval < addr + count || symval >= toaddr)
- && (paddr >= addr + count && paddr < toaddr))
+ && (paddr >= addr + count && paddr < toaddr))
irel->r_addend -= count;
}
return TRUE;
}
-#define NOP_OPCODE (0x0000)
-#define MOVHI 0x0640 /* 4byte. */
-#define MOVHI_MASK 0x07e0
+#define NOP_OPCODE (0x0000)
+#define MOVHI 0x0640 /* 4byte. */
+#define MOVHI_MASK 0x07e0
#define MOVHI_R1(insn) ((insn) & 0x1f) /* 4byte. */
#define MOVHI_R2(insn) ((insn) >> 11)
-#define MOVEA 0x0620 /* 2byte. */
-#define MOVEA_MASK 0x07e0
+#define MOVEA 0x0620 /* 2byte. */
+#define MOVEA_MASK 0x07e0
#define MOVEA_R1(insn) ((insn) & 0x1f)
#define MOVEA_R2(insn) ((insn) >> 11)
-#define JARL_4 0x00040780 /* 4byte. */
-#define JARL_4_MASK 0xFFFF07FF
+#define JARL_4 0x00040780 /* 4byte. */
+#define JARL_4_MASK 0xFFFF07FF
#define JARL_R2(insn) (int)(((insn) & (~JARL_4_MASK)) >> 11)
-#define ADD_I 0x0240 /* 2byte. */
-#define ADD_I_MASK 0x07e0
+#define ADD_I 0x0240 /* 2byte. */
+#define ADD_I_MASK 0x07e0
#define ADD_I5(insn) ((((insn) & 0x001f) << 11) >> 11) /* 2byte. */
#define ADD_R2(insn) ((insn) >> 11)
-#define JMP_R 0x0060 /* 2byte. */
-#define JMP_R_MASK 0xFFE0
+#define JMP_R 0x0060 /* 2byte. */
+#define JMP_R_MASK 0xFFE0
#define JMP_R1(insn) ((insn) & 0x1f)
static bfd_boolean
}
/* Get the reloc for the address from which the register is
- being loaded. This reloc will tell us which function is
- actually being called. */
+ being loaded. This reloc will tell us which function is
+ actually being called. */
for (hi_irelfn = internal_relocs; hi_irelfn < irelend; hi_irelfn ++)
{
continue;
/* For simplicity of coding, we are going to modify the section
- contents, the section relocs, and the BFD symbol table. We
- must tell the rest of the code not to free up this
- information. It would be possible to instead create a table
- of changes which have to be made, as is done in coff-mips.c;
- that would be more work, but would require less memory when
- the linker is run. */
+ contents, the section relocs, and the BFD symbol table. We
+ must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
elf_section_data (sec)->relocs = internal_relocs;
elf_section_data (sec)->this_hdr.contents = contents;
symtab_hdr->contents = (bfd_byte *) isymbuf;
}
/* Get the reloc for the address from which the register is
- being loaded. This reloc will tell us which function is
- actually being called. */
+ being loaded. This reloc will tell us which function is
+ actually being called. */
for (hi_irelfn = internal_relocs; hi_irelfn < irelend; hi_irelfn ++)
{
r_type = ELF32_R_TYPE (hi_irelfn->r_info);
if (ELF32_R_SYM (hi_irelfn->r_info) < symtab_hdr->sh_info)
{
Elf_Internal_Sym * isym;
- asection * sym_sec;
+ asection * sym_sec;
/* A local symbol. */
isym = isymbuf + ELF32_R_SYM (hi_irelfn->r_info);
continue;
/* For simplicity of coding, we are going to modify the section
- contents, the section relocs, and the BFD symbol table. We
- must tell the rest of the code not to free up this
- information. It would be possible to instead create a table
- of changes which have to be made, as is done in coff-mips.c;
- that would be more work, but would require less memory when
- the linker is run. */
+ contents, the section relocs, and the BFD symbol table. We
+ must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
elf_section_data (sec)->relocs = internal_relocs;
elf_section_data (sec)->this_hdr.contents = contents;
symtab_hdr->contents = (bfd_byte *) isymbuf;
{ STRING_COMMA_LEN (".call_table_data"), 0, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE) },
{ STRING_COMMA_LEN (".call_table_text"), 0, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_EXECINSTR) },
- { STRING_COMMA_LEN (".rosdata"), -2, SHT_PROGBITS, (SHF_ALLOC
+ { STRING_COMMA_LEN (".rosdata"), -2, SHT_PROGBITS, (SHF_ALLOC
+ SHF_V850_GPREL) },
- { STRING_COMMA_LEN (".rozdata"), -2, SHT_PROGBITS, (SHF_ALLOC
+ { STRING_COMMA_LEN (".rozdata"), -2, SHT_PROGBITS, (SHF_ALLOC
+ SHF_V850_R0REL) },
- { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
+ { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_GPREL) },
- { STRING_COMMA_LEN (".scommon"), -2, SHT_V850_SCOMMON, (SHF_ALLOC + SHF_WRITE
+ { STRING_COMMA_LEN (".scommon"), -2, SHT_V850_SCOMMON, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_GPREL) },
- { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
+ { STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_GPREL) },
- { STRING_COMMA_LEN (".tbss"), -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
+ { STRING_COMMA_LEN (".tbss"), -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_EPREL) },
- { STRING_COMMA_LEN (".tcommon"), -2, SHT_V850_TCOMMON, (SHF_ALLOC + SHF_WRITE
+ { STRING_COMMA_LEN (".tcommon"), -2, SHT_V850_TCOMMON, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_R0REL) },
- { STRING_COMMA_LEN (".tdata"), -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
+ { STRING_COMMA_LEN (".tdata"), -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_EPREL) },
- { STRING_COMMA_LEN (".zbss"), -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
+ { STRING_COMMA_LEN (".zbss"), -2, SHT_NOBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_R0REL) },
- { STRING_COMMA_LEN (".zcommon"), -2, SHT_V850_ZCOMMON, (SHF_ALLOC + SHF_WRITE
+ { STRING_COMMA_LEN (".zcommon"), -2, SHT_V850_ZCOMMON, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_R0REL) },
- { STRING_COMMA_LEN (".zdata"), -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
+ { STRING_COMMA_LEN (".zdata"), -2, SHT_PROGBITS, (SHF_ALLOC + SHF_WRITE
+ SHF_V850_R0REL) },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
\f
#define TARGET_LITTLE_SYM v850_elf32_vec
#define elf_info_to_howto_rel v850_elf_info_to_howto_rel
#define elf_backend_check_relocs v850_elf_check_relocs
-#define elf_backend_relocate_section v850_elf_relocate_section
+#define elf_backend_relocate_section v850_elf_relocate_section
#define elf_backend_object_p v850_elf_object_p
-#define elf_backend_final_write_processing v850_elf_final_write_processing
-#define elf_backend_section_from_bfd_section v850_elf_section_from_bfd_section
+#define elf_backend_final_write_processing v850_elf_final_write_processing
+#define elf_backend_section_from_bfd_section v850_elf_section_from_bfd_section
#define elf_backend_symbol_processing v850_elf_symbol_processing
#define elf_backend_add_symbol_hook v850_elf_add_symbol_hook
-#define elf_backend_link_output_symbol_hook v850_elf_link_output_symbol_hook
+#define elf_backend_link_output_symbol_hook v850_elf_link_output_symbol_hook
#define elf_backend_section_from_shdr v850_elf_section_from_shdr
#define elf_backend_fake_sections v850_elf_fake_sections
-#define elf_backend_gc_mark_hook v850_elf_gc_mark_hook
+#define elf_backend_gc_mark_hook v850_elf_gc_mark_hook
#define elf_backend_special_sections v850_elf_special_sections
-#define elf_backend_can_gc_sections 1
+#define elf_backend_can_gc_sections 1
#define elf_backend_rela_normal 1
#define bfd_elf32_bfd_is_local_label_name v850_elf_is_local_label_name
#define bfd_elf32_bfd_is_target_special_symbol v850_elf_is_target_special_symbol
#define bfd_elf32_bfd_reloc_type_lookup v850_elf_reloc_type_lookup
-#define bfd_elf32_bfd_reloc_name_lookup v850_elf_reloc_name_lookup
-#define bfd_elf32_bfd_merge_private_bfd_data v850_elf_merge_private_bfd_data
+#define bfd_elf32_bfd_reloc_name_lookup v850_elf_reloc_name_lookup
+#define bfd_elf32_bfd_merge_private_bfd_data v850_elf_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags v850_elf_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data v850_elf_print_private_bfd_data
#define bfd_elf32_bfd_relax_section v850_elf_relax_section
static const struct v850_elf_reloc_map v800_elf_reloc_map[] =
{
- { BFD_RELOC_NONE, R_V810_NONE },
- { BFD_RELOC_8, R_V810_BYTE },
- { BFD_RELOC_16, R_V810_HWORD },
- { BFD_RELOC_32, R_V810_WORD },
- { BFD_RELOC_LO16, R_V810_WLO },
- { BFD_RELOC_HI16, R_V810_WHI },
- { BFD_RELOC_HI16_S, R_V810_WHI1 },
- { BFD_RELOC_V850_32_PCREL, R_V850_PC32 },
- { BFD_RELOC_V850_22_PCREL, R_V850_PCR22 },
- { BFD_RELOC_V850_17_PCREL, R_V850_PC17 },
- { BFD_RELOC_V850_16_PCREL, R_V850_PC16U },
+ { BFD_RELOC_NONE, R_V810_NONE },
+ { BFD_RELOC_8, R_V810_BYTE },
+ { BFD_RELOC_16, R_V810_HWORD },
+ { BFD_RELOC_32, R_V810_WORD },
+ { BFD_RELOC_LO16, R_V810_WLO },
+ { BFD_RELOC_HI16, R_V810_WHI },
+ { BFD_RELOC_HI16_S, R_V810_WHI1 },
+ { BFD_RELOC_V850_32_PCREL, R_V850_PC32 },
+ { BFD_RELOC_V850_22_PCREL, R_V850_PCR22 },
+ { BFD_RELOC_V850_17_PCREL, R_V850_PC17 },
+ { BFD_RELOC_V850_16_PCREL, R_V850_PC16U },
{ BFD_RELOC_V850_9_PCREL, R_V850_PC9 },
- { BFD_RELOC_V850_LO16_S1, R_V810_WLO_1 }, /* Or R_V850_HWLO or R_V850_HWLO_1. */
- { BFD_RELOC_V850_23, R_V850_WLO23 },
+ { BFD_RELOC_V850_LO16_S1, R_V810_WLO_1 }, /* Or R_V850_HWLO or R_V850_HWLO_1. */
+ { BFD_RELOC_V850_23, R_V850_WLO23 },
{ BFD_RELOC_V850_LO16_SPLIT_OFFSET, R_V850_BLO },
{ BFD_RELOC_V850_ZDA_16_16_OFFSET, R_V810_HWORD },
{ BFD_RELOC_V850_TDA_16_16_OFFSET, R_V810_HWORD },
/* Set the howto pointer in CACHE_PTR for a V800 ELF reloc. */
static void
-v800_elf_info_to_howto (bfd * abfd,
- arelent * cache_ptr,
+v800_elf_info_to_howto (bfd * abfd,
+ arelent * cache_ptr,
Elf_Internal_Rela * dst)
{
unsigned int r_type = ELF32_R_TYPE (dst->r_info);
case R_VAX_PLT32:
/* This symbol requires a procedure linkage table entry. We
actually build the entry in adjust_dynamic_symbol,
- because this might be a case of linking PIC code which is
- never referenced by a dynamic object, in which case we
- don't need to generate a procedure linkage table entry
- after all. */
+ because this might be a case of linking PIC code which is
+ never referenced by a dynamic object, in which case we
+ don't need to generate a procedure linkage table entry
+ after all. */
BFD_ASSERT (h != NULL);
/* If this is a local symbol, we resolve it directly without
asection *target;
/* Remember whether there are any reloc sections other
- than .rela.plt. */
+ than .rela.plt. */
if (strcmp (name, ".rela.plt") != 0)
{
const char *outname;
if (skip)
memset (&outrel, 0, sizeof outrel);
/* h->dynindx may be -1 if the symbol was marked to
- become local. */
+ become local. */
else if (h != NULL
&& ((! info->symbolic && h->dynindx != -1)
|| !h->def_regular))
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
/* This reloc will be computed at runtime, so there's no
- need to do anything now, except for R_VAX_32
- relocations that have been turned into
- R_VAX_RELATIVE. */
+ need to do anything now, except for R_VAX_32
+ relocations that have been turned into
+ R_VAX_RELATIVE. */
if (!relocate)
continue;
}
}
/* VAX PCREL relocations are from the end of relocation, not the start.
- So subtract the difference from the relocation amount since we can't
- add it to the offset. */
+ So subtract the difference from the relocation amount since we can't
+ add it to the offset. */
if (howto->pc_relative && howto->pcrel_offset)
relocation -= bfd_get_reloc_size(howto);
/* Fill in the entry in the procedure linkage table. */
memcpy (splt->contents + h->plt.offset, elf_vax_plt_entry,
- PLT_ENTRY_SIZE);
+ PLT_ENTRY_SIZE);
/* The offset is relative to the first extension word. */
bfd_put_32 (output_bfd,
{
memcpy (splt->contents, elf_vax_plt0_entry, PLT_ENTRY_SIZE);
bfd_put_32 (output_bfd,
- (sgot->output_section->vma
- + sgot->output_offset + 4
- - (splt->output_section->vma + 6)),
- splt->contents + 2);
+ (sgot->output_section->vma
+ + sgot->output_offset + 4
+ - (splt->output_section->vma + 6)),
+ splt->contents + 2);
bfd_put_32 (output_bfd,
- (sgot->output_section->vma
- + sgot->output_offset + 8
- - (splt->output_section->vma + 12)),
- splt->contents + 8);
- elf_section_data (splt->output_section)->this_hdr.sh_entsize
- = PLT_ENTRY_SIZE;
+ (sgot->output_section->vma
+ + sgot->output_offset + 8
+ - (splt->output_section->vma + 12)),
+ splt->contents + 8);
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize
+ = PLT_ENTRY_SIZE;
}
}
#define elf_backend_gc_mark_hook elf_vax_gc_mark_hook
#define elf_backend_plt_sym_val elf_vax_plt_sym_val
#define bfd_elf32_bfd_merge_private_bfd_data \
- elf32_vax_merge_private_bfd_data
+ elf32_vax_merge_private_bfd_data
#define bfd_elf32_bfd_set_private_flags \
- elf32_vax_set_private_flags
+ elf32_vax_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data \
- elf32_vax_print_private_bfd_data
+ elf32_vax_print_private_bfd_data
#define elf_backend_can_gc_sections 1
#define elf_backend_want_got_plt 1
static reloc_howto_type elf32_wasm32_howto_table[] =
{
HOWTO (R_WASM32_NONE, /* type */
- 0, /* rightshift */
- 3, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_WASM32_NONE", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 3, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_WASM32_NONE", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* 32 bit absolute */
HOWTO (R_WASM32_32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield,/* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_WASM32_32", /* name */
- FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_WASM32_32", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
/* Look up the relocation CODE. */
static reloc_howto_type *
elf32_wasm32_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
switch (code)
{
static reloc_howto_type *
elf32_wasm32_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- const char *r_name)
+ const char *r_name)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE (elf32_wasm32_howto_table); i++)
if (elf32_wasm32_howto_table[i].name != NULL
- && strcasecmp (elf32_wasm32_howto_table[i].name, r_name) == 0)
+ && strcasecmp (elf32_wasm32_howto_table[i].name, r_name) == 0)
return &elf32_wasm32_howto_table[i];
return NULL;
static void
elf32_wasm32_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
- arelent *cache_ptr,
- Elf_Internal_Rela *dst)
+ arelent *cache_ptr,
+ Elf_Internal_Rela *dst)
{
unsigned int r_type = ELF32_R_TYPE (dst->r_info);
cache_ptr->howto = elf32_wasm32_rtype_to_howto (abfd, r_type);
https://github.com/pipcet/binutils-gdb/issues/4 */
#define ELF_MAXPAGESIZE 4096
-#define TARGET_LITTLE_SYM wasm32_elf32_vec
+#define TARGET_LITTLE_SYM wasm32_elf32_vec
#define TARGET_LITTLE_NAME "elf32-wasm32"
-#define elf_backend_can_gc_sections 1
-#define elf_backend_rela_normal 1
+#define elf_backend_can_gc_sections 1
+#define elf_backend_rela_normal 1
/* For testing. */
-#define elf_backend_want_dynrelro 1
+#define elf_backend_want_dynrelro 1
#define elf_info_to_howto elf32_wasm32_info_to_howto_rela
#define elf_info_to_howto_rel NULL
#define bfd_elf32_bfd_reloc_type_lookup elf32_wasm32_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup elf32_wasm32_reloc_name_lookup
-#define ELF_DYNAMIC_INTERPRETER "/sbin/elf-dynamic-interpreter.so"
+#define ELF_DYNAMIC_INTERPRETER "/sbin/elf-dynamic-interpreter.so"
-#define elf_backend_want_got_plt 1
-#define elf_backend_plt_readonly 1
-#define elf_backend_got_header_size 0
+#define elf_backend_want_got_plt 1
+#define elf_backend_plt_readonly 1
+#define elf_backend_got_header_size 0
#include "elf32-target.h"
FALSE), /* pcrel_offset */
HOWTO (R_XC16X_ABS_32, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 32, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_bitfield, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_XC16X_ABS_32", /* name */
- TRUE, /* partial_inplace */
- 0x00000000, /* src_mask */
- 0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_bitfield, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_XC16X_ABS_32", /* name */
+ TRUE, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* A PC relative 8 bit relocation. */
/* Relocation regarding page number. */
HOWTO (R_XC16X_PAG, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_XC16X_PAG", /* name */
- TRUE, /* partial_inplace */
- 0x00000000, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_XC16X_PAG", /* name */
+ TRUE, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* Relocation regarding page number. */
HOWTO (R_XC16X_POF, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_XC16X_POF", /* name */
- TRUE, /* partial_inplace */
- 0x00000000, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_XC16X_POF", /* name */
+ TRUE, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* Relocation regarding segment number. */
HOWTO (R_XC16X_SEG, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_XC16X_SEG", /* name */
- TRUE, /* partial_inplace */
- 0x00000000, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_XC16X_SEG", /* name */
+ TRUE, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* Relocation regarding segment offset. */
HOWTO (R_XC16X_SOF, /* type */
- 0, /* rightshift */
- 1, /* size (0 = byte, 1 = short, 2 = long) */
- 16, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_signed, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
- "R_XC16X_SOF", /* name */
- TRUE, /* partial_inplace */
- 0x00000000, /* src_mask */
- 0x0000ffff, /* dst_mask */
- FALSE) /* pcrel_offset */
+ 0, /* rightshift */
+ 1, /* size (0 = byte, 1 = short, 2 = long) */
+ 16, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_signed, /* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_XC16X_SOF", /* name */
+ TRUE, /* partial_inplace */
+ 0x00000000, /* src_mask */
+ 0x0000ffff, /* dst_mask */
+ FALSE) /* pcrel_offset */
};
static const struct xc16x_reloc_map xc16x_reloc_map [] =
{
- { BFD_RELOC_NONE, R_XC16X_NONE },
- { BFD_RELOC_8, R_XC16X_ABS_8 },
- { BFD_RELOC_16, R_XC16X_ABS_16 },
- { BFD_RELOC_32, R_XC16X_ABS_32 },
- { BFD_RELOC_8_PCREL, R_XC16X_8_PCREL },
+ { BFD_RELOC_NONE, R_XC16X_NONE },
+ { BFD_RELOC_8, R_XC16X_ABS_8 },
+ { BFD_RELOC_16, R_XC16X_ABS_16 },
+ { BFD_RELOC_32, R_XC16X_ABS_32 },
+ { BFD_RELOC_8_PCREL, R_XC16X_8_PCREL },
{ BFD_RELOC_XC16X_PAG, R_XC16X_PAG},
{ BFD_RELOC_XC16X_POF, R_XC16X_POF},
{ BFD_RELOC_XC16X_SEG, R_XC16X_SEG},
#define TARGET_LITTLE_SYM xc16x_elf32_vec
#define TARGET_LITTLE_NAME "elf32-xc16x"
#define elf_backend_final_write_processing elf32_xc16x_final_write_processing
-#define elf_backend_object_p elf32_xc16x_object_p
+#define elf_backend_object_p elf32_xc16x_object_p
#define elf_backend_can_gc_sections 1
#define bfd_elf32_bfd_reloc_type_lookup xc16x_reloc_type_lookup
#define bfd_elf32_bfd_reloc_name_lookup xc16x_reloc_name_lookup
#define elf_info_to_howto elf32_xc16x_info_to_howto
#define elf_info_to_howto_rel elf32_xc16x_info_to_howto
-#define elf_backend_relocate_section elf32_xc16x_relocate_section
+#define elf_backend_relocate_section elf32_xc16x_relocate_section
#define elf_backend_rela_normal 1
#include "elf32-target.h"
for (i = 0; i < ARRAY_SIZE (elf_xgate_howto_table); i++)
if (elf_xgate_howto_table[i].name != NULL
- && strcasecmp (elf_xgate_howto_table[i].name, r_name) == 0)
+ && strcasecmp (elf_xgate_howto_table[i].name, r_name) == 0)
return &elf_xgate_howto_table[i];
return NULL;
}
-#define ELF_ARCH bfd_arch_xgate
-#define ELF_MACHINE_CODE EM_XGATE
-#define ELF_TARGET_ID XGATE_ELF_DATA
+#define ELF_ARCH bfd_arch_xgate
+#define ELF_MACHINE_CODE EM_XGATE
+#define ELF_TARGET_ID XGATE_ELF_DATA
-#define ELF_MAXPAGESIZE 0x1000
+#define ELF_MAXPAGESIZE 0x1000
-#define TARGET_BIG_SYM xgate_elf32_vec
-#define TARGET_BIG_NAME "elf32-xgate"
+#define TARGET_BIG_SYM xgate_elf32_vec
+#define TARGET_BIG_NAME "elf32-xgate"
-#define elf_info_to_howto 0
-#define elf_info_to_howto_rel xgate_info_to_howto_rel
-#define elf_backend_check_relocs elf32_xgate_check_relocs
-#define elf_backend_relocate_section elf32_xgate_relocate_section
-#define elf_backend_object_p xgate_elf_set_mach_from_flags
+#define elf_info_to_howto 0
+#define elf_info_to_howto_rel xgate_info_to_howto_rel
+#define elf_backend_check_relocs elf32_xgate_check_relocs
+#define elf_backend_relocate_section elf32_xgate_relocate_section
+#define elf_backend_object_p xgate_elf_set_mach_from_flags
#define elf_backend_final_write_processing 0
-#define elf_backend_can_gc_sections 1
-#define elf_backend_special_sections elf32_xgate_special_sections
+#define elf_backend_can_gc_sections 1
+#define elf_backend_special_sections elf32_xgate_special_sections
#define elf_backend_post_process_headers elf32_xgate_post_process_headers
-#define elf_backend_add_symbol_hook elf32_xgate_add_symbol_hook
+#define elf_backend_add_symbol_hook elf32_xgate_add_symbol_hook
#define bfd_elf32_bfd_link_hash_table_create xgate_elf_bfd_link_hash_table_create
-#define bfd_elf32_bfd_set_private_flags _bfd_xgate_elf_set_private_flags
+#define bfd_elf32_bfd_set_private_flags _bfd_xgate_elf_set_private_flags
#define bfd_elf32_bfd_print_private_bfd_data _bfd_xgate_elf_print_private_bfd_data
#define xgate_stub_hash_lookup(table, string, create, copy) \
((struct elf32_xgate_stub_hash_entry *) \
- bfd_hash_lookup ((table), (string), (create), (copy)))
+ bfd_hash_lookup ((table), (string), (create), (copy)))
#include "elf32-target.h"
/* Assorted information used by elf32_hppa_size_stubs. */
unsigned int bfd_count;
- int top_index;
+ int top_index;
asection ** input_list;
/* Small local sym cache. */
{
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_XSTORMY16_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_XSTORMY16_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_XSTORMY16_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage */
HOWTO (R_XSTORMY16_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_XSTORMY16_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_XSTORMY16_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
\f
typedef struct xstormy16_reloc_map
{
bfd_reloc_code_real_type bfd_reloc_val;
- unsigned int xstormy16_reloc_val;
- reloc_howto_type * table;
+ unsigned int xstormy16_reloc_val;
+ reloc_howto_type * table;
} reloc_map;
static const reloc_map xstormy16_reloc_map [] =
{
- { BFD_RELOC_NONE, R_XSTORMY16_NONE, xstormy16_elf_howto_table },
- { BFD_RELOC_32, R_XSTORMY16_32, xstormy16_elf_howto_table },
- { BFD_RELOC_16, R_XSTORMY16_16, xstormy16_elf_howto_table },
- { BFD_RELOC_8, R_XSTORMY16_8, xstormy16_elf_howto_table },
- { BFD_RELOC_32_PCREL, R_XSTORMY16_PC32, xstormy16_elf_howto_table },
- { BFD_RELOC_16_PCREL, R_XSTORMY16_PC16, xstormy16_elf_howto_table },
- { BFD_RELOC_8_PCREL, R_XSTORMY16_PC8, xstormy16_elf_howto_table },
- { BFD_RELOC_XSTORMY16_REL_12, R_XSTORMY16_REL_12, xstormy16_elf_howto_table },
- { BFD_RELOC_XSTORMY16_24, R_XSTORMY16_24, xstormy16_elf_howto_table },
- { BFD_RELOC_XSTORMY16_FPTR16, R_XSTORMY16_FPTR16, xstormy16_elf_howto_table },
- { BFD_RELOC_LO16, R_XSTORMY16_LO16, xstormy16_elf_howto_table },
- { BFD_RELOC_HI16, R_XSTORMY16_HI16, xstormy16_elf_howto_table },
- { BFD_RELOC_XSTORMY16_12, R_XSTORMY16_12, xstormy16_elf_howto_table },
- { BFD_RELOC_VTABLE_INHERIT, R_XSTORMY16_GNU_VTINHERIT, xstormy16_elf_howto_table2 },
- { BFD_RELOC_VTABLE_ENTRY, R_XSTORMY16_GNU_VTENTRY, xstormy16_elf_howto_table2 },
+ { BFD_RELOC_NONE, R_XSTORMY16_NONE, xstormy16_elf_howto_table },
+ { BFD_RELOC_32, R_XSTORMY16_32, xstormy16_elf_howto_table },
+ { BFD_RELOC_16, R_XSTORMY16_16, xstormy16_elf_howto_table },
+ { BFD_RELOC_8, R_XSTORMY16_8, xstormy16_elf_howto_table },
+ { BFD_RELOC_32_PCREL, R_XSTORMY16_PC32, xstormy16_elf_howto_table },
+ { BFD_RELOC_16_PCREL, R_XSTORMY16_PC16, xstormy16_elf_howto_table },
+ { BFD_RELOC_8_PCREL, R_XSTORMY16_PC8, xstormy16_elf_howto_table },
+ { BFD_RELOC_XSTORMY16_REL_12, R_XSTORMY16_REL_12, xstormy16_elf_howto_table },
+ { BFD_RELOC_XSTORMY16_24, R_XSTORMY16_24, xstormy16_elf_howto_table },
+ { BFD_RELOC_XSTORMY16_FPTR16, R_XSTORMY16_FPTR16, xstormy16_elf_howto_table },
+ { BFD_RELOC_LO16, R_XSTORMY16_LO16, xstormy16_elf_howto_table },
+ { BFD_RELOC_HI16, R_XSTORMY16_HI16, xstormy16_elf_howto_table },
+ { BFD_RELOC_XSTORMY16_12, R_XSTORMY16_12, xstormy16_elf_howto_table },
+ { BFD_RELOC_VTABLE_INHERIT, R_XSTORMY16_GNU_VTINHERIT, xstormy16_elf_howto_table2 },
+ { BFD_RELOC_VTABLE_ENTRY, R_XSTORMY16_GNU_VTENTRY, xstormy16_elf_howto_table2 },
};
static reloc_howto_type *
}
switch (ELF32_R_TYPE (rel->r_info))
- {
+ {
/* This relocation describes a 16-bit pointer to a function.
We may need to allocate a thunk in low memory; reserve memory
for it now. */
/* This relocation describes the C++ object vtable hierarchy.
Reconstruct it for later use during GC. */
- case R_XSTORMY16_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
+ case R_XSTORMY16_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
- case R_XSTORMY16_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
+ case R_XSTORMY16_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
}
}
for (idx = 0; idx < nlocals; ++idx)
if (local_plt_offsets[idx] != (bfd_vma) -1)
{
- local_plt_offsets[idx] = entry;
+ local_plt_offsets[idx] = entry;
entry += 4;
}
}
accordingly. */
static bfd_boolean
-xstormy16_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
- struct bfd_link_info * info,
- bfd * input_bfd,
- asection * input_section,
- bfd_byte * contents,
- Elf_Internal_Rela * relocs,
- Elf_Internal_Sym * local_syms,
- asection ** local_sections)
+xstormy16_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info * info,
+ bfd * input_bfd,
+ asection * input_section,
+ bfd_byte * contents,
+ Elf_Internal_Rela * relocs,
+ Elf_Internal_Sym * local_syms,
+ asection ** local_sections)
{
- Elf_Internal_Shdr * symtab_hdr;
+ Elf_Internal_Shdr * symtab_hdr;
struct elf_link_hash_entry ** sym_hashes;
- Elf_Internal_Rela * rel;
- Elf_Internal_Rela * relend;
+ Elf_Internal_Rela * rel;
+ Elf_Internal_Rela * relend;
asection *splt;
symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
for (rel = relocs; rel < relend; rel ++)
{
- reloc_howto_type * howto;
- unsigned long r_symndx;
- Elf_Internal_Sym * sym;
- asection * sec;
+ reloc_howto_type * howto;
+ unsigned long r_symndx;
+ Elf_Internal_Sym * sym;
+ asection * sec;
struct elf_link_hash_entry * h;
- bfd_vma relocation;
- bfd_reloc_status_type r;
- const char * name = NULL;
- int r_type;
+ bfd_vma relocation;
+ bfd_reloc_status_type r;
+ const char * name = NULL;
+ int r_type;
r_type = ELF32_R_TYPE (rel->r_info);
if (relocation <= 0xffff)
{
- /* If the symbol is in range for a 16-bit address, we should
+ /* If the symbol is in range for a 16-bit address, we should
have deallocated the plt entry in relax_section. */
- BFD_ASSERT (*plt_offset == (bfd_vma) -1);
+ BFD_ASSERT (*plt_offset == (bfd_vma) -1);
}
else
{
#define elf_info_to_howto xstormy16_info_to_howto_rela
#define elf_backend_relocate_section xstormy16_elf_relocate_section
#define elf_backend_gc_mark_hook xstormy16_elf_gc_mark_hook
-#define elf_backend_check_relocs xstormy16_elf_check_relocs
+#define elf_backend_check_relocs xstormy16_elf_check_relocs
#define elf_backend_always_size_sections \
xstormy16_elf_always_size_sections
#define elf_backend_omit_section_dynsym \
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_XTENSA_GNU_VTINHERIT, 0, 2, 0, FALSE, 0, complain_overflow_dont,
- NULL, "R_XTENSA_GNU_VTINHERIT",
+ NULL, "R_XTENSA_GNU_VTINHERIT",
FALSE, 0, 0, FALSE),
/* GNU extension to record C++ vtable member usage. */
HOWTO (R_XTENSA_GNU_VTENTRY, 0, 2, 0, FALSE, 0, complain_overflow_dont,
- _bfd_elf_rel_vtable_reloc_fn, "R_XTENSA_GNU_VTENTRY",
+ _bfd_elf_rel_vtable_reloc_fn, "R_XTENSA_GNU_VTENTRY",
FALSE, 0, 0, FALSE),
/* Relocations for supporting difference of symbols. */
property_table_compare);
/* Check that the table contents are valid. Problems may occur,
- for example, if an unrelocated object file is stripped. */
+ for example, if an unrelocated object file is stripped. */
for (blk = 1; blk < block_count; blk++)
{
/* The only circumstance where two entries may legitimately
static void
elf_xtensa_make_sym_local (struct bfd_link_info *info,
- struct elf_link_hash_entry *h)
+ struct elf_link_hash_entry *h)
{
if (bfd_link_pic (info))
{
if (h->plt.refcount > 0)
- {
+ {
/* For shared objects, there's no need for PLT entries for local
symbols (use RELATIVE relocs instead of JMP_SLOT relocs). */
- if (h->got.refcount < 0)
- h->got.refcount = 0;
- h->got.refcount += h->plt.refcount;
- h->plt.refcount = 0;
- }
+ if (h->got.refcount < 0)
+ h->got.refcount = 0;
+ h->got.refcount += h->plt.refcount;
+ h->plt.refcount = 0;
+ }
}
else
{
static void
elf_xtensa_hide_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *h,
- bfd_boolean force_local)
+ struct elf_link_hash_entry *h,
+ bfd_boolean force_local)
{
/* For a shared link, move the plt refcount to the got refcount to leave
space for RELATIVE relocs. */
case R_XTENSA_ASM_SIMPLIFY:
{
- /* Convert the L32R/CALLX to CALL. */
+ /* Convert the L32R/CALLX to CALL. */
bfd_reloc_status_type retval =
elf_xtensa_do_asm_simplify (contents, address, input_size,
error_message);
xtensa_format_set_slot (isa, fmt, 0, ibuff, sbuff);
xtensa_insnbuf_to_chars (isa, ibuff, contents + rel->r_offset,
- input_size - rel->r_offset);
+ input_size - rel->r_offset);
return TRUE;
}
/* The following text actions are generated:
- "ta_remove_insn" remove an instruction or instructions
- "ta_remove_longcall" convert longcall to call
+ "ta_remove_insn" remove an instruction or instructions
+ "ta_remove_longcall" convert longcall to call
"ta_convert_longcall" convert longcall to nop/call
- "ta_narrow_insn" narrow a wide instruction
- "ta_widen" widen a narrow instruction
- "ta_fill" add fill or remove fill
+ "ta_narrow_insn" narrow a wide instruction
+ "ta_widen" widen a narrow instruction
+ "ta_fill" add fill or remove fill
removed < 0 is a fill; branches to the fill address will be
changed to address + fill size (e.g., address - removed)
removed >= 0 branches to the fill address will stay unchanged
- "ta_remove_literal" remove a literal; this action is
+ "ta_remove_literal" remove a literal; this action is
indicated when a literal is removed
- or replaced.
- "ta_add_literal" insert a new literal; this action is
- indicated when a literal has been moved.
- It may use a virtual_offset because
+ or replaced.
+ "ta_add_literal" insert a new literal; this action is
+ indicated when a literal has been moved.
+ It may use a virtual_offset because
multiple literals can be placed at the
- same location.
+ same location.
For each of these text actions, we also record the number of bytes
removed by performing the text action. In the case of a "ta_widen"
enum text_action_enum_t
{
ta_none,
- ta_remove_insn, /* removed = -size */
- ta_remove_longcall, /* removed = -size */
- ta_convert_longcall, /* removed = 0 */
- ta_narrow_insn, /* removed = -1 */
- ta_widen_insn, /* removed = +1 */
- ta_fill, /* removed = +size */
+ ta_remove_insn, /* removed = -size */
+ ta_remove_longcall, /* removed = -size */
+ ta_convert_longcall, /* removed = 0 */
+ ta_narrow_insn, /* removed = -1 */
+ ta_widen_insn, /* removed = +1 */
+ ta_fill, /* removed = +size */
ta_remove_literal,
ta_add_literal
};
continue;
/* Count PC-relative operand relocations against the target section.
- Note: The conditions tested here must match the conditions under
+ Note: The conditions tested here must match the conditions under
which init_source_reloc is called in collect_source_relocs(). */
is_l32r_reloc = FALSE;
if (is_operand_relocation (ELF32_R_TYPE (irel->r_info)))
reloc[i].irel = irel;
/* Every relocation won't possibly be checked in the optimized version of
- check_section_ebb_pcrels_fit, so this needs to be done here. */
+ check_section_ebb_pcrels_fit, so this needs to be done here. */
if (is_alt_relocation (ELF32_R_TYPE (irel->r_info)))
{
/* None of the current alternate relocs are PC-relative,
continue;
/* The original and new output section for these must be the same
- in order to coalesce. */
+ in order to coalesce. */
if (r_reloc_get_section (&reloc[i].r_rel)->output_section
!= sec->output_section)
return FALSE;
/* Update the action so that the code that moves
the contents will do the right thing. */
/* ta_remove_longcall and ta_remove_insn actions are
- grouped together in the tree as well as
+ grouped together in the tree as well as
ta_convert_longcall and ta_none, so that changes below
can be done w/o removing and reinserting action into
the tree. */
predef_flags = xtensa_get_property_predef_flags (sec);
/* Walk over memory and relocations at the same time.
- This REQUIRES that the internal_relocs be sorted by offset. */
+ This REQUIRES that the internal_relocs be sorted by offset. */
qsort (internal_relocs, sec->reloc_count, sizeof (Elf_Internal_Rela),
internal_reloc_compare);
struct elf_link_hash_entry *h = elf_sym_hashes (abfd)[indx];
while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
- h = (struct elf_link_hash_entry *) h->root.u.i.link;
+ || h->root.type == bfd_link_hash_warning)
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
switch (h->root.type)
{
elf_sym_hashes (abfd)[indx];
while (h->root.type == bfd_link_hash_indirect
- || h->root.type == bfd_link_hash_warning)
+ || h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
if (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak)
+ || h->root.type == bfd_link_hash_defweak)
offset = h->root.u.def.value;
}
return offset;
suffix = sec->name + linkonce_len;
/* For backward compatibility, replace "t." instead of inserting
- the new linkonce_kind (but not for "prop" sections). */
+ the new linkonce_kind (but not for "prop" sections). */
if (CONST_STRNEQ (suffix, "t.") && linkonce_kind[1] == '.')
- suffix += 2;
+ suffix += 2;
strcat (prop_sec_name + linkonce_len, suffix);
}
else
{
{ STRING_COMMA_LEN (".fini.literal"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
{ STRING_COMMA_LEN (".init.literal"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
- { STRING_COMMA_LEN (".literal"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
- { STRING_COMMA_LEN (".xtensa.info"), 0, SHT_NOTE, 0 },
- { NULL, 0, 0, 0, 0 }
+ { STRING_COMMA_LEN (".literal"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR },
+ { STRING_COMMA_LEN (".xtensa.info"), 0, SHT_NOTE, 0 },
+ { NULL, 0, 0, 0, 0 }
};
\f
#define ELF_TARGET_ID XTENSA_ELF_DATA
{
hdr->sh_type = SHT_ALPHA_DEBUG;
/* In a shared object on Irix 5.3, the .mdebug section has an
- entsize of 0. FIXME: Does this matter? */
+ entsize of 0. FIXME: Does this matter? */
if ((abfd->flags & DYNAMIC) != 0 )
hdr->sh_entsize = 0;
else
alpha_elf_tdata (abfd)->find_line_info = fi;
/* Note that we don't bother to ever free this information.
- find_nearest_line is either called all the time, as in
- objdump -l, so the information should be saved, or it is
- rarely called, as in ld error messages, so the memory
- wasted is unimportant. Still, it would probably be a
- good idea for free_cached_info to throw it away. */
+ find_nearest_line is either called all the time, as in
+ objdump -l, so the information should be saved, or it is
+ rarely called, as in ld error messages, so the memory
+ wasted is unimportant. Still, it would probably be a
+ good idea for free_cached_info to throw it away. */
}
if (_bfd_ecoff_locate_line (abfd, section, offset, &fi->d, swap,
}
/* We can only get preliminary data on whether a symbol is
- locally or externally defined, as not all of the input files
- have yet been processed. Do something with what we know, as
- this may help reduce memory usage and processing time later. */
+ locally or externally defined, as not all of the input files
+ have yet been processed. Do something with what we know, as
+ this may help reduce memory usage and processing time later. */
maybe_dynamic = FALSE;
if (h && ((bfd_link_pic (info)
&& (!info->symbolic
|| info->unresolved_syms_in_shared_libs == RM_IGNORE))
|| !h->root.def_regular
|| h->root.root.type == bfd_link_hash_defweak))
- maybe_dynamic = TRUE;
+ maybe_dynamic = TRUE;
need = 0;
gotent_flags = 0;
&& gi->addend == gs->addend)
{
gs->use_count += gi->use_count;
- goto got_found;
+ goto got_found;
}
gi->next = hs->got_entries;
hs->got_entries = gi;
h = hashes[i];
while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
+ || h->root.root.type == bfd_link_hash_warning)
h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
for (be = h->got_entries; be ; be = be->next)
{
if (be->use_count == 0)
- continue;
+ continue;
if (be->gotobj != b)
- continue;
+ continue;
for (ae = h->got_entries; ae ; ae = ae->next)
- if (ae->gotobj == a
+ if (ae->gotobj == a
&& ae->reloc_type == be->reloc_type
&& ae->addend == be->addend)
goto global_found;
total += alpha_got_entry_size (be->reloc_type);
if (total > MAX_GOT_SIZE)
- return FALSE;
+ return FALSE;
global_found:;
}
}
/* Let the local .got entries know they are part of a new subsegment. */
local_got_entries = alpha_elf_tdata (bsub)->local_got_entries;
if (local_got_entries)
- {
+ {
n = elf_tdata (bsub)->symtab_hdr.sh_info;
for (i = 0; i < n; ++i)
{
struct alpha_elf_got_entry *ent;
for (ent = local_got_entries[i]; ent; ent = ent->next)
- ent->gotobj = a;
+ ent->gotobj = a;
}
- }
+ }
/* Merge the global .got entries. */
hashes = alpha_elf_sym_hashes (bsub);
n = NUM_SHDR_ENTRIES (symtab_hdr) - symtab_hdr->sh_info;
for (i = 0; i < n; ++i)
- {
+ {
struct alpha_elf_got_entry *ae, *be, **pbe, **start;
struct alpha_elf_link_hash_entry *h;
h = hashes[i];
while (h->root.root.type == bfd_link_hash_indirect
- || h->root.root.type == bfd_link_hash_warning)
+ || h->root.root.type == bfd_link_hash_warning)
h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link;
pbe = start = &h->got_entries;
while ((be = *pbe) != NULL)
{
if (be->use_count == 0)
- {
+ {
*pbe = be->next;
memset (be, 0xa5, sizeof (*be));
goto kill;
- }
+ }
if (be->gotobj != b)
- goto next;
+ goto next;
for (ae = *start; ae ; ae = ae->next)
- if (ae->gotobj == a
+ if (ae->gotobj == a
&& ae->reloc_type == be->reloc_type
&& ae->addend == be->addend)
{
pbe = &be->next;
kill:;
}
- }
+ }
alpha_elf_tdata (bsub)->gotobj = a;
}
for (k = 0, n = elf_tdata(j)->symtab_hdr.sh_info; k < n; ++k)
for (gotent = local_got_entries[k]; gotent; gotent = gotent->next)
if (gotent->use_count > 0)
- {
+ {
gotent->got_offset = got_offset;
got_offset += alpha_got_entry_size (gotent->reloc_type);
- }
+ }
}
alpha_elf_tdata(i)->got->size = got_offset;
static bfd_boolean
elf64_alpha_size_got_sections (struct bfd_link_info *info,
- bfd_boolean may_merge)
+ bfd_boolean may_merge)
{
bfd *i, *got_list, *cur_got_obj = NULL;
struct alpha_elf_link_hash_table * htab;
/* We are assuming no merging has yet occurred. */
BFD_ASSERT (this_got == i);
- if (alpha_elf_tdata (this_got)->total_got_size > MAX_GOT_SIZE)
+ if (alpha_elf_tdata (this_got)->total_got_size > MAX_GOT_SIZE)
{
/* Yikes! A single object file has too many entries. */
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: .got subsegment exceeds 64K (size %d)"),
- i, alpha_elf_tdata (this_got)->total_got_size);
+ (_("%B: .got subsegment exceeds 64K (size %d)"),
+ i, alpha_elf_tdata (this_got)->total_got_size);
return FALSE;
}
else
{
tsec_relocs = (_bfd_elf_link_read_relocs
- (info->abfd, info->tsec, NULL,
+ (info->abfd, info->tsec, NULL,
(Elf_Internal_Rela *) NULL,
info->link_info->keep_memory));
if (tsec_relocs == NULL)
return 0;
}
if (tsec_free)
- free (tsec_free);
+ free (tsec_free);
}
/* We've now determined that we can skip an initial gp load. Verify
nrel.r_addend = irel->r_addend;
/* As we adjust, move the reloc to the end so that we don't
- break the LITERAL+LITUSE chain. */
+ break the LITERAL+LITUSE chain. */
if (urel < --erel)
- *urel-- = *erel;
+ *urel-- = *erel;
*erel = nrel;
changed_relocs = TRUE;
}
lit_reused = TRUE;
changed_contents = TRUE;
- /* Since all relocs must be optimized, don't bother swapping
- this relocation to the end. */
+ /* Since all relocs must be optimized, don't bother swapping
+ this relocation to the end. */
urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
R_ALPHA_GPRELLOW);
urel->r_addend = irel->r_addend;
htab->relax_trip = link_info->relax_trip;
/* This should never fail after the initial round, since the only error
- is GOT overflow, and relaxation only shrinks the table. However, we
+ is GOT overflow, and relaxation only shrinks the table. However, we
may only merge got sections during the first pass. If we merge
sections after we've created GPREL relocs, the GP for the merged
section backs up which may put the relocs out of range. */
/* Early exit for unhandled or unrelaxable relocations. */
if (r_type != R_ALPHA_LITERAL)
- {
- /* We complete everything except LITERAL in the first pass. */
+ {
+ /* We complete everything except LITERAL in the first pass. */
if (relax_pass != 0)
continue;
if (r_type == R_ALPHA_TLSLDM)
{
/* The symbol for a TLSLDM reloc is ignored. Collapse the
- reloc to the STN_UNDEF (0) symbol so that they all match. */
+ reloc to the STN_UNDEF (0) symbol so that they all match. */
r_symndx = STN_UNDEF;
}
else if (r_type != R_ALPHA_GOTDTPREL
- && r_type != R_ALPHA_GOTTPREL
+ && r_type != R_ALPHA_GOTTPREL
&& r_type != R_ALPHA_TLSGD)
continue;
}
{
symval = isym->st_value;
if (isym->st_shndx == SHN_UNDEF)
- continue;
+ continue;
else if (isym->st_shndx == SHN_ABS)
- info.tsec = bfd_abs_section_ptr;
+ info.tsec = bfd_abs_section_ptr;
else if (isym->st_shndx == SHN_COMMON)
- info.tsec = bfd_com_section_ptr;
+ info.tsec = bfd_com_section_ptr;
else
- info.tsec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+ info.tsec = bfd_section_from_elf_index (abfd, isym->st_shndx);
}
info.h = NULL;
undef_weak_ref = TRUE;
h = (struct alpha_elf_link_hash_entry *) hh;
- dynamic_symbol_p = alpha_elf_dynamic_symbol_p (&h->root, info);
+ dynamic_symbol_p = alpha_elf_dynamic_symbol_p (&h->root, info);
gotent = h->got_entries;
}
case R_ALPHA_GPREL16:
case R_ALPHA_GPRELLOW:
if (dynamic_symbol_p)
- {
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: gp-relative relocation against dynamic symbol %s"),
- input_bfd, h->root.root.root.string);
- ret_val = FALSE;
- }
+ (_("%B: gp-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
+ ret_val = FALSE;
+ }
BFD_ASSERT(gp != 0);
value -= gp;
goto default_reloc;
case R_ALPHA_GPRELHIGH:
if (dynamic_symbol_p)
- {
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: gp-relative relocation against dynamic symbol %s"),
- input_bfd, h->root.root.root.string);
- ret_val = FALSE;
- }
+ (_("%B: gp-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
+ ret_val = FALSE;
+ }
BFD_ASSERT(gp != 0);
value -= gp;
value = ((bfd_signed_vma) value >> 16) + ((value >> 15) & 1);
case R_ALPHA_BRADDR:
if (dynamic_symbol_p)
- {
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: pc-relative relocation against dynamic symbol %s"),
- input_bfd, h->root.root.root.string);
- ret_val = FALSE;
- }
+ (_("%B: pc-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
+ ret_val = FALSE;
+ }
/* The regular PC-relative stuff measures from the start of
the instruction rather than the end. */
value -= 4;
switch (other & STO_ALPHA_STD_GPLOAD)
{
case STO_ALPHA_NOPV:
- break;
+ break;
case STO_ALPHA_STD_GPLOAD:
value += 8;
break;
case R_ALPHA_SREL32:
case R_ALPHA_SREL64:
if (dynamic_symbol_p)
- {
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: pc-relative relocation against dynamic symbol %s"),
- input_bfd, h->root.root.root.string);
- ret_val = FALSE;
- }
+ (_("%B: pc-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
+ ret_val = FALSE;
+ }
else if (bfd_link_pic (info)
&& undef_weak_ref)
- {
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: pc-relative relocation against undefined weak symbol %s"),
- input_bfd, h->root.root.root.string);
- ret_val = FALSE;
- }
+ (_("%B: pc-relative relocation against undefined weak symbol %s"),
+ input_bfd, h->root.root.root.string);
+ ret_val = FALSE;
+ }
/* ??? .eh_frame references to discarded sections will be smashed
else
{
BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);
- value -= dtp_base;
+ value -= dtp_base;
}
bfd_put_64 (output_bfd, value,
sgot->contents + gotent->got_offset + 8);
case R_ALPHA_DTPRELLO:
case R_ALPHA_DTPREL16:
if (dynamic_symbol_p)
- {
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: dtp-relative relocation against dynamic symbol %s"),
- input_bfd, h->root.root.root.string);
- ret_val = FALSE;
- }
+ (_("%B: dtp-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
+ ret_val = FALSE;
+ }
BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);
value -= dtp_base;
if (r_type == R_ALPHA_DTPRELHI)
/* xgettext:c-format */
(_("%B: TLS local exec code cannot be linked into shared objects"),
input_bfd);
- ret_val = FALSE;
+ ret_val = FALSE;
}
else if (dynamic_symbol_p)
- {
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: tp-relative relocation against dynamic symbol %s"),
- input_bfd, h->root.root.root.string);
- ret_val = FALSE;
- }
+ (_("%B: tp-relative relocation against dynamic symbol %s"),
+ input_bfd, h->root.root.root.string);
+ ret_val = FALSE;
+ }
BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL);
value -= tp_base;
if (r_type == R_ALPHA_TPRELHI)
\f
static const struct bfd_elf_special_section elf64_alpha_special_sections[] =
{
- { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
+ { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
{ STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
/* ECOFF swapping routines. These are used when dealing with the
entry = bfd_hash_allocate (table,
sizeof (struct elf64_hppa_link_hash_entry));
if (entry == NULL)
- return entry;
+ return entry;
}
/* Call the allocation method of the superclass. */
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 11);
case EFA_PARISC_2_0:
if (i_ehdrp->e_ident[EI_CLASS] == ELFCLASS64)
- return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25);
+ return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25);
else
- return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 20);
+ return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 20);
case EFA_PARISC_2_0 | EF_PARISC_WIDE:
return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25);
}
struct elf64_hppa_link_hash_entry *hh,
int type,
asection *sec,
- int sec_symndx,
- bfd_vma offset,
+ int sec_symndx,
+ bfd_vma offset,
bfd_vma addend)
{
struct elf64_hppa_dyn_reloc_entry *rent;
*local_dlt = sec->size;
sec->size += DLT_ENTRY_SIZE;
if (bfd_link_pic (info))
- {
+ {
srel->size += sizeof (Elf64_External_Rela);
- }
+ }
}
else
*local_dlt = (bfd_vma) -1;
{
data.ofs = hppa_info->plt_sec->size;
elf_link_hash_traverse (&hppa_info->root,
- allocate_global_data_plt, &data);
+ allocate_global_data_plt, &data);
hppa_info->plt_sec->size = data.ofs;
}
{
bfd_vma *local_opd_offsets, *local_dlt_offsets;
- if (local_offsets == NULL)
- abort ();
+ if (local_offsets == NULL)
+ abort ();
/* Now do .opd creation if needed. */
if (r_type == R_PARISC_LTOFF_FPTR14R
{
bfd_vma *local_opd_offsets;
- if (local_offsets == NULL)
- abort ();
+ if (local_offsets == NULL)
+ abort ();
local_opd_offsets = local_offsets + 2 * symtab_hdr->sh_info;
off = local_opd_offsets[r_symndx];
if ((off & 1) != 0)
{
BFD_ASSERT (off != (bfd_vma) -1);
- off &= ~1;
+ off &= ~1;
}
else
{
rel->r_offset, err);
}
- if (!bfd_link_relocatable (info)
- && relocation == 0
- && eh->root.type != bfd_link_hash_defined
- && eh->root.type != bfd_link_hash_defweak
- && eh->root.type != bfd_link_hash_undefweak)
- {
- if (info->unresolved_syms_in_objects == RM_IGNORE
- && ELF_ST_VISIBILITY (eh->other) == STV_DEFAULT
- && eh->type == STT_PARISC_MILLI)
+ if (!bfd_link_relocatable (info)
+ && relocation == 0
+ && eh->root.type != bfd_link_hash_defined
+ && eh->root.type != bfd_link_hash_defweak
+ && eh->root.type != bfd_link_hash_undefweak)
+ {
+ if (info->unresolved_syms_in_objects == RM_IGNORE
+ && ELF_ST_VISIBILITY (eh->other) == STV_DEFAULT
+ && eh->type == STT_PARISC_MILLI)
(*info->callbacks->undefined_symbol)
(info, eh_name (eh), input_bfd,
input_section, rel->r_offset, FALSE);
- }
+ }
}
if (sym_sec != NULL && discarded_section (sym_sec))
static const struct bfd_elf_special_section elf64_hppa_special_sections[] =
{
- { STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
- { STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
- { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
- { STRING_COMMA_LEN (".dlt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
+ { STRING_COMMA_LEN (".fini"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { STRING_COMMA_LEN (".init"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { STRING_COMMA_LEN (".plt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
+ { STRING_COMMA_LEN (".dlt"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
{ STRING_COMMA_LEN (".sdata"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
- { STRING_COMMA_LEN (".sbss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
- { STRING_COMMA_LEN (".tbss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_HP_TLS },
- { NULL, 0, 0, 0, 0 }
+ { STRING_COMMA_LEN (".sbss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_PARISC_SHORT },
+ { STRING_COMMA_LEN (".tbss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_HP_TLS },
+ { NULL, 0, 0, 0, 0 }
};
/* The hash bucket size is the standard one, namely 4. */
static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] =
{
- 0x0b, 0x78, 0x00, 0x02, 0x00, 0x24, /* [MMI] addl r15=0,r1;; */
- 0x00, 0x41, 0x3c, 0x70, 0x29, 0xc0, /* ld8.acq r16=[r15],8*/
- 0x01, 0x08, 0x00, 0x84, /* mov r14=r1;; */
- 0x11, 0x08, 0x00, 0x1e, 0x18, 0x10, /* [MIB] ld8 r1=[r15] */
- 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */
- 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */
+ 0x0b, 0x78, 0x00, 0x02, 0x00, 0x24, /* [MMI] addl r15=0,r1;; */
+ 0x00, 0x41, 0x3c, 0x70, 0x29, 0xc0, /* ld8.acq r16=[r15],8*/
+ 0x01, 0x08, 0x00, 0x84, /* mov r14=r1;; */
+ 0x11, 0x08, 0x00, 0x1e, 0x18, 0x10, /* [MIB] ld8 r1=[r15] */
+ 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */
+ 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */
};
static const bfd_byte oor_brl[16] =
{
- 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* brl.sptk.few tgt;;*/
+ 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* brl.sptk.few tgt;;*/
0x00, 0x00, 0x00, 0xc0
};
ia64_elf_relax_brl (contents, roff);
irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
- R_IA64_PCREL21B);
+ R_IA64_PCREL21B);
/* If the original relocation offset points to slot
1, change it to slot 2. */
else if (ia64_elf_relax_br (contents, roff))
{
irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
- R_IA64_PCREL60B);
+ R_IA64_PCREL60B);
/* Make the relocation offset point to slot 1. */
irel->r_offset = (irel->r_offset & ~((bfd_vma) 0x3)) + 1;
}
else
{
- memcpy (contents + trampoff, oor_brl, size);
- irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
- R_IA64_PCREL60B);
- irel->r_offset = trampoff + 2;
+ memcpy (contents + trampoff, oor_brl, size);
+ irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
+ R_IA64_PCREL60B);
+ irel->r_offset = trampoff + 2;
}
/* Record the fixup so we don't do it again this section. */
ia64_info);
else if (r_type == R_IA64_LTOFF22X)
{
- /* Can't deal yet correctly with ABS symbols. */
- if (bfd_is_abs_section (tsec))
- continue;
+ /* Can't deal yet correctly with ABS symbols. */
+ if (bfd_is_abs_section (tsec))
+ continue;
irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info),
R_IA64_GPREL22);
static bfd_boolean
create_ia64_vms_notes (bfd *abfd, struct bfd_link_info *info,
- unsigned int time_hi, unsigned int time_lo)
+ unsigned int time_hi, unsigned int time_lo)
{
#define NBR_NOTES 7
Elf_Internal_Note notes[NBR_NOTES];
/* Create note section. */
s = bfd_make_section_anyway_with_flags (abfd, ".vms.note",
- (SEC_LINKER_CREATED
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_READONLY));
+ (SEC_LINKER_CREATED
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY
+ | SEC_READONLY));
if (s == NULL
|| !bfd_set_section_alignment (abfd, s, 3))
return FALSE;
if (create)
{
/* When we create the array, we don't check for duplicates,
- except in the previously sorted section if one exists, and
+ except in the previously sorted section if one exists, and
against the last inserted entry. This allows insertions to
be fast. */
if (info)
got = bfd_make_section_anyway_with_flags (dynobj, ".got",
flags | SEC_SMALL_DATA);
if (got == NULL
- || !bfd_set_section_alignment (dynobj, got, 3))
- return NULL;
+ || !bfd_set_section_alignment (dynobj, got, 3))
+ return NULL;
ia64_info->root.sgot = got;
}
case R_IA64_DTPMOD64MSB:
case R_IA64_DTPMOD64LSB:
case R_IA64_LTOFF_DTPMOD22:
- abort ();
+ abort ();
break;
case R_IA64_IPLTMSB:
case R_IA64_IPLTLSB:
- break;
+ break;
case R_IA64_LTOFF_FPTR22:
case R_IA64_LTOFF_FPTR64I:
break;
case R_IA64_PCREL21B:
- case R_IA64_PCREL60B:
+ case R_IA64_PCREL60B:
/* Depending on where this symbol is defined, we may or may not
need a full plt entry. Only skip if we know we'll not need
the entry -- static or symbolic, and the symbol definition
case R_IA64_DTPMOD64MSB:
case R_IA64_DTPMOD64LSB:
case R_IA64_LTOFF_DTPMOD22:
- abort ();
+ abort ();
break;
case R_IA64_LTOFF_FPTR22:
break;
case R_IA64_PCREL21B:
- case R_IA64_PCREL60B:
+ case R_IA64_PCREL60B:
/* Depending on where this symbol is defined, we may or may not
need a full plt entry. Only skip if we know we'll not need
the entry -- static or symbolic, and the symbol definition
}
if (need_entry & NEED_FPTR)
{
- /* Create the .opd section. */
+ /* Create the .opd section. */
if (!fptr)
{
fptr = get_fptr (abfd, info, ia64_info);
dyn_i->want_ltoff_fptr = 1;
if (need_entry & (NEED_MIN_PLT | NEED_FULL_PLT))
{
- if (!ia64_info->root.dynobj)
+ if (!ia64_info->root.dynobj)
ia64_info->root.dynobj = abfd;
h->needs_plt = 1;
dyn_i->want_plt = 1;
if (h == NULL || !h->def_dynamic)
{
- /* A non dynamic symbol. */
+ /* A non dynamic symbol. */
dyn_i->fptr_offset = x->ofs;
x->ofs += 16;
}
{
/* VMS: FIX64. */
if (dyn_i->h != NULL && dyn_i->h->def_dynamic)
- {
- h_ia64 = (struct elf64_ia64_link_hash_entry *) dyn_i->h;
- elf_ia64_vms_tdata (h_ia64->shl)->fixups_off +=
- sizeof (Elf64_External_VMS_IMAGE_FIXUP);
- ia64_info->fixups_sec->size +=
- sizeof (Elf64_External_VMS_IMAGE_FIXUP);
- }
+ {
+ h_ia64 = (struct elf64_ia64_link_hash_entry *) dyn_i->h;
+ elf_ia64_vms_tdata (h_ia64->shl)->fixups_off +=
+ sizeof (Elf64_External_VMS_IMAGE_FIXUP);
+ ia64_info->fixups_sec->size +=
+ sizeof (Elf64_External_VMS_IMAGE_FIXUP);
+ }
}
if (ia64_info->rel_fptr_sec && dyn_i->want_fptr)
{
/* VMS: FIXFD. */
if (dyn_i->h != NULL && dyn_i->h->def_dynamic)
- {
- h_ia64 = (struct elf64_ia64_link_hash_entry *) dyn_i->h;
- elf_ia64_vms_tdata (h_ia64->shl)->fixups_off +=
- sizeof (Elf64_External_VMS_IMAGE_FIXUP);
- ia64_info->fixups_sec->size +=
- sizeof (Elf64_External_VMS_IMAGE_FIXUP);
- }
+ {
+ h_ia64 = (struct elf64_ia64_link_hash_entry *) dyn_i->h;
+ elf_ia64_vms_tdata (h_ia64->shl)->fixups_off +=
+ sizeof (Elf64_External_VMS_IMAGE_FIXUP);
+ ia64_info->fixups_sec->size +=
+ sizeof (Elf64_External_VMS_IMAGE_FIXUP);
+ }
}
/* Take care of the normal data relocations. */
/* Add a fixup. */
if (!dynamic_symbol)
- abort ();
+ abort ();
h_ia64 = (struct elf64_ia64_link_hash_entry *) dyn_i->h;
elf_ia64_vms_tdata (h_ia64->shl)->fixups_off +=
- sizeof (Elf64_External_VMS_IMAGE_FIXUP);
+ sizeof (Elf64_External_VMS_IMAGE_FIXUP);
ia64_info->fixups_sec->size +=
- sizeof (Elf64_External_VMS_IMAGE_FIXUP);
+ sizeof (Elf64_External_VMS_IMAGE_FIXUP);
}
return TRUE;
}
else if (sec == ia64_info->fixups_sec)
{
- if (strip)
- ia64_info->fixups_sec = NULL;
+ if (strip)
+ ia64_info->fixups_sec = NULL;
}
else if (sec == ia64_info->transfer_sec)
- {
- ;
- }
+ {
+ ;
+ }
else
{
const char *name;
vms_get_time (&time_hi, &time_lo);
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_IDENT, 0))
- return FALSE;
+ return FALSE;
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_LINKTIME,
- (((bfd_uint64_t)time_hi) << 32)
- + time_lo))
- return FALSE;
+ (((bfd_uint64_t)time_hi) << 32)
+ + time_lo))
+ return FALSE;
/* Strtab. */
strdyn_off = dynsec->size;
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_STRTAB_OFFSET, 0))
- return FALSE;
+ return FALSE;
if (!_bfd_elf_add_dynamic_entry (info, DT_STRSZ, 0))
- return FALSE;
+ return FALSE;
/* PLTGOT */
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_PLTGOT_SEG, 0))
- return FALSE;
+ return FALSE;
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_PLTGOT_OFFSET, 0))
- return FALSE;
+ return FALSE;
/* Misc. */
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_FPMODE, 0x9800000))
- return FALSE;
+ return FALSE;
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_LNKFLAGS,
- VMS_LF_IMGSTA | VMS_LF_MAIN))
- return FALSE;
+ VMS_LF_IMGSTA | VMS_LF_MAIN))
+ return FALSE;
/* Add entries for shared libraries. */
for (abfd = info->input_bfds; abfd; abfd = abfd->link.next)
- {
- char *soname;
- size_t soname_len;
- bfd_size_type strindex;
- bfd_byte *newcontents;
- bfd_vma fixups_shl_off;
-
- if (!(abfd->flags & DYNAMIC))
- continue;
- BFD_ASSERT (abfd->xvec == output_bfd->xvec);
-
- if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_NEEDED_IDENT,
- elf_ia64_vms_ident (abfd)))
- return FALSE;
-
- soname = vms_get_module_name (abfd->filename, TRUE);
- if (soname == NULL)
- return FALSE;
- strindex = dynstrsec->size;
- soname_len = strlen (soname) + 1;
- newcontents = (bfd_byte *) bfd_realloc (dynstrsec->contents,
- strindex + soname_len);
- if (newcontents == NULL)
- return FALSE;
- memcpy (newcontents + strindex, soname, soname_len);
- dynstrsec->size += soname_len;
- dynstrsec->contents = newcontents;
-
- if (!_bfd_elf_add_dynamic_entry (info, DT_NEEDED, strindex))
- return FALSE;
-
- if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_FIXUP_NEEDED,
- shl_num))
- return FALSE;
- shl_num++;
-
- /* The fixups_off was in fact containing the size of the fixup
- section. Remap into the offset. */
- fixups_shl_off = elf_ia64_vms_tdata (abfd)->fixups_off;
- elf_ia64_vms_tdata (abfd)->fixups_off = fixups_off;
-
- if (!_bfd_elf_add_dynamic_entry
- (info, DT_IA_64_VMS_FIXUP_RELA_CNT,
- fixups_shl_off / sizeof (Elf64_External_VMS_IMAGE_FIXUP)))
- return FALSE;
- if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_FIXUP_RELA_OFF,
- fixups_off))
- return FALSE;
- fixups_off += fixups_shl_off;
- }
+ {
+ char *soname;
+ size_t soname_len;
+ bfd_size_type strindex;
+ bfd_byte *newcontents;
+ bfd_vma fixups_shl_off;
+
+ if (!(abfd->flags & DYNAMIC))
+ continue;
+ BFD_ASSERT (abfd->xvec == output_bfd->xvec);
+
+ if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_NEEDED_IDENT,
+ elf_ia64_vms_ident (abfd)))
+ return FALSE;
+
+ soname = vms_get_module_name (abfd->filename, TRUE);
+ if (soname == NULL)
+ return FALSE;
+ strindex = dynstrsec->size;
+ soname_len = strlen (soname) + 1;
+ newcontents = (bfd_byte *) bfd_realloc (dynstrsec->contents,
+ strindex + soname_len);
+ if (newcontents == NULL)
+ return FALSE;
+ memcpy (newcontents + strindex, soname, soname_len);
+ dynstrsec->size += soname_len;
+ dynstrsec->contents = newcontents;
+
+ if (!_bfd_elf_add_dynamic_entry (info, DT_NEEDED, strindex))
+ return FALSE;
+
+ if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_FIXUP_NEEDED,
+ shl_num))
+ return FALSE;
+ shl_num++;
+
+ /* The fixups_off was in fact containing the size of the fixup
+ section. Remap into the offset. */
+ fixups_shl_off = elf_ia64_vms_tdata (abfd)->fixups_off;
+ elf_ia64_vms_tdata (abfd)->fixups_off = fixups_off;
+
+ if (!_bfd_elf_add_dynamic_entry
+ (info, DT_IA_64_VMS_FIXUP_RELA_CNT,
+ fixups_shl_off / sizeof (Elf64_External_VMS_IMAGE_FIXUP)))
+ return FALSE;
+ if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_FIXUP_RELA_OFF,
+ fixups_off))
+ return FALSE;
+ fixups_off += fixups_shl_off;
+ }
/* Unwind. */
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_UNWINDSZ, 0))
- return FALSE;
+ return FALSE;
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_UNWIND_CODSEG, 0))
- return FALSE;
+ return FALSE;
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_UNWIND_INFOSEG, 0))
- return FALSE;
+ return FALSE;
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_UNWIND_OFFSET, 0))
- return FALSE;
+ return FALSE;
if (!_bfd_elf_add_dynamic_entry (info, DT_IA_64_VMS_UNWIND_SEG, 0))
- return FALSE;
+ return FALSE;
if (!_bfd_elf_add_dynamic_entry (info, DT_NULL, 0xdead))
- return FALSE;
+ return FALSE;
/* Fix the strtab entries. */
bed = get_elf_backend_data (hash_table->dynobj);
if (dynstrsec->size > 1)
- dynstrsec->contents[0] = 0;
+ dynstrsec->contents[0] = 0;
else
- dynstrsec->size = 0;
+ dynstrsec->size = 0;
/* Note: one 'spare' (ie DT_NULL) entry is added by
- bfd_elf_size_dynsym_hash_dynstr. */
+ bfd_elf_size_dynsym_hash_dynstr. */
dyn.d_tag = DT_IA_64_VMS_STRTAB_OFFSET;
dyn.d_un.d_val = dynsec->size /* + sizeof (Elf64_External_Dyn) */;
bed->s->swap_dyn_out (hash_table->dynobj, &dyn,
- dynsec->contents + strdyn_off);
+ dynsec->contents + strdyn_off);
dyn.d_tag = DT_STRSZ;
dyn.d_un.d_val = dynstrsec->size;
bed->s->swap_dyn_out (hash_table->dynobj, &dyn,
- dynsec->contents + strdyn_off + bed->s->sizeof_dyn);
+ dynsec->contents + strdyn_off + bed->s->sizeof_dyn);
elf_ia64_vms_tdata (output_bfd)->needed_count = shl_num;
/* Note section. */
if (!create_ia64_vms_notes (output_bfd, info, time_hi, time_lo))
- return FALSE;
+ return FALSE;
}
/* ??? Perhaps force __gp local. */
static void
elf64_ia64_install_fixup (bfd *output_bfd,
- struct elf64_ia64_link_hash_table *ia64_info,
- struct elf_link_hash_entry *h,
- unsigned int type, asection *sec, bfd_vma offset,
- bfd_vma addend)
+ struct elf64_ia64_link_hash_table *ia64_info,
+ struct elf_link_hash_entry *h,
+ unsigned int type, asection *sec, bfd_vma offset,
+ bfd_vma addend)
{
asection *relsec;
Elf64_External_VMS_IMAGE_FIXUP *fixup;
&& (!dyn_i->h
|| ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
|| dyn_i->h->root.type != bfd_link_hash_undefweak))
- || elf64_ia64_dynamic_symbol_p (dyn_i->h))
+ || elf64_ia64_dynamic_symbol_p (dyn_i->h))
&& (!dyn_i->want_ltoff_fptr
|| !bfd_link_pie (info)
|| !dyn_i->h
addend = value;
}
- /* VMS: install a FIX32 or FIX64. */
- switch (dyn_r_type)
- {
- case R_IA64_DIR32LSB:
- case R_IA64_FPTR32LSB:
- dyn_r_type = R_IA64_VMS_FIX32;
- break;
- case R_IA64_DIR64LSB:
- case R_IA64_FPTR64LSB:
- dyn_r_type = R_IA64_VMS_FIX64;
- break;
- default:
- BFD_ASSERT (FALSE);
- break;
- }
- elf64_ia64_install_fixup
- (info->output_bfd, ia64_info, dyn_i->h,
- dyn_r_type, got_sec, got_offset, addend);
- }
+ /* VMS: install a FIX32 or FIX64. */
+ switch (dyn_r_type)
+ {
+ case R_IA64_DIR32LSB:
+ case R_IA64_FPTR32LSB:
+ dyn_r_type = R_IA64_VMS_FIX32;
+ break;
+ case R_IA64_DIR64LSB:
+ case R_IA64_FPTR64LSB:
+ dyn_r_type = R_IA64_VMS_FIX64;
+ break;
+ default:
+ BFD_ASSERT (FALSE);
+ break;
+ }
+ elf64_ia64_install_fixup
+ (info->output_bfd, ia64_info, dyn_i->h,
+ dyn_r_type, got_sec, got_offset, addend);
+ }
}
/* Return the address of the linkage table entry. */
|| ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT
|| dyn_i->h->root.type != bfd_link_hash_undefweak))
{
- /* VMS: */
- abort ();
+ /* VMS: */
+ abort ();
}
dyn_i->pltoff_done = 1;
gp_val = _bfd_get_gp_value (abfd);
gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE,
- FALSE, FALSE);
+ FALSE, FALSE);
if (gp)
{
gp->root.type = bfd_link_hash_defined;
addend = value;
}
- /* VMS: install a FIX64. */
- switch (dyn_r_type)
- {
- case R_IA64_DIR32LSB:
- dyn_r_type = R_IA64_VMS_FIX32;
- break;
- case R_IA64_DIR64LSB:
- dyn_r_type = R_IA64_VMS_FIX64;
- break;
- default:
- BFD_ASSERT (FALSE);
- break;
- }
- elf64_ia64_install_fixup
- (output_bfd, ia64_info, h,
- dyn_r_type, input_section, rel->r_offset, addend);
- r = bfd_reloc_ok;
- break;
+ /* VMS: install a FIX64. */
+ switch (dyn_r_type)
+ {
+ case R_IA64_DIR32LSB:
+ dyn_r_type = R_IA64_VMS_FIX32;
+ break;
+ case R_IA64_DIR64LSB:
+ dyn_r_type = R_IA64_VMS_FIX64;
+ break;
+ default:
+ BFD_ASSERT (FALSE);
+ break;
+ }
+ elf64_ia64_install_fixup
+ (output_bfd, ia64_info, h,
+ dyn_r_type, input_section, rel->r_offset, addend);
+ r = bfd_reloc_ok;
+ break;
}
/* Fall through. */
case R_IA64_LTOFF22:
case R_IA64_LTOFF22X:
case R_IA64_LTOFF64I:
- dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
+ dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
value = set_got_entry (input_bfd, info, dyn_i,
rel->r_addend, value, R_IA64_DIR64LSB);
value -= gp_val;
case R_IA64_PLTOFF64I:
case R_IA64_PLTOFF64MSB:
case R_IA64_PLTOFF64LSB:
- dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
+ dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
value = set_pltoff_entry (output_bfd, info, dyn_i, value, FALSE);
value -= gp_val;
r = ia64_elf_install_value (hit_addr, value, r_type);
case R_IA64_FPTR32LSB:
case R_IA64_FPTR64MSB:
case R_IA64_FPTR64LSB:
- dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
+ dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
if (dyn_i->want_fptr)
{
if (!undef_weak_ref)
value = 0;
}
- /* VMS: FIXFD. */
- elf64_ia64_install_fixup
- (output_bfd, ia64_info, h, R_IA64_VMS_FIXFD,
- input_section, rel->r_offset, 0);
- r = bfd_reloc_ok;
- break;
+ /* VMS: FIXFD. */
+ elf64_ia64_install_fixup
+ (output_bfd, ia64_info, h, R_IA64_VMS_FIXFD,
+ input_section, rel->r_offset, 0);
+ r = bfd_reloc_ok;
+ break;
}
r = ia64_elf_install_value (hit_addr, value, r_type);
case R_IA64_LTOFF_FPTR32LSB:
case R_IA64_LTOFF_FPTR64MSB:
case R_IA64_LTOFF_FPTR64LSB:
- dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
- if (dyn_i->want_fptr)
- {
- BFD_ASSERT (h == NULL || !h->def_dynamic);
- if (!undef_weak_ref)
- value = set_fptr_entry (output_bfd, info, dyn_i, value);
- }
- else
- value = 0;
-
- value = set_got_entry (output_bfd, info, dyn_i,
- rel->r_addend, value, R_IA64_FPTR64LSB);
- value -= gp_val;
- r = ia64_elf_install_value (hit_addr, value, r_type);
+ dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
+ if (dyn_i->want_fptr)
+ {
+ BFD_ASSERT (h == NULL || !h->def_dynamic);
+ if (!undef_weak_ref)
+ value = set_fptr_entry (output_bfd, info, dyn_i, value);
+ }
+ else
+ value = 0;
+
+ value = set_got_entry (output_bfd, info, dyn_i,
+ rel->r_addend, value, R_IA64_FPTR64LSB);
+ value -= gp_val;
+ r = ia64_elf_install_value (hit_addr, value, r_type);
break;
case R_IA64_PCREL32MSB:
/* Install a dynamic relocation for this reloc. */
if (dynamic_symbol_p && r_symndx != 0)
{
- /* VMS: doesn't exist ??? */
- abort ();
+ /* VMS: doesn't exist ??? */
+ abort ();
}
goto finish_pcrel;
if ((dynamic_symbol_p || bfd_link_pic (info))
&& (input_section->flags & SEC_ALLOC) != 0)
{
- /* VMS: FIXFD ?? */
- abort ();
+ /* VMS: FIXFD ?? */
+ abort ();
}
if (r_type == R_IA64_IPLTMSB)
/* VMS: FIXFD. */
elf64_ia64_install_fixup
- (output_bfd, ia64_info, h, R_IA64_VMS_FIXFD, ia64_info->pltoff_sec,
- pltoff_addr - (ia64_info->pltoff_sec->output_section->vma
- + ia64_info->pltoff_sec->output_offset), 0);
+ (output_bfd, ia64_info, h, R_IA64_VMS_FIXFD, ia64_info->pltoff_sec,
+ pltoff_addr - (ia64_info->pltoff_sec->output_section->vma
+ + ia64_info->pltoff_sec->output_offset), 0);
}
/* Mark some specially defined symbols as absolute. */
gp_val = _bfd_get_gp_value (abfd);
phdr = _bfd_elf_find_segment_containing_section
- (info->output_bfd, ia64_info->pltoff_sec->output_section);
+ (info->output_bfd, ia64_info->pltoff_sec->output_section);
BFD_ASSERT (phdr != NULL);
base_phdr = elf_tdata (info->output_bfd)->phdr;
gp_seg = phdr - base_phdr;
unwind_sec = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind);
if (unwind_sec != NULL)
- {
- asection *code_sec;
+ {
+ asection *code_sec;
- phdr = _bfd_elf_find_segment_containing_section (abfd, unwind_sec);
- BFD_ASSERT (phdr != NULL);
- unwind_seg = phdr - base_phdr;
+ phdr = _bfd_elf_find_segment_containing_section (abfd, unwind_sec);
+ BFD_ASSERT (phdr != NULL);
+ unwind_seg = phdr - base_phdr;
- code_sec = bfd_get_section_by_name (abfd, "$CODE$");
- phdr = _bfd_elf_find_segment_containing_section (abfd, code_sec);
- BFD_ASSERT (phdr != NULL);
- code_seg = phdr - base_phdr;
- }
+ code_sec = bfd_get_section_by_name (abfd, "$CODE$");
+ phdr = _bfd_elf_find_segment_containing_section (abfd, code_sec);
+ BFD_ASSERT (phdr != NULL);
+ code_seg = phdr - base_phdr;
+ }
for (; dyncon < dynconend; dyncon++)
{
switch (dyn.d_tag)
{
- case DT_IA_64_VMS_FIXUP_RELA_OFF:
- dyn.d_un.d_val +=
- (ia64_info->fixups_sec->output_section->vma
- + ia64_info->fixups_sec->output_offset)
- - (sdyn->output_section->vma + sdyn->output_offset);
- break;
-
- case DT_IA_64_VMS_PLTGOT_OFFSET:
- dyn.d_un.d_val = gp_off;
- break;
-
- case DT_IA_64_VMS_PLTGOT_SEG:
- dyn.d_un.d_val = gp_seg;
- break;
-
- case DT_IA_64_VMS_UNWINDSZ:
- if (unwind_sec == NULL)
- {
- dyn.d_tag = DT_NULL;
- dyn.d_un.d_val = 0xdead;
- }
- else
- dyn.d_un.d_val = unwind_sec->size;
- break;
-
- case DT_IA_64_VMS_UNWIND_CODSEG:
- dyn.d_un.d_val = code_seg;
- break;
-
- case DT_IA_64_VMS_UNWIND_INFOSEG:
- case DT_IA_64_VMS_UNWIND_SEG:
- dyn.d_un.d_val = unwind_seg;
- break;
-
- case DT_IA_64_VMS_UNWIND_OFFSET:
- break;
-
- default:
- /* No need to rewrite the entry. */
- continue;
+ case DT_IA_64_VMS_FIXUP_RELA_OFF:
+ dyn.d_un.d_val +=
+ (ia64_info->fixups_sec->output_section->vma
+ + ia64_info->fixups_sec->output_offset)
+ - (sdyn->output_section->vma + sdyn->output_offset);
+ break;
+
+ case DT_IA_64_VMS_PLTGOT_OFFSET:
+ dyn.d_un.d_val = gp_off;
+ break;
+
+ case DT_IA_64_VMS_PLTGOT_SEG:
+ dyn.d_un.d_val = gp_seg;
+ break;
+
+ case DT_IA_64_VMS_UNWINDSZ:
+ if (unwind_sec == NULL)
+ {
+ dyn.d_tag = DT_NULL;
+ dyn.d_un.d_val = 0xdead;
+ }
+ else
+ dyn.d_un.d_val = unwind_sec->size;
+ break;
+
+ case DT_IA_64_VMS_UNWIND_CODSEG:
+ dyn.d_un.d_val = code_seg;
+ break;
+
+ case DT_IA_64_VMS_UNWIND_INFOSEG:
+ case DT_IA_64_VMS_UNWIND_SEG:
+ dyn.d_un.d_val = unwind_seg;
+ break;
+
+ case DT_IA_64_VMS_UNWIND_OFFSET:
+ break;
+
+ default:
+ /* No need to rewrite the entry. */
+ continue;
}
bfd_elf64_swap_dyn_out (abfd, &dyn, dyncon);
tfr = (struct elf64_vms_transfer *)tfr_sec->contents;
bfd_putl32 (6 * 8, tfr->size);
bfd_putl64 (tfr_sec->output_section->vma
- + tfr_sec->output_offset
- + 6 * 8, tfr->tfradr3);
+ + tfr_sec->output_offset
+ + 6 * 8, tfr->tfradr3);
tfr3 = elf_link_hash_lookup (elf_hash_table (info), "ELF$TFRADR", FALSE,
- FALSE, FALSE);
+ FALSE, FALSE);
if (tfr3
- && (tfr3->root.type == bfd_link_hash_defined
- || tfr3->root.type == bfd_link_hash_defweak))
+ && (tfr3->root.type == bfd_link_hash_defined
+ || tfr3->root.type == bfd_link_hash_defweak))
{
- asection *tfr3_sec = tfr3->root.u.def.section;
- bfd_vma tfr3_val;
+ asection *tfr3_sec = tfr3->root.u.def.section;
+ bfd_vma tfr3_val;
- tfr3_val = (tfr3->root.u.def.value
- + tfr3_sec->output_section->vma
- + tfr3_sec->output_offset);
+ tfr3_val = (tfr3->root.u.def.value
+ + tfr3_sec->output_section->vma
+ + tfr3_sec->output_offset);
- bfd_putl64 (tfr3_val, tfr->tfr3_func);
- bfd_putl64 (_bfd_get_gp_value (info->output_bfd), tfr->tfr3_gp);
+ bfd_putl64 (tfr3_val, tfr->tfr3_func);
+ bfd_putl64 (_bfd_get_gp_value (info->output_bfd), tfr->tfr3_gp);
}
/* FIXME: set linker flags,
static const struct bfd_elf_special_section elf64_ia64_special_sections[] =
{
- { STRING_COMMA_LEN (".sbss"), -1, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
+ { STRING_COMMA_LEN (".sbss"), -1, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
{ STRING_COMMA_LEN (".sdata"), -1, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
static bfd_boolean
asection *newsect = hdr->bfd_section;
if (! bfd_set_section_flags
- (abfd, newsect, bfd_get_section_flags (abfd, newsect) | secflags))
+ (abfd, newsect, bfd_get_section_flags (abfd, newsect) | secflags))
return FALSE;
}
{
case SHT_IA_64_UNWIND:
/* VMS requires sh_info to point to the unwind info section. */
- hdr->sh_info = unwind_info_sect_idx;
+ hdr->sh_info = unwind_info_sect_idx;
break;
}
}
if ((isize & 7) != 0)
{
int ishort = 8 - (isize & 7);
- bfd_uint64_t pad = 0;
+ bfd_uint64_t pad = 0;
bfd_seek (abfd, isize, SEEK_SET);
bfd_bwrite (&pad, ishort, abfd);
/* Be sure there are dynamic sections. */
if (! elf64_ia64_create_dynamic_sections (htab->dynobj, info))
- goto error_return;
+ goto error_return;
s = bfd_get_section_by_name (abfd, ".dynamic");
if (s == NULL)
- {
- /* VMS libraries do not have dynamic sections. Create one from
- the segment. */
- Elf_Internal_Phdr *phdr;
- unsigned int i, phnum;
-
- phdr = elf_tdata (abfd)->phdr;
- if (phdr == NULL)
- goto error_return;
- phnum = elf_elfheader (abfd)->e_phnum;
- for (i = 0; i < phnum; phdr++)
- if (phdr->p_type == PT_DYNAMIC)
- {
- s = bfd_make_section (abfd, ".dynamic");
- if (s == NULL)
- goto error_return;
- s->vma = phdr->p_vaddr;
- s->lma = phdr->p_paddr;
- s->size = phdr->p_filesz;
- s->filepos = phdr->p_offset;
- s->flags |= SEC_HAS_CONTENTS;
- s->alignment_power = bfd_log2 (phdr->p_align);
- break;
- }
- if (s == NULL)
- goto error_return;
- }
+ {
+ /* VMS libraries do not have dynamic sections. Create one from
+ the segment. */
+ Elf_Internal_Phdr *phdr;
+ unsigned int i, phnum;
+
+ phdr = elf_tdata (abfd)->phdr;
+ if (phdr == NULL)
+ goto error_return;
+ phnum = elf_elfheader (abfd)->e_phnum;
+ for (i = 0; i < phnum; phdr++)
+ if (phdr->p_type == PT_DYNAMIC)
+ {
+ s = bfd_make_section (abfd, ".dynamic");
+ if (s == NULL)
+ goto error_return;
+ s->vma = phdr->p_vaddr;
+ s->lma = phdr->p_paddr;
+ s->size = phdr->p_filesz;
+ s->filepos = phdr->p_offset;
+ s->flags |= SEC_HAS_CONTENTS;
+ s->alignment_power = bfd_log2 (phdr->p_align);
+ break;
+ }
+ if (s == NULL)
+ goto error_return;
+ }
/* Extract IDENT. */
if (!bfd_malloc_and_get_section (abfd, s, &dynbuf))
- {
+ {
error_free_dyn:
- free (dynbuf);
- goto error_return;
- }
+ free (dynbuf);
+ goto error_return;
+ }
for (extdyn = dynbuf;
- extdyn < dynbuf + s->size;
- extdyn += bed->s->sizeof_dyn)
- {
- Elf_Internal_Dyn dyn;
-
- bed->s->swap_dyn_in (abfd, extdyn, &dyn);
- if (dyn.d_tag == DT_IA_64_VMS_IDENT)
- {
- bfd_uint64_t tagv = dyn.d_un.d_val;
- elf_ia64_vms_ident (abfd) = tagv;
- break;
- }
- }
+ extdyn < dynbuf + s->size;
+ extdyn += bed->s->sizeof_dyn)
+ {
+ Elf_Internal_Dyn dyn;
+
+ bed->s->swap_dyn_in (abfd, extdyn, &dyn);
+ if (dyn.d_tag == DT_IA_64_VMS_IDENT)
+ {
+ bfd_uint64_t tagv = dyn.d_un.d_val;
+ elf_ia64_vms_ident (abfd) = tagv;
+ break;
+ }
+ }
if (extdyn >= dynbuf + s->size)
- {
- /* Ident not found. */
- goto error_free_dyn;
- }
+ {
+ /* Ident not found. */
+ goto error_free_dyn;
+ }
free (dynbuf);
/* We do not want to include any of the sections in a dynamic
bfd_section_list_clear (abfd);
/* FIXME: should we detect if this library is already included ?
- This should be harmless and shouldn't happen in practice. */
+ This should be harmless and shouldn't happen in practice. */
}
hdr = &elf_tdata (abfd)->symtab_hdr;
new_sec = sec;
if (! bfd_is_und_section (sec))
- h = elf_link_hash_lookup (htab, name, TRUE, FALSE, FALSE);
+ h = elf_link_hash_lookup (htab, name, TRUE, FALSE, FALSE);
else
- h = ((struct elf_link_hash_entry *) bfd_wrapped_link_hash_lookup
- (abfd, info, name, TRUE, FALSE, FALSE));
+ h = ((struct elf_link_hash_entry *) bfd_wrapped_link_hash_lookup
+ (abfd, info, name, TRUE, FALSE, FALSE));
if (h == NULL)
- goto error_free_sym;
+ goto error_free_sym;
*sym_hash = h;
break;
case bfd_link_hash_defined:
- if (abfd->selective_search)
- continue;
- /* Fall-through. */
+ if (abfd->selective_search)
+ continue;
+ /* Fall-through. */
case bfd_link_hash_defweak:
old_bfd = h->root.u.def.section->owner;
break;
}
else
{
- BFD_ASSERT (!h->def_dynamic);
+ BFD_ASSERT (!h->def_dynamic);
h->def_regular = 1;
}
}
else
{
BFD_ASSERT (definition);
- h->def_dynamic = 1;
- h->dynindx = -2;
- ((struct elf64_ia64_link_hash_entry *)h)->shl = abfd;
+ h->def_dynamic = 1;
+ h->dynindx = -2;
+ ((struct elf64_ia64_link_hash_entry *)h)->shl = abfd;
}
}
}
entry if it is the tail, because that would lose any
entries we add to the list later on. */
if (*pundef != info->hash->undefs_tail)
- {
- *pundef = *next_pundef;
- next_pundef = pundef;
- }
+ {
+ *pundef = *next_pundef;
+ next_pundef = pundef;
+ }
continue;
}
return FALSE;
if (element->archive_pass == -1 || element->archive_pass == pass)
- {
- /* Next symbol if this archive is wrong or already handled. */
- continue;
- }
+ {
+ /* Next symbol if this archive is wrong or already handled. */
+ continue;
+ }
orig_element = element;
if (bfd_is_thin_archive (abfd))
- {
- element = _bfd_vms_lib_get_imagelib_file (element);
- if (element == NULL || !bfd_check_format (element, bfd_object))
- {
- orig_element->archive_pass = -1;
- return FALSE;
- }
- }
+ {
+ element = _bfd_vms_lib_get_imagelib_file (element);
+ if (element == NULL || !bfd_check_format (element, bfd_object))
+ {
+ orig_element->archive_pass = -1;
+ return FALSE;
+ }
+ }
else if (! bfd_check_format (element, bfd_object))
- {
- element->archive_pass = -1;
- return FALSE;
- }
+ {
+ element->archive_pass = -1;
+ return FALSE;
+ }
/* Unlike the generic linker, we know that this element provides
a definition for an undefined symbol and we know that we want
to include it. We don't need to check anything. */
if (! (*info->callbacks->add_archive_element) (info, element,
- h->root.string, &element))
+ h->root.string, &element))
continue;
if (! elf64_vms_link_add_object_symbols (element, info))
return FALSE;
/* VMS link methods. */
#undef bfd_elf64_bfd_link_add_symbols
-#define bfd_elf64_bfd_link_add_symbols elf64_vms_bfd_link_add_symbols
+#define bfd_elf64_bfd_link_add_symbols elf64_vms_bfd_link_add_symbols
#undef elf_backend_want_got_sym
-#define elf_backend_want_got_sym 0
+#define elf_backend_want_got_sym 0
#undef bfd_elf64_mkobject
#define bfd_elf64_mkobject elf64_ia64_vms_mkobject
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_GPREL", /* name */
TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A MIPS16 reference to the global offset table. */
"R_MIPS16_GOT16", /* name */
TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A MIPS16 call through the global offset table. */
"R_MIPS16_CALL16", /* name */
TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* MIPS16 high 16 bits of symbol value. */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_GPREL", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A MIPS16 reference to the global offset table. */
"R_MIPS16_GOT16", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A MIPS16 call through the global offset table. */
"R_MIPS16_CALL16", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* MIPS16 high 16 bits of symbol value. */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
_bfd_mips_elf_generic_reloc, /* special_function */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
_bfd_mips_elf_generic_reloc, /* special_function */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_COPY", /* name */
FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0x0, /* dst_mask */
+ 0x0, /* src_mask */
+ 0x0, /* dst_mask */
FALSE); /* pcrel_offset */
/* Originally a VxWorks extension, but now used for other systems too. */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_JUMP_SLOT", /* name */
FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0x0, /* dst_mask */
+ 0x0, /* src_mask */
+ 0x0, /* dst_mask */
FALSE); /* pcrel_offset */
/* Used in EH tables. */
"R_MIPS_EH", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
+ 0xffffffff, /* dst_mask */
FALSE); /* pcrel_offset */
\f
FALSE, /* partial_inplace */
~0x0100ffff, /* src_mask */
0x0100ffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
HOWTO (R_MMIX_CBRANCH_J, /* type */
2, /* rightshift */
for (rel = relocs; rel < rel_end; rel++)
{
switch (ELF64_R_TYPE (rel->r_info))
- {
+ {
/* This relocation causes a GREG allocation. We need to count
them, and we need to create a section for them, so we need an
object to fake as the owner of that section. We can't use
r_symndx = ELF64_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
switch (ELF64_R_TYPE (rel->r_info))
{
- /* This relocation describes the C++ object vtable hierarchy.
- Reconstruct it for later use during GC. */
- case R_MMIX_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
-
- /* This relocation describes which C++ vtable entries are actually
- used. Record for later use during GC. */
- case R_MMIX_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
+ /* This relocation describes the C++ object vtable hierarchy.
+ Reconstruct it for later use during GC. */
+ case R_MMIX_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
+
+ /* This relocation describes which C++ vtable entries are actually
+ used. Record for later use during GC. */
+ case R_MMIX_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
}
}
|| (sec->flags & SEC_CODE) == 0
|| (sec->flags & SEC_LINKER_CREATED) != 0
/* If no R_MMIX_BASE_PLUS_OFFSET relocs and no PUSHJ-stub relocs,
- then nothing to do. */
+ then nothing to do. */
|| (bpodata == NULL
&& mmix_elf_section_data (sec)->pjs.n_pushj_relocs == 0))
return TRUE;
}
\f
#define ELF_ARCH bfd_arch_mmix
-#define ELF_MACHINE_CODE EM_MMIX
+#define ELF_MACHINE_CODE EM_MMIX
/* According to mmix-doc page 36 (paragraph 45), this should be (1LL << 48LL).
However, that's too much for something somewhere in the linker part of
#define LD_R11_0R11 0xe96b0000 /* ld %r11,xxx+16@l(%r11) */
#define BCTR 0x4e800420 /* bctr */
-#define ADDI_R11_R11 0x396b0000 /* addi %r11,%r11,off@l */
-#define ADDIS_R2_R2 0x3c420000 /* addis %r2,%r2,off@ha */
-#define ADDI_R2_R2 0x38420000 /* addi %r2,%r2,off@l */
-
-#define XOR_R2_R12_R12 0x7d826278 /* xor %r2,%r12,%r12 */
-#define ADD_R11_R11_R2 0x7d6b1214 /* add %r11,%r11,%r2 */
-#define XOR_R11_R12_R12 0x7d8b6278 /* xor %r11,%r12,%r12 */
-#define ADD_R2_R2_R11 0x7c425a14 /* add %r2,%r2,%r11 */
-#define CMPLDI_R2_0 0x28220000 /* cmpldi %r2,0 */
-#define BNECTR 0x4ca20420 /* bnectr+ */
-#define BNECTR_P4 0x4ce20420 /* bnectr+ */
+#define ADDI_R11_R11 0x396b0000 /* addi %r11,%r11,off@l */
+#define ADDIS_R2_R2 0x3c420000 /* addis %r2,%r2,off@ha */
+#define ADDI_R2_R2 0x38420000 /* addi %r2,%r2,off@l */
+
+#define XOR_R2_R12_R12 0x7d826278 /* xor %r2,%r12,%r12 */
+#define ADD_R11_R11_R2 0x7d6b1214 /* add %r11,%r11,%r2 */
+#define XOR_R11_R12_R12 0x7d8b6278 /* xor %r11,%r12,%r12 */
+#define ADD_R2_R2_R11 0x7c425a14 /* add %r2,%r2,%r11 */
+#define CMPLDI_R2_0 0x28220000 /* cmpldi %r2,0 */
+#define BNECTR 0x4ca20420 /* bnectr+ */
+#define BNECTR_P4 0x4ce20420 /* bnectr+ */
#define LD_R12_0R2 0xe9820000 /* ld %r12,xxx+0(%r2) */
#define LD_R11_0R2 0xe9620000 /* ld %r11,xxx+0(%r2) */
-#define LD_R2_0R2 0xe8420000 /* ld %r2,xxx+0(%r2) */
+#define LD_R2_0R2 0xe8420000 /* ld %r2,xxx+0(%r2) */
-#define LD_R2_0R1 0xe8410000 /* ld %r2,0(%r1) */
-#define LD_R2_0R12 0xe84c0000 /* ld %r2,0(%r12) */
-#define ADD_R2_R2_R12 0x7c426214 /* add %r2,%r2,%r12 */
+#define LD_R2_0R1 0xe8410000 /* ld %r2,0(%r1) */
+#define LD_R2_0R12 0xe84c0000 /* ld %r2,0(%r12) */
+#define ADD_R2_R2_R12 0x7c426214 /* add %r2,%r2,%r12 */
-#define LIS_R2 0x3c400000 /* lis %r2,xxx@ha */
+#define LIS_R2 0x3c400000 /* lis %r2,xxx@ha */
#define ADDIS_R2_R12 0x3c4c0000 /* addis %r2,%r12,xxx@ha */
#define ADDIS_R12_R2 0x3d820000 /* addis %r12,%r2,xxx@ha */
#define ADDIS_R12_R12 0x3d8c0000 /* addis %r12,%r12,xxx@ha */
-#define LD_R12_0R12 0xe98c0000 /* ld %r12,xxx@l(%r12) */
+#define LD_R12_0R12 0xe98c0000 /* ld %r12,xxx@l(%r12) */
/* glink call stub instructions. We enter with the index in R0. */
#define GLINK_CALL_STUB_SIZE (16*4)
static const struct bfd_elf_special_section ppc64_elf_special_sections[]=
{
- { STRING_COMMA_LEN (".plt"), 0, SHT_NOBITS, 0 },
- { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
+ { STRING_COMMA_LEN (".plt"), 0, SHT_NOBITS, 0 },
+ { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
- { STRING_COMMA_LEN (".toc"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
- { STRING_COMMA_LEN (".toc1"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { STRING_COMMA_LEN (".toc"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
+ { STRING_COMMA_LEN (".toc1"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE },
{ STRING_COMMA_LEN (".tocbss"), 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
enum _ppc64_sec_type {
/* Multi-instruction sequences that access the TOC can be
optimized, eg. addis ra,r2,0; addi rb,ra,x;
- to nop; addi rb,r2,x; */
+ to nop; addi rb,r2,x; */
howto = ppc64_elf_howto_table[(int) r_type];
switch (r_type)
{
0, /* dst_mask */
FALSE), /* pcrel_offset */
- HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE),
- HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
- bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE),
- HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE),
+ HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE),
+ HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE),
+ HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE),
+ HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE),
HOWTO(R_390_PC32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE),
+ bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE),
HOWTO(R_390_GOT12, 0, 1, 12, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE),
+ bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE),
HOWTO(R_390_GOT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE),
+ bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE),
HOWTO(R_390_PLT32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_COPY, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,MINUS_ONE, FALSE),
- HOWTO(R_390_GLOB_DAT, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE),
+ HOWTO(R_390_COPY, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,MINUS_ONE, FALSE),
+ HOWTO(R_390_GLOB_DAT, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GLOB_DAT", FALSE, 0,MINUS_ONE, FALSE),
- HOWTO(R_390_JMP_SLOT, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_JMP_SLOT, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_JMP_SLOT", FALSE, 0,MINUS_ONE, FALSE),
- HOWTO(R_390_RELATIVE, 0, 4, 64, TRUE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_RELATIVE, 0, 4, 64, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_RELATIVE", FALSE, 0,MINUS_ONE, FALSE),
- HOWTO(R_390_GOTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTOFF32", FALSE, 0,MINUS_ONE, FALSE),
- HOWTO(R_390_GOTPC, 0, 4, 64, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,MINUS_ONE, TRUE),
- HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE),
- HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE),
- HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTPC, 0, 4, 64, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,MINUS_ONE, TRUE),
+ HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE),
+ HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE),
+ HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE),
+ HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT16DBL", FALSE, 0,0x0000ffff, TRUE),
HOWTO(R_390_PC32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE),
+ bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE),
HOWTO(R_390_PLT32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT32DBL", FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPCDBL", FALSE, 0,MINUS_ONE, TRUE),
- HOWTO(R_390_64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_64", FALSE, 0,MINUS_ONE, FALSE),
+ HOWTO(R_390_64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_64", FALSE, 0,MINUS_ONE, FALSE),
HOWTO(R_390_PC64, 0, 4, 64, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC64", FALSE, 0,MINUS_ONE, TRUE),
+ bfd_elf_generic_reloc, "R_390_PC64", FALSE, 0,MINUS_ONE, TRUE),
HOWTO(R_390_GOT64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOT64", FALSE, 0,MINUS_ONE, FALSE),
+ bfd_elf_generic_reloc, "R_390_GOT64", FALSE, 0,MINUS_ONE, FALSE),
HOWTO(R_390_PLT64, 0, 4, 64, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PLT64", FALSE, 0,MINUS_ONE, TRUE),
+ bfd_elf_generic_reloc, "R_390_PLT64", FALSE, 0,MINUS_ONE, TRUE),
HOWTO(R_390_GOTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,MINUS_ONE, TRUE),
- HOWTO(R_390_GOTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,MINUS_ONE, TRUE),
+ HOWTO(R_390_GOTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTOFF16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_GOTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTOFF64", FALSE, 0,MINUS_ONE, FALSE),
HOWTO(R_390_GOTPLT12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "R_390_GOTPLT12", FALSE, 0,0x00000fff, FALSE),
- HOWTO(R_390_GOTPLT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTPLT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPLT16", FALSE, 0,0x0000ffff, FALSE),
HOWTO(R_390_GOTPLT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPLT32", FALSE, 0,0xffffffff, FALSE),
bfd_elf_generic_reloc, "R_390_GOTPLT64", FALSE, 0,MINUS_ONE, FALSE),
HOWTO(R_390_GOTPLTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPLTENT",FALSE, 0,MINUS_ONE, TRUE),
- HOWTO(R_390_PLTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_PLTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLTOFF16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_PLTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_PLTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLTOFF32", FALSE, 0,0xffffffff, FALSE),
- HOWTO(R_390_PLTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_PLTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLTOFF64", FALSE, 0,MINUS_ONE, FALSE),
HOWTO(R_390_TLS_LOAD, 0, 0, 0, FALSE, 0, complain_overflow_dont,
s390_tls_reloc, "R_390_TLS_LOAD", FALSE, 0, 0, FALSE),
HOWTO(R_390_TLS_LDCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont,
s390_tls_reloc, "R_390_TLS_LDCALL", FALSE, 0, 0, FALSE),
EMPTY_HOWTO (R_390_TLS_GD32), /* Empty entry for R_390_TLS_GD32. */
- HOWTO(R_390_TLS_GD64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_TLS_GD64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_TLS_GD64", FALSE, 0, MINUS_ONE, FALSE),
HOWTO(R_390_TLS_GOTIE12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "R_390_TLS_GOTIE12", FALSE, 0, 0x00000fff, FALSE),
HOWTO(R_390_TLS_LDM64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_TLS_LDM64", FALSE, 0, MINUS_ONE, FALSE),
EMPTY_HOWTO (R_390_TLS_IE32), /* Empty entry for R_390_TLS_IE32. */
- HOWTO(R_390_TLS_IE64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_TLS_IE64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_TLS_IE64", FALSE, 0, MINUS_ONE, FALSE),
HOWTO(R_390_TLS_IEENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_TLS_IEENT", FALSE, 0, MINUS_ONE, TRUE),
EMPTY_HOWTO (R_390_TLS_LE32), /* Empty entry for R_390_TLS_LE32. */
- HOWTO(R_390_TLS_LE64, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_TLS_LE64, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_TLS_LE64", FALSE, 0, MINUS_ONE, FALSE),
EMPTY_HOWTO (R_390_TLS_LDO32), /* Empty entry for R_390_TLS_LDO32. */
HOWTO(R_390_TLS_LDO64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_TLS_DTPOFF", FALSE, 0, MINUS_ONE, FALSE),
HOWTO(R_390_TLS_TPOFF, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_TLS_TPOFF", FALSE, 0, MINUS_ONE, FALSE),
- HOWTO(R_390_20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
+ HOWTO(R_390_20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_20", FALSE, 0,0x0fffff00, FALSE),
HOWTO(R_390_GOT20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_GOT20", FALSE, 0,0x0fffff00, FALSE),
- HOWTO(R_390_GOTPLT20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
+ HOWTO(R_390_GOTPLT20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_GOTPLT20", FALSE, 0,0x0fffff00, FALSE),
HOWTO(R_390_TLS_GOTIE20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_TLS_GOTIE20", FALSE, 0,0x0fffff00, FALSE),
HOWTO(R_390_IRELATIVE, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_IRELATIVE", FALSE, 0, MINUS_ONE, FALSE),
- HOWTO(R_390_PC12DBL, 1, 1, 12, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC12DBL", FALSE, 0,0x00000fff, TRUE),
- HOWTO(R_390_PLT12DBL, 1, 1, 12, TRUE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_PC12DBL, 1, 1, 12, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC12DBL", FALSE, 0,0x00000fff, TRUE),
+ HOWTO(R_390_PLT12DBL, 1, 1, 12, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT12DBL", FALSE, 0,0x00000fff, TRUE),
- HOWTO(R_390_PC24DBL, 1, 2, 24, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC24DBL", FALSE, 0,0x00ffffff, TRUE),
- HOWTO(R_390_PLT24DBL, 1, 2, 24, TRUE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_PC24DBL, 1, 2, 24, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC24DBL", FALSE, 0,0x00ffffff, TRUE),
+ HOWTO(R_390_PLT24DBL, 1, 2, 24, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT24DBL", FALSE, 0,0x00ffffff, TRUE),
};
and insert the address in the GOT.
PLT1: LARL 1,<fn>@GOTENT # 6 bytes Load address of GOT entry in r1
- LG 1,0(1) # 6 bytes Load address from GOT in r1
- BCR 15,1 # 2 bytes Jump to address
- RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
- LGF 1,12(1) # 6 bytes Load offset in symbl table in r1
- BRCL 15,-x # 6 bytes Jump to start of PLT
- .long ? # 4 bytes offset into .rela.plt
+ LG 1,0(1) # 6 bytes Load address from GOT in r1
+ BCR 15,1 # 2 bytes Jump to address
+ RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
+ LGF 1,12(1) # 6 bytes Load offset in symbl table in r1
+ BRCL 15,-x # 6 bytes Jump to start of PLT
+ .long ? # 4 bytes offset into .rela.plt
Total = 32 bytes per PLT entry
Fixup at offset 2: relative address to GOT entry
static const bfd_byte elf_s390x_plt_entry[PLT_ENTRY_SIZE] =
{
- 0xc0, 0x10, 0x00, 0x00, 0x00, 0x00, /* larl %r1,. */
- 0xe3, 0x10, 0x10, 0x00, 0x00, 0x04, /* lg %r1,0(%r1) */
- 0x07, 0xf1, /* br %r1 */
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0xe3, 0x10, 0x10, 0x0c, 0x00, 0x14, /* lgf %r1,12(%r1) */
- 0xc0, 0xf4, 0x00, 0x00, 0x00, 0x00, /* jg first plt */
- 0x00, 0x00, 0x00, 0x00 /* .long 0x00000000 */
+ 0xc0, 0x10, 0x00, 0x00, 0x00, 0x00, /* larl %r1,. */
+ 0xe3, 0x10, 0x10, 0x00, 0x00, 0x04, /* lg %r1,0(%r1) */
+ 0x07, 0xf1, /* br %r1 */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0xe3, 0x10, 0x10, 0x0c, 0x00, 0x14, /* lgf %r1,12(%r1) */
+ 0xc0, 0xf4, 0x00, 0x00, 0x00, 0x00, /* jg first plt */
+ 0x00, 0x00, 0x00, 0x00 /* .long 0x00000000 */
};
/* The first PLT entry pushes the offset into the symbol table
static const bfd_byte elf_s390x_first_plt_entry[PLT_FIRST_ENTRY_SIZE] =
{
- 0xe3, 0x10, 0xf0, 0x38, 0x00, 0x24, /* stg %r1,56(%r15) */
- 0xc0, 0x10, 0x00, 0x00, 0x00, 0x00, /* larl %r1,. */
- 0xd2, 0x07, 0xf0, 0x30, 0x10, 0x08, /* mvc 48(8,%r15),8(%r1) */
- 0xe3, 0x10, 0x10, 0x10, 0x00, 0x04, /* lg %r1,16(%r1) */
- 0x07, 0xf1, /* br %r1 */
- 0x07, 0x00, /* nopr %r0 */
- 0x07, 0x00, /* nopr %r0 */
- 0x07, 0x00 /* nopr %r0 */
+ 0xe3, 0x10, 0xf0, 0x38, 0x00, 0x24, /* stg %r1,56(%r15) */
+ 0xc0, 0x10, 0x00, 0x00, 0x00, 0x00, /* larl %r1,. */
+ 0xd2, 0x07, 0xf0, 0x30, 0x10, 0x08, /* mvc 48(8,%r15),8(%r1) */
+ 0xe3, 0x10, 0x10, 0x10, 0x00, 0x04, /* lg %r1,16(%r1) */
+ 0x07, 0xf1, /* br %r1 */
+ 0x07, 0x00, /* nopr %r0 */
+ 0x07, 0x00, /* nopr %r0 */
+ 0x07, 0x00 /* nopr %r0 */
};
{
if (indx == 0)
{
- BFD_ASSERT (! unresolved_reloc);
+ BFD_ASSERT (! unresolved_reloc);
bfd_put_64 (output_bfd,
relocation - dtpoff_base (info),
htab->elf.sgot->contents + off + GOT_ENTRY_SIZE);
#define bfd_elf64_bfd_is_local_label_name elf_s390_is_local_label_name
#define bfd_elf64_bfd_link_hash_table_create elf_s390_link_hash_table_create
#define bfd_elf64_bfd_reloc_type_lookup elf_s390_reloc_type_lookup
-#define bfd_elf64_bfd_reloc_name_lookup elf_s390_reloc_name_lookup
+#define bfd_elf64_bfd_reloc_name_lookup elf_s390_reloc_name_lookup
#define bfd_elf64_bfd_merge_private_bfd_data elf64_s390_merge_private_bfd_data
#define elf_backend_adjust_dynamic_symbol elf_s390_adjust_dynamic_symbol
#define elf_backend_grok_psinfo elf_s390_grok_psinfo
#define elf_backend_write_core_note elf_s390_write_core_note
#define elf_backend_plt_sym_val elf_s390_plt_sym_val
-#define elf_backend_add_symbol_hook elf_s390_add_symbol_hook
-#define elf_backend_sort_relocs_p elf_s390_elf_sort_relocs_p
+#define elf_backend_add_symbol_hook elf_s390_add_symbol_hook
+#define elf_backend_sort_relocs_p elf_s390_elf_sort_relocs_p
#define elf_backend_additional_program_headers elf_s390_additional_program_headers
#define elf_backend_modify_segment_map elf_s390_modify_segment_map
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_SH_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_SH_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_SH_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage */
HOWTO (R_SH_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 2, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_SH_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_SH_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* For 32-bit sh, this is R_SH_LOOP_START. */
EMPTY_HOWTO (36),
FALSE, /* partial_inplace */
0, /* src_mask */
0xfc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in SHARI, SHLLI et al. */
HOWTO (R_SH_DIR6U, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0xfc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in BxxI, LDHI.L et al. */
HOWTO (R_SH_DIR6S, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0xfc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in ADDI, ANDI et al. */
HOWTO (R_SH_DIR10S, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in LD.UW, ST.W et al. */
HOWTO (R_SH_DIR10SW, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in LD.L, FLD.S et al. */
HOWTO (R_SH_DIR10SL, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in FLD.D, FST.P et al. */
HOWTO (R_SH_DIR10SQ, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
EMPTY_HOWTO (52),
EMPTY_HOWTO (53),
10, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_SH_GOT_LOW16", /* name */
+ "R_SH_GOT_LOW16", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 16) & 65536). */
HOWTO (R_SH_GOT_MEDLOW16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 32) & 65536). */
HOWTO (R_SH_GOT_MEDHI16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 48) & 65536). */
HOWTO (R_SH_GOT_HI16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI (x & 65536). */
HOWTO (R_SH_GOTPLT_LOW16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 16) & 65536). */
HOWTO (R_SH_GOTPLT_MEDLOW16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 32) & 65536). */
HOWTO (R_SH_GOTPLT_MEDHI16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 48) & 65536). */
HOWTO (R_SH_GOTPLT_HI16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI (x & 65536). */
HOWTO (R_SH_PLT_LOW16, /* type */
10, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_SH_PLT_LOW16", /* name */
+ "R_SH_PLT_LOW16", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 16) & 65536). */
HOWTO (R_SH_PLT_MEDLOW16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 32) & 65536). */
HOWTO (R_SH_PLT_MEDHI16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 48) & 65536). */
HOWTO (R_SH_PLT_HI16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* Used in MOVI and SHORI (x & 65536). */
HOWTO (R_SH_GOTOFF_LOW16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 16) & 65536). */
HOWTO (R_SH_GOTOFF_MEDLOW16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 32) & 65536). */
HOWTO (R_SH_GOTOFF_MEDHI16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 48) & 65536). */
HOWTO (R_SH_GOTOFF_HI16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI (x & 65536). */
HOWTO (R_SH_GOTPC_LOW16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 16) & 65536). */
HOWTO (R_SH_GOTPC_MEDLOW16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 32) & 65536). */
HOWTO (R_SH_GOTPC_MEDHI16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x >> 48) & 65536). */
HOWTO (R_SH_GOTPC_HI16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* Used in LD.L, FLD.S et al. */
HOWTO (R_SH_GOT10BY4, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in LD.L, FLD.S et al. */
HOWTO (R_SH_GOTPLT10BY4, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in FLD.D, FST.P et al. */
HOWTO (R_SH_GOT10BY8, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in FLD.D, FST.P et al. */
HOWTO (R_SH_GOTPLT10BY8, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0xffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_SH_COPY64, /* type */
0, /* rightshift */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_SH_COPY64", /* name */
+ "R_SH_COPY64", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
((bfd_vma) 0) - 1, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_SH_GLOB_DAT64, /* type */
0, /* rightshift */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_SH_GLOB_DAT64", /* name */
+ "R_SH_GLOB_DAT64", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
((bfd_vma) 0) - 1, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_SH_JMP_SLOT64, /* type */
0, /* rightshift */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_SH_JMP_SLOT64", /* name */
+ "R_SH_JMP_SLOT64", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
((bfd_vma) 0) - 1, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
HOWTO (R_SH_RELATIVE64, /* type */
0, /* rightshift */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_SH_RELATIVE64", /* name */
+ "R_SH_RELATIVE64", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
((bfd_vma) 0) - 1, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
EMPTY_HOWTO (197),
EMPTY_HOWTO (198),
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in SHORI. */
HOWTO (R_SH_IMMU16, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI (x & 65536). */
HOWTO (R_SH_IMM_LOW16, /* type */
10, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_SH_IMM_LOW16", /* name */
+ "R_SH_IMM_LOW16", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI ((x - $) & 65536). */
HOWTO (R_SH_IMM_LOW16_PCREL, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI (((x - $) >> 16) & 65536). */
HOWTO (R_SH_IMM_MEDLOW16_PCREL, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI (((x - $) >> 32) & 65536). */
HOWTO (R_SH_IMM_MEDHI16_PCREL, /* type */
FALSE, /* partial_inplace */
0, /* src_mask */
0x3fffc00, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* Used in MOVI and SHORI (((x - $) >> 48) & 65536). */
HOWTO (R_SH_IMM_HI16_PCREL, /* type */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_SH_64", /* name */
+ "R_SH_64", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
((bfd_vma) 0) - 1, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* For the .uaquad pseudo, (x - $). */
HOWTO (R_SH_64_PCREL, /* type */
return FALSE;
}
- addend = bfd_get_32 (input_bfd, contents + rel->r_offset);
- msec = sec;
- addend =
+ addend = bfd_get_32 (input_bfd, contents + rel->r_offset);
+ msec = sec;
+ addend =
_bfd_elf_rel_local_sym (output_bfd, sym, &msec, addend)
- relocation;
addend += msec->output_section->vma + msec->output_offset;
relocation = sgot->output_offset + off;
}
- relocation -= GOT_BIAS;
+ relocation -= GOT_BIAS;
goto final_link_relocate;
r_symndx = ELF64_R_SYM (rel->r_info);
if (r_symndx < symtab_hdr->sh_info)
- h = NULL;
+ h = NULL;
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
}
switch (ELF64_R_TYPE (rel->r_info))
- {
+ {
/* This relocation describes the C++ object vtable hierarchy.
Reconstruct it for later use during GC. */
- case R_SH_GNU_VTINHERIT:
- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
- return FALSE;
- break;
+ case R_SH_GNU_VTINHERIT:
+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+ return FALSE;
+ break;
/* This relocation describes which C++ vtable entries are actually
used. Record for later use during GC. */
- case R_SH_GNU_VTENTRY:
- BFD_ASSERT (h != NULL);
- if (h != NULL
- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
- return FALSE;
- break;
+ case R_SH_GNU_VTENTRY:
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ return FALSE;
+ break;
force_got:
case R_SH_GOT_LOW16:
}
else
{
- /* This is a global offset table entry for a local
+ /* This is a global offset table entry for a local
symbol. */
if (local_got_offsets == NULL)
{
}
break;
- }
+ }
}
return TRUE;
static const struct bfd_elf_special_section sh64_elf64_special_sections[]=
{
{ STRING_COMMA_LEN (".cranges"), 0, SHT_PROGBITS, 0 },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
#define TARGET_BIG_SYM sh64_elf64_vec
sh_elf64_merge_private_data
#define elf_backend_fake_sections sh64_elf64_fake_sections
-#define elf_backend_gc_mark_hook sh_elf64_gc_mark_hook
-#define elf_backend_check_relocs sh_elf64_check_relocs
+#define elf_backend_gc_mark_hook sh_elf64_gc_mark_hook
+#define elf_backend_check_relocs sh_elf64_check_relocs
#define elf_backend_can_gc_sections 1
sh64_elf64_merge_symbol_attribute
#define elf_backend_final_write_processing \
- sh64_elf64_final_write_processing
+ sh64_elf64_final_write_processing
#define elf_backend_create_dynamic_sections \
sh64_elf64_create_dynamic_sections
if (ELF64_R_SYM (rela.r_info) == STN_UNDEF
/* PR 17512: file: 996185f8. */
|| (!dynamic && ELF64_R_SYM(rela.r_info) > bfd_get_symcount(abfd))
- || (dynamic
- && ELF64_R_SYM(rela.r_info) > bfd_get_dynamic_symcount(abfd)))
+ || (dynamic
+ && ELF64_R_SYM(rela.r_info) > bfd_get_dynamic_symcount(abfd)))
relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
else
{
static void
elf64_sparc_set_reloc (bfd *abfd ATTRIBUTE_UNUSED,
- asection *asect,
- arelent **location,
- unsigned int count)
+ asection *asect,
+ arelent **location,
+ unsigned int count)
{
asect->orelocation = location;
canon_reloc_count (asect) = count;
case 6: reg -= 4; break;
default:
_bfd_error_handler
- (_("%B: Only registers %%g[2367] can be declared using STT_REGISTER"),
- abfd);
+ (_("%B: Only registers %%g[2367] can be declared using STT_REGISTER"),
+ abfd);
return FALSE;
}
if (info->output_bfd->xvec != abfd->xvec
|| (abfd->flags & DYNAMIC) != 0)
- {
+ {
/* STT_REGISTER only works when linking an elf64_sparc object.
If STT_REGISTER comes from a dynamic object, don't put it into
the output bfd. The dynamic linker will recheck it. */
*namep = NULL;
return TRUE;
- }
+ }
p = _bfd_sparc_elf_hash_table(info)->app_regs + reg;
else if (new_flags == old_flags) /* Compatible flags are ok */
;
- else /* Incompatible flags */
+ else /* Incompatible flags */
{
error = FALSE;
/* Warn about any other mismatches */
if (new_flags != old_flags)
- {
- error = TRUE;
+ {
+ error = TRUE;
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: uses different e_flags (%#x) fields than previous modules (%#x)"),
- ibfd, new_flags, old_flags);
- }
+ (_("%B: uses different e_flags (%#x) fields than previous modules (%#x)"),
+ ibfd, new_flags, old_flags);
+ }
elf_elfheader (obfd)->e_flags = old_flags;
if (error)
- {
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
}
return _bfd_sparc_elf_merge_private_bfd_data (ibfd, info);
}
fprintf (file, "REG_%c%c%11s%c%c R", "GOLI" [reg / 8], '0' + (reg & 7), "",
((type & BSF_LOCAL)
? (type & BSF_GLOBAL) ? '!' : 'l'
- : (type & BSF_GLOBAL) ? 'g' : ' '),
- (type & BSF_WEAK) ? 'w' : ' ');
+ : (type & BSF_GLOBAL) ? 'g' : ' '),
+ (type & BSF_WEAK) ? 'w' : ' ');
if (symbol->name == NULL || symbol->name [0] == '\0')
return "#scratch";
else
#define ELF_COMMONPAGESIZE 0x10000
-#define TARGET_BIG_SYM tilegx_elf64_be_vec
-#define TARGET_BIG_NAME "elf64-tilegx-be"
-#define TARGET_LITTLE_SYM tilegx_elf64_le_vec
-#define TARGET_LITTLE_NAME "elf64-tilegx-le"
+#define TARGET_BIG_SYM tilegx_elf64_be_vec
+#define TARGET_BIG_NAME "elf64-tilegx-be"
+#define TARGET_LITTLE_SYM tilegx_elf64_le_vec
+#define TARGET_LITTLE_NAME "elf64-tilegx-le"
#define elf_backend_reloc_type_class tilegx_reloc_type_class
-#define bfd_elf64_bfd_reloc_name_lookup tilegx_reloc_name_lookup
+#define bfd_elf64_bfd_reloc_name_lookup tilegx_reloc_name_lookup
#define bfd_elf64_bfd_link_hash_table_create tilegx_elf_link_hash_table_create
#define bfd_elf64_bfd_reloc_type_lookup tilegx_reloc_type_lookup
#define bfd_elf64_bfd_merge_private_bfd_data \
#define elf_backend_finish_dynamic_sections tilegx_elf_finish_dynamic_sections
#define elf_backend_gc_mark_hook tilegx_elf_gc_mark_hook
#define elf_backend_plt_sym_val tilegx_elf_plt_sym_val
-#define elf_info_to_howto_rel NULL
-#define elf_info_to_howto tilegx_info_to_howto_rela
-#define elf_backend_grok_prstatus tilegx_elf_grok_prstatus
-#define elf_backend_grok_psinfo tilegx_elf_grok_psinfo
+#define elf_info_to_howto_rel NULL
+#define elf_info_to_howto tilegx_info_to_howto_rela
+#define elf_backend_grok_prstatus tilegx_elf_grok_prstatus
+#define elf_backend_grok_psinfo tilegx_elf_grok_psinfo
#define elf_backend_additional_program_headers tilegx_additional_program_headers
#define elf_backend_init_index_section _bfd_elf_init_1_index_section
/* This file contains sizes and offsets of Linux data structures. */
-#define TILEGX_PRSTATUS_SIZEOF 632
+#define TILEGX_PRSTATUS_SIZEOF 632
#define TILEGX_PRSTATUS_OFFSET_PR_CURSIG 12
-#define TILEGX_PRSTATUS_OFFSET_PR_PID 32
-#define TILEGX_PRSTATUS_OFFSET_PR_REG 112
+#define TILEGX_PRSTATUS_OFFSET_PR_PID 32
+#define TILEGX_PRSTATUS_OFFSET_PR_REG 112
-#define TILEGX_PRPSINFO_SIZEOF 136
-#define TILEGX_PRPSINFO_OFFSET_PR_FNAME 40
+#define TILEGX_PRPSINFO_SIZEOF 136
+#define TILEGX_PRPSINFO_OFFSET_PR_FNAME 40
#define TILEGX_PRPSINFO_OFFSET_PR_PSARGS 56
-#define ELF_PR_PSARGS_SIZE 80
+#define ELF_PR_PSARGS_SIZE 80
-#define TILEGX_GREGSET_T_SIZE 512
+#define TILEGX_GREGSET_T_SIZE 512
#endif /* _ELF64_TILEGX_H */
static const bfd_byte elf_x86_64_lazy_bnd_plt0_entry[LAZY_PLT_ENTRY_SIZE] =
{
- 0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */
+ 0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */
0xf2, 0xff, 0x25, 16, 0, 0, 0, /* bnd jmpq *GOT+16(%rip) */
- 0x0f, 0x1f, 0 /* nopl (%rax) */
+ 0x0f, 0x1f, 0 /* nopl (%rax) */
};
/* Subsequent entries for branches with BND prefx in a lazy procedure
static const bfd_byte elf_x86_64_lazy_bnd_plt_entry[LAZY_PLT_ENTRY_SIZE] =
{
- 0x68, 0, 0, 0, 0, /* pushq immediate */
- 0xf2, 0xe9, 0, 0, 0, 0, /* bnd jmpq relative */
- 0x0f, 0x1f, 0x44, 0, 0 /* nopl 0(%rax,%rax,1) */
+ 0x68, 0, 0, 0, 0, /* pushq immediate */
+ 0xf2, 0xe9, 0, 0, 0, 0, /* bnd jmpq relative */
+ 0x0f, 0x1f, 0x44, 0, 0 /* nopl 0(%rax,%rax,1) */
};
/* The first entry in the IBT-enabled lazy procedure linkage table is the
static const bfd_byte elf_x86_64_lazy_ibt_plt_entry[LAZY_PLT_ENTRY_SIZE] =
{
- 0xf3, 0x0f, 0x1e, 0xfa, /* endbr64 */
- 0x68, 0, 0, 0, 0, /* pushq immediate */
- 0xf2, 0xe9, 0, 0, 0, 0, /* bnd jmpq relative */
- 0x90 /* nop */
+ 0xf3, 0x0f, 0x1e, 0xfa, /* endbr64 */
+ 0x68, 0, 0, 0, 0, /* pushq immediate */
+ 0xf2, 0xe9, 0, 0, 0, 0, /* bnd jmpq relative */
+ 0x90 /* nop */
};
/* The first entry in the x32 IBT-enabled lazy procedure linkage table
static const bfd_byte elf_x32_lazy_ibt_plt_entry[LAZY_PLT_ENTRY_SIZE] =
{
- 0xf3, 0x0f, 0x1e, 0xfa, /* endbr64 */
- 0x68, 0, 0, 0, 0, /* pushq immediate */
- 0xe9, 0, 0, 0, 0, /* jmpq relative */
- 0x66, 0x90 /* xchg %ax,%ax */
+ 0xf3, 0x0f, 0x1e, 0xfa, /* endbr64 */
+ 0x68, 0, 0, 0, 0, /* pushq immediate */
+ 0xe9, 0, 0, 0, 0, /* jmpq relative */
+ 0x66, 0x90 /* xchg %ax,%ax */
};
/* Entries in the non-lazey procedure linkage table look like this. */
static const bfd_byte elf_x86_64_non_lazy_plt_entry[NON_LAZY_PLT_ENTRY_SIZE] =
{
- 0xff, 0x25, /* jmpq *name@GOTPC(%rip) */
- 0, 0, 0, 0, /* replaced with offset to this symbol in .got. */
- 0x66, 0x90 /* xchg %ax,%ax */
+ 0xff, 0x25, /* jmpq *name@GOTPC(%rip) */
+ 0, 0, 0, 0, /* replaced with offset to this symbol in .got. */
+ 0x66, 0x90 /* xchg %ax,%ax */
};
/* Entries for branches with BND prefix in the non-lazey procedure
static const bfd_byte elf_x86_64_non_lazy_bnd_plt_entry[NON_LAZY_PLT_ENTRY_SIZE] =
{
- 0xf2, 0xff, 0x25, /* bnd jmpq *name@GOTPC(%rip) */
- 0, 0, 0, 0, /* replaced with offset to this symbol in .got. */
- 0x90 /* nop */
+ 0xf2, 0xff, 0x25, /* bnd jmpq *name@GOTPC(%rip) */
+ 0, 0, 0, 0, /* replaced with offset to this symbol in .got. */
+ 0x90 /* nop */
};
/* Entries for branches with IBT-enabled in the non-lazey procedure
static const bfd_byte elf_x86_64_non_lazy_ibt_plt_entry[LAZY_PLT_ENTRY_SIZE] =
{
- 0xf3, 0x0f, 0x1e, 0xfa, /* endbr64 */
- 0xf2, 0xff, 0x25, /* bnd jmpq *name@GOTPC(%rip) */
+ 0xf3, 0x0f, 0x1e, 0xfa, /* endbr64 */
+ 0xf2, 0xff, 0x25, /* bnd jmpq *name@GOTPC(%rip) */
0, 0, 0, 0, /* replaced with offset to this symbol in .got. */
- 0x0f, 0x1f, 0x44, 0x00, 0x00 /* nopl 0x0(%rax,%rax,1) */
+ 0x0f, 0x1f, 0x44, 0x00, 0x00 /* nopl 0x0(%rax,%rax,1) */
};
/* Entries for branches with IBT-enabled in the x32 non-lazey procedure
static const bfd_byte elf_x32_non_lazy_ibt_plt_entry[LAZY_PLT_ENTRY_SIZE] =
{
- 0xf3, 0x0f, 0x1e, 0xfa, /* endbr64 */
- 0xff, 0x25, /* jmpq *name@GOTPC(%rip) */
+ 0xf3, 0x0f, 0x1e, 0xfa, /* endbr64 */
+ 0xff, 0x25, /* jmpq *name@GOTPC(%rip) */
0, 0, 0, 0, /* replaced with offset to this symbol in .got. */
0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00 /* nopw 0x0(%rax,%rax,1) */
};
/* These are the standard parameters. */
static const struct elf_x86_lazy_plt_layout elf_x86_64_lazy_plt =
{
- elf_x86_64_lazy_plt0_entry, /* plt0_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt0_entry_size */
- elf_x86_64_lazy_plt_entry, /* plt_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 2, /* plt0_got1_offset */
- 8, /* plt0_got2_offset */
- 12, /* plt0_got2_insn_end */
- 2, /* plt_got_offset */
- 7, /* plt_reloc_offset */
- 12, /* plt_plt_offset */
- 6, /* plt_got_insn_size */
- LAZY_PLT_ENTRY_SIZE, /* plt_plt_insn_end */
- 6, /* plt_lazy_offset */
- elf_x86_64_lazy_plt0_entry, /* pic_plt0_entry */
- elf_x86_64_lazy_plt_entry, /* pic_plt_entry */
- elf_x86_64_eh_frame_lazy_plt, /* eh_frame_plt */
+ elf_x86_64_lazy_plt0_entry, /* plt0_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt0_entry_size */
+ elf_x86_64_lazy_plt_entry, /* plt_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 2, /* plt0_got1_offset */
+ 8, /* plt0_got2_offset */
+ 12, /* plt0_got2_insn_end */
+ 2, /* plt_got_offset */
+ 7, /* plt_reloc_offset */
+ 12, /* plt_plt_offset */
+ 6, /* plt_got_insn_size */
+ LAZY_PLT_ENTRY_SIZE, /* plt_plt_insn_end */
+ 6, /* plt_lazy_offset */
+ elf_x86_64_lazy_plt0_entry, /* pic_plt0_entry */
+ elf_x86_64_lazy_plt_entry, /* pic_plt_entry */
+ elf_x86_64_eh_frame_lazy_plt, /* eh_frame_plt */
sizeof (elf_x86_64_eh_frame_lazy_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_non_lazy_plt_layout elf_x86_64_non_lazy_plt =
{
- elf_x86_64_non_lazy_plt_entry, /* plt_entry */
- elf_x86_64_non_lazy_plt_entry, /* pic_plt_entry */
- NON_LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 2, /* plt_got_offset */
- 6, /* plt_got_insn_size */
- elf_x86_64_eh_frame_non_lazy_plt, /* eh_frame_plt */
+ elf_x86_64_non_lazy_plt_entry, /* plt_entry */
+ elf_x86_64_non_lazy_plt_entry, /* pic_plt_entry */
+ NON_LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 2, /* plt_got_offset */
+ 6, /* plt_got_insn_size */
+ elf_x86_64_eh_frame_non_lazy_plt, /* eh_frame_plt */
sizeof (elf_x86_64_eh_frame_non_lazy_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_lazy_plt_layout elf_x86_64_lazy_bnd_plt =
{
- elf_x86_64_lazy_bnd_plt0_entry, /* plt0_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt0_entry_size */
- elf_x86_64_lazy_bnd_plt_entry, /* plt_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 2, /* plt0_got1_offset */
- 1+8, /* plt0_got2_offset */
- 1+12, /* plt0_got2_insn_end */
- 1+2, /* plt_got_offset */
- 1, /* plt_reloc_offset */
- 7, /* plt_plt_offset */
- 1+6, /* plt_got_insn_size */
- 11, /* plt_plt_insn_end */
- 0, /* plt_lazy_offset */
- elf_x86_64_lazy_bnd_plt0_entry, /* pic_plt0_entry */
- elf_x86_64_lazy_bnd_plt_entry, /* pic_plt_entry */
- elf_x86_64_eh_frame_lazy_bnd_plt, /* eh_frame_plt */
+ elf_x86_64_lazy_bnd_plt0_entry, /* plt0_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt0_entry_size */
+ elf_x86_64_lazy_bnd_plt_entry, /* plt_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 2, /* plt0_got1_offset */
+ 1+8, /* plt0_got2_offset */
+ 1+12, /* plt0_got2_insn_end */
+ 1+2, /* plt_got_offset */
+ 1, /* plt_reloc_offset */
+ 7, /* plt_plt_offset */
+ 1+6, /* plt_got_insn_size */
+ 11, /* plt_plt_insn_end */
+ 0, /* plt_lazy_offset */
+ elf_x86_64_lazy_bnd_plt0_entry, /* pic_plt0_entry */
+ elf_x86_64_lazy_bnd_plt_entry, /* pic_plt_entry */
+ elf_x86_64_eh_frame_lazy_bnd_plt, /* eh_frame_plt */
sizeof (elf_x86_64_eh_frame_lazy_bnd_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_non_lazy_plt_layout elf_x86_64_non_lazy_bnd_plt =
{
- elf_x86_64_non_lazy_bnd_plt_entry, /* plt_entry */
- elf_x86_64_non_lazy_bnd_plt_entry, /* pic_plt_entry */
- NON_LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 1+2, /* plt_got_offset */
- 1+6, /* plt_got_insn_size */
- elf_x86_64_eh_frame_non_lazy_plt, /* eh_frame_plt */
+ elf_x86_64_non_lazy_bnd_plt_entry, /* plt_entry */
+ elf_x86_64_non_lazy_bnd_plt_entry, /* pic_plt_entry */
+ NON_LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 1+2, /* plt_got_offset */
+ 1+6, /* plt_got_insn_size */
+ elf_x86_64_eh_frame_non_lazy_plt, /* eh_frame_plt */
sizeof (elf_x86_64_eh_frame_non_lazy_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_lazy_plt_layout elf_x86_64_lazy_ibt_plt =
{
- elf_x86_64_lazy_bnd_plt0_entry, /* plt0_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt0_entry_size */
- elf_x86_64_lazy_ibt_plt_entry, /* plt_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 2, /* plt0_got1_offset */
- 1+8, /* plt0_got2_offset */
- 1+12, /* plt0_got2_insn_end */
- 4+1+2, /* plt_got_offset */
- 4+1, /* plt_reloc_offset */
- 4+1+6, /* plt_plt_offset */
- 4+1+6, /* plt_got_insn_size */
- 4+1+5+5, /* plt_plt_insn_end */
- 0, /* plt_lazy_offset */
- elf_x86_64_lazy_bnd_plt0_entry, /* pic_plt0_entry */
- elf_x86_64_lazy_ibt_plt_entry, /* pic_plt_entry */
- elf_x86_64_eh_frame_lazy_ibt_plt, /* eh_frame_plt */
+ elf_x86_64_lazy_bnd_plt0_entry, /* plt0_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt0_entry_size */
+ elf_x86_64_lazy_ibt_plt_entry, /* plt_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 2, /* plt0_got1_offset */
+ 1+8, /* plt0_got2_offset */
+ 1+12, /* plt0_got2_insn_end */
+ 4+1+2, /* plt_got_offset */
+ 4+1, /* plt_reloc_offset */
+ 4+1+6, /* plt_plt_offset */
+ 4+1+6, /* plt_got_insn_size */
+ 4+1+5+5, /* plt_plt_insn_end */
+ 0, /* plt_lazy_offset */
+ elf_x86_64_lazy_bnd_plt0_entry, /* pic_plt0_entry */
+ elf_x86_64_lazy_ibt_plt_entry, /* pic_plt_entry */
+ elf_x86_64_eh_frame_lazy_ibt_plt, /* eh_frame_plt */
sizeof (elf_x86_64_eh_frame_lazy_ibt_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_lazy_plt_layout elf_x32_lazy_ibt_plt =
{
- elf_x86_64_lazy_plt0_entry, /* plt0_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt0_entry_size */
- elf_x32_lazy_ibt_plt_entry, /* plt_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 2, /* plt0_got1_offset */
- 8, /* plt0_got2_offset */
- 12, /* plt0_got2_insn_end */
- 4+2, /* plt_got_offset */
- 4+1, /* plt_reloc_offset */
- 4+6, /* plt_plt_offset */
- 4+6, /* plt_got_insn_size */
- 4+5+5, /* plt_plt_insn_end */
- 0, /* plt_lazy_offset */
- elf_x86_64_lazy_plt0_entry, /* pic_plt0_entry */
- elf_x32_lazy_ibt_plt_entry, /* pic_plt_entry */
- elf_x32_eh_frame_lazy_ibt_plt, /* eh_frame_plt */
+ elf_x86_64_lazy_plt0_entry, /* plt0_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt0_entry_size */
+ elf_x32_lazy_ibt_plt_entry, /* plt_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 2, /* plt0_got1_offset */
+ 8, /* plt0_got2_offset */
+ 12, /* plt0_got2_insn_end */
+ 4+2, /* plt_got_offset */
+ 4+1, /* plt_reloc_offset */
+ 4+6, /* plt_plt_offset */
+ 4+6, /* plt_got_insn_size */
+ 4+5+5, /* plt_plt_insn_end */
+ 0, /* plt_lazy_offset */
+ elf_x86_64_lazy_plt0_entry, /* pic_plt0_entry */
+ elf_x32_lazy_ibt_plt_entry, /* pic_plt_entry */
+ elf_x32_eh_frame_lazy_ibt_plt, /* eh_frame_plt */
sizeof (elf_x32_eh_frame_lazy_ibt_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_non_lazy_plt_layout elf_x86_64_non_lazy_ibt_plt =
{
- elf_x86_64_non_lazy_ibt_plt_entry, /* plt_entry */
- elf_x86_64_non_lazy_ibt_plt_entry, /* pic_plt_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 4+1+2, /* plt_got_offset */
- 4+1+6, /* plt_got_insn_size */
- elf_x86_64_eh_frame_non_lazy_plt, /* eh_frame_plt */
+ elf_x86_64_non_lazy_ibt_plt_entry, /* plt_entry */
+ elf_x86_64_non_lazy_ibt_plt_entry, /* pic_plt_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 4+1+2, /* plt_got_offset */
+ 4+1+6, /* plt_got_insn_size */
+ elf_x86_64_eh_frame_non_lazy_plt, /* eh_frame_plt */
sizeof (elf_x86_64_eh_frame_non_lazy_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_non_lazy_plt_layout elf_x32_non_lazy_ibt_plt =
{
- elf_x32_non_lazy_ibt_plt_entry, /* plt_entry */
- elf_x32_non_lazy_ibt_plt_entry, /* pic_plt_entry */
- LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
- 4+2, /* plt_got_offset */
- 4+6, /* plt_got_insn_size */
- elf_x86_64_eh_frame_non_lazy_plt, /* eh_frame_plt */
+ elf_x32_non_lazy_ibt_plt_entry, /* plt_entry */
+ elf_x32_non_lazy_ibt_plt_entry, /* pic_plt_entry */
+ LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 4+2, /* plt_got_offset */
+ 4+6, /* plt_got_insn_size */
+ elf_x86_64_eh_frame_non_lazy_plt, /* eh_frame_plt */
sizeof (elf_x86_64_eh_frame_non_lazy_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_backend_data elf_x86_64_arch_bed =
{
- is_normal /* os */
+ is_normal /* os */
};
#define elf_backend_arch_data &elf_x86_64_arch_bed
addr32 call __tls_get_addr
can transit to different access model. For largepic,
we also support:
- leaq foo@tlsgd(%rip), %rdi
- movabsq $__tls_get_addr@pltoff, %rax
- addq $r15, %rax
- call *%rax
+ leaq foo@tlsgd(%rip), %rdi
+ movabsq $__tls_get_addr@pltoff, %rax
+ addq $r15, %rax
+ call *%rax
or
- leaq foo@tlsgd(%rip), %rdi
- movabsq $__tls_get_addr@pltoff, %rax
- addq $rbx, %rax
- call *%rax */
+ leaq foo@tlsgd(%rip), %rdi
+ movabsq $__tls_get_addr@pltoff, %rax
+ addq $rbx, %rax
+ call *%rax */
static const unsigned char leaq[] = { 0x66, 0x48, 0x8d, 0x3d };
/* Check transition from LD access model. Only
leaq foo@tlsld(%rip), %rdi;
call __tls_get_addr@PLT
- or
+ or
leaq foo@tlsld(%rip), %rdi;
call *__tls_get_addr@GOTPCREL(%rip)
which may be converted to
addr32 call __tls_get_addr
can transit to different access model. For largepic
we also support:
- leaq foo@tlsld(%rip), %rdi
- movabsq $__tls_get_addr@pltoff, %rax
- addq $r15, %rax
- call *%rax
+ leaq foo@tlsld(%rip), %rdi
+ movabsq $__tls_get_addr@pltoff, %rax
+ addq $r15, %rax
+ call *%rax
or
- leaq foo@tlsld(%rip), %rdi
- movabsq $__tls_get_addr@pltoff, %rax
- addq $rbx, %rax
- call *%rax */
+ leaq foo@tlsld(%rip), %rdi
+ movabsq $__tls_get_addr@pltoff, %rax
+ addq $rbx, %rax
+ call *%rax */
static const unsigned char lea[] = { 0x48, 0x8d, 0x3d };
/* Don't complain about -fPIC if the symbol is undefined when
building executable unless it is unresolved weak symbol or
-z nocopyreloc is used. */
- if ((input_section->flags & SEC_ALLOC) != 0
+ if ((input_section->flags & SEC_ALLOC) != 0
&& (input_section->flags & SEC_READONLY) != 0
&& h != NULL
&& ((bfd_link_executable (info)
&& htab->elf.dynsym->contents != NULL)
{
/* Check relocation against STT_GNU_IFUNC symbol if there are
- dynamic symbols. */
+ dynamic symbols. */
unsigned long r_symndx = htab->r_sym (rela->r_info);
if (r_symndx != STN_UNDEF)
{
{ STRING_COMMA_LEN (".gnu.linkonce.lb"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE},
{ STRING_COMMA_LEN (".gnu.linkonce.lr"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_X86_64_LARGE},
{ STRING_COMMA_LEN (".gnu.linkonce.lt"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR + SHF_X86_64_LARGE},
- { STRING_COMMA_LEN (".lbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE},
+ { STRING_COMMA_LEN (".lbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE},
{ STRING_COMMA_LEN (".ldata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_X86_64_LARGE},
{ STRING_COMMA_LEN (".lrodata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_X86_64_LARGE},
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
#define TARGET_LITTLE_SYM x86_64_elf64_vec
#define elf_backend_want_plt_sym 0
#define elf_backend_got_header_size (GOT_ENTRY_SIZE*3)
#define elf_backend_rela_normal 1
-#define elf_backend_plt_alignment 4
+#define elf_backend_plt_alignment 4
#define elf_backend_extern_protected_data 1
#define elf_backend_caches_rawsize 1
#define elf_backend_dtrel_excludes_plt 1
/* CloudABI support. */
-#undef TARGET_LITTLE_SYM
+#undef TARGET_LITTLE_SYM
#define TARGET_LITTLE_SYM x86_64_elf64_cloudabi_vec
-#undef TARGET_LITTLE_NAME
+#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-x86-64-cloudabi"
#undef ELF_OSABI
#define ELF_OSABI ELFOSABI_CLOUDABI
-#undef elf64_bed
+#undef elf64_bed
#define elf64_bed elf64_x86_64_cloudabi_bed
#include "elf64-target.h"
/* FreeBSD support. */
-#undef TARGET_LITTLE_SYM
+#undef TARGET_LITTLE_SYM
#define TARGET_LITTLE_SYM x86_64_elf64_fbsd_vec
-#undef TARGET_LITTLE_NAME
+#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf64-x86-64-freebsd"
#undef ELF_OSABI
#define ELF_OSABI ELFOSABI_FREEBSD
-#undef elf64_bed
+#undef elf64_bed
#define elf64_bed elf64_x86_64_fbsd_bed
#include "elf64-target.h"
static const bfd_byte elf_x86_64_nacl_plt0_entry[NACL_PLT_ENTRY_SIZE] =
{
- 0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */
+ 0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */
0x4c, 0x8b, 0x1d, 16, 0, 0, 0, /* mov GOT+16(%rip), %r11 */
- 0x41, 0x83, 0xe3, NACLMASK, /* and $-32, %r11d */
- 0x4d, 0x01, 0xfb, /* add %r15, %r11 */
- 0x41, 0xff, 0xe3, /* jmpq *%r11 */
+ 0x41, 0x83, 0xe3, NACLMASK, /* and $-32, %r11d */
+ 0x4d, 0x01, 0xfb, /* add %r15, %r11 */
+ 0x41, 0xff, 0xe3, /* jmpq *%r11 */
/* 9-byte nop sequence to pad out to the next 32-byte boundary. */
0x66, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopw 0x0(%rax,%rax,1) */
0x2e, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopw %cs:0x0(%rax,%rax,1) */
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, /* excess data16 prefixes */
0x2e, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopw %cs:0x0(%rax,%rax,1) */
- 0x66, /* excess data16 prefix */
- 0x90 /* nop */
+ 0x66, /* excess data16 prefix */
+ 0x90 /* nop */
};
static const bfd_byte elf_x86_64_nacl_plt_entry[NACL_PLT_ENTRY_SIZE] =
{
0x4c, 0x8b, 0x1d, 0, 0, 0, 0, /* mov name@GOTPCREL(%rip),%r11 */
- 0x41, 0x83, 0xe3, NACLMASK, /* and $-32, %r11d */
- 0x4d, 0x01, 0xfb, /* add %r15, %r11 */
- 0x41, 0xff, 0xe3, /* jmpq *%r11 */
+ 0x41, 0x83, 0xe3, NACLMASK, /* and $-32, %r11d */
+ 0x4d, 0x01, 0xfb, /* add %r15, %r11 */
+ 0x41, 0xff, 0xe3, /* jmpq *%r11 */
/* 15-byte nop sequence to pad out to the next 32-byte boundary. */
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, /* excess data16 prefixes */
0x2e, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopw %cs:0x0(%rax,%rax,1) */
/* Lazy GOT entries point here (32-byte aligned). */
- 0x68, /* pushq immediate */
- 0, 0, 0, 0, /* replaced with index into relocation table. */
- 0xe9, /* jmp relative */
- 0, 0, 0, 0, /* replaced with offset to start of .plt0. */
+ 0x68, /* pushq immediate */
+ 0, 0, 0, 0, /* replaced with index into relocation table. */
+ 0xe9, /* jmp relative */
+ 0, 0, 0, 0, /* replaced with offset to start of .plt0. */
- /* 22 bytes of nop to pad out to the standard size. */
+ /* 22 bytes of nop to pad out to the standard size. */
0x66, 0x66, 0x66, 0x66, 0x66, 0x66, /* excess data16 prefixes */
0x2e, 0x0f, 0x1f, 0x84, 0, 0, 0, 0, 0, /* nopw %cs:0x0(%rax,%rax,1) */
- 0x0f, 0x1f, 0x80, 0, 0, 0, 0, /* nopl 0x0(%rax) */
+ 0x0f, 0x1f, 0x80, 0, 0, 0, 0, /* nopl 0x0(%rax) */
};
/* .eh_frame covering the .plt section. */
static const bfd_byte elf_x86_64_nacl_eh_frame_plt[] =
{
-#if (PLT_CIE_LENGTH != 20 \
- || PLT_FDE_LENGTH != 36 \
- || PLT_FDE_START_OFFSET != 4 + PLT_CIE_LENGTH + 8 \
+#if (PLT_CIE_LENGTH != 20 \
+ || PLT_FDE_LENGTH != 36 \
+ || PLT_FDE_START_OFFSET != 4 + PLT_CIE_LENGTH + 8 \
|| PLT_FDE_LEN_OFFSET != 4 + PLT_CIE_LENGTH + 12)
# error "Need elf_x86_backend_data parameters for eh_frame_plt offsets!"
#endif
PLT_CIE_LENGTH, 0, 0, 0, /* CIE length */
0, 0, 0, 0, /* CIE ID */
1, /* CIE version */
- 'z', 'R', 0, /* Augmentation string */
+ 'z', 'R', 0, /* Augmentation string */
1, /* Code alignment factor */
- 0x78, /* Data alignment factor */
+ 0x78, /* Data alignment factor */
16, /* Return address column */
1, /* Augmentation size */
DW_EH_PE_pcrel | DW_EH_PE_sdata4, /* FDE encoding */
static const struct elf_x86_lazy_plt_layout elf_x86_64_nacl_plt =
{
- elf_x86_64_nacl_plt0_entry, /* plt0_entry */
- NACL_PLT_ENTRY_SIZE, /* plt0_entry_size */
- elf_x86_64_nacl_plt_entry, /* plt_entry */
- NACL_PLT_ENTRY_SIZE, /* plt_entry_size */
- 2, /* plt0_got1_offset */
- 9, /* plt0_got2_offset */
- 13, /* plt0_got2_insn_end */
- 3, /* plt_got_offset */
- 33, /* plt_reloc_offset */
- 38, /* plt_plt_offset */
- 7, /* plt_got_insn_size */
- 42, /* plt_plt_insn_end */
- 32, /* plt_lazy_offset */
- elf_x86_64_nacl_plt0_entry, /* pic_plt0_entry */
- elf_x86_64_nacl_plt_entry, /* pic_plt_entry */
- elf_x86_64_nacl_eh_frame_plt, /* eh_frame_plt */
+ elf_x86_64_nacl_plt0_entry, /* plt0_entry */
+ NACL_PLT_ENTRY_SIZE, /* plt0_entry_size */
+ elf_x86_64_nacl_plt_entry, /* plt_entry */
+ NACL_PLT_ENTRY_SIZE, /* plt_entry_size */
+ 2, /* plt0_got1_offset */
+ 9, /* plt0_got2_offset */
+ 13, /* plt0_got2_insn_end */
+ 3, /* plt_got_offset */
+ 33, /* plt_reloc_offset */
+ 38, /* plt_plt_offset */
+ 7, /* plt_got_insn_size */
+ 42, /* plt_plt_insn_end */
+ 32, /* plt_lazy_offset */
+ elf_x86_64_nacl_plt0_entry, /* pic_plt0_entry */
+ elf_x86_64_nacl_plt_entry, /* pic_plt_entry */
+ elf_x86_64_nacl_eh_frame_plt, /* eh_frame_plt */
sizeof (elf_x86_64_nacl_eh_frame_plt) /* eh_frame_plt_size */
};
static const struct elf_x86_backend_data elf_x86_64_nacl_arch_bed =
{
- is_nacl /* os */
+ is_nacl /* os */
};
#undef elf_backend_arch_data
return TRUE;
}
-#undef TARGET_LITTLE_SYM
+#undef TARGET_LITTLE_SYM
#define TARGET_LITTLE_SYM x86_64_elf32_nacl_vec
-#undef TARGET_LITTLE_NAME
+#undef TARGET_LITTLE_NAME
#define TARGET_LITTLE_NAME "elf32-x86-64-nacl"
#undef elf32_bed
#define elf32_bed elf32_x86_64_nacl_bed
continue;
if (back->elf_machine_code == i_ehdrp->e_machine
|| (back->elf_machine_alt1 != 0
- && i_ehdrp->e_machine == back->elf_machine_alt1)
+ && i_ehdrp->e_machine == back->elf_machine_alt1)
|| (back->elf_machine_alt2 != 0
- && i_ehdrp->e_machine == back->elf_machine_alt2))
+ && i_ehdrp->e_machine == back->elf_machine_alt2))
{
/* target_ptr is an ELF backend which matches this
object file, so reject the generic ELF target. */
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& discarded_section (h->root.u.def.section))
- return h->root.u.def.section;
+ return h->root.u.def.section;
else
return NULL;
}
addend field. The symbol mangling format is:
<node> := <literal>
- | <unary-operator> ':' <node>
- | <binary-operator> ':' <node> ':' <node>
+ | <unary-operator> ':' <node>
+ | <binary-operator> ':' <node> ':' <node>
;
<literal> := 's' <digits=N> ':' <N character symbol name>
- | 'S' <digits=N> ':' <N character section name>
+ | 'S' <digits=N> ':' <N character section name>
| '#' <hexdigits>
;
/* Looks up NAME in SECTIONS. If found sets RESULT to NAME's address (in
bytes) and returns TRUE, otherwise returns FALSE. Accepts pseudo-section
names like "foo.end" which is the end address of section "foo". */
-
+
static bfd_boolean
resolve_section (const char *name,
asection *sections,
unsigned long *trunc_p,
unsigned long encoded)
{
- * start = encoded & 0x3F;
- * len = (encoded >> 6) & 0x3F;
+ * start = encoded & 0x3F;
+ * len = (encoded >> 6) & 0x3F;
* oplen = (encoded >> 12) & 0x3F;
* wordsz = (encoded >> 18) & 0xF;
* chunksz = (encoded >> 22) & 0xF;
ilen = strlen (isec->name);
/* Association is determined by the name of the debug
- section containing the name of the code section as
+ section containing the name of the code section as
a suffix. For example .debug_line.text.foo is a
debug section associated with .text.foo. */
for (dsec = ibfd->sections; dsec != NULL; dsec = dsec->next)
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC + 4. */
_bfd_mips_elf_generic_reloc, /* special_function */
/* Protected jump conversion. This is an optimization hint. No
relocation is required for correctness. */
- HOWTO (R_MIPS_JALR, /* type */
+ HOWTO (R_MIPS_JALR, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
- "R_MIPS_JALR", /* name */
+ "R_MIPS_JALR", /* name */
FALSE, /* partial_inplace */
0x00000000, /* src_mask */
0x00000000, /* dst_mask */
/* Protected jump conversion. This is an optimization hint. No
relocation is required for correctness. */
- HOWTO (R_MIPS_JALR, /* type */
+ HOWTO (R_MIPS_JALR, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
_bfd_mips_elf_generic_reloc, /* special_function */
- "R_MIPS_JALR", /* name */
+ "R_MIPS_JALR", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
0, /* dst_mask */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_GPREL", /* name */
TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A MIPS16 reference to the global offset table. */
"R_MIPS16_GOT16", /* name */
TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A MIPS16 call through the global offset table. */
"R_MIPS16_CALL16", /* name */
TRUE, /* partial_inplace */
0x0000ffff, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* MIPS16 high 16 bits of symbol value. */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS16_GPREL", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A MIPS16 reference to the global offset table. */
"R_MIPS16_GOT16", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* A MIPS16 call through the global offset table. */
"R_MIPS16_CALL16", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
- 0x0000ffff, /* dst_mask */
+ 0x0000ffff, /* dst_mask */
FALSE), /* pcrel_offset */
/* MIPS16 high 16 bits of symbol value. */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
_bfd_mips_elf_generic_reloc, /* special_function */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
_bfd_mips_elf_generic_reloc, /* special_function */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_COPY", /* name */
FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0x0, /* dst_mask */
+ 0x0, /* src_mask */
+ 0x0, /* dst_mask */
FALSE); /* pcrel_offset */
/* Originally a VxWorks extension, but now used for other systems too. */
_bfd_mips_elf_generic_reloc, /* special_function */
"R_MIPS_JUMP_SLOT", /* name */
FALSE, /* partial_inplace */
- 0x0, /* src_mask */
- 0x0, /* dst_mask */
+ 0x0, /* src_mask */
+ 0x0, /* dst_mask */
FALSE); /* pcrel_offset */
/* Used in EH tables. */
"R_MIPS_EH", /* name */
TRUE, /* partial_inplace */
0xffffffff, /* src_mask */
- 0xffffffff, /* dst_mask */
+ 0xffffffff, /* dst_mask */
FALSE); /* pcrel_offset */
\f
/* Support for SGI-ish mips targets using n32 ABI. */
-#define TARGET_LITTLE_SYM mips_elf32_n_le_vec
-#define TARGET_LITTLE_NAME "elf32-nlittlemips"
-#define TARGET_BIG_SYM mips_elf32_n_be_vec
-#define TARGET_BIG_NAME "elf32-nbigmips"
+#define TARGET_LITTLE_SYM mips_elf32_n_le_vec
+#define TARGET_LITTLE_NAME "elf32-nlittlemips"
+#define TARGET_BIG_SYM mips_elf32_n_be_vec
+#define TARGET_BIG_NAME "elf32-nbigmips"
#define ELF_MAXPAGESIZE 0x10000
#define ELF_COMMONPAGESIZE 0x1000
#undef ELF_MAXPAGESIZE
#undef ELF_COMMONPAGESIZE
-#define TARGET_LITTLE_SYM mips_elf32_ntrad_le_vec
-#define TARGET_LITTLE_NAME "elf32-ntradlittlemips"
-#define TARGET_BIG_SYM mips_elf32_ntrad_be_vec
-#define TARGET_BIG_NAME "elf32-ntradbigmips"
+#define TARGET_LITTLE_SYM mips_elf32_ntrad_le_vec
+#define TARGET_LITTLE_NAME "elf32-ntradlittlemips"
+#define TARGET_BIG_SYM mips_elf32_ntrad_be_vec
+#define TARGET_BIG_NAME "elf32-ntradbigmips"
#define ELF_MAXPAGESIZE 0x10000
#define ELF_COMMONPAGESIZE 0x1000
fragments of the form:
adrp x0, :tlsgd:foo
- R_AARCH64_TLSGD_ADR_PAGE21(foo)
+ R_AARCH64_TLSGD_ADR_PAGE21(foo)
add x0, :tlsgd_lo12:foo
- R_AARCH64_TLSGD_ADD_LO12_NC(foo)
+ R_AARCH64_TLSGD_ADD_LO12_NC(foo)
bl __tls_get_addr
nop
For TLS descriptors the assembler will present us with code
fragments of the form:
- adrp x0, :tlsdesc:foo R_AARCH64_TLSDESC_ADR_PAGE21(foo)
- ldr x1, [x0, #:tlsdesc_lo12:foo] R_AARCH64_TLSDESC_LD64_LO12(foo)
- add x0, x0, #:tlsdesc_lo12:foo R_AARCH64_TLSDESC_ADD_LO12(foo)
+ adrp x0, :tlsdesc:foo R_AARCH64_TLSDESC_ADR_PAGE21(foo)
+ ldr x1, [x0, #:tlsdesc_lo12:foo] R_AARCH64_TLSDESC_LD64_LO12(foo)
+ add x0, x0, #:tlsdesc_lo12:foo R_AARCH64_TLSDESC_ADD_LO12(foo)
.tlsdesccall foo
- blr x1 R_AARCH64_TLSDESC_CALL(foo)
+ blr x1 R_AARCH64_TLSDESC_CALL(foo)
The relocations R_AARCH64_TLSGD_{ADR_PREL21,ADD_LO12_NC} against foo
indicate that foo is thread local and should be accessed via the
#define HOWTO64(...) EMPTY_HOWTO (0)
#define HOWTO32(...) HOWTO (__VA_ARGS__)
#define LOG_FILE_ALIGN 2
-#define BFD_RELOC_AARCH64_TLSDESC_LD32_LO12 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC
-#define R_AARCH64_P32_TLSDESC_ADD_LO12 R_AARCH64_P32_TLSDESC_ADD_LO12_NC
+#define BFD_RELOC_AARCH64_TLSDESC_LD32_LO12 BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC
+#define R_AARCH64_P32_TLSDESC_ADD_LO12 R_AARCH64_P32_TLSDESC_ADD_LO12_NC
#endif
#define IS_AARCH64_TLS_RELOC(R_TYPE) \
#define RELOC_SIZE(HTAB) (sizeof (ElfNN_External_Rela))
/* GOT Entry size - 8 bytes in ELF64 and 4 bytes in ELF32. */
-#define GOT_ENTRY_SIZE (ARCH_SIZE / 8)
-#define PLT_ENTRY_SIZE (32)
-#define PLT_SMALL_ENTRY_SIZE (16)
-#define PLT_TLSDESC_ENTRY_SIZE (32)
+#define GOT_ENTRY_SIZE (ARCH_SIZE / 8)
+#define PLT_ENTRY_SIZE (32)
+#define PLT_SMALL_ENTRY_SIZE (16)
+#define PLT_TLSDESC_ENTRY_SIZE (32)
/* Encoding of the nop instruction. */
#define INSN_NOP 0xd503201f
0x1f, 0x20, 0x03, 0xd5, /* nop */
};
-#define elf_info_to_howto elfNN_aarch64_info_to_howto
-#define elf_info_to_howto_rel elfNN_aarch64_info_to_howto
+#define elf_info_to_howto elfNN_aarch64_info_to_howto
+#define elf_info_to_howto_rel elfNN_aarch64_info_to_howto
#define AARCH64_ELF_ABI_VERSION 0
return NULL;
}
-#define TARGET_LITTLE_SYM aarch64_elfNN_le_vec
-#define TARGET_LITTLE_NAME "elfNN-littleaarch64"
-#define TARGET_BIG_SYM aarch64_elfNN_be_vec
-#define TARGET_BIG_NAME "elfNN-bigaarch64"
+#define TARGET_LITTLE_SYM aarch64_elfNN_le_vec
+#define TARGET_LITTLE_NAME "elfNN-littleaarch64"
+#define TARGET_BIG_SYM aarch64_elfNN_be_vec
+#define TARGET_BIG_NAME "elfNN-bigaarch64"
/* The linker script knows the section names for placement.
The entry_names are used to do simple name mangling on the stubs.
case aarch64_stub_long_branch:
/* We want the value relative to the address 12 bytes back from the
- value itself. */
+ value itself. */
if (!aarch64_relocate (AARCH64_R (PRELNN), stub_bfd, stub_sec,
stub_entry->stub_offset + 16, sym_value + 12))
BFD_FAIL ();
*rt = AARCH64_RT (insn);
*rt2 = *rt;
if (AARCH64_BIT (insn, 21) == 1)
- {
+ {
*pair = TRUE;
*rt2 = AARCH64_RT2 (insn);
}
case BFD_RELOC_AARCH64_NN:
/* When generating a shared object or relocatable executable, these
- relocations are copied into the output file to be resolved at
- run time. */
+ relocations are copied into the output file to be resolved at
+ run time. */
if (((bfd_link_pic (info)
|| globals->root.is_relocatable_executable)
&& (input_section->flags & SEC_ALLOC)
if (is_local)
{
/* Tiny TLSDESC->LE relaxation:
- ldr x1, :tlsdesc:var => movz R0, #:tprel_g1:var
- adr x0, :tlsdesc:var => movk R0, #:tprel_g0_nc:var
+ ldr x1, :tlsdesc:var => movz R0, #:tprel_g1:var
+ adr x0, :tlsdesc:var => movk R0, #:tprel_g0_nc:var
.tlsdesccall var
- blr x1 => nop
+ blr x1 => nop
Where R is x for LP64, and w for ILP32. */
BFD_ASSERT (ELFNN_R_TYPE (rel[1].r_info) == AARCH64_R (TLSDESC_ADR_PREL21));
else
{
/* Tiny TLSDESC->IE relaxation:
- ldr x1, :tlsdesc:var => ldr x0, :gottprel:var
- adr x0, :tlsdesc:var => nop
+ ldr x1, :tlsdesc:var => ldr x0, :gottprel:var
+ adr x0, :tlsdesc:var => nop
.tlsdesccall var
- blr x1 => nop
+ blr x1 => nop
*/
BFD_ASSERT (ELFNN_R_TYPE (rel[1].r_info) == AARCH64_R (TLSDESC_ADR_PREL21));
BFD_ASSERT (ELFNN_R_TYPE (rel[2].r_info) == AARCH64_R (TLSDESC_CALL));
if (is_local)
{
/* Tiny GD->LE relaxation:
- adr x0, :tlsgd:var => mrs x1, tpidr_el0
- bl __tls_get_addr => add R0, R1, #:tprel_hi12:x, lsl #12
- nop => add R0, R0, #:tprel_lo12_nc:x
+ adr x0, :tlsgd:var => mrs x1, tpidr_el0
+ bl __tls_get_addr => add R0, R1, #:tprel_hi12:x, lsl #12
+ nop => add R0, R0, #:tprel_lo12_nc:x
Where R is x for LP64, and x for Ilp32. */
else
{
/* Tiny GD->IE relaxation:
- adr x0, :tlsgd:var => ldr R0, :gottprel:var
- bl __tls_get_addr => mrs x1, tpidr_el0
- nop => add R0, R0, R1
+ adr x0, :tlsgd:var => ldr R0, :gottprel:var
+ bl __tls_get_addr => mrs x1, tpidr_el0
+ nop => add R0, R0, R1
Where R is x for LP64, and w for Ilp32. */
if (is_local)
{
/* Large GD->LE relaxation:
- movz x0, #:tlsgd_g1:var => movz x0, #:tprel_g2:var, lsl #32
+ movz x0, #:tlsgd_g1:var => movz x0, #:tprel_g2:var, lsl #32
movk x0, #:tlsgd_g0_nc:var => movk x0, #:tprel_g1_nc:var, lsl #16
- add x0, gp, x0 => movk x0, #:tprel_g0_nc:var
- bl __tls_get_addr => mrs x1, tpidr_el0
- nop => add x0, x0, x1
+ add x0, gp, x0 => movk x0, #:tprel_g0_nc:var
+ bl __tls_get_addr => mrs x1, tpidr_el0
+ nop => add x0, x0, x1
*/
rel[2].r_info = ELFNN_R_INFO (ELFNN_R_SYM (rel->r_info),
AARCH64_R (TLSLE_MOVW_TPREL_G0_NC));
else
{
/* Large GD->IE relaxation:
- movz x0, #:tlsgd_g1:var => movz x0, #:gottprel_g1:var, lsl #16
+ movz x0, #:tlsgd_g1:var => movz x0, #:gottprel_g1:var, lsl #16
movk x0, #:tlsgd_g0_nc:var => movk x0, #:gottprel_g0_nc:var
- add x0, gp, x0 => ldr x0, [gp, x0]
- bl __tls_get_addr => mrs x1, tpidr_el0
- nop => add x0, x0, x1
+ add x0, gp, x0 => ldr x0, [gp, x0]
+ bl __tls_get_addr => mrs x1, tpidr_el0
+ nop => add x0, x0, x1
*/
rel[2].r_info = ELFNN_R_INFO (STN_UNDEF, R_AARCH64_NONE);
bfd_putl32 (0xd2a80000, contents + rel->r_offset + 0);
if (is_local)
{
/* GD->LE relaxation
- add x0, #:tlsgd_lo12:var => movk R0, :tprel_g0_nc:var
- bl __tls_get_addr => mrs x1, tpidr_el0
- nop => add R0, R1, R0
+ add x0, #:tlsgd_lo12:var => movk R0, :tprel_g0_nc:var
+ bl __tls_get_addr => mrs x1, tpidr_el0
+ nop => add R0, R1, R0
Where R is x for lp64 mode, and w for ILP32 mode. */
else
{
/* GD->IE relaxation
- ADD x0, #:tlsgd_lo12:var => ldr R0, [x0, #:gottprel_lo12:var]
- BL __tls_get_addr => mrs x1, tpidr_el0
+ ADD x0, #:tlsgd_lo12:var => ldr R0, [x0, #:gottprel_lo12:var]
+ BL __tls_get_addr => mrs x1, tpidr_el0
R_AARCH64_CALL26
- NOP => add R0, R1, R0
+ NOP => add R0, R1, R0
Where R is x for lp64 mode, and w for ilp32 mode. */
case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12:
case BFD_RELOC_AARCH64_TLSDESC_CALL:
/* GD->IE/LE relaxation:
- add x0, x0, #:tlsdesc_lo12:var => nop
- blr xd => nop
+ add x0, x0, #:tlsdesc_lo12:var => nop
+ blr xd => nop
*/
bfd_putl32 (INSN_NOP, contents + rel->r_offset);
return bfd_reloc_ok;
case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
/* IE->LE relaxation:
- adrp xd, :gottprel:var => movz Rd, :tprel_g1:var
+ adrp xd, :gottprel:var => movz Rd, :tprel_g1:var
Where R is x for lp64 mode, and w for ILP32 mode. */
if (is_local)
case BFD_RELOC_AARCH64_TLSIE_LDNN_GOTTPREL_LO12_NC:
/* IE->LE relaxation:
- ldr xd, [xm, #:gottprel_lo12:var] => movk Rd, :tprel_g0_nc:var
+ ldr xd, [xm, #:gottprel_lo12:var] => movk Rd, :tprel_g0_nc:var
Where R is x for lp64 mode, and w for ILP32 mode. */
if (is_local)
}
/* We relax only if we can see that there can be a valid transition
- from a reloc type to another.
- We call elfNN_aarch64_final_link_relocate unless we're completely
- done, i.e., the relaxation produced the final output we want. */
+ from a reloc type to another.
+ We call elfNN_aarch64_final_link_relocate unless we're completely
+ done, i.e., the relaxation produced the final output we want. */
relaxed_bfd_r_type = aarch64_tls_transition (input_bfd, info, r_type,
h, r_symndx);
r = bfd_reloc_continue;
/* There may be multiple consecutive relocations for the
- same offset. In that case we are supposed to treat the
- output of each relocation as the addend for the next. */
+ same offset. In that case we are supposed to treat the
+ output of each relocation as the addend for the next. */
if (rel + 1 < relend
&& rel->r_offset == rel[1].r_offset
&& ELFNN_R_TYPE (rel[1].r_info) != R_AARCH64_NONE
}
/* Dynamic relocs are not propagated for SEC_DEBUGGING sections
- because such sections are not SEC_ALLOC and thus ld.so will
- not process them. */
+ because such sections are not SEC_ALLOC and thus ld.so will
+ not process them. */
if (unresolved_reloc
&& !((input_section->flags & SEC_DEBUGGING) != 0
&& h->def_dynamic)
if (!elf_flags_init (obfd))
{
/* If the input is the default architecture and had the default
- flags then do not bother setting the flags for the output
- architecture, instead allow future merges to do this. If no
- future merges ever set these flags then they will retain their
- uninitialised values, which surprise surprise, correspond
- to the default values. */
+ flags then do not bother setting the flags for the output
+ architecture, instead allow future merges to do this. If no
+ future merges ever set these flags then they will retain their
+ uninitialised values, which surprise surprise, correspond
+ to the default values. */
if (bfd_get_arch_info (ibfd)->the_default
&& elf_elfheader (ibfd)->e_flags == 0)
return TRUE;
else if (htab->root.dynamic_sections_created && h->plt.refcount > 0)
{
/* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
+ Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1 && !h->forced_local
&& h->root.type == bfd_link_hash_undefweak)
{
dyn = htab->root.dynamic_sections_created;
/* Make sure this symbol is output as a dynamic symbol.
- Undefined weak syms won't yet be marked as dynamic. */
+ Undefined weak syms won't yet be marked as dynamic. */
if (dyn && h->dynindx == -1 && !h->forced_local
&& h->root.type == bfd_link_hash_undefweak)
{
if (bfd_link_pic (info))
{
/* Relocs that use pc_count are those that appear on a call
- insn, or certain REL relocs that can generated via assembly.
- We want calls to protected symbols to resolve directly to the
- function rather than going via the plt. If people want
- function pointer comparisons to work as expected then they
- should avoid writing weird assembly. */
+ insn, or certain REL relocs that can generated via assembly.
+ We want calls to protected symbols to resolve directly to the
+ function rather than going via the plt. If people want
+ function pointer comparisons to work as expected then they
+ should avoid writing weird assembly. */
if (SYMBOL_CALLS_LOCAL (info, h))
{
struct elf_dyn_relocs **pp;
}
/* Also discard relocs on undefined weak syms with non-default
- visibility. */
+ visibility. */
if (eh->dyn_relocs != NULL && h->root.type == bfd_link_hash_undefweak)
{
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
else if (ELIMINATE_COPY_RELOCS)
{
/* For the non-shared case, discard space for relocs against
- symbols which turn out to need copy relocs or are not
- dynamic. */
+ symbols which turn out to need copy relocs or are not
+ dynamic. */
if (!h->non_got_ref
&& ((h->def_dynamic
htab->root.splt->size += PLT_TLSDESC_ENTRY_SIZE;
/* If we're not using lazy TLS relocations, don't generate the
- GOT entry required. */
+ GOT entry required. */
if (!(info->flags & DF_BIND_NOW))
{
htab->dt_tlsdesc_got = htab->root.sgot->size;
continue;
/* Allocate memory for the section contents. We use bfd_zalloc
- here in case unused entries are not reclaimed before the
- section's contents are written out. This should not happen,
- but this way if it does, we get a R_AARCH64_NONE reloc instead
- of garbage. */
+ here in case unused entries are not reclaimed before the
+ section's contents are written out. This should not happen,
+ but this way if it does, we get a R_AARCH64_NONE reloc instead
+ of garbage. */
s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
if (s->contents == NULL)
return FALSE;
if (htab->root.dynamic_sections_created)
{
/* Add some entries to the .dynamic section. We fill in the
- values later, in elfNN_aarch64_finish_dynamic_sections, but we
- must add the entries now so that we get the correct size for
- the .dynamic section. The DT_DEBUG entry is filled in by the
- dynamic linker and used by the debugger. */
+ values later, in elfNN_aarch64_finish_dynamic_sections, but we
+ must add the entries now so that we get the correct size for
+ the .dynamic section. The DT_DEBUG entry is filled in by the
+ dynamic linker and used by the debugger. */
#define add_dynamic_entry(TAG, VAL) \
_bfd_elf_add_dynamic_entry (info, TAG, VAL)
asection *plt, *gotplt, *relplt;
/* This symbol has an entry in the procedure linkage table. Set
- it up. */
+ it up. */
/* When building a static executable, use .iplt, .igot.plt and
.rela.iplt sections for STT_GNU_IFUNC symbols. */
bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it
- up. */
+ up. */
if (htab->root.sgot == NULL || htab->root.srelgot == NULL)
abort ();
#define ELF_MINPAGESIZE 0x1000
#define ELF_COMMONPAGESIZE 0x1000
-#define bfd_elfNN_close_and_cleanup \
+#define bfd_elfNN_close_and_cleanup \
elfNN_aarch64_close_and_cleanup
-#define bfd_elfNN_bfd_free_cached_info \
+#define bfd_elfNN_bfd_free_cached_info \
elfNN_aarch64_bfd_free_cached_info
#define bfd_elfNN_bfd_is_target_special_symbol \
elfNN_aarch64_is_target_special_symbol
-#define bfd_elfNN_bfd_link_hash_table_create \
+#define bfd_elfNN_bfd_link_hash_table_create \
elfNN_aarch64_link_hash_table_create
#define bfd_elfNN_bfd_merge_private_bfd_data \
#define elf_backend_object_p \
elfNN_aarch64_object_p
-#define elf_backend_output_arch_local_syms \
+#define elf_backend_output_arch_local_syms \
elfNN_aarch64_output_arch_local_syms
#define elf_backend_plt_sym_val \
#define elf_backend_may_use_rel_p 0
#define elf_backend_may_use_rela_p 1
#define elf_backend_default_use_rela_p 1
-#define elf_backend_rela_normal 1
+#define elf_backend_rela_normal 1
#define elf_backend_dtrel_excludes_plt 1
#define elf_backend_got_header_size (GOT_ENTRY_SIZE * 3)
#define elf_backend_default_execstack 0
#define elf_backend_extern_protected_data 1
#define elf_backend_hash_symbol elf_aarch64_hash_symbol
-#undef elf_backend_obj_attrs_section
+#undef elf_backend_obj_attrs_section
#define elf_backend_obj_attrs_section ".ARM.attributes"
#include "elfNN-target.h"
static const bfd_byte plt_header[PLT_HEADER_SIZE] =
{
- 0x0b, 0x10, 0x00, 0x1c, 0x00, 0x21, /* [MMI] mov r2=r14;; */
- 0xe0, 0x00, 0x08, 0x00, 0x48, 0x00, /* addl r14=0,r2 */
- 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */
- 0x0b, 0x80, 0x20, 0x1c, 0x18, 0x14, /* [MMI] ld8 r16=[r14],8;; */
- 0x10, 0x41, 0x38, 0x30, 0x28, 0x00, /* ld8 r17=[r14],8 */
- 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */
- 0x11, 0x08, 0x00, 0x1c, 0x18, 0x10, /* [MIB] ld8 r1=[r14] */
- 0x60, 0x88, 0x04, 0x80, 0x03, 0x00, /* mov b6=r17 */
- 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */
+ 0x0b, 0x10, 0x00, 0x1c, 0x00, 0x21, /* [MMI] mov r2=r14;; */
+ 0xe0, 0x00, 0x08, 0x00, 0x48, 0x00, /* addl r14=0,r2 */
+ 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */
+ 0x0b, 0x80, 0x20, 0x1c, 0x18, 0x14, /* [MMI] ld8 r16=[r14],8;; */
+ 0x10, 0x41, 0x38, 0x30, 0x28, 0x00, /* ld8 r17=[r14],8 */
+ 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */
+ 0x11, 0x08, 0x00, 0x1c, 0x18, 0x10, /* [MIB] ld8 r1=[r14] */
+ 0x60, 0x88, 0x04, 0x80, 0x03, 0x00, /* mov b6=r17 */
+ 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */
};
static const bfd_byte plt_min_entry[PLT_MIN_ENTRY_SIZE] =
{
- 0x11, 0x78, 0x00, 0x00, 0x00, 0x24, /* [MIB] mov r15=0 */
- 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* nop.i 0x0 */
- 0x00, 0x00, 0x00, 0x40 /* br.few 0 <PLT0>;; */
+ 0x11, 0x78, 0x00, 0x00, 0x00, 0x24, /* [MIB] mov r15=0 */
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* nop.i 0x0 */
+ 0x00, 0x00, 0x00, 0x40 /* br.few 0 <PLT0>;; */
};
static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] =
{
- 0x0b, 0x78, 0x00, 0x02, 0x00, 0x24, /* [MMI] addl r15=0,r1;; */
- 0x00, 0x41, 0x3c, 0x70, 0x29, 0xc0, /* ld8.acq r16=[r15],8*/
- 0x01, 0x08, 0x00, 0x84, /* mov r14=r1;; */
- 0x11, 0x08, 0x00, 0x1e, 0x18, 0x10, /* [MIB] ld8 r1=[r15] */
- 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */
- 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */
+ 0x0b, 0x78, 0x00, 0x02, 0x00, 0x24, /* [MMI] addl r15=0,r1;; */
+ 0x00, 0x41, 0x3c, 0x70, 0x29, 0xc0, /* ld8.acq r16=[r15],8*/
+ 0x01, 0x08, 0x00, 0x84, /* mov r14=r1;; */
+ 0x11, 0x08, 0x00, 0x1e, 0x18, 0x10, /* [MIB] ld8 r1=[r15] */
+ 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */
+ 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */
};
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1"
static const bfd_byte oor_brl[16] =
{
- 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* brl.sptk.few tgt;; */
+ 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* brl.sptk.few tgt;; */
0x00, 0x00, 0x00, 0xc0
};
static const bfd_byte oor_ip[48] =
{
- 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, /* movl r15=0 */
+ 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, /* movl r15=0 */
0x01, 0x00, 0x00, 0x60,
- 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MII] nop.m 0 */
- 0x00, 0x01, 0x00, 0x60, 0x00, 0x00, /* mov r16=ip;; */
- 0xf2, 0x80, 0x00, 0x80, /* add r16=r15,r16;; */
- 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MIB] nop.m 0 */
- 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */
- 0x60, 0x00, 0x80, 0x00 /* br b6;; */
+ 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MII] nop.m 0 */
+ 0x00, 0x01, 0x00, 0x60, 0x00, 0x00, /* mov r16=ip;; */
+ 0xf2, 0x80, 0x00, 0x80, /* add r16=r15,r16;; */
+ 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MIB] nop.m 0 */
+ 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */
+ 0x60, 0x00, 0x80, 0x00 /* br b6;; */
};
static size_t oor_branch_size = sizeof (oor_brl);
if (create)
{
/* When we create the array, we don't check for duplicates,
- except in the previously sorted section if one exists, and
+ except in the previously sorted section if one exists, and
against the last inserted entry. This allows insertions to
be fast. */
if (info)
break;
case R_IA64_PCREL21B:
- case R_IA64_PCREL60B:
+ case R_IA64_PCREL60B:
/* Depending on where this symbol is defined, we may or may not
need a full plt entry. Only skip if we know we'll not need
the entry -- static or symbolic, and the symbol definition
break;
case R_IA64_PCREL21B:
- case R_IA64_PCREL60B:
+ case R_IA64_PCREL60B:
/* Depending on where this symbol is defined, we may or may not
need a full plt entry. Only skip if we know we'll not need
the entry -- static or symbolic, and the symbol definition
dyn_i->want_ltoff_fptr = 1;
if (need_entry & (NEED_MIN_PLT | NEED_FULL_PLT))
{
- if (!ia64_info->root.dynobj)
+ if (!ia64_info->root.dynobj)
ia64_info->root.dynobj = abfd;
h->needs_plt = 1;
dyn_i->want_plt = 1;
|| dyn_i->h->root.type != bfd_link_hash_undefweak)
&& dyn_r_type != R_IA64_DTPREL32LSB
&& dyn_r_type != R_IA64_DTPREL64LSB)
- || elfNN_ia64_dynamic_symbol_p (dyn_i->h, info, dyn_r_type)
+ || elfNN_ia64_dynamic_symbol_p (dyn_i->h, info, dyn_r_type)
|| (dynindx != -1
&& (dyn_r_type == R_IA64_FPTR32LSB
|| dyn_r_type == R_IA64_FPTR64LSB)))
gp_val = _bfd_get_gp_value (abfd);
gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE,
- FALSE, FALSE);
+ FALSE, FALSE);
if (gp)
{
gp->root.type = bfd_link_hash_defined;
case R_IA64_LTOFF22:
case R_IA64_LTOFF22X:
case R_IA64_LTOFF64I:
- dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
+ dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
value = set_got_entry (input_bfd, info, dyn_i, (h ? h->dynindx : -1),
rel->r_addend, value, R_IA64_DIRNNLSB);
value -= gp_val;
case R_IA64_PLTOFF64I:
case R_IA64_PLTOFF64MSB:
case R_IA64_PLTOFF64LSB:
- dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
+ dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
value = set_pltoff_entry (output_bfd, info, dyn_i, value, FALSE);
value -= gp_val;
r = ia64_elf_install_value (hit_addr, value, r_type);
case R_IA64_FPTR32LSB:
case R_IA64_FPTR64MSB:
case R_IA64_FPTR64LSB:
- dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
+ dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE);
if (dyn_i->want_fptr)
{
if (!undef_weak_ref)
if (dyn_i->want_fptr)
{
BFD_ASSERT (h == NULL || h->dynindx == -1);
- if (!undef_weak_ref)
- value = set_fptr_entry (output_bfd, info, dyn_i, value);
+ if (!undef_weak_ref)
+ value = set_fptr_entry (output_bfd, info, dyn_i, value);
dynindx = -1;
}
else
{
- /* Otherwise, we expect the dynamic linker to create
+ /* Otherwise, we expect the dynamic linker to create
the entry. */
- if (h)
+ if (h)
{
if (h->dynindx != -1)
dynindx = h->dynindx;
static const struct bfd_elf_special_section elfNN_ia64_special_sections[] =
{
- { STRING_COMMA_LEN (".sbss"), -1, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
+ { STRING_COMMA_LEN (".sbss"), -1, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
{ STRING_COMMA_LEN (".sdata"), -1, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
static bfd_boolean
#undef TARGET_LITTLE_SYM
#undef TARGET_LITTLE_NAME
#undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM ia64_elfNN_hpux_be_vec
-#undef TARGET_BIG_NAME
-#define TARGET_BIG_NAME "elfNN-ia64-hpux-big"
+#define TARGET_BIG_SYM ia64_elfNN_hpux_be_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elfNN-ia64-hpux-big"
/* These are HP-UX specific functions. */
bfd_vma gotplt_offset_low = RISCV_PCREL_LOW_PART (gotplt_addr, addr);
/* auipc t2, %hi(.got.plt)
- sub t1, t1, t3 # shifted .got.plt offset + hdr size + 12
+ sub t1, t1, t3 # shifted .got.plt offset + hdr size + 12
l[w|d] t3, %lo(.got.plt)(t2) # _dl_runtime_resolve
addi t1, t1, -(hdr size + 12) # shifted .got.plt offset
addi t0, t2, %lo(.got.plt) # &.got.plt
srli t1, t1, log2(16/PTRSIZE) # .got.plt offset
- l[w|d] t0, PTRSIZE(t0) # link map
- jr t3 */
+ l[w|d] t0, PTRSIZE(t0) # link map
+ jr t3 */
entry[0] = RISCV_UTYPE (AUIPC, X_T2, gotplt_offset_high);
entry[1] = RISCV_RTYPE (SUB, X_T1, X_T1, X_T3);
typedef struct riscv_pcrel_lo_reloc
{
- asection * input_section;
- struct bfd_link_info * info;
- reloc_howto_type * howto;
- const Elf_Internal_Rela * reloc;
- bfd_vma addr;
- const char * name;
- bfd_byte * contents;
- struct riscv_pcrel_lo_reloc * next;
+ asection * input_section;
+ struct bfd_link_info * info;
+ reloc_howto_type * howto;
+ const Elf_Internal_Rela * reloc;
+ bfd_vma addr;
+ const char * name;
+ bfd_byte * contents;
+ struct riscv_pcrel_lo_reloc * next;
} riscv_pcrel_lo_reloc;
typedef struct
riscv_pcrel_hi_reloc search = {r->addr, 0};
riscv_pcrel_hi_reloc *entry = htab_find (p->hi_relocs, &search);
if (entry == NULL)
- {
+ {
((*r->info->callbacks->reloc_overflow)
(r->info, NULL, r->name, r->howto->name, (bfd_vma) 0,
input_bfd, r->input_section, r->reloc->r_offset));
return TRUE;
- }
+ }
perform_relocation (r->howto, r->reloc, entry->value, r->input_section,
input_bfd, r->contents);
}
/* The GOT entries have not been initialized yet. Do it
- now, and emit any relocations. */
+ now, and emit any relocations. */
if ((bfd_link_pic (info) || indx != 0)
&& (h == NULL
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
/* If the cooresponding lo relocation has already been seen then it's not
* safe to relax this relocation. */
if (riscv_find_pcgp_lo_reloc (pcgp_relocs, rel->r_offset))
- return TRUE;
+ return TRUE;
break;
return riscv_delete_pcgp_lo_reloc (pcgp_relocs, rel->r_offset, 4);
case R_RISCV_PCREL_HI20:
- riscv_record_pcgp_hi_reloc (pcgp_relocs,
+ riscv_record_pcgp_hi_reloc (pcgp_relocs,
rel->r_offset,
rel->r_addend,
symval,
i++;
}
else if (info->relax_pass == 1 && type == R_RISCV_DELETE)
- relax_func = _bfd_riscv_relax_delete;
+ relax_func = _bfd_riscv_relax_delete;
else if (info->relax_pass == 2 && type == R_RISCV_ALIGN)
relax_func = _bfd_riscv_relax_align;
else
#define elf_backend_finish_dynamic_sections riscv_elf_finish_dynamic_sections
#define elf_backend_gc_mark_hook riscv_elf_gc_mark_hook
#define elf_backend_plt_sym_val riscv_elf_plt_sym_val
-#define elf_backend_grok_prstatus riscv_elf_grok_prstatus
-#define elf_backend_grok_psinfo riscv_elf_grok_psinfo
-#define elf_backend_object_p riscv_elf_object_p
+#define elf_backend_grok_prstatus riscv_elf_grok_prstatus
+#define elf_backend_grok_psinfo riscv_elf_grok_psinfo
+#define elf_backend_object_p riscv_elf_object_p
#define elf_info_to_howto_rel NULL
#define elf_info_to_howto riscv_info_to_howto_rela
#define bfd_elfNN_bfd_relax_section _bfd_riscv_relax_section
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
/* Corresponds to: add rd, rn, #uimm12 to provide the low order
- 12 bits of the page offset following
- BFD_RELOC_AARCH64_ADR_HI21_PCREL which computes the
- (pc-relative) page base. */
+ 12 bits of the page offset following
+ BFD_RELOC_AARCH64_ADR_HI21_PCREL which computes the
+ (pc-relative) page base. */
contents = reencode_add_imm (contents, addend);
break;
if (old_addend & ((1 << howto->rightshift) - 1))
return bfd_reloc_overflow;
/* Used for ldr*|str* rt, [rn, #uimm12] to provide the low order
- 12 bits of the page offset following BFD_RELOC_AARCH64_ADR_HI21_PCREL
- which computes the (pc-relative) page base. */
+ 12 bits of the page offset following BFD_RELOC_AARCH64_ADR_HI21_PCREL
+ which computes the (pc-relative) page base. */
contents = reencode_ldst_pos_imm (contents, addend);
break;
/* Group relocations to create high bits of a 16, 32, 48 or 64
- bit signed data or abs address inline. Will change
- instruction to MOVN or MOVZ depending on sign of calculated
- value. */
+ bit signed data or abs address inline. Will change
+ instruction to MOVN or MOVZ depending on sign of calculated
+ value. */
case BFD_RELOC_AARCH64_MOVW_G0_S:
case BFD_RELOC_AARCH64_MOVW_G1_S:
/* Fall through. */
/* Group relocations to create a 16, 32, 48 or 64 bit unsigned
- data or abs address inline. */
+ data or abs address inline. */
case BFD_RELOC_AARCH64_MOVW_G0:
case BFD_RELOC_AARCH64_MOVW_G0_NC:
default:
return FALSE;
- case 136: /* This is sizeof(struct elf_prpsinfo) on Linux/aarch64. */
+ case 136: /* This is sizeof(struct elf_prpsinfo) on Linux/aarch64. */
elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 24);
elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
case NT_PRPSINFO:
{
- char data[136];
- va_list ap;
+ char data[136];
+ va_list ap;
- va_start (ap, note_type);
- memset (data, 0, sizeof (data));
- strncpy (data + 40, va_arg (ap, const char *), 16);
- strncpy (data + 56, va_arg (ap, const char *), 80);
- va_end (ap);
+ va_start (ap, note_type);
+ memset (data, 0, sizeof (data));
+ strncpy (data + 40, va_arg (ap, const char *), 16);
+ strncpy (data + 56, va_arg (ap, const char *), 80);
+ va_end (ap);
- return elfcore_write_note (abfd, buf, bufsiz, "CORE",
+ return elfcore_write_note (abfd, buf, bufsiz, "CORE",
note_type, data, sizeof (data));
}
case NT_PRSTATUS:
{
- char data[392];
- va_list ap;
- long pid;
- int cursig;
- const void *greg;
-
- va_start (ap, note_type);
- memset (data, 0, sizeof (data));
- pid = va_arg (ap, long);
- bfd_put_32 (abfd, pid, data + 32);
- cursig = va_arg (ap, int);
- bfd_put_16 (abfd, cursig, data + 12);
- greg = va_arg (ap, const void *);
- memcpy (data + 112, greg, 272);
- va_end (ap);
-
- return elfcore_write_note (abfd, buf, bufsiz, "CORE",
+ char data[392];
+ va_list ap;
+ long pid;
+ int cursig;
+ const void *greg;
+
+ va_start (ap, note_type);
+ memset (data, 0, sizeof (data));
+ pid = va_arg (ap, long);
+ bfd_put_32 (abfd, pid, data + 32);
+ cursig = va_arg (ap, int);
+ bfd_put_16 (abfd, cursig, data + 12);
+ greg = va_arg (ap, const void *);
+ memcpy (data + 112, greg, 272);
+ va_end (ap);
+
+ return elfcore_write_note (abfd, buf, bufsiz, "CORE",
note_type, data, sizeof (data));
}
}
#include "stdint.h"
/* Take the PAGE component of an address or offset. */
-#define PG(x) ((x) & ~ (bfd_vma) 0xfff)
+#define PG(x) ((x) & ~ (bfd_vma) 0xfff)
#define PG_OFFSET(x) ((x) & (bfd_vma) 0xfff)
#define AARCH64_ADR_OP 0x10000000
#define elf_backend_add_symbol_hook _bfd_aarch64_elf_add_symbol_hook
#define elf_backend_grok_prstatus _bfd_aarch64_elf_grok_prstatus
-#define elf_backend_grok_psinfo _bfd_aarch64_elf_grok_psinfo
-#define elf_backend_write_core_note _bfd_aarch64_elf_write_core_note
+#define elf_backend_grok_psinfo _bfd_aarch64_elf_grok_psinfo
+#define elf_backend_write_core_note _bfd_aarch64_elf_write_core_note
/* THE RULES for all the stuff the linker creates --
GOT Entries created in response to LTOFF or LTOFF_FPTR
- relocations. Dynamic relocs created for dynamic
- symbols in an application; REL relocs for locals
- in a shared library.
+ relocations. Dynamic relocs created for dynamic
+ symbols in an application; REL relocs for locals
+ in a shared library.
FPTR The canonical function descriptor. Created for local
- symbols in applications. Descriptors for dynamic symbols
- and local symbols in shared libraries are created by
- ld.so. Thus there are no dynamic relocs against these
- objects. The FPTR relocs for such _are_ passed through
- to the dynamic relocation tables.
+ symbols in applications. Descriptors for dynamic symbols
+ and local symbols in shared libraries are created by
+ ld.so. Thus there are no dynamic relocs against these
+ objects. The FPTR relocs for such _are_ passed through
+ to the dynamic relocation tables.
FULL_PLT Created for a PCREL21B relocation against a dynamic symbol.
- Requires the creation of a PLTOFF entry. This does not
- require any dynamic relocations.
+ Requires the creation of a PLTOFF entry. This does not
+ require any dynamic relocations.
- PLTOFF Created by PLTOFF relocations. For local symbols, this
- is an alternate function descriptor, and in shared libraries
- requires two REL relocations. Note that this cannot be
- transformed into an FPTR relocation, since it must be in
- range of the GP. For dynamic symbols, this is a function
- descriptor for a MIN_PLT entry, and requires one IPLT reloc.
+ PLTOFF Created by PLTOFF relocations. For local symbols, this
+ is an alternate function descriptor, and in shared libraries
+ requires two REL relocations. Note that this cannot be
+ transformed into an FPTR relocation, since it must be in
+ range of the GP. For dynamic symbols, this is a function
+ descriptor for a MIN_PLT entry, and requires one IPLT reloc.
MIN_PLT Created by PLTOFF entries against dynamic symbols. This
- does not require dynamic relocations. */
+ does not require dynamic relocations. */
/* ia64-specific relocation. */
done in elfNN_ia64_final_link_relocate. */
static bfd_reloc_status_type
ia64_elf_reloc (bfd *abfd ATTRIBUTE_UNUSED, arelent *reloc,
- asymbol *sym ATTRIBUTE_UNUSED,
- PTR data ATTRIBUTE_UNUSED, asection *input_section,
- bfd *output_bfd, char **error_message)
+ asymbol *sym ATTRIBUTE_UNUSED,
+ PTR data ATTRIBUTE_UNUSED, asection *input_section,
+ bfd *output_bfd, char **error_message)
{
if (output_bfd)
{
reloc_howto_type*
ia64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type bfd_code)
+ bfd_reloc_code_real_type bfd_code)
{
unsigned int rtype;
reloc_howto_type *
ia64_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- const char *r_name)
+ const char *r_name)
{
unsigned int i;
{
case 0:
/* Check if slot 1 and slot 2 are NOPs. Possible template is
- BBB. We only need to check nop.b. */
+ BBB. We only need to check nop.b. */
if (!(IS_NOP_B (s1) && IS_NOP_B (s2)))
return FALSE;
br_code = s0;
void ia64_elf_relax_ldxmov (bfd_byte *contents, bfd_vma off);
bfd_reloc_status_type ia64_elf_install_value (bfd_byte *hit_addr, bfd_vma v,
- unsigned int r_type);
+ unsigned int r_type);
/* Put out word-sized data. */
#define MIPS_ELF_PUT_WORD(abfd, val, ptr) \
- (ABI_64_P (abfd) \
- ? bfd_put_64 (abfd, val, ptr) \
+ (ABI_64_P (abfd) \
+ ? bfd_put_64 (abfd, val, ptr) \
: bfd_put_32 (abfd, val, ptr))
/* The opcode for word-sized loads (LW or LD). */
#define STUB_LW(abfd) \
((ABI_64_P (abfd) \
? 0xdf998010 /* ld t9,0x8010(gp) */ \
- : 0x8f998010)) /* lw t9,0x8010(gp) */
+ : 0x8f998010)) /* lw t9,0x8010(gp) */
#define STUB_MOVE 0x03e07825 /* or t7,ra,zero */
#define STUB_LUI(VAL) (0x3c180000 + (VAL)) /* lui t8,VAL */
#define STUB_JALR 0x0320f809 /* jalr ra,t9 */
/* The name of the dynamic interpreter. This is put in the .interp
section. */
-#define ELF_DYNAMIC_INTERPRETER(abfd) \
- (ABI_N32_P (abfd) ? "/usr/lib32/libc.so.1" \
- : ABI_64_P (abfd) ? "/usr/lib64/libc.so.1" \
+#define ELF_DYNAMIC_INTERPRETER(abfd) \
+ (ABI_N32_P (abfd) ? "/usr/lib32/libc.so.1" \
+ : ABI_64_P (abfd) ? "/usr/lib64/libc.so.1" \
: "/usr/lib/libc.so.1")
#ifdef BFD64
bfd_put_micromips_32 (const bfd *abfd, bfd_vma opcode, bfd_byte *ptr)
{
bfd_put_16 (abfd, (opcode >> 16) & 0xffff, ptr);
- bfd_put_16 (abfd, opcode & 0xffff, ptr + 2);
+ bfd_put_16 (abfd, opcode & 0xffff, ptr + 2);
}
/* microMIPS 32-bit opcode helper retriever. */
&& ! h->need_fn_stub)
{
/* We don't need the fn_stub; the only references to this symbol
- are 16 bit calls. Clobber the size to 0 to prevent it from
- being included in the link. */
+ are 16 bit calls. Clobber the size to 0 to prevent it from
+ being included in the link. */
h->fn_stub->size = 0;
h->fn_stub->flags &= ~SEC_RELOC;
h->fn_stub->reloc_count = 0;
&& ELF_ST_IS_MIPS16 (h->root.other))
{
/* We don't need the call_stub; this is a 16 bit function, so
- calls from other 16 bit functions are OK. Clobber the size
- to 0 to prevent it from being included in the link. */
+ calls from other 16 bit functions are OK. Clobber the size
+ to 0 to prevent it from being included in the link. */
h->call_stub->size = 0;
h->call_stub->flags &= ~SEC_RELOC;
h->call_stub->reloc_count = 0;
&& ELF_ST_IS_MIPS16 (h->root.other))
{
/* We don't need the call_stub; this is a 16 bit function, so
- calls from other 16 bit functions are OK. Clobber the size
- to 0 to prevent it from being included in the link. */
+ calls from other 16 bit functions are OK. Clobber the size
+ to 0 to prevent it from being included in the link. */
h->call_fp_stub->size = 0;
h->call_fp_stub->flags &= ~SEC_RELOC;
h->call_fp_stub->reloc_count = 0;
+--------------+--------------------------------+
| JALX | X| Imm 20:16 | Imm 25:21 |
+--------------+--------------------------------+
- | Immediate 15:0 |
+ | Immediate 15:0 |
+-----------------------------------------------+
JALX is the 5-bit value 00011. X is 0 for jal, 1 for jalx.
big-endian:
+--------+----------------------+
- | | |
- | | targ26-16 |
- |31 26|25 0|
+ | | |
+ | | targ26-16 |
+ |31 26|25 0|
+--------+----------------------+
little-endian:
+----------+------+-------------+
- | | | |
- | sub1 | | sub2 |
- |0 9|10 15|16 31|
+ | | | |
+ | sub1 | | sub2 |
+ |0 9|10 15|16 31|
+----------+--------------------+
where targ26-16 is sub1 followed by sub2 (i.e., the addend field A is
((sub1 << 16) | sub2)).
const char *name;
/* Use undefined class. Also, set class and type for some
- special symbols. */
+ special symbols. */
name = h->root.root.root.string;
if (strcmp (name, mips_elf_dynsym_rtproc_names[0]) == 0
|| strcmp (name, mips_elf_dynsym_rtproc_names[1]) == 0)
*namep = bfd_section_name (input_bfd, sec);
/* For relocations against a section symbol and ones against no
- symbol (absolute relocations) infer the ISA mode from the addend. */
+ symbol (absolute relocations) infer the ISA mode from the addend. */
if (section_p || r_symndx == STN_UNDEF)
{
target_is_16_bit_code_p = (addend & 1) && !micromips_p;
target_is_micromips_code_p = (addend & 1) && micromips_p;
}
/* For relocations against an absolute symbol infer the ISA mode
- from the value of the symbol plus addend. */
+ from the value of the symbol plus addend. */
else if (bfd_is_abs_section (sec))
{
target_is_16_bit_code_p = ((symbol + addend) & 1) && !micromips_p;
sec = h->call_stub;
else
sec = h->call_fp_stub;
- }
+ }
BFD_ASSERT (sec->size > 0);
symbol = sec->output_section->vma + sec->output_offset;
if ((was_local_p || h->root.root.type != bfd_link_hash_undefweak)
&& (*cross_mode_jump_p
? (value & 3) != (r_type == R_MIPS_26)
- : (value & ((1 << shift) - 1)) != (r_type != R_MIPS_26)))
+ : (value & ((1 << shift) - 1)) != (r_type != R_MIPS_26)))
return bfd_reloc_outofrange;
value >>= shift;
else
{
/* For MIPS16 ABI code we generate this sequence
- 0: li $v0,%hi(_gp_disp)
- 4: addiupc $v1,%lo(_gp_disp)
- 8: sll $v0,16
+ 0: li $v0,%hi(_gp_disp)
+ 4: addiupc $v1,%lo(_gp_disp)
+ 8: sll $v0,16
12: addu $v0,$v1
14: move $gp,$v0
So the offsets of hi and lo relocs are the same, but the
addend = _bfd_mips_elf_sign_extend (addend, 18);
/* No need to exclude weak undefined symbols here as they resolve
- to 0 and never set `*cross_mode_jump_p', so this alignment check
- will never trigger for them. */
+ to 0 and never set `*cross_mode_jump_p', so this alignment check
+ will never trigger for them. */
if (*cross_mode_jump_p
? ((symbol + addend) & 3) != 1
: ((symbol + addend) & 3) != 0)
}
/* If the opcode is not JAL or JALX, there's a problem. We cannot
- convert J or JALS to JALX. */
+ convert J or JALS to JALX. */
if (!ok)
{
info->callbacks->einfo
We therefore take the following approach:
- If ABFD contains a .gcc_compiled_longXX section, use it to
- determine the pointer size.
+ determine the pointer size.
- Otherwise check the type of the first relocation. Assume that
- the LP64 ABI is being used if the relocation is of type R_MIPS_64.
+ the LP64 ABI is being used if the relocation is of type R_MIPS_64.
- Otherwise punt.
break;
case SHT_MIPS_DWARF:
if (! CONST_STRNEQ (name, ".debug_")
- && ! CONST_STRNEQ (name, ".zdebug_"))
+ && ! CONST_STRNEQ (name, ".zdebug_"))
return FALSE;
break;
case SHT_MIPS_SYMBOL_LIB:
{
hdr->sh_type = SHT_MIPS_DEBUG;
/* In a shared object on IRIX 5.3, the .mdebug section has an
- entsize of 0. FIXME: Does this matter? */
+ entsize of 0. FIXME: Does this matter? */
if (SGI_COMPAT (abfd) && (abfd->flags & DYNAMIC) != 0)
hdr->sh_entsize = 0;
else
{
hdr->sh_type = SHT_MIPS_REGINFO;
/* In a shared object on IRIX 5.3, the .reginfo section has an
- entsize of 0x18. FIXME: Does this matter? */
+ entsize of 0x18. FIXME: Does this matter? */
if (SGI_COMPAT (abfd))
{
if ((abfd->flags & DYNAMIC) != 0)
hdr->sh_entsize = sizeof (Elf_External_ABIFlags_v0);
}
else if (CONST_STRNEQ (name, ".debug_")
- || CONST_STRNEQ (name, ".zdebug_"))
+ || CONST_STRNEQ (name, ".zdebug_"))
{
hdr->sh_type = SHT_MIPS_DWARF;
{
hdr->sh_type = SHT_MIPS_SYMBOL_LIB;
/* The sh_link and sh_info fields are set in
- final_write_processing. */
+ final_write_processing. */
}
else if (CONST_STRNEQ (name, ".MIPS.events")
|| CONST_STRNEQ (name, ".MIPS.post_rel"))
elf_text_symbol->section = elf_text_section;
}
/* This code used to do *secp = bfd_und_section_ptr if
- bfd_link_pic (info). I don't know why, and that doesn't make sense,
- so I took it out. */
+ bfd_link_pic (info). I don't know why, and that doesn't make sense,
+ so I took it out. */
*secp = mips_elf_tdata (abfd)->elf_text_section;
break;
elf_data_symbol->section = elf_data_section;
}
/* This code used to do *secp = bfd_und_section_ptr if
- bfd_link_pic (info). I don't know why, and that doesn't make sense,
- so I took it out. */
+ bfd_link_pic (info). I don't know why, and that doesn't make sense,
+ so I took it out. */
*secp = mips_elf_tdata (abfd)->elf_data_section;
break;
unsigned long r_symndx;
/* Look at the relocation information to figure out which symbol
- this is for. */
+ this is for. */
r_symndx = mips16_stub_symndx (bed, sec, relocs, rel_end);
if (r_symndx == 0)
asection *o;
/* This stub is for a local symbol. This stub will only be
- needed if there is some relocation in this BFD, other
- than a 16 bit function call, which refers to this symbol. */
+ needed if there is some relocation in this BFD, other
+ than a 16 bit function call, which refers to this symbol. */
for (o = abfd->sections; o != NULL; o = o->next)
{
Elf_Internal_Rela *sec_relocs;
if (o == NULL)
{
/* There is no non-call reloc for this stub, so we do
- not need it. Since this function is called before
- the linker maps input sections to output sections, we
- can easily discard it by setting the SEC_EXCLUDE
- flag. */
+ not need it. Since this function is called before
+ the linker maps input sections to output sections, we
+ can easily discard it by setting the SEC_EXCLUDE
+ flag. */
sec->flags |= SEC_EXCLUDE;
return TRUE;
}
/* Record this stub in an array of local symbol stubs for
- this BFD. */
+ this BFD. */
if (mips_elf_tdata (abfd)->local_stubs == NULL)
{
unsigned long symcount;
mips_elf_tdata (abfd)->local_stubs[r_symndx] = sec;
/* We don't need to set mips16_stubs_seen in this case.
- That flag is used to see whether we need to look through
- the global symbol table for stubs. We don't need to set
- it here, because we just have a local stub. */
+ That flag is used to see whether we need to look through
+ the global symbol table for stubs. We don't need to set
+ it here, because we just have a local stub. */
}
else
{
asection **loc;
/* Look at the relocation information to figure out which symbol
- this is for. */
+ this is for. */
r_symndx = mips16_stub_symndx (bed, sec, relocs, rel_end);
if (r_symndx == 0)
asection *o;
/* This stub is for a local symbol. This stub will only be
- needed if there is some relocation (R_MIPS16_26) in this BFD
- that refers to this symbol. */
+ needed if there is some relocation (R_MIPS16_26) in this BFD
+ that refers to this symbol. */
for (o = abfd->sections; o != NULL; o = o->next)
{
Elf_Internal_Rela *sec_relocs;
if (o == NULL)
{
/* There is no non-call reloc for this stub, so we do
- not need it. Since this function is called before
- the linker maps input sections to output sections, we
- can easily discard it by setting the SEC_EXCLUDE
- flag. */
+ not need it. Since this function is called before
+ the linker maps input sections to output sections, we
+ can easily discard it by setting the SEC_EXCLUDE
+ flag. */
sec->flags |= SEC_EXCLUDE;
return TRUE;
}
/* Record this stub in an array of local symbol call_stubs for
- this BFD. */
+ this BFD. */
if (mips_elf_tdata (abfd)->local_call_stubs == NULL)
{
unsigned long symcount;
mips_elf_tdata (abfd)->local_call_stubs[r_symndx] = sec;
/* We don't need to set mips16_stubs_seen in this case.
- That flag is used to see whether we need to look through
- the global symbol table for stubs. We don't need to set
- it here, because we just have a local stub. */
+ That flag is used to see whether we need to look through
+ the global symbol table for stubs. We don't need to set
+ it here, because we just have a local stub. */
}
else
{
}
/* Record the need for a PLT entry. At this point we don't know
- yet if we are going to create a PLT in the first place, but
- we only record whether the relocation requires a standard MIPS
- or a compressed code entry anyway. If we don't make a PLT after
- all, then we'll just ignore these arrangements. Likewise if
- a PLT entry is not created because the symbol is satisfied
- locally. */
+ yet if we are going to create a PLT in the first place, but
+ we only record whether the relocation requires a standard MIPS
+ or a compressed code entry anyway. If we don't make a PLT after
+ all, then we'll just ignore these arrangements. Likewise if
+ a PLT entry is not created because the symbol is satisfied
+ locally. */
if (h != NULL
&& (branch_reloc_p (r_type)
|| mips16_branch_reloc_p (r_type)
bfd_boolean newabi_p = NEWABI_P (info->output_bfd);
/* If this is the first symbol to need a PLT entry, then make some
- basic setup. Also work out PLT entry sizes. We'll need them
- for PLT offset calculations. */
+ basic setup. Also work out PLT entry sizes. We'll need them
+ for PLT offset calculations. */
if (htab->plt_mips_offset + htab->plt_comp_offset == 0)
{
BFD_ASSERT (htab->root.sgotplt->size == 0);
return FALSE;
/* There are no defined MIPS16 or microMIPS PLT entries for VxWorks,
- n32 or n64, so always use a standard entry there.
+ n32 or n64, so always use a standard entry there.
- If the symbol has a MIPS16 call stub and gets a PLT entry, then
- all MIPS16 calls will go via that stub, and there is no benefit
- to having a MIPS16 entry. And in the case of call_stub a
- standard entry actually has to be used as the stub ends with a J
- instruction. */
+ If the symbol has a MIPS16 call stub and gets a PLT entry, then
+ all MIPS16 calls will go via that stub, and there is no benefit
+ to having a MIPS16 entry. And in the case of call_stub a
+ standard entry actually has to be used as the stub ends with a J
+ instruction. */
if (newabi_p
|| htab->is_vxworks
|| hmips->call_stub
}
/* Otherwise, if there are no direct calls to the function, we
- have a free choice of whether to use standard or compressed
- entries. Prefer microMIPS entries if the object is known to
- contain microMIPS code, so that it becomes possible to create
- pure microMIPS binaries. Prefer standard entries otherwise,
- because MIPS16 ones are no smaller and are usually slower. */
+ have a free choice of whether to use standard or compressed
+ entries. Prefer microMIPS entries if the object is known to
+ contain microMIPS code, so that it becomes possible to create
+ pure microMIPS binaries. Prefer standard entries otherwise,
+ because MIPS16 ones are no smaller and are usually slower. */
if (!h->plt.plist->need_mips && !h->plt.plist->need_comp)
{
if (micromips_p)
}
val += isa_bit;
/* For VxWorks, point at the PLT load stub rather than the lazy
- resolution stub; this stub will become the canonical function
- address. */
+ resolution stub; this stub will become the canonical function
+ address. */
if (htab->is_vxworks)
val += 8;
}
/* Figure out the size of the PLT header if we know that we
- are using it. For the sake of cache alignment always use
- a standard header whenever any standard entries are present
- even if microMIPS entries are present as well. This also
- lets the microMIPS header rely on the value of $v0 only set
- by microMIPS entries, for a small size reduction.
+ are using it. For the sake of cache alignment always use
+ a standard header whenever any standard entries are present
+ even if microMIPS entries are present as well. This also
+ lets the microMIPS header rely on the value of $v0 only set
+ by microMIPS entries, for a small size reduction.
- Set symbol table entry values for symbols that use the
- address of their PLT entry now that we can calculate it.
+ Set symbol table entry values for symbols that use the
+ address of their PLT entry now that we can calculate it.
- Also create the _PROCEDURE_LINKAGE_TABLE_ symbol if we
- haven't already in _bfd_elf_create_dynamic_sections. */
+ Also create the _PROCEDURE_LINKAGE_TABLE_ symbol if we
+ haven't already in _bfd_elf_create_dynamic_sections. */
if (htab->root.splt && htab->plt_mips_offset + htab->plt_comp_offset != 0)
{
bfd_boolean micromips_p = (MICROMIPS_P (output_bfd)
asection *target;
/* If this relocation section applies to a read only
- section, then we probably need a DT_TEXTREL entry.
- If the relocation section is .rel(a).dyn, we always
- assert a DT_TEXTREL entry rather than testing whether
- there exists a relocation to a read only section or
- not. */
+ section, then we probably need a DT_TEXTREL entry.
+ If the relocation section is .rel(a).dyn, we always
+ assert a DT_TEXTREL entry rather than testing whether
+ there exists a relocation to a read only section or
+ not. */
outname = bfd_get_section_name (output_bfd,
s->output_section);
target = bfd_get_section_by_name (output_bfd, outname + 4);
reloc_howto_type *howto;
bfd_boolean cross_mode_jump_p = FALSE;
/* TRUE if the relocation is a RELA relocation, rather than a
- REL relocation. */
+ REL relocation. */
bfd_boolean rela_relocation_p = TRUE;
unsigned int r_type = ELF_R_TYPE (output_bfd, rel->r_info);
const char *msg;
bfd_put_32 (output_bfd, header_address, loc);
/* Now handle the PLT itself. First the standard entry (the order
- does not matter, we just have to pick one). */
+ does not matter, we just have to pick one). */
if (h->plt.plist->mips_offset != MINUS_ONE)
{
const bfd_vma *plt_entry;
bfd_boolean
_bfd_mips_elf_write_section (bfd *output_bfd,
struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
- asection *sec, bfd_byte *contents)
+ asection *sec, bfd_byte *contents)
{
bfd_byte *to, *from, *end;
int i;
mips_elf_tdata (abfd)->find_line_info = fi;
/* Note that we don't bother to ever free this information.
- find_nearest_line is either called all the time, as in
- objdump -l, so the information should be saved, or it is
- rarely called, as in ld error messages, so the memory
- wasted is unimportant. Still, it would probably be a
- good idea for free_cached_info to throw it away. */
+ find_nearest_line is either called all the time, as in
+ objdump -l, so the information should be saved, or it is
+ rarely called, as in ld error messages, so the memory
+ wasted is unimportant. Still, it would probably be a
+ good idea for free_cached_info to throw it away. */
}
if (_bfd_ecoff_locate_line (abfd, section, offset, &fi->d, swap,
int fndopc;
/* The number of bytes to delete for relaxation and from where
- to delete these bytes starting at irel->r_offset. */
+ to delete these bytes starting at irel->r_offset. */
int delcnt = 0;
int deloff = 0;
/* If this isn't something that can be relaxed, then ignore
- this reloc. */
+ this reloc. */
if (r_type != R_MICROMIPS_HI16
&& r_type != R_MICROMIPS_PC16_S1
&& r_type != R_MICROMIPS_26_S1)
/* For simplicity of coding, we are going to modify the
- section contents, the section relocs, and the BFD symbol
- table. We must tell the rest of the code not to free up this
- information. It would be possible to instead create a table
- of changes which have to be made, as is done in coff-mips.c;
- that would be more work, but would require less memory when
- the linker is run. */
+ section contents, the section relocs, and the BFD symbol
+ table. We must tell the rest of the code not to free up this
+ information. It would be possible to instead create a table
+ of changes which have to be made, as is done in coff-mips.c;
+ that would be more work, but would require less memory when
+ the linker is run. */
/* Only 32-bit instructions relaxed. */
if (irel->r_offset + 4 > sec->size)
opcode = bfd_get_micromips_32 (abfd, ptr);
/* This is the pc-relative distance from the instruction the
- relocation is applied to, to the symbol referred. */
+ relocation is applied to, to the symbol referred. */
pcrval = (symval
- (sec->output_section->vma + sec->output_offset)
- irel->r_offset);
/* R_MICROMIPS_HI16 / LUI relaxation to nil, performing relaxation
- of corresponding R_MICROMIPS_LO16 to R_MICROMIPS_HI0_LO16 or
- R_MICROMIPS_PC23_S2. The R_MICROMIPS_PC23_S2 condition is
+ of corresponding R_MICROMIPS_LO16 to R_MICROMIPS_HI0_LO16 or
+ R_MICROMIPS_PC23_S2. The R_MICROMIPS_PC23_S2 condition is
- (symval % 4 == 0 && IS_BITSIZE (pcrval, 25))
+ (symval % 4 == 0 && IS_BITSIZE (pcrval, 25))
- where pcrval has first to be adjusted to apply against the LO16
- location (we make the adjustment later on, when we have figured
- out the offset). */
+ where pcrval has first to be adjusted to apply against the LO16
+ location (we make the adjustment later on, when we have figured
+ out the offset). */
if (r_type == R_MICROMIPS_HI16 && MATCH (opcode, lui_insn))
{
bfd_boolean bzc = FALSE;
irel[1].r_info = ELF32_R_INFO (r_symndx, R_MICROMIPS_HI0_LO16);
/* Instructions using R_MICROMIPS_LO16 have the base or
- source register in bits 20:16. This register becomes $0
- (zero) as the result of the R_MICROMIPS_HI16 being 0. */
+ source register in bits 20:16. This register becomes $0
+ (zero) as the result of the R_MICROMIPS_HI16 being 0. */
nextopc &= ~0x001f0000;
bfd_put_16 (abfd, (nextopc >> 16) & 0xffff,
contents + irel[1].r_offset);
}
/* Compact branch relaxation -- due to the multitude of macros
- employed by the compiler/assembler, compact branches are not
- always generated. Obviously, this can/will be fixed elsewhere,
- but there is no drawback in double checking it here. */
+ employed by the compiler/assembler, compact branches are not
+ always generated. Obviously, this can/will be fixed elsewhere,
+ but there is no drawback in double checking it here. */
else if (r_type == R_MICROMIPS_PC16_S1
&& irel->r_offset + 5 < sec->size
&& ((fndopc = find_match (opcode, bz_rs_insns_32)) >= 0
}
/* R_MICROMIPS_PC16_S1 relaxation to R_MICROMIPS_PC10_S1. We need
- to check the distance from the next instruction, so subtract 2. */
+ to check the distance from the next instruction, so subtract 2. */
else if (!insn32
&& r_type == R_MICROMIPS_PC16_S1
&& IS_BITSIZE (pcrval - 2, 11)
}
/* R_MICROMIPS_PC16_S1 relaxation to R_MICROMIPS_PC7_S1. We need
- to check the distance from the next instruction, so subtract 2. */
+ to check the distance from the next instruction, so subtract 2. */
else if (!insn32
&& r_type == R_MICROMIPS_PC16_S1
&& IS_BITSIZE (pcrval - 2, 8)
if (relaxed)
{
/* JAL with 32-bit delay slot that is changed to a JALS
- with 16-bit delay slot. */
+ with 16-bit delay slot. */
bfd_put_micromips_32 (abfd, jal_insn_32_bd16.match, ptr);
/* Delete 2 bytes from irel->r_offset + 6. */
{
switch (isa_ext)
{
- case AFL_EXT_3900: return bfd_mach_mips3900;
- case AFL_EXT_4010: return bfd_mach_mips4010;
- case AFL_EXT_4100: return bfd_mach_mips4100;
- case AFL_EXT_4111: return bfd_mach_mips4111;
- case AFL_EXT_4120: return bfd_mach_mips4120;
- case AFL_EXT_4650: return bfd_mach_mips4650;
- case AFL_EXT_5400: return bfd_mach_mips5400;
- case AFL_EXT_5500: return bfd_mach_mips5500;
- case AFL_EXT_5900: return bfd_mach_mips5900;
- case AFL_EXT_10000: return bfd_mach_mips10000;
+ case AFL_EXT_3900: return bfd_mach_mips3900;
+ case AFL_EXT_4010: return bfd_mach_mips4010;
+ case AFL_EXT_4100: return bfd_mach_mips4100;
+ case AFL_EXT_4111: return bfd_mach_mips4111;
+ case AFL_EXT_4120: return bfd_mach_mips4120;
+ case AFL_EXT_4650: return bfd_mach_mips4650;
+ case AFL_EXT_5400: return bfd_mach_mips5400;
+ case AFL_EXT_5500: return bfd_mach_mips5500;
+ case AFL_EXT_5900: return bfd_mach_mips5900;
+ case AFL_EXT_10000: return bfd_mach_mips10000;
case AFL_EXT_LOONGSON_2E: return bfd_mach_mips_loongson_2e;
case AFL_EXT_LOONGSON_2F: return bfd_mach_mips_loongson_2f;
case AFL_EXT_LOONGSON_3A: return bfd_mach_mips_loongson_3a;
- case AFL_EXT_SB1: return bfd_mach_mips_sb1;
+ case AFL_EXT_SB1: return bfd_mach_mips_sb1;
case AFL_EXT_OCTEON: return bfd_mach_mips_octeon;
case AFL_EXT_OCTEONP: return bfd_mach_mips_octeonp;
case AFL_EXT_OCTEON2: return bfd_mach_mips_octeon2;
- case AFL_EXT_XLR: return bfd_mach_mips_xlr;
- default: return bfd_mach_mips3000;
+ case AFL_EXT_XLR: return bfd_mach_mips_xlr;
+ default: return bfd_mach_mips3000;
}
}
{
switch (bfd_get_mach (abfd))
{
- case bfd_mach_mips3900: return AFL_EXT_3900;
- case bfd_mach_mips4010: return AFL_EXT_4010;
- case bfd_mach_mips4100: return AFL_EXT_4100;
- case bfd_mach_mips4111: return AFL_EXT_4111;
- case bfd_mach_mips4120: return AFL_EXT_4120;
- case bfd_mach_mips4650: return AFL_EXT_4650;
- case bfd_mach_mips5400: return AFL_EXT_5400;
- case bfd_mach_mips5500: return AFL_EXT_5500;
- case bfd_mach_mips5900: return AFL_EXT_5900;
- case bfd_mach_mips10000: return AFL_EXT_10000;
+ case bfd_mach_mips3900: return AFL_EXT_3900;
+ case bfd_mach_mips4010: return AFL_EXT_4010;
+ case bfd_mach_mips4100: return AFL_EXT_4100;
+ case bfd_mach_mips4111: return AFL_EXT_4111;
+ case bfd_mach_mips4120: return AFL_EXT_4120;
+ case bfd_mach_mips4650: return AFL_EXT_4650;
+ case bfd_mach_mips5400: return AFL_EXT_5400;
+ case bfd_mach_mips5500: return AFL_EXT_5500;
+ case bfd_mach_mips5900: return AFL_EXT_5900;
+ case bfd_mach_mips10000: return AFL_EXT_10000;
case bfd_mach_mips_loongson_2e: return AFL_EXT_LOONGSON_2E;
case bfd_mach_mips_loongson_2f: return AFL_EXT_LOONGSON_2F;
case bfd_mach_mips_loongson_3a: return AFL_EXT_LOONGSON_3A;
- case bfd_mach_mips_sb1: return AFL_EXT_SB1;
- case bfd_mach_mips_octeon: return AFL_EXT_OCTEON;
- case bfd_mach_mips_octeonp: return AFL_EXT_OCTEONP;
- case bfd_mach_mips_octeon3: return AFL_EXT_OCTEON3;
- case bfd_mach_mips_octeon2: return AFL_EXT_OCTEON2;
- case bfd_mach_mips_xlr: return AFL_EXT_XLR;
+ case bfd_mach_mips_sb1: return AFL_EXT_SB1;
+ case bfd_mach_mips_octeon: return AFL_EXT_OCTEON;
+ case bfd_mach_mips_octeonp: return AFL_EXT_OCTEONP;
+ case bfd_mach_mips_octeon3: return AFL_EXT_OCTEON3;
+ case bfd_mach_mips_octeon2: return AFL_EXT_OCTEON2;
+ case bfd_mach_mips_xlr: return AFL_EXT_XLR;
case bfd_mach_mips_interaptiv_mr2:
return AFL_EXT_INTERAPTIV_MR2;
- default: return 0;
+ default: return 0;
}
}
Elf_Internal_ABIFlags_v0 abiflags;
/* Set up the FP ABI attribute from the abiflags if it is not already
- set. */
+ set. */
if (in_attr[Tag_GNU_MIPS_ABI_FP].i == Val_GNU_MIPS_ABI_FP_ANY)
- in_attr[Tag_GNU_MIPS_ABI_FP].i = in_tdata->abiflags.fp_abi;
+ in_attr[Tag_GNU_MIPS_ABI_FP].i = in_tdata->abiflags.fp_abi;
infer_mips_abiflags (ibfd, &abiflags);
in_abiflags = in_tdata->abiflags;
/* It is not possible to infer the correct ISA revision
- for R3 or R5 so drop down to R2 for the checks. */
+ for R3 or R5 so drop down to R2 for the checks. */
if (in_abiflags.isa_rev == 3 || in_abiflags.isa_rev == 5)
in_abiflags.isa_rev = 2;
const struct bfd_elf_special_section _bfd_mips_elf_special_sections[] =
{
- { STRING_COMMA_LEN (".lit4"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
- { STRING_COMMA_LEN (".lit8"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
+ { STRING_COMMA_LEN (".lit4"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
+ { STRING_COMMA_LEN (".lit8"), 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
{ STRING_COMMA_LEN (".mdebug"), 0, SHT_MIPS_DEBUG, 0 },
- { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
+ { STRING_COMMA_LEN (".sbss"), -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
{ STRING_COMMA_LEN (".sdata"), -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_MIPS_GPREL },
{ STRING_COMMA_LEN (".ucode"), 0, SHT_MIPS_UCODE, 0 },
- { NULL, 0, 0, 0, 0 }
+ { NULL, 0, 0, 0, 0 }
};
/* Merge non visibility st_other attributes. Ensure that the
bfd_elf_generic_reloc, /* special_function */
"R_RISCV_COPY", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
+ 0, /* src_mask */
+ 0, /* dst_mask */
FALSE), /* pcrel_offset */
HOWTO (R_RISCV_JUMP_SLOT, /* type */
bfd_elf_generic_reloc, /* special_function */
"R_RISCV_JUMP_SLOT", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
+ 0, /* src_mask */
+ 0, /* dst_mask */
FALSE), /* pcrel_offset */
/* Dynamic TLS relocations. */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ bfd_elf_generic_reloc, /* special_function */
"R_RISCV_TLS_DTPMOD32", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ bfd_elf_generic_reloc, /* special_function */
"R_RISCV_TLS_DTPMOD64", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ bfd_elf_generic_reloc, /* special_function */
"R_RISCV_TLS_DTPREL32", /* name */
TRUE, /* partial_inplace */
0, /* src_mask */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ bfd_elf_generic_reloc, /* special_function */
"R_RISCV_TLS_DTPREL64", /* name */
TRUE, /* partial_inplace */
0, /* src_mask */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ bfd_elf_generic_reloc, /* special_function */
"R_RISCV_TLS_TPREL32", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
- bfd_elf_generic_reloc, /* special_function */
+ bfd_elf_generic_reloc, /* special_function */
"R_RISCV_TLS_TPREL64", /* name */
FALSE, /* partial_inplace */
0, /* src_mask */
static reloc_howto_type _bfd_sparc_elf_howto_table[] =
{
- HOWTO(R_SPARC_NONE, 0,3, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE),
- HOWTO(R_SPARC_8, 0,0, 8,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_8", FALSE,0,0x000000ff,TRUE),
- HOWTO(R_SPARC_16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_16", FALSE,0,0x0000ffff,TRUE),
- HOWTO(R_SPARC_32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_32", FALSE,0,0xffffffff,TRUE),
- HOWTO(R_SPARC_DISP8, 0,0, 8,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP8", FALSE,0,0x000000ff,TRUE),
- HOWTO(R_SPARC_DISP16, 0,1,16,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP16", FALSE,0,0x0000ffff,TRUE),
- HOWTO(R_SPARC_DISP32, 0,2,32,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", FALSE,0,0xffffffff,TRUE),
+ HOWTO(R_SPARC_NONE, 0,3, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE),
+ HOWTO(R_SPARC_8, 0,0, 8,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_8", FALSE,0,0x000000ff,TRUE),
+ HOWTO(R_SPARC_16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_16", FALSE,0,0x0000ffff,TRUE),
+ HOWTO(R_SPARC_32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_32", FALSE,0,0xffffffff,TRUE),
+ HOWTO(R_SPARC_DISP8, 0,0, 8,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP8", FALSE,0,0x000000ff,TRUE),
+ HOWTO(R_SPARC_DISP16, 0,1,16,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP16", FALSE,0,0x0000ffff,TRUE),
+ HOWTO(R_SPARC_DISP32, 0,2,32,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", FALSE,0,0xffffffff,TRUE),
HOWTO(R_SPARC_WDISP30, 2,2,30,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP30", FALSE,0,0x3fffffff,TRUE),
HOWTO(R_SPARC_WDISP22, 2,2,22,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP22", FALSE,0,0x003fffff,TRUE),
- HOWTO(R_SPARC_HI22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HI22", FALSE,0,0x003fffff,TRUE),
- HOWTO(R_SPARC_22, 0,2,22,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_22", FALSE,0,0x003fffff,TRUE),
- HOWTO(R_SPARC_13, 0,2,13,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_13", FALSE,0,0x00001fff,TRUE),
- HOWTO(R_SPARC_LO10, 0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_LO10", FALSE,0,0x000003ff,TRUE),
- HOWTO(R_SPARC_GOT10, 0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT10", FALSE,0,0x000003ff,TRUE),
- HOWTO(R_SPARC_GOT13, 0,2,13,FALSE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_GOT13", FALSE,0,0x00001fff,TRUE),
- HOWTO(R_SPARC_GOT22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT22", FALSE,0,0x003fffff,TRUE),
- HOWTO(R_SPARC_PC10, 0,2,10,TRUE, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC10", FALSE,0,0x000003ff,TRUE),
- HOWTO(R_SPARC_PC22, 10,2,22,TRUE, 0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PC22", FALSE,0,0x003fffff,TRUE),
- HOWTO(R_SPARC_WPLT30, 2,2,30,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WPLT30", FALSE,0,0x3fffffff,TRUE),
- HOWTO(R_SPARC_COPY, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_COPY", FALSE,0,0x00000000,TRUE),
+ HOWTO(R_SPARC_HI22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HI22", FALSE,0,0x003fffff,TRUE),
+ HOWTO(R_SPARC_22, 0,2,22,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_22", FALSE,0,0x003fffff,TRUE),
+ HOWTO(R_SPARC_13, 0,2,13,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_13", FALSE,0,0x00001fff,TRUE),
+ HOWTO(R_SPARC_LO10, 0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_LO10", FALSE,0,0x000003ff,TRUE),
+ HOWTO(R_SPARC_GOT10, 0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT10", FALSE,0,0x000003ff,TRUE),
+ HOWTO(R_SPARC_GOT13, 0,2,13,FALSE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_GOT13", FALSE,0,0x00001fff,TRUE),
+ HOWTO(R_SPARC_GOT22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT22", FALSE,0,0x003fffff,TRUE),
+ HOWTO(R_SPARC_PC10, 0,2,10,TRUE, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC10", FALSE,0,0x000003ff,TRUE),
+ HOWTO(R_SPARC_PC22, 10,2,22,TRUE, 0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PC22", FALSE,0,0x003fffff,TRUE),
+ HOWTO(R_SPARC_WPLT30, 2,2,30,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WPLT30", FALSE,0,0x3fffffff,TRUE),
+ HOWTO(R_SPARC_COPY, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_COPY", FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_GLOB_DAT, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GLOB_DAT",FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_JMP_SLOT, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_JMP_SLOT",FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_RELATIVE, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_RELATIVE",FALSE,0,0x00000000,TRUE),
- HOWTO(R_SPARC_UA32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", FALSE,0,0xffffffff,TRUE),
- HOWTO(R_SPARC_PLT32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT32", FALSE,0,0xffffffff,TRUE),
- HOWTO(R_SPARC_HIPLT22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_HIPLT22", FALSE,0,0x00000000,TRUE),
- HOWTO(R_SPARC_LOPLT10, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_LOPLT10", FALSE,0,0x00000000,TRUE),
- HOWTO(R_SPARC_PCPLT32, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT32", FALSE,0,0x00000000,TRUE),
- HOWTO(R_SPARC_PCPLT22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT22", FALSE,0,0x00000000,TRUE),
- HOWTO(R_SPARC_PCPLT10, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT10", FALSE,0,0x00000000,TRUE),
- HOWTO(R_SPARC_10, 0,2,10,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_10", FALSE,0,0x000003ff,TRUE),
- HOWTO(R_SPARC_11, 0,2,11,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_11", FALSE,0,0x000007ff,TRUE),
- HOWTO(R_SPARC_64, 0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_64", FALSE,0,MINUS_ONE, TRUE),
- HOWTO(R_SPARC_OLO10, 0,2,13,FALSE,0,complain_overflow_signed, sparc_elf_notsup_reloc, "R_SPARC_OLO10", FALSE,0,0x00001fff,TRUE),
- HOWTO(R_SPARC_HH22, 42,2,22,FALSE,0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_HH22", FALSE,0,0x003fffff,TRUE),
- HOWTO(R_SPARC_HM10, 32,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HM10", FALSE,0,0x000003ff,TRUE),
- HOWTO(R_SPARC_LM22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_LM22", FALSE,0,0x003fffff,TRUE),
- HOWTO(R_SPARC_PC_HH22, 42,2,22,TRUE, 0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_PC_HH22", FALSE,0,0x003fffff,TRUE),
- HOWTO(R_SPARC_PC_HM10, 32,2,10,TRUE, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC_HM10", FALSE,0,0x000003ff,TRUE),
- HOWTO(R_SPARC_PC_LM22, 10,2,22,TRUE, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC_LM22", FALSE,0,0x003fffff,TRUE),
+ HOWTO(R_SPARC_UA32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", FALSE,0,0xffffffff,TRUE),
+ HOWTO(R_SPARC_PLT32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT32", FALSE,0,0xffffffff,TRUE),
+ HOWTO(R_SPARC_HIPLT22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_HIPLT22", FALSE,0,0x00000000,TRUE),
+ HOWTO(R_SPARC_LOPLT10, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_LOPLT10", FALSE,0,0x00000000,TRUE),
+ HOWTO(R_SPARC_PCPLT32, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT32", FALSE,0,0x00000000,TRUE),
+ HOWTO(R_SPARC_PCPLT22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT22", FALSE,0,0x00000000,TRUE),
+ HOWTO(R_SPARC_PCPLT10, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT10", FALSE,0,0x00000000,TRUE),
+ HOWTO(R_SPARC_10, 0,2,10,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_10", FALSE,0,0x000003ff,TRUE),
+ HOWTO(R_SPARC_11, 0,2,11,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_11", FALSE,0,0x000007ff,TRUE),
+ HOWTO(R_SPARC_64, 0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_64", FALSE,0,MINUS_ONE, TRUE),
+ HOWTO(R_SPARC_OLO10, 0,2,13,FALSE,0,complain_overflow_signed, sparc_elf_notsup_reloc, "R_SPARC_OLO10", FALSE,0,0x00001fff,TRUE),
+ HOWTO(R_SPARC_HH22, 42,2,22,FALSE,0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_HH22", FALSE,0,0x003fffff,TRUE),
+ HOWTO(R_SPARC_HM10, 32,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HM10", FALSE,0,0x000003ff,TRUE),
+ HOWTO(R_SPARC_LM22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_LM22", FALSE,0,0x003fffff,TRUE),
+ HOWTO(R_SPARC_PC_HH22, 42,2,22,TRUE, 0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_PC_HH22", FALSE,0,0x003fffff,TRUE),
+ HOWTO(R_SPARC_PC_HM10, 32,2,10,TRUE, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC_HM10", FALSE,0,0x000003ff,TRUE),
+ HOWTO(R_SPARC_PC_LM22, 10,2,22,TRUE, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC_LM22", FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_WDISP16, 2,2,16,TRUE, 0,complain_overflow_signed, sparc_elf_wdisp16_reloc,"R_SPARC_WDISP16", FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_WDISP19, 2,2,19,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP19", FALSE,0,0x0007ffff,TRUE),
HOWTO(R_SPARC_UNUSED_42, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_UNUSED_42",FALSE,0,0x00000000,TRUE),
- HOWTO(R_SPARC_7, 0,2, 7,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_7", FALSE,0,0x0000007f,TRUE),
- HOWTO(R_SPARC_5, 0,2, 5,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_5", FALSE,0,0x0000001f,TRUE),
- HOWTO(R_SPARC_6, 0,2, 6,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_6", FALSE,0,0x0000003f,TRUE),
- HOWTO(R_SPARC_DISP64, 0,4,64,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP64", FALSE,0,MINUS_ONE, TRUE),
- HOWTO(R_SPARC_PLT64, 0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT64", FALSE,0,MINUS_ONE, TRUE),
- HOWTO(R_SPARC_HIX22, 0,4, 0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc, "R_SPARC_HIX22", FALSE,0,MINUS_ONE, FALSE),
- HOWTO(R_SPARC_LOX10, 0,4, 0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_LOX10", FALSE,0,MINUS_ONE, FALSE),
- HOWTO(R_SPARC_H44, 22,2,22,FALSE,0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_H44", FALSE,0,0x003fffff,FALSE),
- HOWTO(R_SPARC_M44, 12,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_M44", FALSE,0,0x000003ff,FALSE),
- HOWTO(R_SPARC_L44, 0,2,13,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_L44", FALSE,0,0x00000fff,FALSE),
+ HOWTO(R_SPARC_7, 0,2, 7,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_7", FALSE,0,0x0000007f,TRUE),
+ HOWTO(R_SPARC_5, 0,2, 5,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_5", FALSE,0,0x0000001f,TRUE),
+ HOWTO(R_SPARC_6, 0,2, 6,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_6", FALSE,0,0x0000003f,TRUE),
+ HOWTO(R_SPARC_DISP64, 0,4,64,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP64", FALSE,0,MINUS_ONE, TRUE),
+ HOWTO(R_SPARC_PLT64, 0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT64", FALSE,0,MINUS_ONE, TRUE),
+ HOWTO(R_SPARC_HIX22, 0,4, 0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc, "R_SPARC_HIX22", FALSE,0,MINUS_ONE, FALSE),
+ HOWTO(R_SPARC_LOX10, 0,4, 0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_LOX10", FALSE,0,MINUS_ONE, FALSE),
+ HOWTO(R_SPARC_H44, 22,2,22,FALSE,0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_H44", FALSE,0,0x003fffff,FALSE),
+ HOWTO(R_SPARC_M44, 12,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_M44", FALSE,0,0x000003ff,FALSE),
+ HOWTO(R_SPARC_L44, 0,2,13,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_L44", FALSE,0,0x00000fff,FALSE),
HOWTO(R_SPARC_REGISTER, 0,4, 0,FALSE,0,complain_overflow_bitfield,sparc_elf_notsup_reloc, "R_SPARC_REGISTER",FALSE,0,MINUS_ONE, FALSE),
- HOWTO(R_SPARC_UA64, 0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA64", FALSE,0,MINUS_ONE, TRUE),
- HOWTO(R_SPARC_UA16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", FALSE,0,0x0000ffff,TRUE),
+ HOWTO(R_SPARC_UA64, 0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA64", FALSE,0,MINUS_ONE, TRUE),
+ HOWTO(R_SPARC_UA16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", FALSE,0,0x0000ffff,TRUE),
HOWTO(R_SPARC_TLS_GD_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_HI22",FALSE,0,0x003fffff,TRUE),
HOWTO(R_SPARC_TLS_GD_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_LO10",FALSE,0,0x000003ff,TRUE),
HOWTO(R_SPARC_TLS_GD_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_ADD",FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_GOTDATA_HIX22,0,2,0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc,"R_SPARC_GOTDATA_HIX22",FALSE,0,0x003fffff, FALSE),
HOWTO(R_SPARC_GOTDATA_LOX10,0,2,0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_GOTDATA_LOX10",FALSE,0,0x000003ff, FALSE),
HOWTO(R_SPARC_GOTDATA_OP_HIX22,0,2,0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc,"R_SPARC_GOTDATA_OP_HIX22",FALSE,0,0x003fffff, FALSE),
- HOWTO(R_SPARC_GOTDATA_OP_LOX10,0,2,0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_GOTDATA_OP_LOX10",FALSE,0,0x000003ff, FALSE),
+ HOWTO(R_SPARC_GOTDATA_OP_LOX10,0,2,0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_GOTDATA_OP_LOX10",FALSE,0,0x000003ff, FALSE),
HOWTO(R_SPARC_GOTDATA_OP,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOTDATA_OP",FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_H34,12,2,22,FALSE,0,complain_overflow_unsigned,bfd_elf_generic_reloc,"R_SPARC_H34",FALSE,0,0x003fffff,FALSE),
HOWTO(R_SPARC_SIZE32,0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc,"R_SPARC_SIZE32",FALSE,0,0xffffffff,TRUE),
1. Has non-GOT/non-PLT relocations in text section.
Or
2. Has no GOT/PLT relocation. */
-#define UNDEFINED_WEAK_RESOLVED_TO_ZERO(INFO, EH) \
- ((EH)->elf.root.type == bfd_link_hash_undefweak \
- && bfd_link_executable (INFO) \
- && (_bfd_sparc_elf_hash_table (INFO)->interp == NULL \
- || !(EH)->has_got_reloc \
- || (EH)->has_non_got_reloc \
+#define UNDEFINED_WEAK_RESOLVED_TO_ZERO(INFO, EH) \
+ ((EH)->elf.root.type == bfd_link_hash_undefweak \
+ && bfd_link_executable (INFO) \
+ && (_bfd_sparc_elf_hash_table (INFO)->interp == NULL \
+ || !(EH)->has_got_reloc \
+ || (EH)->has_non_got_reloc \
|| !(INFO)->dynamic_undefined_weak))
/* SPARC ELF linker hash entry. */
bfd_put_32 (output_bfd, (bfd_vma) 0x8a10000f, entry);
bfd_put_32 (output_bfd, (bfd_vma) 0x40000002, entry + 4);
bfd_put_32 (output_bfd, (bfd_vma) SPARC_NOP, entry + 8);
- bfd_put_32 (output_bfd, (bfd_vma) ldx, entry + 12);
+ bfd_put_32 (output_bfd, (bfd_vma) ldx, entry + 12);
bfd_put_32 (output_bfd, (bfd_vma) 0x83c3c001, entry + 16);
bfd_put_32 (output_bfd, (bfd_vma) 0x9e100005, entry + 20);
case R_SPARC_TLS_LDM_HI22:
case R_SPARC_TLS_LDM_LO10:
htab->tls_ldm_got.refcount += 1;
- if (eh != NULL)
- eh->has_got_reloc = 1;
+ if (eh != NULL)
+ eh->has_got_reloc = 1;
break;
case R_SPARC_TLS_LE_HIX22:
return FALSE;
}
- if (eh != NULL)
- eh->has_got_reloc = 1;
+ if (eh != NULL)
+ eh->has_got_reloc = 1;
break;
case R_SPARC_TLS_GD_CALL:
break;
/* It does not make sense to have a procedure linkage
- table entry for a local symbol. */
+ table entry for a local symbol. */
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
}
h->plt.refcount += 1;
- eh = (struct _bfd_sparc_elf_link_hash_entry *) h;
- eh->has_got_reloc = 1;
+ eh = (struct _bfd_sparc_elf_link_hash_entry *) h;
+ eh->has_got_reloc = 1;
break;
case R_SPARC_PC10:
if (h != NULL)
h->non_got_ref = 1;
- if (eh != NULL && (sec->flags & SEC_CODE) != 0)
- eh->has_non_got_reloc = 1;
+ if (eh != NULL && (sec->flags & SEC_CODE) != 0)
+ eh->has_non_got_reloc = 1;
r_sparc_plt32:
if (h != NULL && !bfd_link_pic (info))
bfd_boolean
_bfd_sparc_elf_fixup_symbol (struct bfd_link_info *info,
- struct elf_link_hash_entry *h)
+ struct elf_link_hash_entry *h)
{
if (h->dynindx != -1
&& UNDEFINED_WEAK_RESOLVED_TO_ZERO (info,
- _bfd_sparc_elf_hash_entry (h)))
+ _bfd_sparc_elf_hash_entry (h)))
{
h->dynindx = -1;
_bfd_elf_strtab_delref (elf_hash_table (info)->dynstr,
- h->dynstr_index);
+ h->dynstr_index);
}
return TRUE;
}
Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1
&& !h->forced_local
- && !resolved_to_zero
- && h->root.type == bfd_link_hash_undefweak)
+ && !resolved_to_zero
+ && h->root.type == bfd_link_hash_undefweak)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
/* Make room for this entry. */
s->size += htab->plt_entry_size;
- /* There should be no PLT relocations against resolved undefined
- weak symbols in the executable. */
- if (!resolved_to_zero)
- {
+ /* There should be no PLT relocations against resolved undefined
+ weak symbols in the executable. */
+ if (!resolved_to_zero)
+ {
/* We also need to make an entry in the .rela.plt section. */
if (s == htab->elf.splt)
- htab->elf.srelplt->size += SPARC_ELF_RELA_BYTES (htab);
+ htab->elf.srelplt->size += SPARC_ELF_RELA_BYTES (htab);
else
- htab->elf.irelplt->size += SPARC_ELF_RELA_BYTES (htab);
- }
+ htab->elf.irelplt->size += SPARC_ELF_RELA_BYTES (htab);
+ }
if (htab->is_vxworks)
{
Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1
&& !h->forced_local
- && !resolved_to_zero
- && h->root.type == bfd_link_hash_undefweak)
+ && !resolved_to_zero
+ && h->root.type == bfd_link_hash_undefweak)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
else if (tls_type == GOT_TLS_GD)
htab->elf.srelgot->size += 2 * SPARC_ELF_RELA_BYTES (htab);
else if (((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- && !resolved_to_zero)
- || h->root.type != bfd_link_hash_undefweak)
- && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
- bfd_link_pic (info),
+ && !resolved_to_zero)
+ || h->root.type != bfd_link_hash_undefweak)
+ && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
+ bfd_link_pic (info),
h))
htab->elf.srelgot->size += SPARC_ELF_RELA_BYTES (htab);
}
if (eh->dyn_relocs != NULL
&& h->root.type == bfd_link_hash_undefweak)
{
- /* An undefined weak symbol is never
+ /* An undefined weak symbol is never
bound locally in a shared library. */
if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
- || resolved_to_zero)
- {
- if (h->non_got_ref)
- {
- /* Keep dynamic non-GOT/non-PLT relocation so that we
- can branch to 0 without PLT. */
- struct elf_dyn_relocs **pp;
-
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
- if (p->pc_count == 0)
- *pp = p->next;
- else
- {
- /* Remove other relocations. */
- p->count = p->pc_count;
- pp = &p->next;
- }
-
- if (eh->dyn_relocs != NULL)
- {
- /* Make sure undefined weak symbols are output
- as dynamic symbols in PIEs for dynamic non-GOT
- non-PLT reloations. */
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
- }
- else
- eh->dyn_relocs = NULL;
- }
+ || resolved_to_zero)
+ {
+ if (h->non_got_ref)
+ {
+ /* Keep dynamic non-GOT/non-PLT relocation so that we
+ can branch to 0 without PLT. */
+ struct elf_dyn_relocs **pp;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL;)
+ if (p->pc_count == 0)
+ *pp = p->next;
+ else
+ {
+ /* Remove other relocations. */
+ p->count = p->pc_count;
+ pp = &p->next;
+ }
+
+ if (eh->dyn_relocs != NULL)
+ {
+ /* Make sure undefined weak symbols are output
+ as dynamic symbols in PIEs for dynamic non-GOT
+ non-PLT reloations. */
+ if (! bfd_elf_link_record_dynamic_symbol (info, h))
+ return FALSE;
+ }
+ }
+ else
+ eh->dyn_relocs = NULL;
+ }
/* Make sure undefined weak symbols are output as a dynamic
symbol in PIEs. */
dynamic. */
if ((!h->non_got_ref
- || (h->root.type == bfd_link_hash_undefweak
- && !resolved_to_zero))
+ || (h->root.type == bfd_link_hash_undefweak
+ && !resolved_to_zero))
&& ((h->def_dynamic
&& !h->def_regular)
|| (htab->elf.dynamic_sections_created
Undefined weak syms won't yet be marked as dynamic. */
if (h->dynindx == -1
&& !h->forced_local
- && !resolved_to_zero
- && h->root.type == bfd_link_hash_undefweak)
+ && !resolved_to_zero
+ && h->root.type == bfd_link_hash_undefweak)
{
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
{
/* Set the contents of the .interp section to the interpreter. */
if (bfd_link_executable (info) && !info->nointerp)
- {
- s = bfd_get_linker_section (dynobj, ".interp");
- BFD_ASSERT (s != NULL);
- s->size = htab->dynamic_interpreter_size;
- s->contents = (unsigned char *) htab->dynamic_interpreter;
- htab->interp = s;
- }
+ {
+ s = bfd_get_linker_section (dynobj, ".interp");
+ BFD_ASSERT (s != NULL);
+ s->size = htab->dynamic_interpreter_size;
+ s->contents = (unsigned char *) htab->dynamic_interpreter;
+ htab->interp = s;
+ }
}
/* Set up .got offsets for local syms, and space for local dynamic
eh = (struct _bfd_sparc_elf_link_hash_entry *) h;
resolved_to_zero = (eh != NULL
- && UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh));
+ && UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh));
switch (r_type)
{
|| is_vxworks_tls)
break;
- /* Copy dynamic function pointer relocations. Don't generate
- dynamic relocations against resolved undefined weak symbols
- in PIE. */
+ /* Copy dynamic function pointer relocations. Don't generate
+ dynamic relocations against resolved undefined weak symbols
+ in PIE. */
if ((bfd_link_pic (info)
&& (h == NULL
|| ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- && !resolved_to_zero)
+ && !resolved_to_zero)
|| h->root.type != bfd_link_hash_undefweak))
&& (! howto->pc_relative
|| !SYMBOL_CALLS_LOCAL (info, h)))
&& ((h->def_dynamic
&& !h->def_regular)
|| (h->root.type == bfd_link_hash_undefweak
- && !resolved_to_zero)
+ && !resolved_to_zero)
|| h->root.type == bfd_link_hash_undefined)))
{
Elf_Internal_Rela outrel;
if (!(outrel.r_offset & 7))
r_type = R_SPARC_64;
break;
- case R_SPARC_DISP8:
+ case R_SPARC_DISP8:
case R_SPARC_DISP16:
- case R_SPARC_DISP32:
- case R_SPARC_DISP64:
+ case R_SPARC_DISP32:
+ case R_SPARC_DISP64:
/* If the symbol is not dynamic, we should not keep
a dynamic relocation. But an .rela.* slot has been
allocated for it, output R_SPARC_NONE.
{
if (indx == 0)
{
- BFD_ASSERT (! unresolved_reloc);
+ BFD_ASSERT (! unresolved_reloc);
SPARC_ELF_PUT_WORD (htab, output_bfd,
relocation - dtpoff_base (info),
(htab->elf.sgot->contents + off
&& howto->pc_relative)
break;
- name = NULL;
+ name = NULL;
}
else
{
bed->s->swap_reloca_out (output_bfd, &rela, loc);
if (!local_undefweak
- && !h->def_regular)
+ && !h->def_regular)
{
/* Mark the symbol as undefined, rather than as defined in
the .plt section. Leave the value alone. */
static bfd_boolean
pie_finish_undefweak_symbol (struct bfd_hash_entry *bh,
- void *inf)
+ void *inf)
{
struct elf_link_hash_entry *h = (struct elf_link_hash_entry *) bh;
struct bfd_link_info *info = (struct bfd_link_info *) inf;
return TRUE;
return _bfd_sparc_elf_finish_dynamic_symbol (info->output_bfd, info,
- h, NULL);
+ h, NULL);
}
bfd_boolean
}
if (elf_section_data (splt->output_section) != NULL)
- elf_section_data (splt->output_section)->this_hdr.sh_entsize
- = ((htab->is_vxworks || !ABI_64_P (output_bfd))
- ? 0 : htab->plt_entry_size);
+ elf_section_data (splt->output_section)->this_hdr.sh_entsize
+ = ((htab->is_vxworks || !ABI_64_P (output_bfd))
+ ? 0 : htab->plt_entry_size);
}
/* Set the first entry in the global offset table to the address of
/* Fill PLT entries for undefined weak symbols in PIE. */
if (bfd_link_pie (info))
bfd_hash_traverse (&info->hash->table,
- pie_finish_undefweak_symbol,
- info);
+ pie_finish_undefweak_symbol,
+ info);
return TRUE;
}
unsigned int v9c_hwcaps_mask = ELF_SPARC_HWCAP_ASI_BLK_INIT;
unsigned int v9d_hwcaps_mask = (ELF_SPARC_HWCAP_FMAF
- | ELF_SPARC_HWCAP_VIS3
- | ELF_SPARC_HWCAP_HPC);
+ | ELF_SPARC_HWCAP_VIS3
+ | ELF_SPARC_HWCAP_HPC);
unsigned int v9e_hwcaps_mask = (ELF_SPARC_HWCAP_AES
- | ELF_SPARC_HWCAP_DES
- | ELF_SPARC_HWCAP_KASUMI
- | ELF_SPARC_HWCAP_CAMELLIA
- | ELF_SPARC_HWCAP_MD5
- | ELF_SPARC_HWCAP_SHA1
- | ELF_SPARC_HWCAP_SHA256
- | ELF_SPARC_HWCAP_SHA512
- | ELF_SPARC_HWCAP_MPMUL
- | ELF_SPARC_HWCAP_MONT
- | ELF_SPARC_HWCAP_CRC32C
- | ELF_SPARC_HWCAP_CBCOND
- | ELF_SPARC_HWCAP_PAUSE);
+ | ELF_SPARC_HWCAP_DES
+ | ELF_SPARC_HWCAP_KASUMI
+ | ELF_SPARC_HWCAP_CAMELLIA
+ | ELF_SPARC_HWCAP_MD5
+ | ELF_SPARC_HWCAP_SHA1
+ | ELF_SPARC_HWCAP_SHA256
+ | ELF_SPARC_HWCAP_SHA512
+ | ELF_SPARC_HWCAP_MPMUL
+ | ELF_SPARC_HWCAP_MONT
+ | ELF_SPARC_HWCAP_CRC32C
+ | ELF_SPARC_HWCAP_CBCOND
+ | ELF_SPARC_HWCAP_PAUSE);
unsigned int v9v_hwcaps_mask = (ELF_SPARC_HWCAP_FJFMAU
- | ELF_SPARC_HWCAP_IMA);
+ | ELF_SPARC_HWCAP_IMA);
unsigned int v9m_hwcaps2_mask = (ELF_SPARC_HWCAP2_SPARC5
- | ELF_SPARC_HWCAP2_MWAIT
- | ELF_SPARC_HWCAP2_XMPMUL
- | ELF_SPARC_HWCAP2_XMONT);
+ | ELF_SPARC_HWCAP2_MWAIT
+ | ELF_SPARC_HWCAP2_XMPMUL
+ | ELF_SPARC_HWCAP2_XMONT);
unsigned int m8_hwcaps2_mask = (ELF_SPARC_HWCAP2_SPARC6
- | ELF_SPARC_HWCAP2_ONADDSUB
- | ELF_SPARC_HWCAP2_ONMUL
- | ELF_SPARC_HWCAP2_ONDIV
- | ELF_SPARC_HWCAP2_DICTUNP
- | ELF_SPARC_HWCAP2_FPCMPSHL
- | ELF_SPARC_HWCAP2_RLE
- | ELF_SPARC_HWCAP2_SHA3);
+ | ELF_SPARC_HWCAP2_ONADDSUB
+ | ELF_SPARC_HWCAP2_ONMUL
+ | ELF_SPARC_HWCAP2_ONDIV
+ | ELF_SPARC_HWCAP2_DICTUNP
+ | ELF_SPARC_HWCAP2_FPCMPSHL
+ | ELF_SPARC_HWCAP2_RLE
+ | ELF_SPARC_HWCAP2_SHA3);
if (ABI_64_P (abfd))
{
unsigned long mach = bfd_mach_sparc_v9;
if (hwcaps2->i & m8_hwcaps2_mask)
- mach = bfd_mach_sparc_v9m8;
+ mach = bfd_mach_sparc_v9m8;
else if (hwcaps2->i & v9m_hwcaps2_mask)
- mach = bfd_mach_sparc_v9m;
+ mach = bfd_mach_sparc_v9m;
else if (hwcaps->i & v9v_hwcaps_mask)
- mach = bfd_mach_sparc_v9v;
+ mach = bfd_mach_sparc_v9v;
else if (hwcaps->i & v9e_hwcaps_mask)
- mach = bfd_mach_sparc_v9e;
+ mach = bfd_mach_sparc_v9e;
else if (hwcaps->i & v9d_hwcaps_mask)
- mach = bfd_mach_sparc_v9d;
+ mach = bfd_mach_sparc_v9d;
else if (hwcaps->i & v9c_hwcaps_mask)
- mach = bfd_mach_sparc_v9c;
+ mach = bfd_mach_sparc_v9c;
else if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US3)
mach = bfd_mach_sparc_v9b;
else if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1)
{
if (elf_elfheader (abfd)->e_machine == EM_SPARC32PLUS)
{
- if (hwcaps2->i & m8_hwcaps2_mask)
- return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
- bfd_mach_sparc_v8plusm8);
- else if (hwcaps2->i & v9m_hwcaps2_mask)
+ if (hwcaps2->i & m8_hwcaps2_mask)
+ return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
+ bfd_mach_sparc_v8plusm8);
+ else if (hwcaps2->i & v9m_hwcaps2_mask)
return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
bfd_mach_sparc_v8plusm);
- else if (hwcaps->i & v9v_hwcaps_mask)
- return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
+ else if (hwcaps->i & v9v_hwcaps_mask)
+ return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
bfd_mach_sparc_v8plusv);
- else if (hwcaps->i & v9e_hwcaps_mask)
- return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
+ else if (hwcaps->i & v9e_hwcaps_mask)
+ return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
bfd_mach_sparc_v8pluse);
- else if (hwcaps->i & v9d_hwcaps_mask)
- return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
+ else if (hwcaps->i & v9d_hwcaps_mask)
+ return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
bfd_mach_sparc_v8plusd);
- else if (hwcaps->i & v9c_hwcaps_mask)
- return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
+ else if (hwcaps->i & v9c_hwcaps_mask)
+ return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
bfd_mach_sparc_v8plusc);
else if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US3)
return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
FALSE, /* partial_inplace */
0, /* src_mask */
-1, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
HOWTO (R_TILEGX_JUMPOFF_X1_PLT, /* type */
TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES, /* rightshift */
FALSE, /* partial_inplace */
0, /* src_mask */
-1, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
#define TILEGX_IMM_HOWTO(name, size, bitsize) \
HOWTO (name, 0, size, bitsize, FALSE, 0, \
- complain_overflow_signed, bfd_elf_generic_reloc, \
- #name, FALSE, 0, -1, FALSE)
+ complain_overflow_signed, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, -1, FALSE)
#define TILEGX_UIMM_HOWTO(name, size, bitsize) \
HOWTO (name, 0, size, bitsize, FALSE, 0, \
- complain_overflow_unsigned, bfd_elf_generic_reloc, \
- #name, FALSE, 0, -1, FALSE)
+ complain_overflow_unsigned, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, -1, FALSE)
TILEGX_IMM_HOWTO(R_TILEGX_IMM8_X0, 0, 8),
TILEGX_IMM_HOWTO(R_TILEGX_IMM8_Y0, 0, 8),
#define TILEGX_IMM16_HOWTO(name, rshift) \
HOWTO (name, rshift, 1, 16, FALSE, 0, \
- complain_overflow_dont, bfd_elf_generic_reloc, \
- #name, FALSE, 0, 0xffff, FALSE)
+ complain_overflow_dont, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, 0xffff, FALSE)
TILEGX_IMM16_HOWTO (R_TILEGX_IMM16_X0_HW0, 0),
TILEGX_IMM16_HOWTO (R_TILEGX_IMM16_X1_HW0, 0),
#define TILEGX_IMM16_HOWTO_LAST(name, rshift) \
HOWTO (name, rshift, 1, 16, FALSE, 0, \
- complain_overflow_signed, bfd_elf_generic_reloc, \
- #name, FALSE, 0, 0xffff, FALSE)
+ complain_overflow_signed, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, 0xffff, FALSE)
TILEGX_IMM16_HOWTO_LAST (R_TILEGX_IMM16_X0_HW0_LAST, 0),
TILEGX_IMM16_HOWTO_LAST (R_TILEGX_IMM16_X1_HW0_LAST, 0),
#define TILEGX_IMM16_HOWTO_PCREL(name, rshift) \
HOWTO (name, rshift, 1, 16, TRUE, 0, \
- complain_overflow_dont, bfd_elf_generic_reloc, \
- #name, FALSE, 0, 0xffff, TRUE)
+ complain_overflow_dont, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, 0xffff, TRUE)
TILEGX_IMM16_HOWTO_PCREL (R_TILEGX_IMM16_X0_HW0_PCREL, 0),
TILEGX_IMM16_HOWTO_PCREL (R_TILEGX_IMM16_X1_HW0_PCREL, 0),
#define TILEGX_IMM16_HOWTO_LAST_PCREL(name, rshift) \
HOWTO (name, rshift, 1, 16, TRUE, 0, \
- complain_overflow_signed, bfd_elf_generic_reloc, \
- #name, FALSE, 0, 0xffff, TRUE)
+ complain_overflow_signed, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, 0xffff, TRUE)
TILEGX_IMM16_HOWTO_LAST_PCREL (R_TILEGX_IMM16_X0_HW0_LAST_PCREL, 0),
TILEGX_IMM16_HOWTO_LAST_PCREL (R_TILEGX_IMM16_X1_HW0_LAST_PCREL, 0),
#define TILEGX_IMM16_HOWTO_TLS_IE(name, rshift) \
HOWTO (name, rshift, 1, 16, FALSE, 0, \
- complain_overflow_dont, bfd_elf_generic_reloc, \
- #name, FALSE, 0, 0xffff, TRUE)
+ complain_overflow_dont, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, 0xffff, TRUE)
TILEGX_IMM16_HOWTO_TLS_IE (R_TILEGX_IMM16_X0_HW0_TLS_IE, 0),
TILEGX_IMM16_HOWTO_TLS_IE (R_TILEGX_IMM16_X1_HW0_TLS_IE, 0),
#define TILEGX_IMM16_HOWTO_LAST_TLS_IE(name, rshift) \
HOWTO (name, rshift, 1, 16, FALSE, 0, \
- complain_overflow_signed, bfd_elf_generic_reloc, \
- #name, FALSE, 0, 0xffff, TRUE)
+ complain_overflow_signed, bfd_elf_generic_reloc, \
+ #name, FALSE, 0, 0xffff, TRUE)
TILEGX_IMM16_HOWTO_LAST_TLS_IE (R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, 0),
TILEGX_IMM16_HOWTO_LAST_TLS_IE (R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, 0),
EMPTY_HOWTO (105),
HOWTO(R_TILEGX_TLS_DTPMOD64, 0, 0, 0, FALSE, 0, complain_overflow_dont,
- bfd_elf_generic_reloc, "R_TILEGX_TLS_DTPMOD64",
- FALSE, 0, 0, TRUE),
+ bfd_elf_generic_reloc, "R_TILEGX_TLS_DTPMOD64",
+ FALSE, 0, 0, TRUE),
HOWTO(R_TILEGX_TLS_DTPOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_TILEGX_TLS_DTPOFF64",
- FALSE, 0, -1, TRUE),
+ bfd_elf_generic_reloc, "R_TILEGX_TLS_DTPOFF64",
+ FALSE, 0, -1, TRUE),
HOWTO(R_TILEGX_TLS_TPOFF64, 0, 0, 0, FALSE, 0, complain_overflow_dont,
- bfd_elf_generic_reloc, "R_TILEGX_TLS_TPOFF64",
- FALSE, 0, 0, TRUE),
+ bfd_elf_generic_reloc, "R_TILEGX_TLS_TPOFF64",
+ FALSE, 0, 0, TRUE),
HOWTO(R_TILEGX_TLS_DTPMOD32, 0, 0, 0, FALSE, 0, complain_overflow_dont,
- bfd_elf_generic_reloc, "R_TILEGX_TLS_DTPMOD32",
- FALSE, 0, 0, TRUE),
+ bfd_elf_generic_reloc, "R_TILEGX_TLS_DTPMOD32",
+ FALSE, 0, 0, TRUE),
HOWTO(R_TILEGX_TLS_DTPOFF32, 0, 4, 32, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_TILEGX_TLS_DTPOFF32",
- FALSE, 0, -1, TRUE),
+ bfd_elf_generic_reloc, "R_TILEGX_TLS_DTPOFF32",
+ FALSE, 0, -1, TRUE),
HOWTO(R_TILEGX_TLS_TPOFF32, 0, 0, 0, FALSE, 0, complain_overflow_dont,
- bfd_elf_generic_reloc, "R_TILEGX_TLS_TPOFF32",
- FALSE, 0, 0, TRUE),
+ bfd_elf_generic_reloc, "R_TILEGX_TLS_TPOFF32",
+ FALSE, 0, 0, TRUE),
HOWTO (R_TILEGX_TLS_GD_CALL, /* type */
TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES, /* rightshift */
FALSE, /* partial_inplace */
0, /* src_mask */
-1, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
TILEGX_IMM_HOWTO(R_TILEGX_IMM8_X0_TLS_GD_ADD, 0, 8),
TILEGX_IMM_HOWTO(R_TILEGX_IMM8_X1_TLS_GD_ADD, 0, 8),
{
/* GNU extension to record C++ vtable hierarchy */
HOWTO (R_TILEGX_GNU_VTINHERIT, /* type */
- 0, /* rightshift */
- 4, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- NULL, /* special_function */
- "R_TILEGX_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0, /* rightshift */
+ 4, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ NULL, /* special_function */
+ "R_TILEGX_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* GNU extension to record C++ vtable member usage */
- HOWTO (R_TILEGX_GNU_VTENTRY, /* type */
- 0, /* rightshift */
- 4, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
- FALSE, /* pc_relative */
- 0, /* bitpos */
- complain_overflow_dont, /* complain_on_overflow */
- _bfd_elf_rel_vtable_reloc_fn, /* special_function */
- "R_TILEGX_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE), /* pcrel_offset */
+ HOWTO (R_TILEGX_GNU_VTENTRY, /* type */
+ 0, /* rightshift */
+ 4, /* size (0 = byte, 1 = short, 2 = long) */
+ 0, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont, /* complain_on_overflow */
+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */
+ "R_TILEGX_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
\f
typedef struct tilegx_reloc_map
{
bfd_reloc_code_real_type bfd_reloc_val;
- unsigned int tilegx_reloc_val;
- reloc_howto_type * table;
+ unsigned int tilegx_reloc_val;
+ reloc_howto_type * table;
} reloc_map;
static const reloc_map tilegx_reloc_map [] =
{ bfd, tilegx, tilegx_elf_howto_table },
/* Standard relocations. */
- TH_REMAP (BFD_RELOC_NONE, R_TILEGX_NONE)
- TH_REMAP (BFD_RELOC_64, R_TILEGX_64)
- TH_REMAP (BFD_RELOC_32, R_TILEGX_32)
- TH_REMAP (BFD_RELOC_16, R_TILEGX_16)
- TH_REMAP (BFD_RELOC_8, R_TILEGX_8)
- TH_REMAP (BFD_RELOC_64_PCREL, R_TILEGX_64_PCREL)
- TH_REMAP (BFD_RELOC_32_PCREL, R_TILEGX_32_PCREL)
- TH_REMAP (BFD_RELOC_16_PCREL, R_TILEGX_16_PCREL)
- TH_REMAP (BFD_RELOC_8_PCREL, R_TILEGX_8_PCREL)
+ TH_REMAP (BFD_RELOC_NONE, R_TILEGX_NONE)
+ TH_REMAP (BFD_RELOC_64, R_TILEGX_64)
+ TH_REMAP (BFD_RELOC_32, R_TILEGX_32)
+ TH_REMAP (BFD_RELOC_16, R_TILEGX_16)
+ TH_REMAP (BFD_RELOC_8, R_TILEGX_8)
+ TH_REMAP (BFD_RELOC_64_PCREL, R_TILEGX_64_PCREL)
+ TH_REMAP (BFD_RELOC_32_PCREL, R_TILEGX_32_PCREL)
+ TH_REMAP (BFD_RELOC_16_PCREL, R_TILEGX_16_PCREL)
+ TH_REMAP (BFD_RELOC_8_PCREL, R_TILEGX_8_PCREL)
#define SIMPLE_REMAP(t) TH_REMAP (BFD_RELOC_##t, R_##t)
#undef SIMPLE_REMAP
#undef TH_REMAP
- { BFD_RELOC_VTABLE_INHERIT, R_TILEGX_GNU_VTINHERIT, tilegx_elf_howto_table2 },
- { BFD_RELOC_VTABLE_ENTRY, R_TILEGX_GNU_VTENTRY, tilegx_elf_howto_table2 },
+ { BFD_RELOC_VTABLE_INHERIT, R_TILEGX_GNU_VTINHERIT, tilegx_elf_howto_table2 },
+ { BFD_RELOC_VTABLE_ENTRY, R_TILEGX_GNU_VTENTRY, tilegx_elf_howto_table2 },
};
for (i = 0;
i < (sizeof (tilegx_elf_howto_table)
- / sizeof (tilegx_elf_howto_table[0]));
+ / sizeof (tilegx_elf_howto_table[0]));
i++)
if (tilegx_elf_howto_table[i].name != NULL
- && strcasecmp (tilegx_elf_howto_table[i].name, r_name) == 0)
+ && strcasecmp (tilegx_elf_howto_table[i].name, r_name) == 0)
return &tilegx_elf_howto_table[i];
return NULL;
/* The procedure linkage table starts with the following header:
- ld_add r28, r27, 8
- ld r27, r27
+ ld_add r28, r27, 8
+ ld r27, r27
{
- jr r27
- info 10 ## SP not offset, return PC in LR
+ jr r27
+ info 10 ## SP not offset, return PC in LR
}
Subsequent entries are the following, jumping to the header at the end:
{
- moveli r28, <_GLOBAL_OFFSET_TABLE_ - 1f + MY_GOT_OFFSET>
- lnk r26
+ moveli r28, <_GLOBAL_OFFSET_TABLE_ - 1f + MY_GOT_OFFSET>
+ lnk r26
}
1:
{
- moveli r27, <_GLOBAL_OFFSET_TABLE_ - 1b>
- shl16insli r28, r28, <_GLOBAL_OFFSET_TABLE_ - 1b + MY_GOT_OFFSET>
+ moveli r27, <_GLOBAL_OFFSET_TABLE_ - 1b>
+ shl16insli r28, r28, <_GLOBAL_OFFSET_TABLE_ - 1b + MY_GOT_OFFSET>
}
{
- add r28, r26, r28
- shl16insli r27, r27, <_GLOBAL_OFFSET_TABLE_ - 1b>
+ add r28, r26, r28
+ shl16insli r27, r27, <_GLOBAL_OFFSET_TABLE_ - 1b>
}
{
- add r27, r26, r27
- ld r28, r28
- info 10 ## SP not offset, return PC in LR
+ add r27, r26, r27
+ ld r28, r28
+ info 10 ## SP not offset, return PC in LR
}
{
- shl16insli r29, zero, MY_PLT_INDEX
- jr r28
+ shl16insli r29, zero, MY_PLT_INDEX
+ jr r28
}
This code sequence lets the code at at the start of the PLT determine
If the offset fits in 16 bits,
- lnk r26
+ lnk r26
1:
{
- addli r28, r26, <_GLOBAL_OFFSET_TABLE_ - 1b + MY_GOT_OFFSET>
- moveli r27, <_GLOBAL_OFFSET_TABLE_ - 1b>
+ addli r28, r26, <_GLOBAL_OFFSET_TABLE_ - 1b + MY_GOT_OFFSET>
+ moveli r27, <_GLOBAL_OFFSET_TABLE_ - 1b>
}
{
- shl16insli r29, zero, MY_PLT_INDEX
- ld r28, r28
+ shl16insli r29, zero, MY_PLT_INDEX
+ ld r28, r28
}
{
- add r27, r26, r27
- jr r28
+ add r27, r26, r27
+ jr r28
}
- info 10 ## SP not offset, return PC in LR
+ info 10 ## SP not offset, return PC in LR
For the purpose of backtracing, the procedure linkage table ends with the
following tail entry:
- info 10 ## SP not offset, return PC in LR
+ info 10 ## SP not offset, return PC in LR
The 32-bit versions are similar, with ld4s replacing ld, and offsets into
the GOT being multiples of 4 instead of 8.
if (entry == NULL)
{
entry =
- bfd_hash_allocate (table,
- sizeof (struct tilegx_elf_link_hash_entry));
+ bfd_hash_allocate (table,
+ sizeof (struct tilegx_elf_link_hash_entry));
if (entry == NULL)
return entry;
}
case R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD:
BFD_ASSERT (bfd_link_pic (info));
tls_type = GOT_TLS_GD;
- goto have_got_reference;
+ goto have_got_reference;
case R_TILEGX_IMM16_X0_HW0_TLS_IE:
case R_TILEGX_IMM16_X1_HW0_TLS_IE:
case R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE:
case R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE:
case R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE:
- tls_type = GOT_TLS_IE;
- if (!bfd_link_executable (info))
- info->flags |= DF_STATIC_TLS;
- goto have_got_reference;
+ tls_type = GOT_TLS_IE;
+ if (!bfd_link_executable (info))
+ info->flags |= DF_STATIC_TLS;
+ goto have_got_reference;
case R_TILEGX_IMM16_X0_HW0_GOT:
case R_TILEGX_IMM16_X1_HW0_GOT:
case R_TILEGX_IMM16_X1_HW0_LAST_GOT:
case R_TILEGX_IMM16_X0_HW1_LAST_GOT:
case R_TILEGX_IMM16_X1_HW1_LAST_GOT:
- tls_type = GOT_NORMAL;
- /* Fall Through */
+ tls_type = GOT_NORMAL;
+ /* Fall Through */
- have_got_reference:
+ have_got_reference:
/* This symbol requires a global offset table entry. */
{
- int old_tls_type;
+ int old_tls_type;
if (h != NULL)
{
if (local_got_refcounts == NULL)
return FALSE;
elf_local_got_refcounts (abfd) = local_got_refcounts;
- _bfd_tilegx_elf_local_got_tls_type (abfd)
- = (char *) (local_got_refcounts + symtab_hdr->sh_info);
+ _bfd_tilegx_elf_local_got_tls_type (abfd)
+ = (char *) (local_got_refcounts + symtab_hdr->sh_info);
}
local_got_refcounts[r_symndx] += 1;
- old_tls_type = _bfd_tilegx_elf_local_got_tls_type (abfd) [r_symndx];
- }
-
- /* If a TLS symbol is accessed using IE at least once,
- there is no point to use dynamic model for it. */
- if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN
- && (old_tls_type != GOT_TLS_GD
- || tls_type != GOT_TLS_IE))
- {
- if (old_tls_type == GOT_TLS_IE && tls_type == GOT_TLS_GD)
- tls_type = old_tls_type;
- else
- {
+ old_tls_type = _bfd_tilegx_elf_local_got_tls_type (abfd) [r_symndx];
+ }
+
+ /* If a TLS symbol is accessed using IE at least once,
+ there is no point to use dynamic model for it. */
+ if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN
+ && (old_tls_type != GOT_TLS_GD
+ || tls_type != GOT_TLS_IE))
+ {
+ if (old_tls_type == GOT_TLS_IE && tls_type == GOT_TLS_GD)
+ tls_type = old_tls_type;
+ else
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: `%s' accessed both as normal and thread local symbol"),
- abfd, h ? h->root.root.string : "<local>");
- return FALSE;
- }
- }
-
- if (old_tls_type != tls_type)
- {
- if (h != NULL)
- tilegx_elf_hash_entry (h)->tls_type = tls_type;
- else
- _bfd_tilegx_elf_local_got_tls_type (abfd) [r_symndx] = tls_type;
+ (_("%B: `%s' accessed both as normal and thread local symbol"),
+ abfd, h ? h->root.root.string : "<local>");
+ return FALSE;
+ }
+ }
+
+ if (old_tls_type != tls_type)
+ {
+ if (h != NULL)
+ tilegx_elf_hash_entry (h)->tls_type = tls_type;
+ else
+ _bfd_tilegx_elf_local_got_tls_type (abfd) [r_symndx] = tls_type;
}
}
break;
/* Fall through */
- case R_TILEGX_JUMPOFF_X1_PLT:
+ case R_TILEGX_JUMPOFF_X1_PLT:
case R_TILEGX_IMM16_X0_HW0_PLT_PCREL:
case R_TILEGX_IMM16_X1_HW0_PLT_PCREL:
case R_TILEGX_IMM16_X0_HW1_PLT_PCREL:
need to generate a procedure linkage table after all. */
if (h != NULL)
- {
- h->needs_plt = 1;
- h->plt.refcount += 1;
- }
+ {
+ h->needs_plt = 1;
+ h->plt.refcount += 1;
+ }
break;
- case R_TILEGX_64_PCREL:
- case R_TILEGX_32_PCREL:
- case R_TILEGX_16_PCREL:
- case R_TILEGX_8_PCREL:
+ case R_TILEGX_64_PCREL:
+ case R_TILEGX_32_PCREL:
+ case R_TILEGX_16_PCREL:
+ case R_TILEGX_8_PCREL:
case R_TILEGX_IMM16_X0_HW0_PCREL:
case R_TILEGX_IMM16_X1_HW0_PCREL:
case R_TILEGX_IMM16_X0_HW1_PCREL:
break;
/* Fall through. */
- case R_TILEGX_64:
- case R_TILEGX_32:
- case R_TILEGX_16:
- case R_TILEGX_8:
+ case R_TILEGX_64:
+ case R_TILEGX_32:
+ case R_TILEGX_16:
+ case R_TILEGX_8:
case R_TILEGX_HW0:
case R_TILEGX_HW1:
case R_TILEGX_HW2:
case R_TILEGX_HW0_LAST:
case R_TILEGX_HW1_LAST:
case R_TILEGX_HW2_LAST:
- case R_TILEGX_COPY:
- case R_TILEGX_GLOB_DAT:
- case R_TILEGX_JMP_SLOT:
- case R_TILEGX_RELATIVE:
- case R_TILEGX_BROFF_X1:
- case R_TILEGX_JUMPOFF_X1:
- case R_TILEGX_IMM8_X0:
- case R_TILEGX_IMM8_Y0:
- case R_TILEGX_IMM8_X1:
- case R_TILEGX_IMM8_Y1:
- case R_TILEGX_DEST_IMM8_X1:
- case R_TILEGX_MT_IMM14_X1:
- case R_TILEGX_MF_IMM14_X1:
- case R_TILEGX_MMSTART_X0:
- case R_TILEGX_MMEND_X0:
- case R_TILEGX_SHAMT_X0:
- case R_TILEGX_SHAMT_X1:
- case R_TILEGX_SHAMT_Y0:
- case R_TILEGX_SHAMT_Y1:
+ case R_TILEGX_COPY:
+ case R_TILEGX_GLOB_DAT:
+ case R_TILEGX_JMP_SLOT:
+ case R_TILEGX_RELATIVE:
+ case R_TILEGX_BROFF_X1:
+ case R_TILEGX_JUMPOFF_X1:
+ case R_TILEGX_IMM8_X0:
+ case R_TILEGX_IMM8_Y0:
+ case R_TILEGX_IMM8_X1:
+ case R_TILEGX_IMM8_Y1:
+ case R_TILEGX_DEST_IMM8_X1:
+ case R_TILEGX_MT_IMM14_X1:
+ case R_TILEGX_MF_IMM14_X1:
+ case R_TILEGX_MMSTART_X0:
+ case R_TILEGX_MMEND_X0:
+ case R_TILEGX_SHAMT_X0:
+ case R_TILEGX_SHAMT_X1:
+ case R_TILEGX_SHAMT_Y0:
+ case R_TILEGX_SHAMT_Y1:
case R_TILEGX_IMM16_X0_HW0:
case R_TILEGX_IMM16_X1_HW0:
case R_TILEGX_IMM16_X0_HW1:
relocations we need for this symbol. */
if (h != NULL)
head =
- &((struct tilegx_elf_link_hash_entry *) h)->dyn_relocs;
+ &((struct tilegx_elf_link_hash_entry *) h)->dyn_relocs;
else
{
/* Track dynamic relocs needed for local syms too.
&& h->root.type == bfd_link_hash_undefweak))
{
/* This case can occur if we saw a R_TILEGX_JUMPOFF_X1_PLT
- reloc in an input file, but the symbol was never referred
- to by a dynamic object, or if all references were garbage
- collected. In such a case, we don't actually need to build
- a procedure linkage table, and we can just do a
- R_TILEGX_JUMPOFF_X1 relocation instead. */
+ reloc in an input file, but the symbol was never referred
+ to by a dynamic object, or if all references were garbage
+ collected. In such a case, we don't actually need to build
+ a procedure linkage table, and we can just do a
+ R_TILEGX_JUMPOFF_X1 relocation instead. */
h->plt.offset = (bfd_vma) -1;
h->needs_plt = 0;
}
s->size = PLT_ENTRY_SIZE;
}
- h->plt.offset = s->size - PLT_ENTRY_SIZE + PLT_HEADER_SIZE;
+ h->plt.offset = s->size - PLT_ENTRY_SIZE + PLT_HEADER_SIZE;
/* If this symbol is not defined in a regular file, and we are
not generating a shared library, then set the symbol to this
s->size += TILEGX_ELF_WORD_BYTES (htab);
/* TLS_GD entries need 2 consecutive GOT slots. */
if (tls_type == GOT_TLS_GD)
- s->size += TILEGX_ELF_WORD_BYTES (htab);
+ s->size += TILEGX_ELF_WORD_BYTES (htab);
dyn = htab->elf.dynamic_sections_created;
/* TLS_IE needs one dynamic relocation,
- TLS_GD needs two if local symbol and two if global. */
+ TLS_GD needs two if local symbol and two if global. */
if (tls_type == GOT_TLS_GD || tls_type == GOT_TLS_IE)
htab->elf.srelgot->size += 2 * TILEGX_ELF_RELA_BYTES (htab);
else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
{
*local_got = s->size;
s->size += TILEGX_ELF_WORD_BYTES (htab);
- if (*local_tls_type == GOT_TLS_GD)
- s->size += TILEGX_ELF_WORD_BYTES (htab);
- if (bfd_link_pic (info)
- || *local_tls_type == GOT_TLS_GD
- || *local_tls_type == GOT_TLS_IE)
+ if (*local_tls_type == GOT_TLS_GD)
+ s->size += TILEGX_ELF_WORD_BYTES (htab);
+ if (bfd_link_pic (info)
+ || *local_tls_type == GOT_TLS_GD
+ || *local_tls_type == GOT_TLS_IE)
srel->size += TILEGX_ELF_RELA_BYTES (htab);
}
else
FALSE, FALSE, FALSE);
/* Don't allocate .got.plt section if there are no GOT nor PLT
- entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. */
+ entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. */
if ((got == NULL
|| !got->ref_regular_nonweak)
&& (htab->elf.sgotplt->size
off = local_got_offsets[r_symndx];
/* The offset must always be a multiple of 8 on 64-bit.
- We use the least significant bit to record
+ We use the least significant bit to record
whether we have already processed this entry. */
if ((off & 1) != 0)
off &= ~1;
relocation = off - got_base;
break;
- case R_TILEGX_JUMPOFF_X1_PLT:
+ case R_TILEGX_JUMPOFF_X1_PLT:
case R_TILEGX_IMM16_X0_HW0_PLT_PCREL:
case R_TILEGX_IMM16_X1_HW0_PLT_PCREL:
case R_TILEGX_IMM16_X0_HW1_PLT_PCREL:
case R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL:
/* Relocation is to the entry for this symbol in the
procedure linkage table. */
- BFD_ASSERT (h != NULL);
+ BFD_ASSERT (h != NULL);
if (h->plt.offset == (bfd_vma) -1 || htab->elf.splt == NULL)
{
unresolved_reloc = FALSE;
break;
- case R_TILEGX_64_PCREL:
- case R_TILEGX_32_PCREL:
- case R_TILEGX_16_PCREL:
- case R_TILEGX_8_PCREL:
+ case R_TILEGX_64_PCREL:
+ case R_TILEGX_32_PCREL:
+ case R_TILEGX_16_PCREL:
+ case R_TILEGX_8_PCREL:
case R_TILEGX_IMM16_X0_HW0_PCREL:
case R_TILEGX_IMM16_X1_HW0_PCREL:
case R_TILEGX_IMM16_X0_HW1_PCREL:
&& strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
break;
/* Fall through. */
- case R_TILEGX_64:
- case R_TILEGX_32:
- case R_TILEGX_16:
- case R_TILEGX_8:
+ case R_TILEGX_64:
+ case R_TILEGX_32:
+ case R_TILEGX_16:
+ case R_TILEGX_8:
case R_TILEGX_HW0:
case R_TILEGX_HW1:
case R_TILEGX_HW2:
case R_TILEGX_HW0_LAST:
case R_TILEGX_HW1_LAST:
case R_TILEGX_HW2_LAST:
- case R_TILEGX_COPY:
- case R_TILEGX_GLOB_DAT:
- case R_TILEGX_JMP_SLOT:
- case R_TILEGX_RELATIVE:
- case R_TILEGX_BROFF_X1:
- case R_TILEGX_JUMPOFF_X1:
- case R_TILEGX_IMM8_X0:
- case R_TILEGX_IMM8_Y0:
- case R_TILEGX_IMM8_X1:
- case R_TILEGX_IMM8_Y1:
- case R_TILEGX_DEST_IMM8_X1:
- case R_TILEGX_MT_IMM14_X1:
- case R_TILEGX_MF_IMM14_X1:
- case R_TILEGX_MMSTART_X0:
- case R_TILEGX_MMEND_X0:
- case R_TILEGX_SHAMT_X0:
- case R_TILEGX_SHAMT_X1:
- case R_TILEGX_SHAMT_Y0:
- case R_TILEGX_SHAMT_Y1:
+ case R_TILEGX_COPY:
+ case R_TILEGX_GLOB_DAT:
+ case R_TILEGX_JMP_SLOT:
+ case R_TILEGX_RELATIVE:
+ case R_TILEGX_BROFF_X1:
+ case R_TILEGX_JUMPOFF_X1:
+ case R_TILEGX_IMM8_X0:
+ case R_TILEGX_IMM8_Y0:
+ case R_TILEGX_IMM8_X1:
+ case R_TILEGX_IMM8_Y1:
+ case R_TILEGX_DEST_IMM8_X1:
+ case R_TILEGX_MT_IMM14_X1:
+ case R_TILEGX_MF_IMM14_X1:
+ case R_TILEGX_MMSTART_X0:
+ case R_TILEGX_MMEND_X0:
+ case R_TILEGX_SHAMT_X0:
+ case R_TILEGX_SHAMT_X1:
+ case R_TILEGX_SHAMT_Y0:
+ case R_TILEGX_SHAMT_Y1:
case R_TILEGX_IMM16_X0_HW0:
case R_TILEGX_IMM16_X1_HW0:
case R_TILEGX_IMM16_X0_HW1:
switch (r_type)
{
- case R_TILEGX_64_PCREL:
- case R_TILEGX_32_PCREL:
- case R_TILEGX_16_PCREL:
- case R_TILEGX_8_PCREL:
+ case R_TILEGX_64_PCREL:
+ case R_TILEGX_32_PCREL:
+ case R_TILEGX_16_PCREL:
+ case R_TILEGX_8_PCREL:
/* If the symbol is not dynamic, we should not keep
a dynamic relocation. But an .rela.* slot has been
allocated for it, output R_TILEGX_NONE.
}
break;
- case R_TILEGX_IMM16_X0_HW0_TLS_LE:
- case R_TILEGX_IMM16_X1_HW0_TLS_LE:
- case R_TILEGX_IMM16_X0_HW0_LAST_TLS_LE:
- case R_TILEGX_IMM16_X1_HW0_LAST_TLS_LE:
- case R_TILEGX_IMM16_X0_HW1_LAST_TLS_LE:
- case R_TILEGX_IMM16_X1_HW1_LAST_TLS_LE:
+ case R_TILEGX_IMM16_X0_HW0_TLS_LE:
+ case R_TILEGX_IMM16_X1_HW0_TLS_LE:
+ case R_TILEGX_IMM16_X0_HW0_LAST_TLS_LE:
+ case R_TILEGX_IMM16_X1_HW0_LAST_TLS_LE:
+ case R_TILEGX_IMM16_X0_HW1_LAST_TLS_LE:
+ case R_TILEGX_IMM16_X1_HW1_LAST_TLS_LE:
if (!bfd_link_executable (info))
{
Elf_Internal_Rela outrel;
relocation = tpoff (info, relocation);
break;
- case R_TILEGX_IMM16_X0_HW0_TLS_GD:
- case R_TILEGX_IMM16_X1_HW0_TLS_GD:
- case R_TILEGX_IMM16_X0_HW0_LAST_TLS_GD:
- case R_TILEGX_IMM16_X1_HW0_LAST_TLS_GD:
- case R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD:
- case R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD:
- case R_TILEGX_IMM16_X0_HW0_TLS_IE:
- case R_TILEGX_IMM16_X1_HW0_TLS_IE:
- case R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE:
- case R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE:
- case R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE:
- case R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE:
+ case R_TILEGX_IMM16_X0_HW0_TLS_GD:
+ case R_TILEGX_IMM16_X1_HW0_TLS_GD:
+ case R_TILEGX_IMM16_X0_HW0_LAST_TLS_GD:
+ case R_TILEGX_IMM16_X1_HW0_LAST_TLS_GD:
+ case R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD:
+ case R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD:
+ case R_TILEGX_IMM16_X0_HW0_TLS_IE:
+ case R_TILEGX_IMM16_X1_HW0_TLS_IE:
+ case R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE:
+ case R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE:
+ case R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE:
+ case R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE:
r_type = tilegx_elf_tls_transition (info, r_type, h == NULL,
input_section->sec_flg0);
- tls_type = GOT_UNKNOWN;
+ tls_type = GOT_UNKNOWN;
if (h == NULL && local_got_offsets)
tls_type =
_bfd_tilegx_elf_local_got_tls_type (input_bfd) [r_symndx];
if (h != NULL)
{
- bfd_boolean dyn;
- dyn = htab->elf.dynamic_sections_created;
+ bfd_boolean dyn;
+ dyn = htab->elf.dynamic_sections_created;
if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
bfd_link_pic (info),
}
/* The GOT entries have not been initialized yet. Do it
- now, and emit any relocations. */
+ now, and emit any relocations. */
if ((bfd_link_pic (info) || indx != 0)
&& (h == NULL
|| ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
|| h->root.type != bfd_link_hash_undefweak))
need_relocs = TRUE;
- switch (r_type)
- {
+ switch (r_type)
+ {
case R_TILEGX_IMM16_X0_HW0_TLS_IE:
case R_TILEGX_IMM16_X1_HW0_TLS_IE:
case R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE:
if (need_relocs) {
TILEGX_ELF_PUT_WORD (htab, output_bfd, 0,
htab->elf.sgot->contents + off);
- outrel.r_offset = (htab->elf.sgot->output_section->vma
+ outrel.r_offset = (htab->elf.sgot->output_section->vma
+ htab->elf.sgot->output_offset + off);
- outrel.r_addend = 0;
+ outrel.r_addend = 0;
if (indx == 0)
- outrel.r_addend = relocation - dtpoff_base (info);
+ outrel.r_addend = relocation - dtpoff_base (info);
outrel.r_info = TILEGX_ELF_R_INFO (htab, NULL, indx,
TILEGX_ELF_TPOFF_RELOC (htab));
tilegx_elf_append_rela (output_bfd, htab->elf.srelgot, &outrel);
- } else {
+ } else {
TILEGX_ELF_PUT_WORD (htab, output_bfd,
tpoff (info, relocation),
htab->elf.sgot->contents + off);
- }
- break;
+ }
+ break;
case R_TILEGX_IMM16_X0_HW0_TLS_GD:
case R_TILEGX_IMM16_X1_HW0_TLS_GD:
case R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD:
case R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD:
if (need_relocs) {
- outrel.r_offset = (htab->elf.sgot->output_section->vma
+ outrel.r_offset = (htab->elf.sgot->output_section->vma
+ htab->elf.sgot->output_offset + off);
- outrel.r_addend = 0;
- outrel.r_info = TILEGX_ELF_R_INFO (htab, NULL, indx,
+ outrel.r_addend = 0;
+ outrel.r_info = TILEGX_ELF_R_INFO (htab, NULL, indx,
TILEGX_ELF_DTPMOD_RELOC (htab));
TILEGX_ELF_PUT_WORD (htab, output_bfd, 0,
htab->elf.sgot->contents + off);
- tilegx_elf_append_rela (output_bfd, htab->elf.srelgot, &outrel);
+ tilegx_elf_append_rela (output_bfd, htab->elf.srelgot, &outrel);
if (indx == 0)
- {
- BFD_ASSERT (! unresolved_reloc);
+ {
+ BFD_ASSERT (! unresolved_reloc);
TILEGX_ELF_PUT_WORD (htab, output_bfd,
relocation - dtpoff_base (info),
(htab->elf.sgot->contents + off +
TILEGX_ELF_WORD_BYTES (htab)));
- }
+ }
else
- {
+ {
TILEGX_ELF_PUT_WORD (htab, output_bfd, 0,
(htab->elf.sgot->contents + off +
TILEGX_ELF_WORD_BYTES (htab)));
- outrel.r_info = TILEGX_ELF_R_INFO (htab, NULL, indx,
+ outrel.r_info = TILEGX_ELF_R_INFO (htab, NULL, indx,
TILEGX_ELF_DTPOFF_RELOC (htab));
- outrel.r_offset += TILEGX_ELF_WORD_BYTES (htab);
- tilegx_elf_append_rela (output_bfd, htab->elf.srelgot, &outrel);
- }
- }
+ outrel.r_offset += TILEGX_ELF_WORD_BYTES (htab);
+ tilegx_elf_append_rela (output_bfd, htab->elf.srelgot, &outrel);
+ }
+ }
else {
/* If we are not emitting relocations for a
- general dynamic reference, then we must be in a
- static link or an executable link with the
- symbol binding locally. Mark it as belonging
- to module 1, the executable. */
+ general dynamic reference, then we must be in a
+ static link or an executable link with the
+ symbol binding locally. Mark it as belonging
+ to module 1, the executable. */
TILEGX_ELF_PUT_WORD (htab, output_bfd, 1,
htab->elf.sgot->contents + off );
TILEGX_ELF_PUT_WORD (htab, output_bfd,
htab->elf.sgot->contents + off +
TILEGX_ELF_WORD_BYTES (htab));
}
- break;
- }
+ break;
+ }
}
if (off >= (bfd_vma) -2)
create_func = reloc_to_create_func[r_type];
if (create_func == NULL)
{
- r = _bfd_final_link_relocate (howto, input_bfd, input_section,
- contents, rel->r_offset,
- relocation, rel->r_addend);
+ r = _bfd_final_link_relocate (howto, input_bfd, input_section,
+ contents, rel->r_offset,
+ relocation, rel->r_addend);
}
else
{
- if (howto->pc_relative)
- {
- relocation -=
- input_section->output_section->vma + input_section->output_offset;
- if (howto->pcrel_offset)
- relocation -= rel->r_offset;
- }
-
- bfd_byte *data;
-
- /* Add the relocation addend if any to the final target value */
- relocation += rel->r_addend;
-
- /* Do basic range checking */
- r = bfd_check_overflow (howto->complain_on_overflow,
- howto->bitsize,
- howto->rightshift,
- TILEGX_ELF_WORD_BYTES (htab) * 8,
- relocation);
-
- /*
- * Write the relocated value out into the raw section data.
- * Don't put a relocation out in the .rela section.
- */
- tilegx_bundle_bits mask = create_func(-1);
- tilegx_bundle_bits value = create_func(relocation >> howto->rightshift);
-
- /* Only touch bytes while the mask is not 0, so we
- don't write to out of bounds memory if this is actually
- a 16-bit switch instruction. */
- for (data = contents + rel->r_offset; mask != 0; data++)
- {
- bfd_byte byte_mask = (bfd_byte)mask;
- *data = (*data & ~byte_mask) | ((bfd_byte)value & byte_mask);
- mask >>= 8;
- value >>= 8;
- }
+ if (howto->pc_relative)
+ {
+ relocation -=
+ input_section->output_section->vma + input_section->output_offset;
+ if (howto->pcrel_offset)
+ relocation -= rel->r_offset;
+ }
+
+ bfd_byte *data;
+
+ /* Add the relocation addend if any to the final target value */
+ relocation += rel->r_addend;
+
+ /* Do basic range checking */
+ r = bfd_check_overflow (howto->complain_on_overflow,
+ howto->bitsize,
+ howto->rightshift,
+ TILEGX_ELF_WORD_BYTES (htab) * 8,
+ relocation);
+
+ /*
+ * Write the relocated value out into the raw section data.
+ * Don't put a relocation out in the .rela section.
+ */
+ tilegx_bundle_bits mask = create_func(-1);
+ tilegx_bundle_bits value = create_func(relocation >> howto->rightshift);
+
+ /* Only touch bytes while the mask is not 0, so we
+ don't write to out of bounds memory if this is actually
+ a 16-bit switch instruction. */
+ for (data = contents + rel->r_offset; mask != 0; data++)
+ {
+ bfd_byte byte_mask = (bfd_byte)mask;
+ *data = (*data & ~byte_mask) | ((bfd_byte)value & byte_mask);
+ mask >>= 8;
+ value >>= 8;
+ }
}
if (r != bfd_reloc_ok)
&& h->got.refcount > 0)
{
/* Don't use the regular PLT if there are both GOT and GOTPLT
- reloctions. */
+ reloctions. */
h->plt.offset = (bfd_vma) -1;
/* Use the GOT PLT. */
if (htab->tls_ld_or_ldm_got.refcount > 0)
{
/* Allocate 2 got entries and 1 dynamic reloc for R_386_TLS_LDM
- or R_X86_64_TLSLD relocs. */
+ or R_X86_64_TLSLD relocs. */
htab->tls_ld_or_ldm_got.offset = htab->elf.sgot->size;
htab->elf.sgot->size += 2 * htab->got_entry_size;
htab->elf.srelgot->size += htab->sizeof_reloc;
: sdyn->output_section->vma + sdyn->output_offset);
/* Set the first entry in the global offset table to the address
- of the dynamic section. Write GOT[1] and GOT[2], needed for
+ of the dynamic section. Write GOT[1] and GOT[2], needed for
the dynamic linker. */
if (htab->got_entry_size == 8)
{
/* The first entry in an absolute lazy procedure linkage table looks
like this. */
const bfd_byte *plt0_entry;
- unsigned int plt0_entry_size; /* Size of PLT0 entry. */
+ unsigned int plt0_entry_size; /* Size of PLT0 entry. */
/* Later entries in an absolute lazy procedure linkage table look
like this. */
const bfd_byte *plt_entry;
- unsigned int plt_entry_size; /* Size of each PLT entry. */
+ unsigned int plt_entry_size; /* Size of each PLT entry. */
/* Offsets into plt0_entry that are to be replaced with GOT[1] and
GOT[2]. */
/* Entries in a PIC non-lazy procedure linkage table look like this. */
const bfd_byte *pic_plt_entry;
- unsigned int plt_entry_size; /* Size of each PLT entry. */
+ unsigned int plt_entry_size; /* Size of each PLT entry. */
/* Offsets into plt_entry that are to be replaced with... */
unsigned int plt_got_offset; /* ... address of this symbol in .got. */
const bfd_byte *plt0_entry;
/* Entries in a procedure linkage table look like this. */
const bfd_byte *plt_entry;
- unsigned int plt_entry_size; /* Size of each PLT entry. */
+ unsigned int plt_entry_size; /* Size of each PLT entry. */
/* 1 has PLT0. */
unsigned int has_plt0;
| (((flags) & 0x3f) << 26))
#define N_SET_MACHTYPE(execp, machtype) \
((execp)->a_info = \
- ((execp)->a_info & 0xfb00ffff) | ((((int) (machtype)) & 0x3ff) << 16))
+ ((execp)->a_info & 0xfb00ffff) | ((((int) (machtype)) & 0x3ff) << 16))
#define N_SET_FLAGS(execp, flags) \
((execp)->a_info = \
((execp)->a_info & 0x03ffffff) | ((flags & 0x03f) << 26))
.struct bfd_hash_entry *
.@var{function_name} (struct bfd_hash_entry *entry,
-. struct bfd_hash_table *table,
-. const char *string)
+. struct bfd_hash_table *table,
+. const char *string)
.{
. struct @var{entry_type} *ret = (@var{entry_type} *) entry;
.
. {
. ret = bfd_hash_allocate (table, sizeof (* ret));
. if (ret == NULL)
-. return NULL;
+. return NULL;
. }
.
. {* Call the allocation method of the base class. *}
. ret = ((@var{entry_type} *)
-. @var{base_newfunc} ((struct bfd_hash_entry *) ret, table, string));
+. @var{base_newfunc} ((struct bfd_hash_entry *) ret, table, string));
.
. {* Initialize the local fields here. *}
.
char *new_string;
new_string = (char *) objalloc_alloc ((struct objalloc *) table->memory,
- len + 1);
+ len + 1);
if (!new_string)
{
bfd_set_error (bfd_error_no_memory);
{
if (entry == NULL)
entry = (struct bfd_hash_entry *) bfd_hash_allocate (table,
- sizeof (* entry));
+ sizeof (* entry));
return entry;
}
subclass. */
if (ret == NULL)
ret = (struct strtab_hash_entry *) bfd_hash_allocate (table,
- sizeof (* ret));
+ sizeof (* ret));
if (ret == NULL)
return NULL;
else
{
entry = (struct strtab_hash_entry *) bfd_hash_allocate (&tab->table,
- sizeof (* entry));
+ sizeof (* entry));
if (entry == NULL)
return (bfd_size_type) -1;
if (! copy)
n = (char *) bfd_hash_allocate (&tab->table, len);
if (n == NULL)
return (bfd_size_type) -1;
- memcpy (n, str, len);
+ memcpy (n, str, len);
entry->root.string = n;
}
entry->index = (bfd_size_type) -1;
#undef TARGET_IS_BIG_ENDIAN_P
#endif
-#include "libaout.h" /* BFD a.out internal data structures */
+#include "libaout.h" /* BFD a.out internal data structures */
#include "aout/aout64.h"
#ifdef HOST_MACHINE_ARCH
MA 02110-1301, USA. */
-/* hpux native ------------> | |
- | hp300hpux bfd | ----------> hpux w/gnu ext
- hpux w/gnu extension ----> | |
+/* hpux native ------------> | |
+ | hp300hpux bfd | ----------> hpux w/gnu ext
+ hpux w/gnu extension ----> | |
Support for the 9000/[34]00 has several limitations.
1. Shared libraries are not supported.
code where a unique implementation is needed:
{
- #define a bunch of stuff
- #include <aoutx.h>
+ #define a bunch of stuff
+ #include <aoutx.h>
- implement a bunch of functions
+ implement a bunch of functions
- #include "aout-target.h"
+ #include "aout-target.h"
}
The hp symbol table is a bit different than other a.out targets. Instead
#define HP_SYMTYPE_ALIGN 0x10
#define HP_SYMTYPE_EXTERNAL 0x20
-#define HP_SECONDARY_SYMBOL 0x40
+#define HP_SECONDARY_SYMBOL 0x40
/* RELOCATION DEFINITIONS */
#define HP_RSEGMENT_TEXT 0x00
#define HP_RSEGMENT_DATA 0x01
#define HP_RSEGMENT_BSS 0x02
#define HP_RSEGMENT_EXTERNAL 0x03
-#define HP_RSEGMENT_PCREL 0x04
-#define HP_RSEGMENT_RDLT 0x05
-#define HP_RSEGMENT_RPLT 0x06
+#define HP_RSEGMENT_PCREL 0x04
+#define HP_RSEGMENT_RDLT 0x05
+#define HP_RSEGMENT_RPLT 0x06
#define HP_RSEGMENT_NOOP 0x3F
#define HP_RLENGTH_BYTE 0x00
abort ();
case N_UNDF | N_EXT:
/* If the value is nonzero, then just treat this as a
- common symbol. I don't know if this is correct in
- all cases, but it is more correct than treating it as
- a weak undefined symbol. */
+ common symbol. I don't know if this is correct in
+ all cases, but it is more correct than treating it as
+ a weak undefined symbol. */
if (cache_ptr->symbol.value == 0)
new_type = N_WEAKU;
break;
/*
DESCRIPTION
- Swaps the information in an executable header taken from a raw
- byte stream memory image, into the internal exec_header
- structure.
+ Swaps the information in an executable header taken from a raw
+ byte stream memory image, into the internal exec_header
+ structure.
*/
void
/* check the header to see if it was generated by a bfd output */
/* this is detected rather bizarrely by requiring a bunch of */
/* header fields to be zero and an old unused field (now used) */
- /* to be set. */
+ /* to be set. */
/***************************************************************/
do
{
/**************************************************************/
/* the hp string is not null terminated so we create a new one*/
/* by copying the string to overlap the just vacated nlist */
- /* structure before it in memory. */
+ /* structure before it in memory. */
/**************************************************************/
cache_ptr->symbol.name = strings;
memcpy (strings, sym_pointer + 1, length);
{
/* The GNU linker assumes any offset from beginning of section */
/* is already incorporated into the image while the HP linker */
- /* adds this in later. Add it in now... */
+ /* adds this in later. Add it in now... */
MOVE_ADDRESS (-cache_ptr->address);
}
else
/************************************************************************/
/* The following functions are identical to functions in aoutx.h except */
/* they refer to MY(func) rather than NAME(aout,func) and they also */
-/* call aout_32 versions if the input file was generated by gcc */
+/* call aout_32 versions if the input file was generated by gcc */
/************************************************************************/
long aout_32_canonicalize_symtab (bfd *, asymbol **);
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
- 0, /* symbol prefix */
+ 0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit data */
it won't be encountered in core-dumps from older HP-UX's) is
harmless. */
#if !defined(CORE_ANON_SHMEM)
-#define CORE_ANON_SHMEM 0x00000200 /* anonymous shared memory */
+#define CORE_ANON_SHMEM 0x00000200 /* anonymous shared memory */
#endif
/* These are stored in the bfd's tdata */
struct hpux_core_struct
{
int sig;
- int lwpid; /* Kernel thread ID. */
+ int lwpid; /* Kernel thread ID. */
unsigned long user_tid; /* User thread ID. */
char cmd[MAXCOMLEN + 1];
};
#define hpux_core_core_file_pid _bfd_nocore_core_file_pid
static asection *make_bfd_asection (bfd *, const char *, flagword,
- bfd_size_type, bfd_vma, unsigned int);
+ bfd_size_type, bfd_vma, unsigned int);
static const bfd_target *hpux_core_core_file_p (bfd *);
static char *hpux_core_core_file_failing_command (bfd *);
static int hpux_core_core_file_failing_signal (bfd *);
static asection *
make_bfd_asection (bfd *abfd, const char *name, flagword flags,
- bfd_size_type size, bfd_vma vma,
- unsigned int alignment_power)
+ bfd_size_type size, bfd_vma vma,
+ unsigned int alignment_power)
{
asection *asect;
char *newname;
static int
thread_section_p (bfd *abfd ATTRIBUTE_UNUSED,
- asection *sect,
- void *obj ATTRIBUTE_UNUSED)
+ asection *sect,
+ void *obj ATTRIBUTE_UNUSED)
{
return CONST_STRNEQ (sect->name, ".reg/");
}
case CORE_FORMAT:
/* Just skip this. */
bfd_seek (abfd, (file_ptr) core_header.len, SEEK_CUR);
- good_sections++;
+ good_sections++;
break;
case CORE_EXEC:
{
abfd) != core_header.len)
break;
strncpy (core_command (abfd), proc_exec.cmd, MAXCOMLEN + 1);
- good_sections++;
+ good_sections++;
}
break;
case CORE_PROC:
struct proc_info proc_info;
char secname[100]; /* Of arbitrary size, but plenty large. */
- /* We need to read this section, 'cause we need to determine
- whether the core-dumped app was threaded before we create
- any .reg sections. */
+ /* We need to read this section, 'cause we need to determine
+ whether the core-dumped app was threaded before we create
+ any .reg sections. */
if (bfd_bread (&proc_info, (bfd_size_type) core_header.len, abfd)
!= core_header.len)
break;
- /* However, we also want to create those sections with the
- file positioned at the start of the record, it seems. */
- if (bfd_seek (abfd, -((file_ptr) core_header.len), SEEK_CUR) != 0)
- break;
+ /* However, we also want to create those sections with the
+ file positioned at the start of the record, it seems. */
+ if (bfd_seek (abfd, -((file_ptr) core_header.len), SEEK_CUR) != 0)
+ break;
#if defined(PROC_INFO_HAS_THREAD_ID)
- core_kernel_thread_id (abfd) = proc_info.lwpid;
- core_user_thread_id (abfd) = proc_info.user_tid;
+ core_kernel_thread_id (abfd) = proc_info.lwpid;
+ core_user_thread_id (abfd) = proc_info.user_tid;
#else
- core_kernel_thread_id (abfd) = 0;
- core_user_thread_id (abfd) = 0;
+ core_kernel_thread_id (abfd) = 0;
+ core_user_thread_id (abfd) = 0;
#endif
- /* If the program was unthreaded, then we'll just create a
- .reg section.
-
- If the program was threaded, then we'll create .reg/XXXXX
- section for each thread, where XXXXX is a printable
- representation of the kernel thread id. We'll also
- create a .reg section for the thread that was running
- and signalled at the time of the core-dump (i.e., this
- is effectively an alias, needed to keep GDB happy.)
-
- Note that we use `.reg/XXXXX' as opposed to '.regXXXXX'
- because GDB expects that .reg2 will be the floating-
- point registers. */
- if (core_kernel_thread_id (abfd) == 0)
- {
- if (!make_bfd_asection (abfd, ".reg",
+ /* If the program was unthreaded, then we'll just create a
+ .reg section.
+
+ If the program was threaded, then we'll create .reg/XXXXX
+ section for each thread, where XXXXX is a printable
+ representation of the kernel thread id. We'll also
+ create a .reg section for the thread that was running
+ and signalled at the time of the core-dump (i.e., this
+ is effectively an alias, needed to keep GDB happy.)
+
+ Note that we use `.reg/XXXXX' as opposed to '.regXXXXX'
+ because GDB expects that .reg2 will be the floating-
+ point registers. */
+ if (core_kernel_thread_id (abfd) == 0)
+ {
+ if (!make_bfd_asection (abfd, ".reg",
SEC_HAS_CONTENTS,
core_header.len,
(bfd_vma) offsetof (struct proc_info,
hw_regs),
2))
goto fail;
- }
- else
- {
- /* There are threads. Is this the one that caused the
- core-dump? We'll claim it was the running thread. */
- if (proc_info.sig != -1)
- {
+ }
+ else
+ {
+ /* There are threads. Is this the one that caused the
+ core-dump? We'll claim it was the running thread. */
+ if (proc_info.sig != -1)
+ {
if (!make_bfd_asection (abfd, ".reg",
SEC_HAS_CONTENTS,
core_header.len,
hw_regs),
2))
goto fail;
- }
- /* We always make one of these sections, for every thread. */
- sprintf (secname, ".reg/%d", core_kernel_thread_id (abfd));
- if (!make_bfd_asection (abfd, secname,
+ }
+ /* We always make one of these sections, for every thread. */
+ sprintf (secname, ".reg/%d", core_kernel_thread_id (abfd));
+ if (!make_bfd_asection (abfd, secname,
SEC_HAS_CONTENTS,
core_header.len,
(bfd_vma) offsetof (struct proc_info,
hw_regs),
2))
goto fail;
- }
+ }
core_signal (abfd) = proc_info.sig;
- if (bfd_seek (abfd, (file_ptr) core_header.len, SEEK_CUR) != 0)
- break;
- good_sections++;
+ if (bfd_seek (abfd, (file_ptr) core_header.len, SEEK_CUR) != 0)
+ break;
+ good_sections++;
}
break;
goto fail;
bfd_seek (abfd, (file_ptr) core_header.len, SEEK_CUR);
- good_sections++;
+ good_sections++;
break;
case CORE_NONE:
- /* Let's not punt if we encounter a section of unknown
- type. Rather, let's make a note of it. If we later
- see that there were also "good" sections, then we'll
- declare that this a core file, but we'll also warn that
- it may be incompatible with this gdb.
- */
+ /* Let's not punt if we encounter a section of unknown
+ type. Rather, let's make a note of it. If we later
+ see that there were also "good" sections, then we'll
+ declare that this a core file, but we'll also warn that
+ it may be incompatible with this gdb.
+ */
unknown_sections++;
- break;
+ break;
- default:
+ default:
goto fail; /*unrecognized core file type */
}
}
asection *reg_sect;
if (asect != NULL)
- {
- reg_sect = make_bfd_asection (abfd, ".reg", asect->flags,
- asect->size, asect->vma,
- asect->alignment_power);
- if (reg_sect == NULL)
- goto fail;
-
- reg_sect->filepos = asect->filepos;
- }
+ {
+ reg_sect = make_bfd_asection (abfd, ".reg", asect->flags,
+ asect->size, asect->vma,
+ asect->alignment_power);
+ if (reg_sect == NULL)
+ goto fail;
+
+ reg_sect->filepos = asect->filepos;
+ }
}
/* Were there sections of unknown type? If so, yet there were
system, and I'll stick it in for the next release. */
#define N_HEADER_IN_TEXT(x) 0
-#define N_TXTOFF(x) 0x20
-#define N_TXTADDR(x) (N_MAGIC (x) == ZMAGIC ? 0x1020 : 0)
-#define N_TXTSIZE(x) ((x)->a_text)
-#define TARGET_PAGE_SIZE 4096
-#define SEGMENT_SIZE 0x400000
-#define DEFAULT_ARCH bfd_arch_i386
+#define N_TXTOFF(x) 0x20
+#define N_TXTADDR(x) (N_MAGIC (x) == ZMAGIC ? 0x1020 : 0)
+#define N_TXTSIZE(x) ((x)->a_text)
+#define TARGET_PAGE_SIZE 4096
+#define SEGMENT_SIZE 0x400000
+#define DEFAULT_ARCH bfd_arch_i386
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
}
#define MY_write_object_contents i386aout_write_object_contents
-#define MY_backend_data & MY (backend_data)
+#define MY_backend_data & MY (backend_data)
static const struct aout_backend_data MY (backend_data);
#include "aout/aout64.h"
#include "aout/stab_gnu.h"
#include "aout/ar.h"
-#include "libaout.h" /* BFD a.out internal data structures */
+#include "libaout.h" /* BFD a.out internal data structures */
#define DEFAULT_ARCH bfd_arch_i386
{ \
if (adata(abfd).magic == undecided_magic) \
NAME(aout,adjust_sizes_and_vmas) (abfd); \
- \
+ \
execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE; \
execp->a_entry = bfd_get_start_address (abfd); \
- \
+ \
execp->a_trsize = ((obj_textsec (abfd)->reloc_count) * \
obj_reloc_entry_size (abfd)); \
execp->a_drsize = ((obj_datasec (abfd)->reloc_count) * \
abfd) != EXEC_BYTES_SIZE) \
return FALSE; \
/* Now write out reloc info, followed by syms and strings */ \
- \
- if (bfd_get_symcount (abfd) != 0) \
+ \
+ if (bfd_get_symcount (abfd) != 0) \
{ \
if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) \
!= 0) \
- return FALSE; \
+ return FALSE; \
\
if (! NAME(aout,write_syms) (abfd)) return FALSE; \
\
if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (execp)), SEEK_SET) \
!= 0) \
- return FALSE; \
+ return FALSE; \
\
if (!NAME(lynx,squirt_out_relocs) (abfd, obj_textsec (abfd))) \
return FALSE; \
if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp)), SEEK_SET) \
!= 0) \
- return 0; \
+ return 0; \
\
if (!NAME(lynx,squirt_out_relocs) (abfd, obj_datasec (abfd))) \
return FALSE; \
to give the true offset from the section */
-#define MOVE_ADDRESS(ad) \
+#define MOVE_ADDRESS(ad) \
if (r_extern) \
{ \
/* undefined symbol */ \
} \
else \
{ \
- /* defined, section relative. replace symbol with pointer to \
+ /* defined, section relative. replace symbol with pointer to \
symbol which points to section */ \
switch (r_index) { \
case N_TEXT: \
cache_ptr->addend = ad; \
break; \
} \
- } \
+ } \
static void
NAME(lynx,swap_ext_reloc_in) (bfd *abfd,
#include "aout/aout64.h"
#include "aout/stab_gnu.h"
#include "aout/ar.h"
-#include "libaout.h" /* BFD a.out internal data structures */
+#include "libaout.h" /* BFD a.out internal data structures */
#define DEFAULT_ARCH bfd_arch_i386
for (sec = abfd->sections; sec != (asection *) NULL; sec = sec->next)
{
if (sec->size == 0)
- continue;
+ continue;
if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
- {
+ {
bfd_vma sec_vma = bfd_get_section_vma (abfd, sec) + sec->size;
if (sec_vma > high_vma)
high_vma = sec_vma;
}
if (bfd_get_section_flags (abfd, sec) & SEC_LOAD)
- {
+ {
file_ptr sec_end = (sizeof (hdr)
+ bfd_get_section_vma (abfd, sec)
+ sec->size);
if (bfd_get_section_flags (abfd, section) & SEC_LOAD)
{
if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
- || bfd_bwrite (location, count, abfd) != count)
- return FALSE;
+ || bfd_bwrite (location, count, abfd) != count)
+ return FALSE;
}
return TRUE;
#define SEGMENT_SIZE TARGET_PAGE_SIZE
#define DEFAULT_ARCH bfd_arch_i386
-#define DEFAULT_MID M_386_NETBSD
+#define DEFAULT_MID M_386_NETBSD
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
/* Functions for reading from ieee files in the strange way that the
standard requires. */
-#define this_byte(ieee) *((ieee)->input_p)
+#define this_byte(ieee) *((ieee)->input_p)
#define this_byte_and_next(ieee) ((ieee)->input_p < (ieee)->end_p ? *((ieee)->input_p++) : 0)
static bfd_boolean
return FALSE;
/* Fully linked IEEE-695 files tend to give every symbol
- an absolute value. Try to convert that back into a
- section relative value. FIXME: This won't always to
- the right thing. */
+ an absolute value. Try to convert that back into a
+ section relative value. FIXME: This won't always to
+ the right thing. */
if (bfd_is_abs_section (symbol->symbol.section)
&& (abfd->flags & HAS_RELOC) == 0)
{
library = read_id (&(ieee->h));
if (library == NULL)
- goto got_wrong_format_error;
+ goto got_wrong_format_error;
if (strcmp (library, "LIBRARY") != 0)
goto got_wrong_format_error;
processor = ieee->mb.processor = read_id (&(ieee->h));
if (processor == NULL)
- goto got_wrong_format;
+ goto got_wrong_format;
if (strcmp (processor, "LIBRARY") == 0)
goto got_wrong_format;
ieee->mb.module_name = read_id (&(ieee->h));
case '4':
if (processor[4] == '9') /* 68349 */
strcpy (family, "68030"); /* CPU030 */
- else /* 68340, 68341 */
+ else /* 68340, 68341 */
strcpy (family, "68332"); /* CPU32 and CPU32+ */
break;
}
}
else if (TOUPPER (processor[3]) == 'F') /* 68F333 */
- strcpy (family, "68332"); /* CPU32 */
+ strcpy (family, "68332"); /* CPU32 */
else if ((TOUPPER (processor[3]) == 'C') /* Embedded controllers. */
&& ((TOUPPER (processor[2]) == 'E')
|| (TOUPPER (processor[2]) == 'H')
for (s = abfd->sections; s != (asection *) NULL; s = s->next)
{
/* Skip sections that have no loadable contents (.bss,
- debugging, etc.) */
+ debugging, etc.) */
if ((s->flags & SEC_LOAD) == 0)
continue;
return FALSE;
}
/* bfd_set_section_contents has already checked that everything
- is within range. */
+ is within range. */
memcpy (section->contents + offset, location, (size_t) count);
return TRUE;
}
else
{
/* This can happen - when there are gaps in the symbols read
- from an input ieee file. */
+ from an input ieee file. */
}
}
}
}
#define ieee_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define ieee_find_line _bfd_nosymbols_find_line
+#define ieee_find_line _bfd_nosymbols_find_line
#define ieee_find_inliner_info _bfd_nosymbols_find_inliner_info
static int
&& sec->vma + sec->size == extbase + segbase + addr)
{
/* This data goes at the end of the section we are
- currently building. */
+ currently building. */
sec->size += len;
}
else if (len > 0)
continue;
/* This is called after ihex_scan has succeeded, so we ought to
- know the exact format. */
+ know the exact format. */
BFD_ASSERT (c == ':');
if (bfd_bread (hdr, (bfd_size_type) 8, abfd) != 8)
if (section->used_by_bfd == NULL)
return FALSE;
if (! ihex_read_section (abfd, section,
- (bfd_byte *) section->used_by_bfd))
+ (bfd_byte *) section->used_by_bfd))
return FALSE;
}
else
{
/* The extended address record and the extended
- linear address record are combined, at least by
- some readers. We need an extended linear address
- record here, so if we've already written out an
- extended address record, zero it out to avoid
- confusion. */
+ linear address record are combined, at least by
+ some readers. We need an extended linear address
+ record here, so if we've already written out an
+ extended address record, zero it out to avoid
+ confusion. */
if (segbase != 0)
{
addr[0] = 0;
rec_addr = where - (extbase + segbase);
- /* Output records shouldn't cross 64K boundaries. */
- if (rec_addr + now > 0xffff)
- now = 0x10000 - rec_addr;
+ /* Output records shouldn't cross 64K boundaries. */
+ if (rec_addr + now > 0xffff)
+ now = 0x10000 - rec_addr;
if (! ihex_write_record (abfd, now, rec_addr, 0, p))
return FALSE;
/* Some random definitions for the target vector. */
-#define ihex_close_and_cleanup _bfd_generic_close_and_cleanup
-#define ihex_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define ihex_new_section_hook _bfd_generic_new_section_hook
-#define ihex_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-#define ihex_get_symtab_upper_bound bfd_0l
-#define ihex_canonicalize_symtab ((long (*) (bfd *, asymbol **)) bfd_0l)
-#define ihex_make_empty_symbol _bfd_generic_make_empty_symbol
-#define ihex_print_symbol _bfd_nosymbols_print_symbol
-#define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info
+#define ihex_close_and_cleanup _bfd_generic_close_and_cleanup
+#define ihex_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define ihex_new_section_hook _bfd_generic_new_section_hook
+#define ihex_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define ihex_get_symtab_upper_bound bfd_0l
+#define ihex_canonicalize_symtab ((long (*) (bfd *, asymbol **)) bfd_0l)
+#define ihex_make_empty_symbol _bfd_generic_make_empty_symbol
+#define ihex_print_symbol _bfd_nosymbols_print_symbol
+#define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info
#define ihex_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define ihex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
-#define ihex_get_lineno _bfd_nosymbols_get_lineno
-#define ihex_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define ihex_find_line _bfd_nosymbols_find_line
-#define ihex_find_inliner_info _bfd_nosymbols_find_inliner_info
-#define ihex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define ihex_read_minisymbols _bfd_nosymbols_read_minisymbols
-#define ihex_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol
-#define ihex_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define ihex_bfd_relax_section bfd_generic_relax_section
-#define ihex_bfd_gc_sections bfd_generic_gc_sections
-#define ihex_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define ihex_bfd_merge_sections bfd_generic_merge_sections
-#define ihex_bfd_is_group_section bfd_generic_is_group_section
-#define ihex_bfd_discard_group bfd_generic_discard_group
-#define ihex_section_already_linked _bfd_generic_section_already_linked
-#define ihex_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define ihex_bfd_define_start_stop bfd_generic_define_start_stop
-#define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define ihex_bfd_link_just_syms _bfd_generic_link_just_syms
-#define ihex_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
-#define ihex_bfd_final_link _bfd_generic_final_link
-#define ihex_bfd_link_split_section _bfd_generic_link_split_section
-#define ihex_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define ihex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
+#define ihex_get_lineno _bfd_nosymbols_get_lineno
+#define ihex_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define ihex_find_line _bfd_nosymbols_find_line
+#define ihex_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define ihex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define ihex_read_minisymbols _bfd_nosymbols_read_minisymbols
+#define ihex_minisymbol_to_symbol _bfd_nosymbols_minisymbol_to_symbol
+#define ihex_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
+#define ihex_bfd_relax_section bfd_generic_relax_section
+#define ihex_bfd_gc_sections bfd_generic_gc_sections
+#define ihex_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define ihex_bfd_merge_sections bfd_generic_merge_sections
+#define ihex_bfd_is_group_section bfd_generic_is_group_section
+#define ihex_bfd_discard_group bfd_generic_discard_group
+#define ihex_section_already_linked _bfd_generic_section_already_linked
+#define ihex_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define ihex_bfd_define_start_stop bfd_generic_define_start_stop
+#define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define ihex_bfd_link_just_syms _bfd_generic_link_just_syms
+#define ihex_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
+#define ihex_bfd_final_link _bfd_generic_final_link
+#define ihex_bfd_link_split_section _bfd_generic_link_split_section
+#define ihex_bfd_link_check_relocs _bfd_generic_link_check_relocs
/* The Intel Hex target vector. */
static asection *
make_bfd_asection (bfd *abfd,
- const char *name,
- flagword flags,
- bfd_size_type size,
- bfd_vma vma,
- file_ptr filepos)
+ const char *name,
+ flagword flags,
+ bfd_size_type size,
+ bfd_vma vma,
+ file_ptr filepos)
{
asection *asect;
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
- 0, /* symbol prefix */
+ 0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
0, /* match_priority */
unsigned char a_talign; /* Alignment of text segment. */
unsigned char a_dalign; /* Alignment of data segment. */
unsigned char a_balign; /* Alignment of bss segment. */
- char a_relaxable; /* Enough info for linker relax. */
+ char a_relaxable; /* Enough info for linker relax. */
};
/* Magic number is written
- < MSB >
+ < MSB >
3130292827262524232221201918171615141312111009080706050403020100
- < FLAGS >< MACHINE TYPE >< MAGIC NUMBER > */
+ < FLAGS >< MACHINE TYPE >< MAGIC NUMBER > */
/* Magic number for NetBSD is
- <MSB >
+ <MSB >
3130292827262524232221201918171615141312111009080706050403020100
- < FLAGS >< MACHINE TYPE >< MAGIC NUMBER > */
+ < FLAGS >< MACHINE TYPE >< MAGIC NUMBER > */
enum machine_type
{
M_NS32032 = (64), /* NS32032 running ? */
M_NS32532 = (64 + 5), /* NS32532 running mach. */
M_386 = 100,
- M_29K = 101, /* AMD 29000. */
+ M_29K = 101, /* AMD 29000. */
M_386_DYNIX = 102, /* Sequent running dynix. */
M_ARM = 103, /* Advanced Risc Machines ARM. */
M_SPARCLET = 131, /* SPARClet = M_SPARC + 128. */
M_SPARCLET_1 = 147, /* 0x93, reserved. */
M_POWERPC_NETBSD = 149, /* NetBSD/powerpc (big-endian) binary. */
M_VAX4K_NETBSD = 150, /* NetBSD/vax 4K pages binary. */
- M_MIPS1 = 151, /* MIPS R2000/R3000 binary. */
- M_MIPS2 = 152, /* MIPS R4000/R6000 binary. */
+ M_MIPS1 = 151, /* MIPS R2000/R3000 binary. */
+ M_MIPS2 = 152, /* MIPS R4000/R6000 binary. */
M_88K_OPENBSD = 153, /* OpenBSD/m88k binary. */
M_HPPA_OPENBSD = 154, /* OpenBSD/hppa binary. */
M_SPARC64_NETBSD = 156, /* NetBSD/sparc64 binary. */
struct internal_exec e;
};
-#define adata(bfd) ((bfd)->tdata.aout_data->a)
-#define exec_hdr(bfd) (adata (bfd).hdr)
-#define obj_aout_symbols(bfd) (adata (bfd).symbols)
-#define obj_textsec(bfd) (adata (bfd).textsec)
-#define obj_datasec(bfd) (adata (bfd).datasec)
-#define obj_bsssec(bfd) (adata (bfd).bsssec)
-#define obj_sym_filepos(bfd) (adata (bfd).sym_filepos)
-#define obj_str_filepos(bfd) (adata (bfd).str_filepos)
-#define obj_reloc_entry_size(bfd) (adata (bfd).reloc_entry_size)
-#define obj_symbol_entry_size(bfd) (adata (bfd).symbol_entry_size)
-#define obj_aout_subformat(bfd) (adata (bfd).subformat)
-#define obj_aout_external_syms(bfd) (adata (bfd).external_syms)
+#define adata(bfd) ((bfd)->tdata.aout_data->a)
+#define exec_hdr(bfd) (adata (bfd).hdr)
+#define obj_aout_symbols(bfd) (adata (bfd).symbols)
+#define obj_textsec(bfd) (adata (bfd).textsec)
+#define obj_datasec(bfd) (adata (bfd).datasec)
+#define obj_bsssec(bfd) (adata (bfd).bsssec)
+#define obj_sym_filepos(bfd) (adata (bfd).sym_filepos)
+#define obj_str_filepos(bfd) (adata (bfd).str_filepos)
+#define obj_reloc_entry_size(bfd) (adata (bfd).reloc_entry_size)
+#define obj_symbol_entry_size(bfd) (adata (bfd).symbol_entry_size)
+#define obj_aout_subformat(bfd) (adata (bfd).subformat)
+#define obj_aout_external_syms(bfd) (adata (bfd).external_syms)
#define obj_aout_external_sym_count(bfd) (adata (bfd).external_sym_count)
-#define obj_aout_sym_window(bfd) (adata (bfd).sym_window)
-#define obj_aout_external_strings(bfd) (adata (bfd).external_strings)
+#define obj_aout_sym_window(bfd) (adata (bfd).sym_window)
+#define obj_aout_external_strings(bfd) (adata (bfd).external_strings)
#define obj_aout_external_string_size(bfd) (adata (bfd).external_string_size)
-#define obj_aout_string_window(bfd) (adata (bfd).string_window)
-#define obj_aout_sym_hashes(bfd) (adata (bfd).sym_hashes)
-#define obj_aout_dynamic_info(bfd) (adata (bfd).dynamic_info)
+#define obj_aout_string_window(bfd) (adata (bfd).string_window)
+#define obj_aout_sym_hashes(bfd) (adata (bfd).sym_hashes)
+#define obj_aout_dynamic_info(bfd) (adata (bfd).dynamic_info)
/* We take the address of the first element of an asymbol to ensure that the
macro is only ever applied to an asymbol. */
{ \
if (adata(abfd).magic == undecided_magic) \
NAME (aout, adjust_sizes_and_vmas) (abfd); \
- \
+ \
execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE; \
execp->a_entry = bfd_get_start_address (abfd); \
- \
+ \
execp->a_trsize = ((obj_textsec (abfd)->reloc_count) * \
obj_reloc_entry_size (abfd)); \
execp->a_drsize = ((obj_datasec (abfd)->reloc_count) * \
abfd) != EXEC_BYTES_SIZE) \
return FALSE; \
/* Now write out reloc info, followed by syms and strings. */ \
- \
+ \
if (bfd_get_outsymbols (abfd) != NULL \
- && bfd_get_symcount (abfd) != 0) \
+ && bfd_get_symcount (abfd) != 0) \
{ \
if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) != 0)\
return FALSE; \
} \
\
if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (execp)), SEEK_SET) != 0) \
- return FALSE; \
- if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd))) \
- return FALSE; \
+ return FALSE; \
+ if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd))) \
+ return FALSE; \
\
if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp)), SEEK_SET) != 0) \
- return FALSE; \
- if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd))) \
- return FALSE; \
+ return FALSE; \
+ if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd))) \
+ return FALSE; \
}
#endif
(bfd *, struct stat *);
#define _bfd_read_ar_hdr(abfd) \
- BFD_SEND (abfd, _bfd_read_ar_hdr_fn, (abfd))
-#define _bfd_write_ar_hdr(archive, abfd) \
- BFD_SEND (abfd, _bfd_write_ar_hdr_fn, (archive, abfd))
+ BFD_SEND (abfd, _bfd_read_ar_hdr_fn, (abfd))
+#define _bfd_write_ar_hdr(archive, abfd) \
+ BFD_SEND (abfd, _bfd_write_ar_hdr_fn, (archive, abfd))
\f
/* Generic routines to use for BFD_JUMP_TABLE_GENERIC. Use
BFD_JUMP_TABLE_GENERIC (_bfd_generic). */
extern long _bfd_norelocs_canonicalize_reloc (bfd *, asection *,
arelent **, asymbol **);
extern void _bfd_norelocs_set_reloc (bfd *, asection *,
- arelent **, unsigned int);
+ arelent **, unsigned int);
#define _bfd_norelocs_bfd_reloc_type_lookup \
((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr)
#define _bfd_norelocs_bfd_reloc_name_lookup \
void
_bfd_norelocs_set_reloc (bfd *abfd ATTRIBUTE_UNUSED,
- asection *sec ATTRIBUTE_UNUSED,
- arelent **relptr ATTRIBUTE_UNUSED,
- unsigned int count ATTRIBUTE_UNUSED)
+ asection *sec ATTRIBUTE_UNUSED,
+ arelent **relptr ATTRIBUTE_UNUSED,
+ unsigned int count ATTRIBUTE_UNUSED)
{
/* Do nothing. */
}
/* FIXME: Should these take a count argument?
Answer (gnu@cygnus.com): No, but perhaps they should be inline
- functions in swap.h #ifdef __GNUC__.
- Gprof them later and find out. */
+ functions in swap.h #ifdef __GNUC__.
+ Gprof them later and find out. */
/*
FUNCTION
.
.#define bfd_put(bits, abfd, val, ptr) \
. ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \
-. : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
-. : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
-. : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
+. : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \
+. : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \
+. : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \
. : (abort (), (void) 0))
.
*/
-/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
- generated from "libbfd-in.h", "libbfd.c", "bfdio.c", "bfdwin.c",
+/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
+ generated from "libbfd-in.h", "libbfd.c", "bfdio.c", "bfdwin.c",
"cache.c", "reloc.c", "archures.c" and "linker.c".
Run "make headers" in your build bfd/ to regenerate. */
(bfd *, struct stat *);
#define _bfd_read_ar_hdr(abfd) \
- BFD_SEND (abfd, _bfd_read_ar_hdr_fn, (abfd))
-#define _bfd_write_ar_hdr(archive, abfd) \
- BFD_SEND (abfd, _bfd_write_ar_hdr_fn, (archive, abfd))
+ BFD_SEND (abfd, _bfd_read_ar_hdr_fn, (abfd))
+#define _bfd_write_ar_hdr(archive, abfd) \
+ BFD_SEND (abfd, _bfd_write_ar_hdr_fn, (archive, abfd))
\f
/* Generic routines to use for BFD_JUMP_TABLE_GENERIC. Use
BFD_JUMP_TABLE_GENERIC (_bfd_generic). */
extern long _bfd_norelocs_canonicalize_reloc (bfd *, asection *,
arelent **, asymbol **);
extern void _bfd_norelocs_set_reloc (bfd *, asection *,
- arelent **, unsigned int);
+ arelent **, unsigned int);
#define _bfd_norelocs_bfd_reloc_type_lookup \
((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr)
#define _bfd_norelocs_bfd_reloc_name_lookup \
if an error occurs. */
file_ptr (*btell) (struct bfd *abfd);
/* For the following, on successful completion a value of 0 is returned.
- Otherwise, a value of -1 is returned (and <<bfd_error>> is set). */
+ Otherwise, a value of -1 is returned (and <<bfd_error>> is set). */
int (*bseek) (struct bfd *abfd, file_ptr offset, int whence);
int (*bclose) (struct bfd *abfd);
int (*bflush) (struct bfd *abfd);
/* Object file tdata; access macros. */
#define coff_data(bfd) ((bfd)->tdata.coff_obj_data)
-#define obj_pe(bfd) (coff_data (bfd)->pe)
+#define obj_pe(bfd) (coff_data (bfd)->pe)
#define obj_symbols(bfd) (coff_data (bfd)->symbols)
#define obj_sym_filepos(bfd) (coff_data (bfd)->sym_filepos)
#define obj_relocbase(bfd) (coff_data (bfd)->relocbase)
struct coff_reloc_cookie
{
- struct internal_reloc * rels;
- struct internal_reloc * rel;
- struct internal_reloc * relend;
- struct coff_symbol_struct * symbols; /* Symtab for input bfd. */
- bfd * abfd;
+ struct internal_reloc * rels;
+ struct internal_reloc * rel;
+ struct internal_reloc * relend;
+ struct coff_symbol_struct * symbols; /* Symtab for input bfd. */
+ bfd * abfd;
struct coff_link_hash_entry ** sym_hashes;
};
-/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
+/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically
generated from "libcoff-in.h" and "coffcode.h".
Run "make headers" in your build bfd/ to regenerate. */
/* Object file tdata; access macros. */
#define coff_data(bfd) ((bfd)->tdata.coff_obj_data)
-#define obj_pe(bfd) (coff_data (bfd)->pe)
+#define obj_pe(bfd) (coff_data (bfd)->pe)
#define obj_symbols(bfd) (coff_data (bfd)->symbols)
#define obj_sym_filepos(bfd) (coff_data (bfd)->sym_filepos)
#define obj_relocbase(bfd) (coff_data (bfd)->relocbase)
struct coff_reloc_cookie
{
- struct internal_reloc * rels;
- struct internal_reloc * rel;
- struct internal_reloc * relend;
- struct coff_symbol_struct * symbols; /* Symtab for input bfd. */
- bfd * abfd;
+ struct internal_reloc * rels;
+ struct internal_reloc * rel;
+ struct internal_reloc * relend;
+ struct coff_symbol_struct * symbols; /* Symtab for input bfd. */
+ bfd * abfd;
struct coff_link_hash_entry ** sym_hashes;
};
bfd_boolean (*_bfd_coff_pointerize_aux_hook)
(bfd *, combined_entry_type *, combined_entry_type *,
- unsigned int, combined_entry_type *);
+ unsigned int, combined_entry_type *);
bfd_boolean (*_bfd_coff_print_aux)
(bfd *, FILE *, combined_entry_type *, combined_entry_type *,
- combined_entry_type *, unsigned int);
+ combined_entry_type *, unsigned int);
void (*_bfd_coff_reloc16_extra_cases)
(bfd *, struct bfd_link_info *, struct bfd_link_order *, arelent *,
- bfd_byte *, unsigned int *, unsigned int *);
+ bfd_byte *, unsigned int *, unsigned int *);
int (*_bfd_coff_reloc16_estimate)
(bfd *, asection *, arelent *, unsigned int,
- struct bfd_link_info *);
+ struct bfd_link_info *);
enum coff_symbol_classification (*_bfd_coff_classify_symbol)
(bfd *, struct internal_syment *);
bfd_boolean (*_bfd_coff_relocate_section)
(bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
- struct internal_reloc *, struct internal_syment *, asection **);
+ struct internal_reloc *, struct internal_syment *, asection **);
reloc_howto_type *(*_bfd_coff_rtype_to_howto)
(bfd *, asection *, struct internal_reloc *,
- struct coff_link_hash_entry *, struct internal_syment *,
- bfd_vma *);
+ struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *);
bfd_boolean (*_bfd_coff_adjust_symndx)
(bfd *, struct bfd_link_info *, bfd *, asection *,
- struct internal_reloc *, bfd_boolean *);
+ struct internal_reloc *, bfd_boolean *);
bfd_boolean (*_bfd_coff_link_add_one_symbol)
(struct bfd_link_info *, bfd *, const char *, flagword,
- asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean,
- struct bfd_link_hash_entry **);
+ asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean,
+ struct bfd_link_hash_entry **);
bfd_boolean (*_bfd_coff_link_output_has_begun)
(bfd *, struct coff_final_link_info *);
struct nlm_relent *relocs;
} nlmNAME(symbol_type);
-extern bfd_boolean nlm_mkobject (bfd *);
-extern bfd_boolean nlm_set_arch_mach (bfd *, enum bfd_architecture, unsigned long);
-extern void nlmNAME (get_symbol_info) (bfd *, asymbol *, symbol_info *);
-extern long nlmNAME (get_symtab_upper_bound)(bfd *);
-extern long nlmNAME (canonicalize_symtab) (bfd *, asymbol **);
-extern asymbol * nlmNAME (make_empty_symbol) (bfd *);
-extern void nlmNAME (print_symbol) (bfd *, void *, asymbol *, bfd_print_symbol_type);
-extern long nlmNAME (get_reloc_upper_bound) (bfd *, asection *);
-extern long nlmNAME (canonicalize_reloc) (bfd *, asection *, arelent **, asymbol **);
-extern const bfd_target * nlmNAME (object_p) (bfd *);
-extern bfd_boolean nlmNAME (set_arch_mach) (bfd *, enum bfd_architecture, unsigned long);
-extern bfd_boolean nlmNAME (set_section_contents) (bfd *, asection *, const void *, file_ptr, bfd_size_type);
-extern bfd_boolean nlmNAME (write_object_contents) (bfd *);
+extern bfd_boolean nlm_mkobject (bfd *);
+extern bfd_boolean nlm_set_arch_mach (bfd *, enum bfd_architecture, unsigned long);
+extern void nlmNAME (get_symbol_info) (bfd *, asymbol *, symbol_info *);
+extern long nlmNAME (get_symtab_upper_bound)(bfd *);
+extern long nlmNAME (canonicalize_symtab) (bfd *, asymbol **);
+extern asymbol * nlmNAME (make_empty_symbol) (bfd *);
+extern void nlmNAME (print_symbol) (bfd *, void *, asymbol *, bfd_print_symbol_type);
+extern long nlmNAME (get_reloc_upper_bound) (bfd *, asection *);
+extern long nlmNAME (canonicalize_reloc) (bfd *, asection *, arelent **, asymbol **);
+extern const bfd_target * nlmNAME (object_p) (bfd *);
+extern bfd_boolean nlmNAME (set_arch_mach) (bfd *, enum bfd_architecture, unsigned long);
+extern bfd_boolean nlmNAME (set_section_contents) (bfd *, asection *, const void *, file_ptr, bfd_size_type);
+extern bfd_boolean nlmNAME (write_object_contents) (bfd *);
/* Some private data is stashed away for future use using the tdata pointer
in the bfd structure. */
};
#define nlm_backend(bfd) ((struct nlm_backend_data *)((bfd) -> xvec -> backend_data))
-#define nlm_signature(bfd) (nlm_backend (bfd) -> signature)
-#define nlm_fixed_header_size(bfd) (nlm_backend (bfd) -> fixed_header_size)
-#define nlm_optional_prefix_size(bfd) (nlm_backend (bfd) -> optional_prefix_size)
-#define nlm_architecture(bfd) (nlm_backend (bfd) -> arch)
-#define nlm_machine(bfd) (nlm_backend (bfd) -> mach)
-#define nlm_no_uninitialized_data(bfd) (nlm_backend (bfd) -> no_uninitialized_data)
-#define nlm_backend_object_p_func(bfd) (nlm_backend (bfd) -> nlm_backend_object_p)
-#define nlm_write_prefix_func(bfd) (nlm_backend (bfd) -> nlm_write_prefix)
-#define nlm_read_reloc_func(bfd) (nlm_backend (bfd) -> nlm_read_reloc)
-#define nlm_mangle_relocs_func(bfd) (nlm_backend (bfd) -> nlm_mangle_relocs)
-#define nlm_read_import_func(bfd) (nlm_backend (bfd) -> nlm_read_import)
-#define nlm_write_import_func(bfd) (nlm_backend (bfd) -> nlm_write_import)
+#define nlm_signature(bfd) (nlm_backend (bfd) -> signature)
+#define nlm_fixed_header_size(bfd) (nlm_backend (bfd) -> fixed_header_size)
+#define nlm_optional_prefix_size(bfd) (nlm_backend (bfd) -> optional_prefix_size)
+#define nlm_architecture(bfd) (nlm_backend (bfd) -> arch)
+#define nlm_machine(bfd) (nlm_backend (bfd) -> mach)
+#define nlm_no_uninitialized_data(bfd) (nlm_backend (bfd) -> no_uninitialized_data)
+#define nlm_backend_object_p_func(bfd) (nlm_backend (bfd) -> nlm_backend_object_p)
+#define nlm_write_prefix_func(bfd) (nlm_backend (bfd) -> nlm_write_prefix)
+#define nlm_read_reloc_func(bfd) (nlm_backend (bfd) -> nlm_read_reloc)
+#define nlm_mangle_relocs_func(bfd) (nlm_backend (bfd) -> nlm_mangle_relocs)
+#define nlm_read_import_func(bfd) (nlm_backend (bfd) -> nlm_read_import)
+#define nlm_write_import_func(bfd) (nlm_backend (bfd) -> nlm_write_import)
#define nlm_set_public_section_func(bfd) (nlm_backend (bfd) -> nlm_set_public_section)
-#define nlm_get_public_offset_func(bfd) (nlm_backend (bfd) -> nlm_get_public_offset)
+#define nlm_get_public_offset_func(bfd) (nlm_backend (bfd) -> nlm_get_public_offset)
#define nlm_swap_fixed_header_in_func(bfd) (nlm_backend (bfd) -> nlm_swap_fhdr_in)
#define nlm_swap_fixed_header_out_func(bfd)(nlm_backend (bfd) -> nlm_swap_fhdr_out)
-#define nlm_write_external_func(bfd) (nlm_backend (bfd) -> nlm_write_external)
-#define nlm_write_export_func(bfd) (nlm_backend (bfd) -> nlm_write_export)
+#define nlm_write_external_func(bfd) (nlm_backend (bfd) -> nlm_write_external)
+#define nlm_write_export_func(bfd) (nlm_backend (bfd) -> nlm_write_export)
/* The NLM code, data, and uninitialized sections have no names defined
in the NLM, but bfd wants to give them names, so use the traditional
#ifdef COFF_WITH_pex64
-#define GET_OPTHDR_IMAGE_BASE H_GET_64
-#define PUT_OPTHDR_IMAGE_BASE H_PUT_64
+#define GET_OPTHDR_IMAGE_BASE H_GET_64
+#define PUT_OPTHDR_IMAGE_BASE H_PUT_64
#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
-#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
-#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
-#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
-#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
-#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
-#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
-#define GET_PDATA_ENTRY bfd_get_32
+#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
+#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
+#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
+#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
+#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
+#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
+#define GET_PDATA_ENTRY bfd_get_32
#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pex64_bfd_copy_private_bfd_data_common
#define _bfd_XX_bfd_copy_private_section_data _bfd_pex64_bfd_copy_private_section_data
#define coff_final_link_postscript _bfd_XXi_final_link_postscript
#endif
-void _bfd_XXi_swap_sym_in (bfd *, void *, void *);
+void _bfd_XXi_swap_sym_in (bfd *, void *, void *);
unsigned _bfd_XXi_swap_sym_out (bfd *, void *, void *);
-void _bfd_XXi_swap_aux_in (bfd *, void *, int, int, int, int, void *);
+void _bfd_XXi_swap_aux_in (bfd *, void *, int, int, int, int, void *);
unsigned _bfd_XXi_swap_aux_out (bfd *, void *, int, int, int, int, void *);
-void _bfd_XXi_swap_lineno_in (bfd *, void *, void *);
+void _bfd_XXi_swap_lineno_in (bfd *, void *, void *);
unsigned _bfd_XXi_swap_lineno_out (bfd *, void *, void *);
-void _bfd_XXi_swap_aouthdr_in (bfd *, void *, void *);
+void _bfd_XXi_swap_aouthdr_in (bfd *, void *, void *);
unsigned _bfd_XXi_swap_aouthdr_out (bfd *, void *, void *);
unsigned _bfd_XXi_swap_scnhdr_out (bfd *, void *, void *);
bfd_boolean _bfd_XX_print_private_bfd_data_common (bfd *, void *);
bfd_boolean _bfd_XX_bfd_copy_private_bfd_data_common (bfd *, bfd *);
-void _bfd_XX_get_symbol_info (bfd *, asymbol *, symbol_info *);
+void _bfd_XX_get_symbol_info (bfd *, asymbol *, symbol_info *);
bfd_boolean _bfd_XXi_final_link_postscript (bfd *, struct coff_final_link_info *);
-void _bfd_XXi_swap_debugdir_in (bfd *, void *, void *);
+void _bfd_XXi_swap_debugdir_in (bfd *, void *, void *);
unsigned _bfd_XXi_swap_debugdir_out (bfd *, void *, void *);
unsigned _bfd_XXi_write_codeview_record (bfd *, file_ptr, CODEVIEW_INFO *);
CODEVIEW_INFO * _bfd_XXi_slurp_codeview_record (bfd * abfd, file_ptr where, unsigned long length, CODEVIEW_INFO *cvinfo);
/* Check for the magic number U802TOMAGIC for 32 bit targets. */
#define bfd_xcoff_is_xcoff32(a) (0x01DF == (bfd_xcoff_magic_number (a)))
-#define bfd_xcoff_rtinit_size(a) ((xcoff_backend (a)->_xcoff_rtinit_size))
+#define bfd_xcoff_rtinit_size(a) ((xcoff_backend (a)->_xcoff_rtinit_size))
#define bfd_xcoff_generate_rtinit(a, b, c, d) ((xcoff_backend (a)->_xcoff_generate_rtinit ((a), (b), (c), (d))))
/* Accessor macros for tdata. */
if (entry == NULL)
{
entry = (struct bfd_hash_entry *)
- bfd_hash_allocate (table, sizeof (struct bfd_link_hash_entry));
+ bfd_hash_allocate (table, sizeof (struct bfd_link_hash_entry));
if (entry == NULL)
return entry;
}
struct bfd_link_hash_entry *h;
/* This symbol is being wrapped. We want to replace all
- references to SYM with references to __wrap_SYM. */
+ references to SYM with references to __wrap_SYM. */
amt = strlen (l) + sizeof WRAP + 1;
n = (char *) bfd_malloc (amt);
struct bfd_link_hash_entry *h;
/* This is a reference to __real_SYM, where SYM is being
- wrapped. We want to replace all references to __real_SYM
- with references to SYM. */
+ wrapped. We want to replace all references to __real_SYM
+ with references to SYM. */
amt = strlen (l + sizeof REAL - 1) + 2;
n = (char *) bfd_malloc (amt);
if (symsize < 0)
return FALSE;
bfd_get_outsymbols (abfd) = (struct bfd_symbol **) bfd_alloc (abfd,
- symsize);
+ symsize);
if (bfd_get_outsymbols (abfd) == NULL && symsize != 0)
return FALSE;
symcount = bfd_canonicalize_symtab (abfd, bfd_get_outsymbols (abfd));
h = (struct generic_link_hash_entry *) bh;
/* If this is a constructor symbol, and the linker didn't do
- anything with it, then we want to just pass the symbol
- through to the output file. This will happen when
- linking with -r. */
+ anything with it, then we want to just pass the symbol
+ through to the output file. This will happen when
+ linking with -r. */
if ((p->flags & BSF_CONSTRUCTOR) != 0
&& (h == NULL || h->root.type == bfd_link_hash_new))
{
static const enum link_action link_action[8][8] =
{
/* current\prev new undef undefw def defw com indr warn */
- /* UNDEF_ROW */ {UND, NOACT, UND, REF, REF, NOACT, REFC, WARNC },
+ /* UNDEF_ROW */ {UND, NOACT, UND, REF, REF, NOACT, REFC, WARNC },
/* UNDEFW_ROW */ {WEAK, NOACT, NOACT, REF, REF, NOACT, REFC, WARNC },
- /* DEF_ROW */ {DEF, DEF, DEF, MDEF, DEF, CDEF, MDEF, CYCLE },
- /* DEFW_ROW */ {DEFW, DEFW, DEFW, NOACT, NOACT, NOACT, NOACT, CYCLE },
+ /* DEF_ROW */ {DEF, DEF, DEF, MDEF, DEF, CDEF, MDEF, CYCLE },
+ /* DEFW_ROW */ {DEFW, DEFW, DEFW, NOACT, NOACT, NOACT, NOACT, CYCLE },
/* COMMON_ROW */ {COM, COM, COM, CREF, COM, BIG, REFC, WARNC },
/* INDR_ROW */ {IND, IND, IND, MDEF, IND, CIND, MIND, CYCLE },
/* WARN_ROW */ {MWARN, WARN, WARN, WARN, WARN, WARN, WARN, NOACT },
&& s[CONS_PREFIX_LEN] == s[CONS_PREFIX_LEN + 2])
{
/* If this is a definition of a symbol which
- was previously weakly defined, we are in
- trouble. We have already added a
- constructor entry for the weak defined
- symbol, and now we are trying to add one
- for the new symbol. Fortunately, this case
- should never arise in practice. */
+ was previously weakly defined, we are in
+ trouble. We have already added a
+ constructor entry for the weak defined
+ symbol, and now we are trying to add one
+ for the new symbol. Fortunately, this case
+ should never arise in practice. */
if (oldtype == bfd_link_hash_defweak)
abort ();
h->u.c.size = value;
/* Select a default alignment based on the size. This may
- be overridden by the caller. */
+ be overridden by the caller. */
{
unsigned int power;
}
/* The section of a common symbol is only used if the common
- symbol is actually allocated. It basically provides a
- hook for the linker script to decide which output section
- the common symbols should be put in. In most cases, the
- section of a common symbol will be bfd_com_section_ptr,
- the code here will choose a common symbol section named
- "COMMON", and the linker script will contain *(COMMON) in
- the appropriate place. A few targets use separate common
- sections for small symbols, and they require special
- handling. */
+ symbol is actually allocated. It basically provides a
+ hook for the linker script to decide which output section
+ the common symbols should be put in. In most cases, the
+ section of a common symbol will be bfd_com_section_ptr,
+ the code here will choose a common symbol section named
+ "COMMON", and the linker script will contain *(COMMON) in
+ the appropriate place. A few targets use separate common
+ sections for small symbols, and they require special
+ handling. */
if (section == bfd_com_section_ptr)
{
h->u.c.p->section = bfd_make_section_old_way (abfd, "COMMON");
else if ((sym->flags & BSF_CONSTRUCTOR) != 0)
{
/* This case normally means that the main linker code
- deliberately ignored this constructor symbol. We
- should just pass it through. This will screw up if
- the constructor symbol is from a different,
- non-generic, object file format, but the case will
- only arise when linking with -r, which will probably
- fail anyhow, since there will be no way to represent
- the relocs in the output format being used. */
+ deliberately ignored this constructor symbol. We
+ should just pass it through. This will screw up if
+ the constructor symbol is from a different,
+ non-generic, object file format, but the case will
+ only arise when linking with -r, which will probably
+ fail anyhow, since there will be no way to represent
+ the relocs in the output format being used. */
h = NULL;
}
else if (bfd_is_und_section (bfd_get_section (sym)))
break;
case bfd_link_hash_new:
/* This can happen when a constructor symbol is seen but we are
- not building constructors. */
+ not building constructors. */
if (sym->section != NULL)
{
BFD_ASSERT ((sym->flags & BSF_CONSTRUCTOR) != 0);
bfd_link_split_section
SYNOPSIS
- bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
+ bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
DESCRIPTION
Return nonzero if @var{sec} should be split during a
reloceatable or final link.
.#define bfd_link_split_section(abfd, sec) \
-. BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
+. BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
.
*/
bfd_section_already_linked
SYNOPSIS
- bfd_boolean bfd_section_already_linked (bfd *abfd,
+ bfd_boolean bfd_section_already_linked (bfd *abfd,
asection *sec,
struct bfd_link_info *info);
or final link. Return TRUE if it has.
.#define bfd_section_already_linked(abfd, sec, info) \
-. BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
+. BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
.
*/
Return TRUE on success and FALSE on failure.
.#define bfd_define_common_symbol(output_bfd, info, h) \
-. BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
+. BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h))
.
*/
Return the symbol or NULL if no such undefined symbol exists.
.#define bfd_define_start_stop(output_bfd, info, symbol, sec) \
-. BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
+. BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec))
.
*/
(bfd *abfd, struct bfd_link_info *info);
DESCRIPTION
- Stub function for targets that do not implement reloc checking.
+ Stub function for targets that do not implement reloc checking.
Return TRUE.
This is an internal function. It should not be called from
outside the BFD library.
Not enough memory exists to create private data for @var{obfd}.
.#define bfd_merge_private_bfd_data(ibfd, info) \
-. BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
-. (ibfd, info))
+. BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \
+. (ibfd, info))
*/
/*
pagesize + tcontext_size + pss.ssize
#if defined (SPARC) || defined (__SPARC__)
/* SPARC Lynx seems to start dumping
- the .data section at a page
- boundary. It's OK to check a
- #define like SPARC here because this
- file can only be compiled on a Lynx
- host. */
+ the .data section at a page
+ boundary. It's OK to check a
+ #define like SPARC here because this
+ file can only be compiled on a Lynx
+ host. */
+ pss.data_start % pagesize
#endif
);
#define TARGET_PAGE_SIZE 0x1000
#define DEFAULT_ARCH bfd_arch_m68k
-#define DEFAULT_MID M_68K4K_NETBSD
+#define DEFAULT_MID M_68K4K_NETBSD
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
#include "aout/aout64.h"
#include "aout/stab_gnu.h"
#include "aout/ar.h"
-#include "libaout.h" /* BFD a.out internal data structures */
+#include "libaout.h" /* BFD a.out internal data structures */
#define TARGET_IS_BIG_ENDIAN_P
#define DEFAULT_ARCH bfd_arch_m68k
#define TARGET_PAGE_SIZE 0x2000
#define DEFAULT_ARCH bfd_arch_m68k
-#define DEFAULT_MID M_68K_NETBSD
+#define DEFAULT_MID M_68K_NETBSD
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
#define TARGET_PAGE_SIZE (4096*2)
#define SEGMENT_SIZE 0x20000
#define TEXT_START_ADDR 0
-#define N_HEADER_IN_TEXT(x) 1 /* (N_MAGIG(x) == ZMAGIC) */
+#define N_HEADER_IN_TEXT(x) 1 /* (N_MAGIG(x) == ZMAGIC) */
#define N_TXTSIZE(x) ((x)->a_text)
bfd_mach_o_arm64_core_p (bfd *abfd)
{
return bfd_mach_o_header_p (abfd, 0,
- BFD_MACH_O_MH_CORE, BFD_MACH_O_CPU_TYPE_ARM64);
+ BFD_MACH_O_MH_CORE, BFD_MACH_O_CPU_TYPE_ARM64);
}
static bfd_boolean
break;
case BFD_MACH_O_ARM64_RELOC_SUBTRACTOR:
if (reloc.r_pcrel)
- return FALSE;
+ return FALSE;
switch (reloc.r_length)
- {
- case 2:
- res->howto = &arm64_howto_table[11];
- return TRUE;
- case 3:
- res->howto = &arm64_howto_table[12];
- return TRUE;
- default:
- return FALSE;
- }
+ {
+ case 2:
+ res->howto = &arm64_howto_table[11];
+ return TRUE;
+ case 3:
+ res->howto = &arm64_howto_table[12];
+ return TRUE;
+ default:
+ return FALSE;
+ }
break;
case BFD_MACH_O_ARM64_RELOC_BRANCH26:
if (reloc.r_length == 2 && reloc.r_pcrel == 1)
return NULL;
}
-#define TARGET_NAME aarch64_mach_o_vec
-#define TARGET_STRING "mach-o-arm64"
+#define TARGET_NAME aarch64_mach_o_vec
+#define TARGET_STRING "mach-o-arm64"
#define TARGET_ARCHITECTURE bfd_arch_aarch64
#define TARGET_PAGESIZE 4096
-#define TARGET_BIG_ENDIAN 0
-#define TARGET_ARCHIVE 0
+#define TARGET_BIG_ENDIAN 0
+#define TARGET_ARCHIVE 0
#define TARGET_PRIORITY 0
#include "mach-o-target.c"
bfd_mach_o_arm_core_p (bfd *abfd)
{
return bfd_mach_o_header_p (abfd, 0,
- BFD_MACH_O_MH_CORE, BFD_MACH_O_CPU_TYPE_ARM);
+ BFD_MACH_O_MH_CORE, BFD_MACH_O_CPU_TYPE_ARM);
}
static bfd_boolean
if (reloc.r_scattered)
{
switch (reloc.r_type)
- {
- case BFD_MACH_O_ARM_RELOC_PAIR:
+ {
+ case BFD_MACH_O_ARM_RELOC_PAIR:
/* PR 21813: Check for a corrupt PAIR reloc at the start. */
if (res == res_base)
return FALSE;
- if (reloc.r_length == 2)
- {
+ if (reloc.r_length == 2)
+ {
res->howto = &arm_howto_table[7];
res->address = res[-1].address;
return TRUE;
- }
- else if (reloc.r_length == 1)
+ }
+ else if (reloc.r_length == 1)
{
res->howto = &arm_howto_table[10];
res->address = res[-1].address;
return TRUE;
}
- return FALSE;
+ return FALSE;
- case BFD_MACH_O_ARM_RELOC_SECTDIFF:
- if (reloc.r_length == 2)
- {
+ case BFD_MACH_O_ARM_RELOC_SECTDIFF:
+ if (reloc.r_length == 2)
+ {
res->howto = &arm_howto_table[5];
return TRUE;
- }
- else if (reloc.r_length == 1)
- {
+ }
+ else if (reloc.r_length == 1)
+ {
res->howto = &arm_howto_table[8];
return TRUE;
- }
- return FALSE;
+ }
+ return FALSE;
- case BFD_MACH_O_ARM_RELOC_LOCAL_SECTDIFF:
- if (reloc.r_length == 2)
- {
+ case BFD_MACH_O_ARM_RELOC_LOCAL_SECTDIFF:
+ if (reloc.r_length == 2)
+ {
res->howto = &arm_howto_table[6];
return TRUE;
- }
- else if (reloc.r_length == 1)
- {
+ }
+ else if (reloc.r_length == 1)
+ {
res->howto = &arm_howto_table[9];
return TRUE;
- }
- return FALSE;
+ }
+ return FALSE;
case BFD_MACH_O_ARM_RELOC_HALF_SECTDIFF:
switch (reloc.r_length)
}
return FALSE;
- default:
- break;
- }
+ default:
+ break;
+ }
}
else
{
switch (reloc.r_type)
- {
- case BFD_MACH_O_ARM_RELOC_VANILLA:
- switch ((reloc.r_length << 1) | reloc.r_pcrel)
- {
- case 0: /* len = 0, pcrel = 0 */
- res->howto = &arm_howto_table[2];
- return TRUE;
- case 2: /* len = 1, pcrel = 0 */
- res->howto = &arm_howto_table[1];
- return TRUE;
- case 3: /* len = 1, pcrel = 1 */
- res->howto = &arm_howto_table[4];
- return TRUE;
- case 4: /* len = 2, pcrel = 0 */
- res->howto = &arm_howto_table[0];
- return TRUE;
- case 5: /* len = 2, pcrel = 1 */
- res->howto = &arm_howto_table[3];
- return TRUE;
- default:
- return FALSE;
- }
- break;
-
- case BFD_MACH_O_ARM_RELOC_BR24:
+ {
+ case BFD_MACH_O_ARM_RELOC_VANILLA:
+ switch ((reloc.r_length << 1) | reloc.r_pcrel)
+ {
+ case 0: /* len = 0, pcrel = 0 */
+ res->howto = &arm_howto_table[2];
+ return TRUE;
+ case 2: /* len = 1, pcrel = 0 */
+ res->howto = &arm_howto_table[1];
+ return TRUE;
+ case 3: /* len = 1, pcrel = 1 */
+ res->howto = &arm_howto_table[4];
+ return TRUE;
+ case 4: /* len = 2, pcrel = 0 */
+ res->howto = &arm_howto_table[0];
+ return TRUE;
+ case 5: /* len = 2, pcrel = 1 */
+ res->howto = &arm_howto_table[3];
+ return TRUE;
+ default:
+ return FALSE;
+ }
+ break;
+
+ case BFD_MACH_O_ARM_RELOC_BR24:
if (reloc.r_length == 2 && reloc.r_pcrel == 1)
{
- res->howto = &arm_howto_table[11];
- return TRUE;
+ res->howto = &arm_howto_table[11];
+ return TRUE;
}
break;
- case BFD_MACH_O_THUMB_RELOC_BR22:
+ case BFD_MACH_O_THUMB_RELOC_BR22:
if (reloc.r_length == 2 && reloc.r_pcrel == 1)
{
- res->howto = &arm_howto_table[16];
- return TRUE;
+ res->howto = &arm_howto_table[16];
+ return TRUE;
}
break;
- case BFD_MACH_O_ARM_RELOC_HALF:
+ case BFD_MACH_O_ARM_RELOC_HALF:
if (reloc.r_pcrel == 0)
switch (reloc.r_length)
{
}
break;
- case BFD_MACH_O_ARM_RELOC_PAIR:
+ case BFD_MACH_O_ARM_RELOC_PAIR:
if (res[-1].howto == &arm_howto_table[12]
&& reloc.r_length == 0)
{
res[-1].addend += (res->address & 0xffff) << 16;
res->address = res[-1].address;
return TRUE;
- }
+ }
else if (res[-1].howto == &arm_howto_table[14]
&& reloc.r_length == 1)
{
res[-1].addend += res->address & 0xffff;
res->address = res[-1].address;
return TRUE;
- }
+ }
break;
- default:
+ default:
break;
- }
+ }
}
return FALSE;
return NULL;
}
-#define TARGET_NAME arm_mach_o_vec
-#define TARGET_STRING "mach-o-arm"
+#define TARGET_NAME arm_mach_o_vec
+#define TARGET_STRING "mach-o-arm"
#define TARGET_ARCHITECTURE bfd_arch_arm
#define TARGET_PAGESIZE 4096
-#define TARGET_BIG_ENDIAN 0
-#define TARGET_ARCHIVE 0
+#define TARGET_BIG_ENDIAN 0
+#define TARGET_ARCHIVE 0
#define TARGET_PRIORITY 0
#include "mach-o-target.c"
bfd_mach_o_i386_core_p (bfd *abfd)
{
return bfd_mach_o_header_p (abfd, 0,
- BFD_MACH_O_MH_CORE, BFD_MACH_O_CPU_TYPE_I386);
+ BFD_MACH_O_MH_CORE, BFD_MACH_O_CPU_TYPE_I386);
}
static bfd_boolean
static bfd_boolean
bfd_mach_o_i386_canonicalize_one_reloc (bfd * abfd,
- struct mach_o_reloc_info_external * raw,
+ struct mach_o_reloc_info_external * raw,
arelent * res,
asymbol ** syms,
arelent * res_base)
if (reloc.r_scattered)
{
switch (reloc.r_type)
- {
- case BFD_MACH_O_GENERIC_RELOC_PAIR:
+ {
+ case BFD_MACH_O_GENERIC_RELOC_PAIR:
/* PR 21813: Check for a corrupt PAIR reloc at the start. */
if (res == res_base)
return FALSE;
- if (reloc.r_length == 2)
- {
+ if (reloc.r_length == 2)
+ {
res->howto = &i386_howto_table[7];
res->address = res[-1].address;
return TRUE;
- }
- else if (reloc.r_length == 1)
+ }
+ else if (reloc.r_length == 1)
{
res->howto = &i386_howto_table[10];
res->address = res[-1].address;
return TRUE;
}
- return FALSE;
- case BFD_MACH_O_GENERIC_RELOC_SECTDIFF:
- if (reloc.r_length == 2)
- {
+ return FALSE;
+ case BFD_MACH_O_GENERIC_RELOC_SECTDIFF:
+ if (reloc.r_length == 2)
+ {
res->howto = &i386_howto_table[5];
return TRUE;
- }
- else if (reloc.r_length == 1)
- {
+ }
+ else if (reloc.r_length == 1)
+ {
res->howto = &i386_howto_table[8];
return TRUE;
- }
- return FALSE;
- case BFD_MACH_O_GENERIC_RELOC_LOCAL_SECTDIFF:
- if (reloc.r_length == 2)
- {
+ }
+ return FALSE;
+ case BFD_MACH_O_GENERIC_RELOC_LOCAL_SECTDIFF:
+ if (reloc.r_length == 2)
+ {
res->howto = &i386_howto_table[6];
return TRUE;
- }
- else if (reloc.r_length == 1)
- {
+ }
+ else if (reloc.r_length == 1)
+ {
res->howto = &i386_howto_table[9];
return TRUE;
- }
- return FALSE;
- default:
+ }
+ return FALSE;
+ default:
break;
- }
+ }
}
else
{
switch (reloc.r_type)
- {
- case BFD_MACH_O_GENERIC_RELOC_VANILLA:
- switch ((reloc.r_length << 1) | reloc.r_pcrel)
- {
- case 0: /* len = 0, pcrel = 0 */
- res->howto = &i386_howto_table[2];
- return TRUE;
- case 2: /* len = 1, pcrel = 0 */
- res->howto = &i386_howto_table[1];
- return TRUE;
- case 3: /* len = 1, pcrel = 1 */
- res->howto = &i386_howto_table[4];
- return TRUE;
- case 4: /* len = 2, pcrel = 0 */
- res->howto = &i386_howto_table[0];
- return TRUE;
- case 5: /* len = 2, pcrel = 1 */
- res->howto = &i386_howto_table[3];
- return TRUE;
- default:
- return FALSE;
- }
- default:
- break;
- }
+ {
+ case BFD_MACH_O_GENERIC_RELOC_VANILLA:
+ switch ((reloc.r_length << 1) | reloc.r_pcrel)
+ {
+ case 0: /* len = 0, pcrel = 0 */
+ res->howto = &i386_howto_table[2];
+ return TRUE;
+ case 2: /* len = 1, pcrel = 0 */
+ res->howto = &i386_howto_table[1];
+ return TRUE;
+ case 3: /* len = 1, pcrel = 1 */
+ res->howto = &i386_howto_table[4];
+ return TRUE;
+ case 4: /* len = 2, pcrel = 0 */
+ res->howto = &i386_howto_table[0];
+ return TRUE;
+ case 5: /* len = 2, pcrel = 1 */
+ res->howto = &i386_howto_table[3];
+ return TRUE;
+ default:
+ return FALSE;
+ }
+ default:
+ break;
+ }
}
return FALSE;
}
rinfo->r_pcrel = rel->howto->pc_relative;
rinfo->r_length = rel->howto->size; /* Correct in practice. */
if ((*rel->sym_ptr_ptr)->flags & BSF_SECTION_SYM)
- {
- rinfo->r_extern = 0;
- rinfo->r_value =
+ {
+ rinfo->r_extern = 0;
+ rinfo->r_value =
(*rel->sym_ptr_ptr)->section->output_section->target_index;
- }
+ }
else
- {
- rinfo->r_extern = 1;
- rinfo->r_value = (*rel->sym_ptr_ptr)->udata.i;
- }
+ {
+ rinfo->r_extern = 1;
+ rinfo->r_value = (*rel->sym_ptr_ptr)->udata.i;
+ }
break;
case BFD_RELOC_MACH_O_SECTDIFF:
rinfo->r_scattered = 1;
static reloc_howto_type *
bfd_mach_o_i386_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
unsigned int i;
static reloc_howto_type *
bfd_mach_o_i386_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- const char *name ATTRIBUTE_UNUSED)
+ const char *name ATTRIBUTE_UNUSED)
{
return NULL;
}
static bfd_boolean
bfd_mach_o_i386_print_thread (bfd *abfd, bfd_mach_o_thread_flavour *thread,
- void *vfile, char *buf)
+ void *vfile, char *buf)
{
FILE *file = (FILE *)vfile;
{
case BFD_MACH_O_x86_THREAD_STATE:
if (thread->size < (8 + 16 * 4))
- return FALSE;
+ return FALSE;
fprintf (file, " x86_THREAD_STATE:\n");
fprintf (file, " flavor: 0x%08lx count: 0x%08lx\n",
- (unsigned long)bfd_get_32 (abfd, buf + 0),
- (unsigned long)bfd_get_32 (abfd, buf + 4));
+ (unsigned long)bfd_get_32 (abfd, buf + 0),
+ (unsigned long)bfd_get_32 (abfd, buf + 4));
fprintf (file, " eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n",
- (unsigned long)bfd_get_32 (abfd, buf + 8),
- (unsigned long)bfd_get_32 (abfd, buf + 12),
- (unsigned long)bfd_get_32 (abfd, buf + 16),
- (unsigned long)bfd_get_32 (abfd, buf + 20));
+ (unsigned long)bfd_get_32 (abfd, buf + 8),
+ (unsigned long)bfd_get_32 (abfd, buf + 12),
+ (unsigned long)bfd_get_32 (abfd, buf + 16),
+ (unsigned long)bfd_get_32 (abfd, buf + 20));
fprintf (file, " edi: %08lx esi: %08lx ebp: %08lx esp: %08lx\n",
- (unsigned long)bfd_get_32 (abfd, buf + 24),
- (unsigned long)bfd_get_32 (abfd, buf + 28),
- (unsigned long)bfd_get_32 (abfd, buf + 32),
- (unsigned long)bfd_get_32 (abfd, buf + 36));
+ (unsigned long)bfd_get_32 (abfd, buf + 24),
+ (unsigned long)bfd_get_32 (abfd, buf + 28),
+ (unsigned long)bfd_get_32 (abfd, buf + 32),
+ (unsigned long)bfd_get_32 (abfd, buf + 36));
fprintf (file, " ss: %08lx flg: %08lx eip: %08lx cs: %08lx\n",
- (unsigned long)bfd_get_32 (abfd, buf + 40),
- (unsigned long)bfd_get_32 (abfd, buf + 44),
- (unsigned long)bfd_get_32 (abfd, buf + 48),
- (unsigned long)bfd_get_32 (abfd, buf + 52));
+ (unsigned long)bfd_get_32 (abfd, buf + 40),
+ (unsigned long)bfd_get_32 (abfd, buf + 44),
+ (unsigned long)bfd_get_32 (abfd, buf + 48),
+ (unsigned long)bfd_get_32 (abfd, buf + 52));
fprintf (file, " ds: %08lx es: %08lx fs: %08lx gs: %08lx\n",
- (unsigned long)bfd_get_32 (abfd, buf + 56),
- (unsigned long)bfd_get_32 (abfd, buf + 60),
- (unsigned long)bfd_get_32 (abfd, buf + 64),
- (unsigned long)bfd_get_32 (abfd, buf + 68));
+ (unsigned long)bfd_get_32 (abfd, buf + 56),
+ (unsigned long)bfd_get_32 (abfd, buf + 60),
+ (unsigned long)bfd_get_32 (abfd, buf + 64),
+ (unsigned long)bfd_get_32 (abfd, buf + 68));
return TRUE;
case BFD_MACH_O_x86_FLOAT_STATE:
if (thread->size < 8)
- return FALSE;
+ return FALSE;
fprintf (file, " x86_FLOAT_STATE:\n");
fprintf (file, " flavor: 0x%08lx count: 0x%08lx\n",
- (unsigned long)bfd_get_32 (abfd, buf + 0),
- (unsigned long)bfd_get_32 (abfd, buf + 4));
+ (unsigned long)bfd_get_32 (abfd, buf + 0),
+ (unsigned long)bfd_get_32 (abfd, buf + 4));
return TRUE;
case BFD_MACH_O_x86_EXCEPTION_STATE:
if (thread->size < 8 + 3 * 4)
- return FALSE;
+ return FALSE;
fprintf (file, " x86_EXCEPTION_STATE:\n");
fprintf (file, " flavor: 0x%08lx count: 0x%08lx\n",
- (unsigned long)bfd_get_32 (abfd, buf + 0),
- (unsigned long)bfd_get_32 (abfd, buf + 4));
+ (unsigned long)bfd_get_32 (abfd, buf + 0),
+ (unsigned long)bfd_get_32 (abfd, buf + 4));
fprintf (file, " trapno: %08lx err: %08lx faultaddr: %08lx\n",
- (unsigned long)bfd_get_32 (abfd, buf + 8),
- (unsigned long)bfd_get_32 (abfd, buf + 12),
- (unsigned long)bfd_get_32 (abfd, buf + 16));
+ (unsigned long)bfd_get_32 (abfd, buf + 8),
+ (unsigned long)bfd_get_32 (abfd, buf + 12),
+ (unsigned long)bfd_get_32 (abfd, buf + 16));
return TRUE;
default:
break;
};
#define bfd_mach_o_canonicalize_one_reloc bfd_mach_o_i386_canonicalize_one_reloc
-#define bfd_mach_o_swap_reloc_out bfd_mach_o_i386_swap_reloc_out
-#define bfd_mach_o_print_thread bfd_mach_o_i386_print_thread
+#define bfd_mach_o_swap_reloc_out bfd_mach_o_i386_swap_reloc_out
+#define bfd_mach_o_print_thread bfd_mach_o_i386_print_thread
#define bfd_mach_o_tgt_seg_table mach_o_i386_segsec_names_xlat
#define bfd_mach_o_section_type_valid_for_tgt NULL
#define bfd_mach_o_bfd_reloc_type_lookup bfd_mach_o_i386_bfd_reloc_type_lookup
#define bfd_mach_o_bfd_reloc_name_lookup bfd_mach_o_i386_bfd_reloc_name_lookup
-#define TARGET_NAME i386_mach_o_vec
-#define TARGET_STRING "mach-o-i386"
+#define TARGET_NAME i386_mach_o_vec
+#define TARGET_STRING "mach-o-i386"
#define TARGET_ARCHITECTURE bfd_arch_i386
#define TARGET_PAGESIZE 4096
-#define TARGET_BIG_ENDIAN 0
-#define TARGET_ARCHIVE 0
+#define TARGET_BIG_ENDIAN 0
+#define TARGET_ARCHIVE 0
#define TARGET_PRIORITY 0
#include "mach-o-target.c"
#ifndef MACH_O_TARGET_COMMON_DEFINED
#define MACH_O_TARGET_COMMON_DEFINED
-#define bfd_mach_o_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define bfd_mach_o_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
#define bfd_mach_o_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
#define bfd_mach_o_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
-#define bfd_mach_o_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define bfd_mach_o_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define bfd_mach_o_get_lineno _bfd_nosymbols_get_lineno
-#define bfd_mach_o_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define bfd_mach_o_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#define bfd_mach_o_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define bfd_mach_o_get_lineno _bfd_nosymbols_get_lineno
+#define bfd_mach_o_find_inliner_info _bfd_nosymbols_find_inliner_info
#define bfd_mach_o_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define bfd_mach_o_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define bfd_mach_o_read_minisymbols _bfd_generic_read_minisymbols
-#define bfd_mach_o_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define bfd_mach_o_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define bfd_mach_o_read_minisymbols _bfd_generic_read_minisymbols
+#define bfd_mach_o_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
#define bfd_mach_o_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define bfd_mach_o_bfd_relax_section bfd_generic_relax_section
-#define bfd_mach_o_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define bfd_mach_o_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define bfd_mach_o_bfd_link_just_syms _bfd_generic_link_just_syms
+#define bfd_mach_o_bfd_relax_section bfd_generic_relax_section
+#define bfd_mach_o_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define bfd_mach_o_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define bfd_mach_o_bfd_link_just_syms _bfd_generic_link_just_syms
#define bfd_mach_o_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
-#define bfd_mach_o_bfd_final_link _bfd_generic_final_link
-#define bfd_mach_o_bfd_link_split_section _bfd_generic_link_split_section
-#define bfd_mach_o_bfd_link_check_relocs _bfd_generic_link_check_relocs
-#define bfd_mach_o_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
-#define bfd_mach_o_bfd_set_private_flags bfd_mach_o_bfd_set_private_flags
-#define bfd_mach_o_get_section_contents _bfd_generic_get_section_contents
-#define bfd_mach_o_bfd_gc_sections bfd_generic_gc_sections
-#define bfd_mach_o_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define bfd_mach_o_bfd_merge_sections bfd_generic_merge_sections
-#define bfd_mach_o_bfd_is_group_section bfd_generic_is_group_section
-#define bfd_mach_o_bfd_discard_group bfd_generic_discard_group
-#define bfd_mach_o_section_already_linked _bfd_generic_section_already_linked
-#define bfd_mach_o_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define bfd_mach_o_bfd_define_start_stop bfd_generic_define_start_stop
-#define bfd_mach_o_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
+#define bfd_mach_o_bfd_final_link _bfd_generic_final_link
+#define bfd_mach_o_bfd_link_split_section _bfd_generic_link_split_section
+#define bfd_mach_o_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define bfd_mach_o_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
+#define bfd_mach_o_bfd_set_private_flags bfd_mach_o_bfd_set_private_flags
+#define bfd_mach_o_get_section_contents _bfd_generic_get_section_contents
+#define bfd_mach_o_bfd_gc_sections bfd_generic_gc_sections
+#define bfd_mach_o_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define bfd_mach_o_bfd_merge_sections bfd_generic_merge_sections
+#define bfd_mach_o_bfd_is_group_section bfd_generic_is_group_section
+#define bfd_mach_o_bfd_discard_group bfd_generic_discard_group
+#define bfd_mach_o_section_already_linked _bfd_generic_section_already_linked
+#define bfd_mach_o_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define bfd_mach_o_bfd_define_start_stop bfd_generic_define_start_stop
+#define bfd_mach_o_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
#define bfd_mach_o_core_file_matches_executable_p generic_core_file_matches_executable_p
-#define bfd_mach_o_core_file_pid _bfd_nocore_core_file_pid
+#define bfd_mach_o_core_file_pid _bfd_nocore_core_file_pid
#define bfd_mach_o_set_reloc _bfd_generic_set_reloc
#define bfd_mach_o_get_dynamic_symtab_upper_bound bfd_mach_o_get_symtab_upper_bound
#define bfd_mach_o_canonicalize_dynamic_symtab bfd_mach_o_canonicalize_symtab
/* For Mach-O special archives. */
-#define bfd_mach_o_read_ar_hdr _bfd_noarchive_read_ar_hdr
-#define bfd_mach_o_write_ar_hdr _bfd_noarchive_write_ar_hdr
-#define bfd_mach_o_slurp_armap _bfd_noarchive_slurp_armap
-#define bfd_mach_o_slurp_extended_name_table _bfd_noarchive_slurp_extended_name_table
+#define bfd_mach_o_read_ar_hdr _bfd_noarchive_read_ar_hdr
+#define bfd_mach_o_write_ar_hdr _bfd_noarchive_write_ar_hdr
+#define bfd_mach_o_slurp_armap _bfd_noarchive_slurp_armap
+#define bfd_mach_o_slurp_extended_name_table _bfd_noarchive_slurp_extended_name_table
#define bfd_mach_o_construct_extended_name_table _bfd_noarchive_construct_extended_name_table
-#define bfd_mach_o_truncate_arname _bfd_noarchive_truncate_arname
-#define bfd_mach_o_write_armap _bfd_noarchive_write_armap
-#define bfd_mach_o_get_elt_at_index _bfd_noarchive_get_elt_at_index
-#define bfd_mach_o_update_armap_timestamp _bfd_noarchive_update_armap_timestamp
+#define bfd_mach_o_truncate_arname _bfd_noarchive_truncate_arname
+#define bfd_mach_o_write_armap _bfd_noarchive_write_armap
+#define bfd_mach_o_get_elt_at_index _bfd_noarchive_get_elt_at_index
+#define bfd_mach_o_update_armap_timestamp _bfd_noarchive_update_armap_timestamp
#define TARGET_NAME_BACKEND XCONCAT2(TARGET_NAME,_backend)
bfd_mach_o_x86_64_core_p (bfd *abfd)
{
return bfd_mach_o_header_p (abfd, 0,
- BFD_MACH_O_MH_CORE, BFD_MACH_O_CPU_TYPE_X86_64);
+ BFD_MACH_O_MH_CORE, BFD_MACH_O_CPU_TYPE_X86_64);
}
static bfd_boolean
{
case BFD_MACH_O_X86_64_RELOC_UNSIGNED:
if (reloc.r_pcrel)
- return FALSE;
+ return FALSE;
switch (reloc.r_length)
- {
- case 2:
- res->howto = &x86_64_howto_table[1];
- return TRUE;
- case 3:
- res->howto = &x86_64_howto_table[0];
- return TRUE;
- default:
- return FALSE;
- }
+ {
+ case 2:
+ res->howto = &x86_64_howto_table[1];
+ return TRUE;
+ case 3:
+ res->howto = &x86_64_howto_table[0];
+ return TRUE;
+ default:
+ return FALSE;
+ }
case BFD_MACH_O_X86_64_RELOC_SIGNED:
if (reloc.r_length == 2 && reloc.r_pcrel)
- {
- res->howto = &x86_64_howto_table[2];
- return TRUE;
- }
+ {
+ res->howto = &x86_64_howto_table[2];
+ return TRUE;
+ }
break;
case BFD_MACH_O_X86_64_RELOC_BRANCH:
if (!reloc.r_pcrel)
- return FALSE;
+ return FALSE;
switch (reloc.r_length)
- {
- case 2:
- res->howto = &x86_64_howto_table[6];
- return TRUE;
- default:
- return FALSE;
- }
+ {
+ case 2:
+ res->howto = &x86_64_howto_table[6];
+ return TRUE;
+ default:
+ return FALSE;
+ }
break;
case BFD_MACH_O_X86_64_RELOC_GOT_LOAD:
if (reloc.r_length == 2 && reloc.r_pcrel && reloc.r_extern)
- {
- res->howto = &x86_64_howto_table[7];
- return TRUE;
- }
+ {
+ res->howto = &x86_64_howto_table[7];
+ return TRUE;
+ }
break;
case BFD_MACH_O_X86_64_RELOC_GOT:
if (reloc.r_length == 2 && reloc.r_pcrel && reloc.r_extern)
- {
- res->howto = &x86_64_howto_table[10];
- return TRUE;
- }
+ {
+ res->howto = &x86_64_howto_table[10];
+ return TRUE;
+ }
break;
case BFD_MACH_O_X86_64_RELOC_SUBTRACTOR:
if (reloc.r_pcrel)
- return FALSE;
+ return FALSE;
switch (reloc.r_length)
- {
- case 2:
- res->howto = &x86_64_howto_table[8];
- return TRUE;
- case 3:
- res->howto = &x86_64_howto_table[9];
- return TRUE;
- default:
- return FALSE;
- }
+ {
+ case 2:
+ res->howto = &x86_64_howto_table[8];
+ return TRUE;
+ case 3:
+ res->howto = &x86_64_howto_table[9];
+ return TRUE;
+ default:
+ return FALSE;
+ }
break;
case BFD_MACH_O_X86_64_RELOC_SIGNED_1:
if (reloc.r_length == 2 && reloc.r_pcrel)
- {
- res->howto = &x86_64_howto_table[3];
- return TRUE;
- }
+ {
+ res->howto = &x86_64_howto_table[3];
+ return TRUE;
+ }
break;
case BFD_MACH_O_X86_64_RELOC_SIGNED_2:
if (reloc.r_length == 2 && reloc.r_pcrel)
- {
- res->howto = &x86_64_howto_table[4];
- return TRUE;
- }
+ {
+ res->howto = &x86_64_howto_table[4];
+ return TRUE;
+ }
break;
case BFD_MACH_O_X86_64_RELOC_SIGNED_4:
if (reloc.r_length == 2 && reloc.r_pcrel)
- {
- res->howto = &x86_64_howto_table[5];
- return TRUE;
- }
+ {
+ res->howto = &x86_64_howto_table[5];
+ return TRUE;
+ }
break;
default:
return FALSE;
static reloc_howto_type *
bfd_mach_o_x86_64_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
unsigned int i;
static reloc_howto_type *
bfd_mach_o_x86_64_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- const char *name ATTRIBUTE_UNUSED)
+ const char *name ATTRIBUTE_UNUSED)
{
return NULL;
}
#define bfd_mach_o_tgt_seg_table mach_o_x86_64_segsec_names_xlat
#define bfd_mach_o_section_type_valid_for_tgt bfd_mach_o_section_type_valid_for_x86_64
-#define TARGET_NAME x86_64_mach_o_vec
-#define TARGET_STRING "mach-o-x86-64"
+#define TARGET_NAME x86_64_mach_o_vec
+#define TARGET_STRING "mach-o-x86-64"
#define TARGET_ARCHITECTURE bfd_arch_i386
#define TARGET_PAGESIZE 4096
-#define TARGET_BIG_ENDIAN 0
-#define TARGET_ARCHIVE 0
+#define TARGET_BIG_ENDIAN 0
+#define TARGET_ARCHIVE 0
#define TARGET_PRIORITY 0
#include "mach-o-target.c"
for (seg = segsec_names_xlat; seg->segname; seg++)
if (strncmp (seg->segname, segname, BFD_MACH_O_SEGNAME_SIZE) == 0)
for (sec = seg->sections; sec->mach_o_name; sec++)
- if (strncmp (sec->mach_o_name, sectname,
+ if (strncmp (sec->mach_o_name, sectname,
BFD_MACH_O_SECTNAME_SIZE) == 0)
- return sec;
+ return sec;
return NULL;
}
static const mach_o_section_name_xlat *
bfd_mach_o_convert_section_name_to_mach_o (bfd *abfd ATTRIBUTE_UNUSED,
- asection *sect,
- bfd_mach_o_section *section)
+ asection *sect,
+ bfd_mach_o_section *section)
{
const mach_o_section_name_xlat *xlat;
const char *name = bfd_get_section_name (abfd, sect);
if (seglen <= BFD_MACH_O_SEGNAME_SIZE
&& seclen <= BFD_MACH_O_SECTNAME_SIZE)
- {
- memcpy (section->segname, name, seglen);
- section->segname[seglen] = 0;
- memcpy (section->sectname, dot + 1, seclen);
- section->sectname[seclen] = 0;
- return NULL;
- }
+ {
+ memcpy (section->segname, name, seglen);
+ section->segname[seglen] = 0;
+ memcpy (section->sectname, dot + 1, seclen);
+ section->sectname[seclen] = 0;
+ return NULL;
+ }
}
/* The segment and section names are both missing - don't make them
if (!bfd_mach_o_read_symtab_symbols (abfd))
{
_bfd_error_handler
- (_("bfd_mach_o_canonicalize_symtab: unable to load symbols"));
+ (_("bfd_mach_o_canonicalize_symtab: unable to load symbols"));
return 0;
}
long
bfd_mach_o_get_synthetic_symtab (bfd *abfd,
- long symcount ATTRIBUTE_UNUSED,
- asymbol **syms ATTRIBUTE_UNUSED,
- long dynsymcount ATTRIBUTE_UNUSED,
- asymbol **dynsyms ATTRIBUTE_UNUSED,
- asymbol **ret)
+ long symcount ATTRIBUTE_UNUSED,
+ asymbol **syms ATTRIBUTE_UNUSED,
+ long dynsymcount ATTRIBUTE_UNUSED,
+ asymbol **dynsyms ATTRIBUTE_UNUSED,
+ asymbol **ret)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
bfd_mach_o_dysymtab_command *dysymtab = mdata->dysymtab;
bfd_vma entry_size;
switch (sec->flags & BFD_MACH_O_SECTION_TYPE_MASK)
- {
- case BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS:
- case BFD_MACH_O_S_LAZY_SYMBOL_POINTERS:
- case BFD_MACH_O_S_SYMBOL_STUBS:
- /* Only these sections have indirect symbols. */
- first = sec->reserved1;
- last = first + bfd_mach_o_section_get_nbr_indirect (abfd, sec);
- addr = sec->addr;
- entry_size = bfd_mach_o_section_get_entry_size (abfd, sec);
+ {
+ case BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS:
+ case BFD_MACH_O_S_LAZY_SYMBOL_POINTERS:
+ case BFD_MACH_O_S_SYMBOL_STUBS:
+ /* Only these sections have indirect symbols. */
+ first = sec->reserved1;
+ last = first + bfd_mach_o_section_get_nbr_indirect (abfd, sec);
+ addr = sec->addr;
+ entry_size = bfd_mach_o_section_get_entry_size (abfd, sec);
/* PR 17512: file: 08e15eec. */
if (first >= count || last >= count || first > last)
goto fail;
- for (j = first; j < last; j++)
- {
- unsigned int isym = dysymtab->indirect_syms[j];
+ for (j = first; j < last; j++)
+ {
+ unsigned int isym = dysymtab->indirect_syms[j];
/* PR 17512: file: 04d64d9b. */
if (((char *) s) + sizeof (* s) > s_end)
goto fail;
- s->flags = BSF_GLOBAL | BSF_SYNTHETIC;
- s->section = sec->bfdsection;
- s->value = addr - sec->addr;
- s->udata.p = NULL;
+ s->flags = BSF_GLOBAL | BSF_SYNTHETIC;
+ s->section = sec->bfdsection;
+ s->value = addr - sec->addr;
+ s->udata.p = NULL;
- if (isym < symtab->nsyms
- && symtab->symbols[isym].symbol.name)
- {
- const char *sym = symtab->symbols[isym].symbol.name;
- size_t len;
+ if (isym < symtab->nsyms
+ && symtab->symbols[isym].symbol.name)
+ {
+ const char *sym = symtab->symbols[isym].symbol.name;
+ size_t len;
- s->name = names;
- len = strlen (sym);
+ s->name = names;
+ len = strlen (sym);
/* PR 17512: file: 47dfd4d2. */
if (names + len >= s_end)
goto fail;
- memcpy (names, sym, len);
- names += len;
+ memcpy (names, sym, len);
+ names += len;
/* PR 17512: file: 18f340a4. */
if (names + sizeof (stub) >= s_end)
goto fail;
- memcpy (names, stub, sizeof (stub));
- names += sizeof (stub);
- }
- else
- s->name = nul_name;
-
- addr += entry_size;
- s++;
- n++;
- }
- break;
- default:
- break;
- }
+ memcpy (names, stub, sizeof (stub));
+ names += sizeof (stub);
+ }
+ else
+ s->name = nul_name;
+
+ addr += entry_size;
+ s++;
+ n++;
+ }
+ break;
+ default:
+ break;
+ }
}
return n;
switch (asym->n_type & BFD_MACH_O_N_TYPE)
{
case BFD_MACH_O_N_UNDF:
- if (symbol->value == 0)
- name = "UND";
- else
- name = "COM";
+ if (symbol->value == 0)
+ name = "UND";
+ else
+ name = "COM";
break;
case BFD_MACH_O_N_ABS:
name = "ABS";
if (name == NULL)
name = "";
fprintf (file, " %02x %-6s %02x %04x",
- asym->n_type, name, asym->n_sect, asym->n_desc);
+ asym->n_type, name, asym->n_sect, asym->n_desc);
if ((asym->n_type & BFD_MACH_O_N_STAB) == 0
&& (asym->n_type & BFD_MACH_O_N_TYPE) == BFD_MACH_O_N_SECT)
fprintf (file, " [%s]", symbol->section->name);
case BFD_MACH_O_CPU_TYPE_ARM:
*type = bfd_arch_arm;
switch (msubtype)
- {
- case BFD_MACH_O_CPU_SUBTYPE_ARM_V4T:
- *subtype = bfd_mach_arm_4T;
- break;
- case BFD_MACH_O_CPU_SUBTYPE_ARM_V6:
- *subtype = bfd_mach_arm_4T; /* Best fit ? */
- break;
- case BFD_MACH_O_CPU_SUBTYPE_ARM_V5TEJ:
- *subtype = bfd_mach_arm_5TE;
- break;
- case BFD_MACH_O_CPU_SUBTYPE_ARM_XSCALE:
- *subtype = bfd_mach_arm_XScale;
- break;
- case BFD_MACH_O_CPU_SUBTYPE_ARM_V7:
- *subtype = bfd_mach_arm_5TE; /* Best fit ? */
- break;
- case BFD_MACH_O_CPU_SUBTYPE_ARM_ALL:
- default:
- break;
- }
+ {
+ case BFD_MACH_O_CPU_SUBTYPE_ARM_V4T:
+ *subtype = bfd_mach_arm_4T;
+ break;
+ case BFD_MACH_O_CPU_SUBTYPE_ARM_V6:
+ *subtype = bfd_mach_arm_4T; /* Best fit ? */
+ break;
+ case BFD_MACH_O_CPU_SUBTYPE_ARM_V5TEJ:
+ *subtype = bfd_mach_arm_5TE;
+ break;
+ case BFD_MACH_O_CPU_SUBTYPE_ARM_XSCALE:
+ *subtype = bfd_mach_arm_XScale;
+ break;
+ case BFD_MACH_O_CPU_SUBTYPE_ARM_V7:
+ *subtype = bfd_mach_arm_5TE; /* Best fit ? */
+ break;
+ case BFD_MACH_O_CPU_SUBTYPE_ARM_ALL:
+ default:
+ break;
+ }
break;
case BFD_MACH_O_CPU_TYPE_MC88000:
*type = bfd_arch_m88k;
{
BFD_ASSERT ((cmd->flavours[i].size % 4) == 0);
BFD_ASSERT (cmd->flavours[i].offset ==
- (command->offset + offset + BFD_MACH_O_LC_SIZE));
+ (command->offset + offset + BFD_MACH_O_LC_SIZE));
bfd_h_put_32 (abfd, cmd->flavours[i].flavour, raw.flavour);
bfd_h_put_32 (abfd, (cmd->flavours[i].size / 4), raw.count);
if (bfd_seek (abfd, command->offset + offset, SEEK_SET) != 0
- || bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
+ || bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
return FALSE;
offset += cmd->flavours[i].size + sizeof (raw);
long
bfd_mach_o_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED,
- asection *asect)
+ asection *asect)
{
return (asect->reloc_count + 1) * sizeof (arelent *);
}
binary) contains the address of the section. To comply with
bfd convention, subtract the section address.
Use the address from the header, so that the user can modify
- the vma of the section. */
+ the vma of the section. */
res->addend = -mdata->sections[num - 1]->addr;
}
the following section or, if it falls within alignment padding, as
null - which will assert later. */
for (j = 0; j < mdata->nsects; j++)
- {
- bfd_mach_o_section *sect = mdata->sections[j];
- if (symnum >= sect->addr && symnum < sect->addr + sect->size)
- {
- res->sym_ptr_ptr = sect->bfdsection->symbol_ptr_ptr;
- res->addend = symnum - sect->addr;
- break;
- }
- }
+ {
+ bfd_mach_o_section *sect = mdata->sections[j];
+ if (symnum >= sect->addr && symnum < sect->addr + sect->size)
+ {
+ res->sym_ptr_ptr = sect->bfdsection->symbol_ptr_ptr;
+ res->addend = symnum - sect->addr;
+ break;
+ }
+ }
/* Extract the info and address fields from r_address. */
reloc->r_type = BFD_MACH_O_GET_SR_TYPE (addr);
res->address = addr;
/* The value and info fields have to be extracted dependent on target
- endian-ness. */
+ endian-ness. */
bfd_mach_o_swap_in_non_scattered_reloc (abfd, reloc, raw->r_symbolnum);
if (!bfd_mach_o_canonicalize_non_scattered_reloc (abfd, reloc,
static int
bfd_mach_o_canonicalize_relocs (bfd *abfd, unsigned long filepos,
- unsigned long count,
- arelent *res, asymbol **syms)
+ unsigned long count,
+ arelent *res, asymbol **syms)
{
bfd_mach_o_backend_data *bed = bfd_mach_o_get_backend_data (abfd);
unsigned long i;
{
if (!(*bed->_bfd_mach_o_canonicalize_one_reloc)(abfd, &native_relocs[i],
&res[i], syms, res))
- goto err;
+ goto err;
}
free (native_relocs);
return i;
long
bfd_mach_o_canonicalize_reloc (bfd *abfd, asection *asect,
- arelent **rels, asymbol **syms)
+ arelent **rels, asymbol **syms)
{
bfd_mach_o_backend_data *bed = bfd_mach_o_get_backend_data (abfd);
unsigned long i;
return -1;
res = bfd_malloc (asect->reloc_count * sizeof (arelent));
if (res == NULL)
- return -1;
+ return -1;
if (bfd_mach_o_canonicalize_relocs (abfd, asect->rel_filepos,
- asect->reloc_count, res, syms) < 0)
- {
- free (res);
- return -1;
- }
+ asect->reloc_count, res, syms) < 0)
+ {
+ free (res);
+ return -1;
+ }
asect->relocation = res;
}
long
bfd_mach_o_canonicalize_dynamic_reloc (bfd *abfd, arelent **rels,
- struct bfd_symbol **syms)
+ struct bfd_symbol **syms)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
bfd_mach_o_dysymtab_command *dysymtab = mdata->dysymtab;
return -1;
res = bfd_malloc ((dysymtab->nextrel + dysymtab->nlocrel)
- * sizeof (arelent));
+ * sizeof (arelent));
if (res == NULL)
- return -1;
+ return -1;
if (bfd_mach_o_canonicalize_relocs (abfd, dysymtab->extreloff,
- dysymtab->nextrel, res, syms) < 0)
- {
- free (res);
- return -1;
- }
+ dysymtab->nextrel, res, syms) < 0)
+ {
+ free (res);
+ return -1;
+ }
if (bfd_mach_o_canonicalize_relocs (abfd, dysymtab->locreloff,
- dysymtab->nlocrel,
- res + dysymtab->nextrel, syms) < 0)
- {
- free (res);
- return -1;
- }
+ dysymtab->nlocrel,
+ res + dysymtab->nextrel, syms) < 0)
+ {
+ free (res);
+ return -1;
+ }
mdata->dyn_reloc_cache = res;
}
/* Convert relocation to an intermediate representation. */
if (!(*bed->_bfd_mach_o_swap_reloc_out) (rel, pinfo))
- return FALSE;
+ return FALSE;
/* Lower the relocation info. */
if (pinfo->r_scattered)
- {
- unsigned long v;
-
- v = BFD_MACH_O_SR_SCATTERED
- | (pinfo->r_pcrel ? BFD_MACH_O_SR_PCREL : 0)
- | BFD_MACH_O_SET_SR_LENGTH (pinfo->r_length)
- | BFD_MACH_O_SET_SR_TYPE (pinfo->r_type)
- | BFD_MACH_O_SET_SR_ADDRESS (pinfo->r_address);
- /* Note: scattered relocs have field in reverse order... */
- bfd_put_32 (abfd, v, raw.r_address);
- bfd_put_32 (abfd, pinfo->r_value, raw.r_symbolnum);
- }
+ {
+ unsigned long v;
+
+ v = BFD_MACH_O_SR_SCATTERED
+ | (pinfo->r_pcrel ? BFD_MACH_O_SR_PCREL : 0)
+ | BFD_MACH_O_SET_SR_LENGTH (pinfo->r_length)
+ | BFD_MACH_O_SET_SR_TYPE (pinfo->r_type)
+ | BFD_MACH_O_SET_SR_ADDRESS (pinfo->r_address);
+ /* Note: scattered relocs have field in reverse order... */
+ bfd_put_32 (abfd, v, raw.r_address);
+ bfd_put_32 (abfd, pinfo->r_value, raw.r_symbolnum);
+ }
else
- {
- bfd_put_32 (abfd, pinfo->r_address, raw.r_address);
- bfd_mach_o_swap_out_non_scattered_reloc (abfd, raw.r_symbolnum,
+ {
+ bfd_put_32 (abfd, pinfo->r_address, raw.r_address);
+ bfd_mach_o_swap_out_non_scattered_reloc (abfd, raw.r_symbolnum,
pinfo);
- }
+ }
if (bfd_bwrite (&raw, BFD_MACH_O_RELENT_SIZE, abfd)
- != BFD_MACH_O_RELENT_SIZE)
- return FALSE;
+ != BFD_MACH_O_RELENT_SIZE)
+ return FALSE;
}
return TRUE;
}
if (s->symbol.name == 0 || s->symbol.name[0] == '\0')
/* An index of 0 always means the empty string. */
- str_index = 0;
+ str_index = 0;
else
- {
- str_index = _bfd_stringtab_add (strtab, s->symbol.name, TRUE, FALSE);
+ {
+ str_index = _bfd_stringtab_add (strtab, s->symbol.name, TRUE, FALSE);
- if (str_index == (bfd_size_type) -1)
- goto err;
- }
+ if (str_index == (bfd_size_type) -1)
+ goto err;
+ }
if (wide)
- {
- struct mach_o_nlist_64_external raw;
-
- bfd_h_put_32 (abfd, str_index, raw.n_strx);
- bfd_h_put_8 (abfd, s->n_type, raw.n_type);
- bfd_h_put_8 (abfd, s->n_sect, raw.n_sect);
- bfd_h_put_16 (abfd, s->n_desc, raw.n_desc);
- bfd_h_put_64 (abfd, s->symbol.section->vma + s->symbol.value,
- raw.n_value);
-
- if (bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
- goto err;
- }
+ {
+ struct mach_o_nlist_64_external raw;
+
+ bfd_h_put_32 (abfd, str_index, raw.n_strx);
+ bfd_h_put_8 (abfd, s->n_type, raw.n_type);
+ bfd_h_put_8 (abfd, s->n_sect, raw.n_sect);
+ bfd_h_put_16 (abfd, s->n_desc, raw.n_desc);
+ bfd_h_put_64 (abfd, s->symbol.section->vma + s->symbol.value,
+ raw.n_value);
+
+ if (bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
+ goto err;
+ }
else
- {
- struct mach_o_nlist_external raw;
+ {
+ struct mach_o_nlist_external raw;
- bfd_h_put_32 (abfd, str_index, raw.n_strx);
- bfd_h_put_8 (abfd, s->n_type, raw.n_type);
- bfd_h_put_8 (abfd, s->n_sect, raw.n_sect);
- bfd_h_put_16 (abfd, s->n_desc, raw.n_desc);
- bfd_h_put_32 (abfd, s->symbol.section->vma + s->symbol.value,
- raw.n_value);
+ bfd_h_put_32 (abfd, str_index, raw.n_strx);
+ bfd_h_put_8 (abfd, s->n_type, raw.n_type);
+ bfd_h_put_8 (abfd, s->n_sect, raw.n_sect);
+ bfd_h_put_16 (abfd, s->n_desc, raw.n_desc);
+ bfd_h_put_32 (abfd, s->symbol.section->vma + s->symbol.value,
+ raw.n_value);
- if (bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
- goto err;
- }
+ if (bfd_bwrite (&raw, sizeof (raw), abfd) != sizeof (raw))
+ goto err;
+ }
}
sym->strsize = _bfd_stringtab_size (strtab);
sym->stroff = mdata->filelen;
return FALSE;
cmd->indirect_syms = bfd_zalloc (abfd, cmd->nindirectsyms * 4);
if (cmd->indirect_syms == NULL)
- return FALSE;
+ return FALSE;
n = 0;
for (i = 0; i < mdata->nsects; ++i)
for (j = 0; j < num; j++, n++)
{
if (isyms[j] == NULL)
- cmd->indirect_syms[n] = BFD_MACH_O_INDIRECT_SYM_LOCAL;
+ cmd->indirect_syms[n] = BFD_MACH_O_INDIRECT_SYM_LOCAL;
else if (isyms[j]->symbol.section == bfd_abs_section_ptr
&& ! (isyms[j]->n_type & BFD_MACH_O_N_EXT))
- cmd->indirect_syms[n] = BFD_MACH_O_INDIRECT_SYM_LOCAL
+ cmd->indirect_syms[n] = BFD_MACH_O_INDIRECT_SYM_LOCAL
| BFD_MACH_O_INDIRECT_SYM_ABS;
else
- cmd->indirect_syms[n] = isyms[j]->symbol.udata.i;
+ cmd->indirect_syms[n] = isyms[j]->symbol.udata.i;
}
}
break;
if (soa == 0)
{
if (sa->symbol.udata.i < sb->symbol.udata.i)
- return -1;
+ return -1;
if (sa->symbol.udata.i > sb->symbol.udata.i)
- return 1;
+ return 1;
/* This is probably an error. */
return 0;
this, since more meaningful diagnostics can be made that way. */
if (s->symbol.udata.i == SYM_MACHO_FIELDS_UNSET)
- {
- /* No symbol information has been set - therefore determine
- it from the bfd symbol flags/info. */
- if (s->symbol.section == bfd_abs_section_ptr)
- s->n_type = BFD_MACH_O_N_ABS;
- else if (s->symbol.section == bfd_und_section_ptr)
- {
- s->n_type = BFD_MACH_O_N_UNDF;
- if (s->symbol.flags & BSF_WEAK)
- s->n_desc |= BFD_MACH_O_N_WEAK_REF;
- /* mach-o automatically makes undefined symbols extern. */
+ {
+ /* No symbol information has been set - therefore determine
+ it from the bfd symbol flags/info. */
+ if (s->symbol.section == bfd_abs_section_ptr)
+ s->n_type = BFD_MACH_O_N_ABS;
+ else if (s->symbol.section == bfd_und_section_ptr)
+ {
+ s->n_type = BFD_MACH_O_N_UNDF;
+ if (s->symbol.flags & BSF_WEAK)
+ s->n_desc |= BFD_MACH_O_N_WEAK_REF;
+ /* mach-o automatically makes undefined symbols extern. */
s->n_type |= BFD_MACH_O_N_EXT;
s->symbol.flags |= BSF_GLOBAL;
- }
- else if (s->symbol.section == bfd_com_section_ptr)
+ }
+ else if (s->symbol.section == bfd_com_section_ptr)
{
- s->n_type = BFD_MACH_O_N_UNDF | BFD_MACH_O_N_EXT;
- s->symbol.flags |= BSF_GLOBAL;
- }
- else
- s->n_type = BFD_MACH_O_N_SECT;
+ s->n_type = BFD_MACH_O_N_UNDF | BFD_MACH_O_N_EXT;
+ s->symbol.flags |= BSF_GLOBAL;
+ }
+ else
+ s->n_type = BFD_MACH_O_N_SECT;
- if (s->symbol.flags & BSF_GLOBAL)
- s->n_type |= BFD_MACH_O_N_EXT;
- }
+ if (s->symbol.flags & BSF_GLOBAL)
+ s->n_type |= BFD_MACH_O_N_EXT;
+ }
/* Put the section index in, where required. */
if ((s->symbol.section != bfd_abs_section_ptr
- && s->symbol.section != bfd_und_section_ptr
- && s->symbol.section != bfd_com_section_ptr)
- || ((s->n_type & BFD_MACH_O_N_STAB) != 0
- && s->symbol.name == NULL))
+ && s->symbol.section != bfd_und_section_ptr
+ && s->symbol.section != bfd_com_section_ptr)
+ || ((s->n_type & BFD_MACH_O_N_STAB) != 0
+ && s->symbol.name == NULL))
s->n_sect = s->symbol.section->output_section->target_index;
/* Number to preserve order for local and debug syms. */
bfd_h_put_32 (abfd, cmd->len, raw.cmdsize);
if (bfd_seek (abfd, cmd->offset, SEEK_SET) != 0
- || bfd_bwrite (&raw, BFD_MACH_O_LC_SIZE, abfd) != 8)
+ || bfd_bwrite (&raw, BFD_MACH_O_LC_SIZE, abfd) != 8)
return FALSE;
switch (cmd->type)
static void
bfd_mach_o_append_section_to_segment (bfd_mach_o_segment_command *seg,
- bfd_mach_o_section *s)
+ bfd_mach_o_section *s)
{
if (seg->sect_head == NULL)
seg->sect_head = s;
/* Zerofill sections have zero file size & offset, the only content
written to the file is the symbols. */
if ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK) == BFD_MACH_O_S_ZEROFILL
- || ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK)
+ || ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK)
== BFD_MACH_O_S_GB_ZEROFILL))
- continue;
+ continue;
/* The Darwin system tools (in MH_OBJECT files, at least) always account
sections, even those with zero size. */
if (1)
{
seg->filesize = FILE_ALIGN (seg->filesize, s->align);
- mdata->filelen = FILE_ALIGN (mdata->filelen, s->align);
- }
+ mdata->filelen = FILE_ALIGN (mdata->filelen, s->align);
+ }
seg->filesize += s->size;
/* The system tools write even zero-sized sections with an offset
field set to the current file position. */
- s->offset = mdata->filelen;
+ s->offset = mdata->filelen;
}
sec->filepos = s->offset;
ms->nreloc = sec->reloc_count;
if (ms->nreloc == 0)
- {
+ {
/* Clear nreloc and reloff if there is no relocs. */
ms->reloff = 0;
continue;
- }
+ }
sec->rel_filepos = mdata->filelen;
ms->reloff = sec->rel_filepos;
mdata->filelen += sec->reloc_count * BFD_MACH_O_RELENT_SIZE;
seg->filesize = FILE_ALIGN (seg->filesize, s->align);
if ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK) != BFD_MACH_O_S_ZEROFILL
- && ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK)
+ && ((s->flags & BFD_MACH_O_SECTION_TYPE_MASK)
!= BFD_MACH_O_S_GB_ZEROFILL))
{
mdata->filelen = FILE_ALIGN (mdata->filelen, s->align);
if (mdata->header.filetype == 0)
{
if (abfd->flags & EXEC_P)
- mdata->header.filetype = BFD_MACH_O_MH_EXECUTE;
+ mdata->header.filetype = BFD_MACH_O_MH_EXECUTE;
else if (abfd->flags & DYNAMIC)
- mdata->header.filetype = BFD_MACH_O_MH_DYLIB;
+ mdata->header.filetype = BFD_MACH_O_MH_DYLIB;
else
- mdata->header.filetype = BFD_MACH_O_MH_OBJECT;
+ mdata->header.filetype = BFD_MACH_O_MH_OBJECT;
}
/* If hasn't already been done, flatten sections list, and sort
static void
bfd_mach_o_init_section_from_mach_o (bfd *abfd, asection *sec,
- unsigned long prot)
+ unsigned long prot)
{
flagword flags;
bfd_mach_o_section *section;
{
/* Try to guess flags. */
if (section->flags & BFD_MACH_O_S_ATTR_DEBUG)
- flags = SEC_DEBUGGING;
+ flags = SEC_DEBUGGING;
else
- {
- flags = SEC_ALLOC;
- if ((section->flags & BFD_MACH_O_SECTION_TYPE_MASK)
- != BFD_MACH_O_S_ZEROFILL)
- {
- flags |= SEC_LOAD;
- if (prot & BFD_MACH_O_PROT_EXECUTE)
- flags |= SEC_CODE;
- if (prot & BFD_MACH_O_PROT_WRITE)
- flags |= SEC_DATA;
- else if (prot & BFD_MACH_O_PROT_READ)
- flags |= SEC_READONLY;
- }
- }
+ {
+ flags = SEC_ALLOC;
+ if ((section->flags & BFD_MACH_O_SECTION_TYPE_MASK)
+ != BFD_MACH_O_S_ZEROFILL)
+ {
+ flags |= SEC_LOAD;
+ if (prot & BFD_MACH_O_PROT_EXECUTE)
+ flags |= SEC_CODE;
+ if (prot & BFD_MACH_O_PROT_WRITE)
+ flags |= SEC_DATA;
+ else if (prot & BFD_MACH_O_PROT_READ)
+ flags |= SEC_READONLY;
+ }
+ }
}
else
{
if ((flags & SEC_DEBUGGING) == 0)
- flags |= SEC_ALLOC;
+ flags |= SEC_ALLOC;
}
if (section->offset != 0)
static asection *
bfd_mach_o_make_bfd_section (bfd *abfd,
- const unsigned char *segname,
- const unsigned char *sectname)
+ const unsigned char *segname,
+ const unsigned char *sectname)
{
const char *sname;
flagword flags;
static bfd_boolean
bfd_mach_o_read_symtab_symbol (bfd *abfd,
- bfd_mach_o_symtab_command *sym,
- bfd_mach_o_asymbol *s,
- unsigned long i)
+ bfd_mach_o_symtab_command *sym,
+ bfd_mach_o_asymbol *s,
+ unsigned long i)
{
bfd_mach_o_data_struct *mdata = bfd_mach_o_get_data (abfd);
unsigned int wide = mach_o_wide_p (&mdata->header);
{
_bfd_error_handler
/* xgettext:c-format */
- (_("bfd_mach_o_read_symtab_symbol: unable to read %d bytes at %u"),
- symwidth, symoff);
+ (_("bfd_mach_o_read_symtab_symbol: unable to read %d bytes at %u"),
+ symwidth, symoff);
return FALSE;
}
{
_bfd_error_handler
/* xgettext:c-format */
- (_("bfd_mach_o_read_symtab_symbol: name out of range (%lu >= %u)"),
- stroff,
- sym->strsize);
+ (_("bfd_mach_o_read_symtab_symbol: name out of range (%lu >= %u)"),
+ stroff,
+ sym->strsize);
return FALSE;
}
{
s->symbol.section = mdata->sections[section - 1]->bfdsection;
s->symbol.value =
- s->symbol.value - mdata->sections[section - 1]->addr;
+ s->symbol.value - mdata->sections[section - 1]->addr;
}
break;
}
switch (symtype)
{
case BFD_MACH_O_N_UNDF:
- if (type == (BFD_MACH_O_N_UNDF | BFD_MACH_O_N_EXT)
- && s->symbol.value != 0)
- {
- /* A common symbol. */
- s->symbol.section = bfd_com_section_ptr;
- s->symbol.flags = BSF_NO_FLAGS;
- }
- else
- {
- s->symbol.section = bfd_und_section_ptr;
- if (s->n_desc & BFD_MACH_O_N_WEAK_REF)
- s->symbol.flags |= BSF_WEAK;
- }
+ if (type == (BFD_MACH_O_N_UNDF | BFD_MACH_O_N_EXT)
+ && s->symbol.value != 0)
+ {
+ /* A common symbol. */
+ s->symbol.section = bfd_com_section_ptr;
+ s->symbol.flags = BSF_NO_FLAGS;
+ }
+ else
+ {
+ s->symbol.section = bfd_und_section_ptr;
+ if (s->n_desc & BFD_MACH_O_N_WEAK_REF)
+ s->symbol.flags |= BSF_WEAK;
+ }
break;
case BFD_MACH_O_N_PBUD:
s->symbol.section = bfd_und_section_ptr;
{
s->symbol.section = mdata->sections[section - 1]->bfdsection;
s->symbol.value =
- s->symbol.value - mdata->sections[section - 1]->addr;
+ s->symbol.value - mdata->sections[section - 1]->addr;
}
else
{
return FALSE;
sym->strtab = bfd_alloc (abfd, sym->strsize + 1);
if (sym->strtab == NULL)
- return FALSE;
+ return FALSE;
if (bfd_seek (abfd, sym->stroff, SEEK_SET) != 0
- || bfd_bread (sym->strtab, sym->strsize, abfd) != sym->strsize)
- {
+ || bfd_bread (sym->strtab, sym->strsize, abfd) != sym->strsize)
+ {
/* PR 17512: file: 10888-1609-0.004. */
bfd_release (abfd, sym->strtab);
sym->strtab = NULL;
- bfd_set_error (bfd_error_file_truncated);
- return FALSE;
- }
+ bfd_set_error (bfd_error_file_truncated);
+ return FALSE;
+ }
/* Zero terminate the string table. */
sym->strtab[sym->strsize] = 0;
}
static bfd_boolean
bfd_mach_o_read_prebound_dylib (bfd *abfd,
- bfd_mach_o_load_command *command)
+ bfd_mach_o_load_command *command)
{
bfd_mach_o_prebound_dylib_command *cmd = &command->command.prebound_dylib;
struct mach_o_prebound_dylib_command_external raw;
return FALSE;
if (bfd_seek (abfd, command->offset + offset, SEEK_SET) != 0
- || bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
+ || bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
return FALSE;
offset += sizeof (raw) + bfd_h_get_32 (abfd, raw.count) * 4;
return FALSE;
if (bfd_seek (abfd, command->offset + offset, SEEK_SET) != 0
- || bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
+ || bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
return FALSE;
cmd->flavours[nflavours].flavour = bfd_h_get_32 (abfd, raw.flavour);
unsigned int module_len = wide ? 56 : 52;
cmd->dylib_module =
- bfd_alloc2 (abfd, cmd->nmodtab, sizeof (bfd_mach_o_dylib_module));
+ bfd_alloc2 (abfd, cmd->nmodtab, sizeof (bfd_mach_o_dylib_module));
if (cmd->dylib_module == NULL)
- return FALSE;
+ return FALSE;
if (bfd_seek (abfd, cmd->modtaboff, SEEK_SET) != 0)
- return FALSE;
+ return FALSE;
for (i = 0; i < cmd->nmodtab; i++)
- {
- bfd_mach_o_dylib_module *module = &cmd->dylib_module[i];
- unsigned long v;
- unsigned char buf[56];
-
- if (bfd_bread ((void *) buf, module_len, abfd) != module_len)
- return FALSE;
-
- module->module_name_idx = bfd_h_get_32 (abfd, buf + 0);
- module->iextdefsym = bfd_h_get_32 (abfd, buf + 4);
- module->nextdefsym = bfd_h_get_32 (abfd, buf + 8);
- module->irefsym = bfd_h_get_32 (abfd, buf + 12);
- module->nrefsym = bfd_h_get_32 (abfd, buf + 16);
- module->ilocalsym = bfd_h_get_32 (abfd, buf + 20);
- module->nlocalsym = bfd_h_get_32 (abfd, buf + 24);
- module->iextrel = bfd_h_get_32 (abfd, buf + 28);
- module->nextrel = bfd_h_get_32 (abfd, buf + 32);
- v = bfd_h_get_32 (abfd, buf +36);
- module->iinit = v & 0xffff;
- module->iterm = (v >> 16) & 0xffff;
- v = bfd_h_get_32 (abfd, buf + 40);
- module->ninit = v & 0xffff;
- module->nterm = (v >> 16) & 0xffff;
- if (wide)
- {
- module->objc_module_info_size = bfd_h_get_32 (abfd, buf + 44);
- module->objc_module_info_addr = bfd_h_get_64 (abfd, buf + 48);
- }
- else
- {
- module->objc_module_info_addr = bfd_h_get_32 (abfd, buf + 44);
- module->objc_module_info_size = bfd_h_get_32 (abfd, buf + 48);
- }
- }
+ {
+ bfd_mach_o_dylib_module *module = &cmd->dylib_module[i];
+ unsigned long v;
+ unsigned char buf[56];
+
+ if (bfd_bread ((void *) buf, module_len, abfd) != module_len)
+ return FALSE;
+
+ module->module_name_idx = bfd_h_get_32 (abfd, buf + 0);
+ module->iextdefsym = bfd_h_get_32 (abfd, buf + 4);
+ module->nextdefsym = bfd_h_get_32 (abfd, buf + 8);
+ module->irefsym = bfd_h_get_32 (abfd, buf + 12);
+ module->nrefsym = bfd_h_get_32 (abfd, buf + 16);
+ module->ilocalsym = bfd_h_get_32 (abfd, buf + 20);
+ module->nlocalsym = bfd_h_get_32 (abfd, buf + 24);
+ module->iextrel = bfd_h_get_32 (abfd, buf + 28);
+ module->nextrel = bfd_h_get_32 (abfd, buf + 32);
+ v = bfd_h_get_32 (abfd, buf +36);
+ module->iinit = v & 0xffff;
+ module->iterm = (v >> 16) & 0xffff;
+ v = bfd_h_get_32 (abfd, buf + 40);
+ module->ninit = v & 0xffff;
+ module->nterm = (v >> 16) & 0xffff;
+ if (wide)
+ {
+ module->objc_module_info_size = bfd_h_get_32 (abfd, buf + 44);
+ module->objc_module_info_addr = bfd_h_get_64 (abfd, buf + 48);
+ }
+ else
+ {
+ module->objc_module_info_addr = bfd_h_get_32 (abfd, buf + 44);
+ module->objc_module_info_size = bfd_h_get_32 (abfd, buf + 48);
+ }
+ }
}
if (cmd->ntoc != 0)
unsigned long i;
cmd->dylib_toc = bfd_alloc2
- (abfd, cmd->ntoc, sizeof (bfd_mach_o_dylib_table_of_content));
+ (abfd, cmd->ntoc, sizeof (bfd_mach_o_dylib_table_of_content));
if (cmd->dylib_toc == NULL)
- return FALSE;
+ return FALSE;
if (bfd_seek (abfd, cmd->tocoff, SEEK_SET) != 0)
- return FALSE;
+ return FALSE;
for (i = 0; i < cmd->ntoc; i++)
- {
- struct mach_o_dylib_table_of_contents_external raw;
- bfd_mach_o_dylib_table_of_content *toc = &cmd->dylib_toc[i];
+ {
+ struct mach_o_dylib_table_of_contents_external raw;
+ bfd_mach_o_dylib_table_of_content *toc = &cmd->dylib_toc[i];
- if (bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return FALSE;
+ if (bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
+ return FALSE;
- toc->symbol_index = bfd_h_get_32 (abfd, raw.symbol_index);
- toc->module_index = bfd_h_get_32 (abfd, raw.module_index);
- }
+ toc->symbol_index = bfd_h_get_32 (abfd, raw.symbol_index);
+ toc->module_index = bfd_h_get_32 (abfd, raw.module_index);
+ }
}
if (cmd->nindirectsyms != 0)
unsigned int i;
cmd->indirect_syms = bfd_alloc2
- (abfd, cmd->nindirectsyms, sizeof (unsigned int));
+ (abfd, cmd->nindirectsyms, sizeof (unsigned int));
if (cmd->indirect_syms == NULL)
- return FALSE;
+ return FALSE;
if (bfd_seek (abfd, cmd->indirectsymoff, SEEK_SET) != 0)
- return FALSE;
+ return FALSE;
for (i = 0; i < cmd->nindirectsyms; i++)
- {
- unsigned char raw[4];
- unsigned int *is = &cmd->indirect_syms[i];
+ {
+ unsigned char raw[4];
+ unsigned int *is = &cmd->indirect_syms[i];
- if (bfd_bread (raw, sizeof (raw), abfd) != sizeof (raw))
- return FALSE;
+ if (bfd_bread (raw, sizeof (raw), abfd) != sizeof (raw))
+ return FALSE;
- *is = bfd_h_get_32 (abfd, raw);
- }
+ *is = bfd_h_get_32 (abfd, raw);
+ }
}
if (cmd->nextrefsyms != 0)
unsigned int i;
cmd->ext_refs = bfd_alloc2
- (abfd, cmd->nextrefsyms, sizeof (bfd_mach_o_dylib_reference));
+ (abfd, cmd->nextrefsyms, sizeof (bfd_mach_o_dylib_reference));
if (cmd->ext_refs == NULL)
- return FALSE;
+ return FALSE;
if (bfd_seek (abfd, cmd->extrefsymoff, SEEK_SET) != 0)
- return FALSE;
+ return FALSE;
for (i = 0; i < cmd->nextrefsyms; i++)
- {
- unsigned char raw[4];
- bfd_mach_o_dylib_reference *ref = &cmd->ext_refs[i];
-
- if (bfd_bread (raw, sizeof (raw), abfd) != sizeof (raw))
- return FALSE;
-
- /* Fields isym and flags are written as bit-fields, thus we need
- a specific processing for endianness. */
- v = bfd_h_get_32 (abfd, raw);
- if (bfd_big_endian (abfd))
- {
- ref->isym = (v >> 8) & 0xffffff;
- ref->flags = v & 0xff;
- }
- else
- {
- ref->isym = v & 0xffffff;
- ref->flags = (v >> 24) & 0xff;
- }
- }
+ {
+ unsigned char raw[4];
+ bfd_mach_o_dylib_reference *ref = &cmd->ext_refs[i];
+
+ if (bfd_bread (raw, sizeof (raw), abfd) != sizeof (raw))
+ return FALSE;
+
+ /* Fields isym and flags are written as bit-fields, thus we need
+ a specific processing for endianness. */
+ v = bfd_h_get_32 (abfd, raw);
+ if (bfd_big_endian (abfd))
+ {
+ ref->isym = (v >> 8) & 0xffffff;
+ ref->flags = v & 0xff;
+ }
+ else
+ {
+ ref->isym = v & 0xffffff;
+ ref->flags = (v >> 24) & 0xff;
+ }
+ }
}
if (mdata->dysymtab)
static bfd_boolean
bfd_mach_o_read_segment (bfd *abfd,
- bfd_mach_o_load_command *command,
- unsigned int wide)
+ bfd_mach_o_load_command *command,
+ unsigned int wide)
{
bfd_mach_o_segment_command *seg = &command->command.segment;
unsigned long i;
BFD_ASSERT (command->type == BFD_MACH_O_LC_SEGMENT_64);
if (bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return FALSE;
+ return FALSE;
memcpy (seg->segname, raw.segname, 16);
seg->segname[16] = '\0';
BFD_ASSERT (command->type == BFD_MACH_O_LC_SEGMENT);
if (bfd_bread (&raw, sizeof (raw), abfd) != sizeof (raw))
- return FALSE;
+ return FALSE;
memcpy (seg->segname, raw.segname, 16);
seg->segname[16] = '\0';
sec = bfd_mach_o_read_section (abfd, seg->initprot, wide);
if (sec == NULL)
- return FALSE;
+ return FALSE;
bfd_mach_o_append_section_to_segment
(seg, bfd_mach_o_get_mach_o_section (sec));
case BFD_MACH_O_LC_SUB_CLIENT:
case BFD_MACH_O_LC_RPATH:
if (!bfd_mach_o_read_str (abfd, command))
- return FALSE;
+ return FALSE;
break;
case BFD_MACH_O_LC_DYSYMTAB:
if (!bfd_mach_o_read_dysymtab (abfd, command))
|| cmd->type == BFD_MACH_O_LC_SEGMENT_64)
{
bfd_mach_o_segment_command *seg = &cmd->command.segment;
- bfd_mach_o_section *sec;
+ bfd_mach_o_section *sec;
BFD_ASSERT (csect + seg->nsects <= mdata->nsects);
- for (sec = seg->sect_head; sec != NULL; sec = sec->next)
+ for (sec = seg->sect_head; sec != NULL; sec = sec->next)
mdata->sections[csect++] = sec;
}
}
if (cmd->type == BFD_MACH_O_LC_THREAD
|| cmd->type == BFD_MACH_O_LC_UNIXTHREAD)
{
- thr = &cmd->command.thread;
- break;
+ thr = &cmd->command.thread;
+ break;
}
else if (cmd->type == BFD_MACH_O_LC_MAIN && mdata->nsects > 1)
{
unsigned char buf[4];
if (bfd_seek (abfd, thr->flavours[i].offset + 40, SEEK_SET) != 0
- || bfd_bread (buf, 4, abfd) != 4)
+ || bfd_bread (buf, 4, abfd) != 4)
return FALSE;
abfd->start_address = bfd_h_get_32 (abfd, buf);
unsigned char buf[4];
if (bfd_seek (abfd, thr->flavours[i].offset + 0, SEEK_SET) != 0
- || bfd_bread (buf, 4, abfd) != 4)
+ || bfd_bread (buf, 4, abfd) != 4)
return FALSE;
abfd->start_address = bfd_h_get_32 (abfd, buf);
}
else if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_POWERPC_64)
- && (thr->flavours[i].flavour == BFD_MACH_O_PPC_THREAD_STATE64))
- {
- unsigned char buf[8];
+ && (thr->flavours[i].flavour == BFD_MACH_O_PPC_THREAD_STATE64))
+ {
+ unsigned char buf[8];
- if (bfd_seek (abfd, thr->flavours[i].offset + 0, SEEK_SET) != 0
- || bfd_bread (buf, 8, abfd) != 8)
- return FALSE;
+ if (bfd_seek (abfd, thr->flavours[i].offset + 0, SEEK_SET) != 0
+ || bfd_bread (buf, 8, abfd) != 8)
+ return FALSE;
- abfd->start_address = bfd_h_get_64 (abfd, buf);
- }
+ abfd->start_address = bfd_h_get_64 (abfd, buf);
+ }
else if ((mdata->header.cputype == BFD_MACH_O_CPU_TYPE_X86_64)
- && (thr->flavours[i].flavour == BFD_MACH_O_x86_THREAD_STATE64))
- {
- unsigned char buf[8];
+ && (thr->flavours[i].flavour == BFD_MACH_O_x86_THREAD_STATE64))
+ {
+ unsigned char buf[8];
- if (bfd_seek (abfd, thr->flavours[i].offset + (16 * 8), SEEK_SET) != 0
- || bfd_bread (buf, 8, abfd) != 8)
- return FALSE;
+ if (bfd_seek (abfd, thr->flavours[i].offset + (16 * 8), SEEK_SET) != 0
+ || bfd_bread (buf, 8, abfd) != 8)
+ return FALSE;
- abfd->start_address = bfd_h_get_64 (abfd, buf);
- }
+ abfd->start_address = bfd_h_get_64 (abfd, buf);
+ }
}
return TRUE;
bfd_boolean
bfd_mach_o_set_arch_mach (bfd *abfd,
- enum bfd_architecture arch,
- unsigned long machine)
+ enum bfd_architecture arch,
+ unsigned long machine)
{
bfd_mach_o_backend_data *bed = bfd_mach_o_get_backend_data (abfd);
{
_bfd_error_handler
/* xgettext:c-format */
- (_("bfd_mach_o_scan: unknown architecture 0x%lx/0x%lx"),
- header->cputype, header->cpusubtype);
+ (_("bfd_mach_o_scan: unknown architecture 0x%lx/0x%lx"),
+ header->cputype, header->cpusubtype);
return FALSE;
}
const bfd_target *
bfd_mach_o_header_p (bfd *abfd,
file_ptr hdr_off,
- bfd_mach_o_filetype filetype,
- bfd_mach_o_cpu_type cputype)
+ bfd_mach_o_filetype filetype,
+ bfd_mach_o_cpu_type cputype)
{
bfd_mach_o_header header;
bfd_mach_o_data_struct *mdata;
if (cputype)
{
if (header.cputype != cputype)
- goto wrong;
+ goto wrong;
}
else
{
if (filetype)
{
if (header.filetype != filetype)
- goto wrong;
+ goto wrong;
}
else
{
switch (header.filetype)
- {
- case BFD_MACH_O_MH_CORE:
- /* Handled by core_p */
- goto wrong;
- default:
- break;
- }
+ {
+ case BFD_MACH_O_MH_CORE:
+ /* Handled by core_p */
+ goto wrong;
+ default:
+ break;
+ }
}
mdata = (bfd_mach_o_data_struct *) bfd_zalloc (abfd, sizeof (*mdata));
static void
bfd_mach_o_fat_member_init (bfd *abfd,
- enum bfd_architecture arch_type,
- unsigned long arch_subtype,
- mach_o_fat_archentry *entry)
+ enum bfd_architecture arch_type,
+ unsigned long arch_subtype,
+ mach_o_fat_archentry *entry)
{
struct areltdata *areltdata;
/* Create the member filename. Use ARCH_NAME. */
const size_t namelen = 2 + 8 + 1 + 2 + 8 + 1;
char *name = xmalloc (namelen);
snprintf (name, namelen, "0x%lx-0x%lx",
- entry->cputype, entry->cpusubtype);
+ entry->cputype, entry->cpusubtype);
abfd->filename = name;
}
return -1;
if (bfd_seek (abfd, end - size, SEEK_SET) != 0)
- {
- free (buf);
- return -1;
- }
+ {
+ free (buf);
+ return -1;
+ }
nread = bfd_bread (buf, size, abfd);
return FALSE;
if (memcmp (uuid_cmd->uuid, dsym_uuid_cmd->uuid,
- sizeof (uuid_cmd->uuid)) != 0)
+ sizeof (uuid_cmd->uuid)) != 0)
return FALSE;
return TRUE;
static bfd *
bfd_mach_o_find_dsym (const char *dsym_filename,
- const bfd_mach_o_uuid_command *uuid_cmd,
- const bfd_arch_info_type *arch)
+ const bfd_mach_o_uuid_command *uuid_cmd,
+ const bfd_arch_info_type *arch)
{
bfd *base_dsym_bfd, *dsym_bfd;
http://opensource.apple.com/source/gdb/gdb-1708/src/gdb/macosx/macosx-tdep.c
*/
dsym_filename = (char *)bfd_malloc (strlen (base_bfd->filename)
- + strlen (dsym_subdir) + 1
- + strlen (base_basename) + 1);
+ + strlen (dsym_subdir) + 1
+ + strlen (base_basename) + 1);
sprintf (dsym_filename, "%s%s/%s",
- base_bfd->filename, dsym_subdir, base_basename);
+ base_bfd->filename, dsym_subdir, base_basename);
dsym_bfd = bfd_mach_o_find_dsym (dsym_filename, uuid_cmd,
- bfd_get_arch_info (abfd));
+ bfd_get_arch_info (abfd));
if (dsym_bfd == NULL)
free (dsym_filename);
case BFD_MACH_O_MH_BUNDLE:
case BFD_MACH_O_MH_KEXT_BUNDLE:
if (mdata->dwarf2_find_line_info == NULL)
- {
- mdata->dsym_bfd = bfd_mach_o_follow_dsym (abfd);
- /* When we couldn't find dSYM for this binary, we look for
- the debug information in the binary itself. In this way,
- we won't try finding separated dSYM again because
- mdata->dwarf2_find_line_info will be filled. */
- if (! mdata->dsym_bfd)
- break;
- if (! _bfd_dwarf2_slurp_debug_info (abfd, mdata->dsym_bfd,
- dwarf_debug_sections, symbols,
- &mdata->dwarf2_find_line_info,
+ {
+ mdata->dsym_bfd = bfd_mach_o_follow_dsym (abfd);
+ /* When we couldn't find dSYM for this binary, we look for
+ the debug information in the binary itself. In this way,
+ we won't try finding separated dSYM again because
+ mdata->dwarf2_find_line_info will be filled. */
+ if (! mdata->dsym_bfd)
+ break;
+ if (! _bfd_dwarf2_slurp_debug_info (abfd, mdata->dsym_bfd,
+ dwarf_debug_sections, symbols,
+ &mdata->dwarf2_find_line_info,
FALSE))
- return FALSE;
- }
+ return FALSE;
+ }
break;
default:
return FALSE;
_bfd_dwarf2_cleanup_debug_info (abfd, &mdata->dwarf2_find_line_info);
bfd_mach_o_free_cached_info (abfd);
if (mdata->dsym_bfd != NULL)
- {
- bfd *fat_bfd = mdata->dsym_bfd->my_archive;
+ {
+ bfd *fat_bfd = mdata->dsym_bfd->my_archive;
#if 0
/* FIXME: PR 19435: This calculation to find the memory allocated by
bfd_mach_o_follow_dsym for the filename does not always end up
commented out. This does mean that there will be a memory leak,
but it is small, and happens when we are closing down, so it
should not matter too much. */
- char *dsym_filename = (char *)(fat_bfd
- ? fat_bfd->filename
- : mdata->dsym_bfd->filename);
+ char *dsym_filename = (char *)(fat_bfd
+ ? fat_bfd->filename
+ : mdata->dsym_bfd->filename);
#endif
- bfd_close (mdata->dsym_bfd);
- mdata->dsym_bfd = NULL;
- if (fat_bfd)
- bfd_close (fat_bfd);
+ bfd_close (mdata->dsym_bfd);
+ mdata->dsym_bfd = NULL;
+ if (fat_bfd)
+ bfd_close (fat_bfd);
#if 0
- free (dsym_filename);
+ free (dsym_filename);
#endif
- }
+ }
}
return _bfd_generic_close_and_cleanup (abfd);
#define bfd_mach_o_tgt_seg_table NULL
#define bfd_mach_o_section_type_valid_for_tgt NULL
-#define TARGET_NAME mach_o_be_vec
-#define TARGET_STRING "mach-o-be"
+#define TARGET_NAME mach_o_be_vec
+#define TARGET_STRING "mach-o-be"
#define TARGET_ARCHITECTURE bfd_arch_unknown
#define TARGET_PAGESIZE 1
-#define TARGET_BIG_ENDIAN 1
-#define TARGET_ARCHIVE 0
+#define TARGET_BIG_ENDIAN 1
+#define TARGET_ARCHIVE 0
#define TARGET_PRIORITY 1
#include "mach-o-target.c"
#undef TARGET_ARCHIVE
#undef TARGET_PRIORITY
-#define TARGET_NAME mach_o_le_vec
-#define TARGET_STRING "mach-o-le"
+#define TARGET_NAME mach_o_le_vec
+#define TARGET_STRING "mach-o-le"
#define TARGET_ARCHITECTURE bfd_arch_unknown
#define TARGET_PAGESIZE 1
-#define TARGET_BIG_ENDIAN 0
-#define TARGET_ARCHIVE 0
+#define TARGET_BIG_ENDIAN 0
+#define TARGET_ARCHIVE 0
#define TARGET_PRIORITY 1
#include "mach-o-target.c"
#undef TARGET_PRIORITY
/* Not yet handled: creating an archive. */
-#define bfd_mach_o_mkarchive _bfd_noarchive_mkarchive
+#define bfd_mach_o_mkarchive _bfd_noarchive_mkarchive
-#define bfd_mach_o_close_and_cleanup bfd_true
+#define bfd_mach_o_close_and_cleanup bfd_true
/* Not used. */
-#define bfd_mach_o_generic_stat_arch_elt bfd_mach_o_fat_stat_arch_elt
+#define bfd_mach_o_generic_stat_arch_elt bfd_mach_o_fat_stat_arch_elt
#define bfd_mach_o_openr_next_archived_file bfd_mach_o_fat_openr_next_archived_file
#define bfd_mach_o_archive_p bfd_mach_o_fat_archive_p
-#define TARGET_NAME mach_o_fat_vec
-#define TARGET_STRING "mach-o-fat"
+#define TARGET_NAME mach_o_fat_vec
+#define TARGET_STRING "mach-o-fat"
#define TARGET_ARCHITECTURE bfd_arch_unknown
#define TARGET_PAGESIZE 1
-#define TARGET_BIG_ENDIAN 1
-#define TARGET_ARCHIVE 1
+#define TARGET_BIG_ENDIAN 1
+#define TARGET_ARCHIVE 1
#define TARGET_PRIORITY 0
#include "mach-o-target.c"
tables is determined as follows:
table of contents - the defined external symbols are sorted by name
module table - the file contains only one module so everything in the
- file is part of the module.
+ file is part of the module.
reference symbol table - is the defined and undefined external symbols
For dynamically linked shared library files this load command also contains
symbols are sorted by name and is use as the table of contents. */
unsigned long tocoff; /* File offset to table of contents. */
- unsigned long ntoc; /* Number of entries in table of contents. */
+ unsigned long ntoc; /* Number of entries in table of contents. */
/* To support dynamic binding of "modules" (whole object files) the symbol
table must reflect the modules that the file was created from. This is
typedef struct bfd_mach_o_dylinker_command
{
- unsigned int name_offset; /* Offset to library's path name. */
+ unsigned int name_offset; /* Offset to library's path name. */
char *name_str;
}
bfd_mach_o_dylinker_command;
typedef struct bfd_mach_o_dylib_command
{
- unsigned int name_offset; /* Offset to library's path name. */
+ unsigned int name_offset; /* Offset to library's path name. */
unsigned long timestamp; /* Library's build time stamp. */
unsigned long current_version; /* Library's current version number. */
unsigned long compatibility_version; /* Library's compatibility vers number. */
typedef struct bfd_mach_o_prebound_dylib_command
{
- unsigned int name_offset; /* Library's path name. */
- unsigned int nmodules; /* Number of modules in library. */
+ unsigned int name_offset; /* Library's path name. */
+ unsigned int nmodules; /* Number of modules in library. */
unsigned int linked_modules_offset; /* Bit vector of linked modules. */
char *name_str;
const bfd_target *bfd_mach_o_fat_archive_p (bfd *);
bfd *bfd_mach_o_fat_openr_next_archived_file (bfd *, bfd *);
bfd_boolean bfd_mach_o_set_arch_mach (bfd *, enum bfd_architecture,
- unsigned long);
+ unsigned long);
int bfd_mach_o_lookup_command (bfd *, bfd_mach_o_load_command_type, bfd_mach_o_load_command **);
bfd_boolean bfd_mach_o_new_section_hook (bfd *, asection *);
bfd_boolean bfd_mach_o_write_contents (bfd *);
bfd_boolean bfd_mach_o_bfd_copy_private_symbol_data (bfd *, asymbol *,
- bfd *, asymbol *);
+ bfd *, asymbol *);
bfd_boolean bfd_mach_o_bfd_copy_private_section_data (bfd *, asection *,
- bfd *, asection *);
+ bfd *, asection *);
bfd_boolean bfd_mach_o_bfd_copy_private_header_data (bfd *, bfd *);
bfd_boolean bfd_mach_o_bfd_set_private_flags (bfd *, flagword);
long bfd_mach_o_get_symtab_upper_bound (bfd *);
long bfd_mach_o_canonicalize_symtab (bfd *, asymbol **);
long bfd_mach_o_get_synthetic_symtab (bfd *, long, asymbol **, long,
- asymbol **, asymbol **ret);
+ asymbol **, asymbol **ret);
long bfd_mach_o_get_reloc_upper_bound (bfd *, asection *);
long bfd_mach_o_canonicalize_reloc (bfd *, asection *, arelent **, asymbol **);
long bfd_mach_o_get_dynamic_reloc_upper_bound (bfd *);
bfd_boolean bfd_mach_o_core_file_matches_executable_p (bfd *, bfd *);
bfd *bfd_mach_o_fat_extract (bfd *, bfd_format , const bfd_arch_info_type *);
const bfd_target *bfd_mach_o_header_p (bfd *, file_ptr, bfd_mach_o_filetype,
- bfd_mach_o_cpu_type);
+ bfd_mach_o_cpu_type);
bfd_boolean bfd_mach_o_build_commands (bfd *);
bfd_boolean bfd_mach_o_set_section_contents (bfd *, asection *, const void *,
- file_ptr, bfd_size_type);
+ file_ptr, bfd_size_type);
unsigned int bfd_mach_o_version (bfd *);
unsigned int bfd_mach_o_get_section_type_from_name (bfd *, const char *);
(bfd *, struct mach_o_reloc_info_external *, arelent *, asymbol **, arelent *);
bfd_boolean (*_bfd_mach_o_swap_reloc_out)(arelent *, bfd_mach_o_reloc_info *);
bfd_boolean (*_bfd_mach_o_print_thread)(bfd *, bfd_mach_o_thread_flavour *,
- void *, char *);
+ void *, char *);
const mach_o_segment_name_xlat *segsec_names_xlat;
bfd_boolean (*bfd_mach_o_section_type_valid_for_target) (unsigned long);
}
subclass. */
if (entry == NULL)
entry = (struct bfd_hash_entry *)
- bfd_hash_allocate (table, sizeof (struct sec_merge_hash_entry));
+ bfd_hash_allocate (table, sizeof (struct sec_merge_hash_entry));
if (entry == NULL)
return NULL;
{
/* Initialize the information we need to keep track of. */
sinfo = (struct sec_merge_info *)
- bfd_alloc (abfd, sizeof (struct sec_merge_info));
+ bfd_alloc (abfd, sizeof (struct sec_merge_info));
if (sinfo == NULL)
goto error_return;
sinfo->next = (struct sec_merge_info *) *psinfo;
{MIPS_RELOC_HI16, 16, 2, 16, FALSE, 0, complain_overflow_bitfield, 0,
"HI16", FALSE, 0, 0x0000ffff, FALSE},
{MIPS_RELOC_HI16_S, 16, 2, 16, FALSE, 0, complain_overflow_bitfield,
- mips_fix_hi16_s,
- "HI16_S", FALSE, 0, 0x0000ffff, FALSE},
+ mips_fix_hi16_s,
+ "HI16_S", FALSE, 0, 0x0000ffff, FALSE},
{MIPS_RELOC_LO16, 0, 2, 16, FALSE, 0, complain_overflow_dont, 0,
"LO16", FALSE, 0, 0x0000ffff, FALSE},
};
@samp{YZ} in lop_fixr: it is xor:ed into the current location
minus @math{4 * L}. The first byte of the word is 0 or 1. If it
is 1, then @math{L = (@var{lowest 24 bits of word}) - 2^Z}, if 0,
- then @math{L = (@var{lowest 24 bits of word})}.
+ then @math{L = (@var{lowest 24 bits of word})}.
@item lop_file
0x9806YYZZ. @samp{Y} is the file number, @samp{Z} is count of
}
/* We always write the location as 64 bits; no use saving bytes
- here. */
+ here. */
mmo_write_tetra_raw (abfd, (LOP << 24) | (LOP_LOC << 16) | 2);
mmo_write_octa_raw (abfd, vma);
}
/* Not handled here. */
{
/* This would normally be an abort call since this can't happen, but
- we don't do that. */
+ we don't do that. */
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
-#include "libaout.h" /* BFD a.out internal data structures. */
+#include "libaout.h" /* BFD a.out internal data structures. */
#include <sys/param.h>
#include <sys/dir.h>
NULL,
- NULL /* Backend_data. */
+ NULL /* Backend_data. */
};
#define N_HEADER_IN_TEXT(x) 1
/* Determine if this is a shared library using the flags. */
-#define N_SHARED_LIB(x) (N_DYNAMIC (x))
+#define N_SHARED_LIB(x) (N_DYNAMIC (x))
/* We have 6 bits of flags and 10 bits of machine ID. */
#define N_MACHTYPE(execp) \
| (((flags) & 0x3f) << 24))
#define N_SET_MACHTYPE(execp, machtype) \
((execp)->a_info = \
- ((execp)->a_info & 0xfb00ffff) | ((((int) (machtype)) & 0x3ff) << 16))
+ ((execp)->a_info & 0xfb00ffff) | ((((int) (machtype)) & 0x3ff) << 16))
#define N_SET_FLAGS(execp, flags) \
((execp)->a_info = \
((execp)->a_info & 0x03ffffff) | ((flags & 0x03f) << 26))
#include "aout/aout64.h"
#include "aout/stab_gnu.h"
#include "aout/ar.h"
-#include "libaout.h" /* BFD a.out internal data structures */
+#include "libaout.h" /* BFD a.out internal data structures */
#include "aout-target.h"
#define nlm_core_file_p _bfd_dummy_target
-#define nlm_get_symtab_upper_bound nlmNAME (get_symtab_upper_bound)
-#define nlm_canonicalize_symtab nlmNAME (canonicalize_symtab)
-#define nlm_make_empty_symbol nlmNAME (make_empty_symbol)
-#define nlm_print_symbol nlmNAME (print_symbol)
-#define nlm_get_symbol_info nlmNAME (get_symbol_info)
+#define nlm_get_symtab_upper_bound nlmNAME (get_symtab_upper_bound)
+#define nlm_canonicalize_symtab nlmNAME (canonicalize_symtab)
+#define nlm_make_empty_symbol nlmNAME (make_empty_symbol)
+#define nlm_print_symbol nlmNAME (print_symbol)
+#define nlm_get_symbol_info nlmNAME (get_symbol_info)
#define nlm_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define nlm_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define nlm_bfd_is_local_label_name bfd_generic_is_local_label_name
#define nlm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define nlm_get_lineno _bfd_nosymbols_get_lineno
-#define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define nlm_find_line _bfd_nosymbols_find_line
-#define nlm_find_inliner_info _bfd_nosymbols_find_inliner_info
-#define nlm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define nlm_read_minisymbols _bfd_generic_read_minisymbols
-#define nlm_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-
-#define nlm_get_reloc_upper_bound nlmNAME (get_reloc_upper_bound)
-#define nlm_canonicalize_reloc nlmNAME (canonicalize_reloc)
+#define nlm_get_lineno _bfd_nosymbols_get_lineno
+#define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define nlm_find_line _bfd_nosymbols_find_line
+#define nlm_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define nlm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define nlm_read_minisymbols _bfd_generic_read_minisymbols
+#define nlm_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+
+#define nlm_get_reloc_upper_bound nlmNAME (get_reloc_upper_bound)
+#define nlm_canonicalize_reloc nlmNAME (canonicalize_reloc)
#define nlm_set_reloc _bfd_generic_set_reloc
-#define nlm_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
-#define nlm_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
-#define nlm_set_section_contents nlmNAME (set_section_contents)
-
-#define nlm_sizeof_headers _bfd_nolink_sizeof_headers
-#define nlm_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define nlm_bfd_relax_section bfd_generic_relax_section
-#define nlm_bfd_gc_sections bfd_generic_gc_sections
+#define nlm_bfd_reloc_type_lookup bfd_default_reloc_type_lookup
+#define nlm_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
+#define nlm_set_section_contents nlmNAME (set_section_contents)
+
+#define nlm_sizeof_headers _bfd_nolink_sizeof_headers
+#define nlm_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
+#define nlm_bfd_relax_section bfd_generic_relax_section
+#define nlm_bfd_gc_sections bfd_generic_gc_sections
#define nlm_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define nlm_bfd_merge_sections bfd_generic_merge_sections
-#define nlm_bfd_is_group_section bfd_generic_is_group_section
-#define nlm_bfd_discard_group bfd_generic_discard_group
-#define nlm_section_already_linked _bfd_generic_section_already_linked
-#define nlm_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define nlm_bfd_define_start_stop bfd_generic_define_start_stop
-#define nlm_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define nlm_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define nlm_bfd_link_just_syms _bfd_generic_link_just_syms
+#define nlm_bfd_merge_sections bfd_generic_merge_sections
+#define nlm_bfd_is_group_section bfd_generic_is_group_section
+#define nlm_bfd_discard_group bfd_generic_discard_group
+#define nlm_section_already_linked _bfd_generic_section_already_linked
+#define nlm_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define nlm_bfd_define_start_stop bfd_generic_define_start_stop
+#define nlm_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define nlm_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define nlm_bfd_link_just_syms _bfd_generic_link_just_syms
#define nlm_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
-#define nlm_bfd_final_link _bfd_generic_final_link
-#define nlm_bfd_link_split_section _bfd_generic_link_split_section
-#define nlm_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define nlm_bfd_final_link _bfd_generic_final_link
+#define nlm_bfd_link_split_section _bfd_generic_link_split_section
+#define nlm_bfd_link_check_relocs _bfd_generic_link_check_relocs
/* This structure contains everything that BFD knows about a target.
It includes things like its byte order, name, what routines to call
static reloc_howto_type nlm_powerpc_howto_table[] =
{
/* Standard 32 bit relocation. */
- HOWTO (0, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_POS", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffffffff, /* Source mask. */
- 0xffffffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_POS", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffffffff, /* Source mask. */
+ 0xffffffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* 32 bit relocation, but store negative value. */
- HOWTO (1, /* Type. */
- 0, /* Rightshift. */
- -2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (1, /* Type. */
+ 0, /* Rightshift. */
+ -2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_NEG", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffffffff, /* Source mask. */
- 0xffffffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_NEG", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffffffff, /* Source mask. */
+ 0xffffffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* 32 bit PC relative relocation. */
- HOWTO (2, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- TRUE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (2, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ TRUE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_REL", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffffffff, /* Source mask. */
- 0xffffffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_REL", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffffffff, /* Source mask. */
+ 0xffffffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* 16 bit TOC relative relocation. */
- HOWTO (3, /* Type. */
- 0, /* Rightshift. */
- 1, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (3, /* Type. */
+ 0, /* Rightshift. */
+ 1, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_TOC", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_TOC", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* I don't really know what this is. */
- HOWTO (4, /* Type. */
- 1, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (4, /* Type. */
+ 1, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_RTB", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffffffff, /* Source mask. */
- 0xffffffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_RTB", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffffffff, /* Source mask. */
+ 0xffffffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* External TOC relative symbol. */
- HOWTO (5, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (5, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_GL", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_GL", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* Local TOC relative symbol. */
- HOWTO (6, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (6, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_TCL", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_TCL", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
{ 7 },
/* Non modifiable absolute branch. */
- HOWTO (8, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 26, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (8, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 26, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_BA", /* Name. */
- TRUE, /* Partial_inplace. */
- 0x3fffffc, /* Source mask. */
- 0x3fffffc, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_BA", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0x3fffffc, /* Source mask. */
+ 0x3fffffc, /* Dest mask. */
+ FALSE), /* PC rel offset. */
{ 9 },
/* Non modifiable relative branch. */
- HOWTO (0xa, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 26, /* Bitsize. */
- TRUE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0xa, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 26, /* Bitsize. */
+ TRUE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_BR", /* Name. */
- TRUE, /* Partial_inplace. */
- 0x3fffffc, /* Source mask. */
- 0x3fffffc, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_BR", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0x3fffffc, /* Source mask. */
+ 0x3fffffc, /* Dest mask. */
+ FALSE), /* PC rel offset. */
{ 0xb },
/* Indirect load. */
- HOWTO (0xc, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0xc, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_RL", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_RL", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* Load address. */
- HOWTO (0xd, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0xd, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_RLA", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_RLA", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
{ 0xe },
/* Non-relocating reference. */
- HOWTO (0xf, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0xf, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_REF", /* Name. */
- FALSE, /* Partial_inplace. */
- 0, /* Source mask. */
- 0, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_REF", /* Name. */
+ FALSE, /* Partial_inplace. */
+ 0, /* Source mask. */
+ 0, /* Dest mask. */
+ FALSE), /* PC rel offset. */
{ 0x10 },
{ 0x11 },
/* TOC relative indirect load. */
- HOWTO (0x12, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0x12, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_TRL", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_TRL", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* TOC relative load address. */
- HOWTO (0x13, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0x13, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_TRLA", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_TRLA", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* Modifiable relative branch. */
- HOWTO (0x14, /* Type. */
- 1, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0x14, /* Type. */
+ 1, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_RRTBI", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffffffff, /* Source mask. */
- 0xffffffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_RRTBI", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffffffff, /* Source mask. */
+ 0xffffffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* Modifiable absolute branch. */
- HOWTO (0x15, /* Type. */
- 1, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0x15, /* Type. */
+ 1, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_RRTBA", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffffffff, /* Source mask. */
- 0xffffffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_RRTBA", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffffffff, /* Source mask. */
+ 0xffffffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* Modifiable call absolute indirect. */
- HOWTO (0x16, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0x16, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_CAI", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_CAI", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* Modifiable call relative. */
- HOWTO (0x17, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0x17, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_REL", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_REL", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* Modifiable branch absolute. */
- HOWTO (0x18, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0x18, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_RBA", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_RBA", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* Modifiable branch absolute. */
- HOWTO (0x19, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0x19, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_RBAC", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_RBAC", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* Modifiable branch relative. */
- HOWTO (0x1a, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 26, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0x1a, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 26, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_signed, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_REL", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE), /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_REL", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE), /* PC rel offset. */
/* Modifiable branch absolute. */
- HOWTO (0x1b, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 16, /* Bitsize. */
- FALSE, /* PC relative. */
- 0, /* Bitpos. */
+ HOWTO (0x1b, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 16, /* Bitsize. */
+ FALSE, /* PC relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- 0, /* Special_function. */
- "R_REL", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffff, /* Source mask. */
- 0xffff, /* Dest mask. */
- FALSE) /* PC rel offset. */
+ 0, /* Special_function. */
+ "R_REL", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffff, /* Source mask. */
+ 0xffff, /* Dest mask. */
+ FALSE) /* PC rel offset. */
};
#define HOWTO_COUNT (sizeof nlm_powerpc_howto_table \
/* Netware wants a list of relocs for each address.
Format is:
- long offset
- long addend
- char type
+ long offset
+ long addend
+ char type
That should be it. */
/* The value we write out is the offset into the appropriate
code sections
data sections
other sections (custom data, messages, help, shared NLM, RPC,
- module dependencies)
+ module dependencies)
relocation fixups
external references (imports)
public symbols (exports)
extern bfd_reloc_status_type _bfd_ns32k_relocate_contents (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *);
extern bfd_reloc_status_type _bfd_do_ns32k_reloc_contents (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *, bfd_vma (*) (bfd_byte *, int), void (*) (bfd_vma, bfd_byte *, int));
extern bfd_reloc_status_type _bfd_ns32k_final_link_relocate (reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma, bfd_vma, bfd_vma);
-extern bfd_vma _bfd_ns32k_get_displacement (bfd_byte *, int);
-extern bfd_vma _bfd_ns32k_get_immediate (bfd_byte *, int);
-extern void _bfd_ns32k_put_displacement (bfd_vma, bfd_byte *, int);
-extern void _bfd_ns32k_put_immediate (bfd_vma, bfd_byte *, int);
-extern bfd_reloc_status_type _bfd_ns32k_reloc_disp (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
-extern bfd_reloc_status_type _bfd_ns32k_reloc_imm (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+extern bfd_vma _bfd_ns32k_get_displacement (bfd_byte *, int);
+extern bfd_vma _bfd_ns32k_get_immediate (bfd_byte *, int);
+extern void _bfd_ns32k_put_displacement (bfd_vma, bfd_byte *, int);
+extern void _bfd_ns32k_put_immediate (bfd_vma, bfd_byte *, int);
+extern bfd_reloc_status_type _bfd_ns32k_reloc_disp (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
+extern bfd_reloc_status_type _bfd_ns32k_reloc_imm (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
#define SEGMENT_SIZE 4096
#define DEFAULT_ARCH bfd_arch_ns32k
-#define DEFAULT_MID M_532_NETBSD
+#define DEFAULT_MID M_532_NETBSD
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
}
#define oasys_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define oasys_find_line _bfd_nosymbols_find_line
+#define oasys_find_line _bfd_nosymbols_find_line
#define oasys_find_inliner_info _bfd_nosymbols_find_inliner_info
static int
return 0;
}
-#define oasys_close_and_cleanup _bfd_generic_close_and_cleanup
-#define oasys_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define oasys_slurp_armap bfd_true
-#define oasys_slurp_extended_name_table bfd_true
-#define oasys_construct_extended_name_table ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_true)
-#define oasys_truncate_arname bfd_dont_truncate_arname
-#define oasys_write_armap ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) bfd_true)
-#define oasys_read_ar_hdr bfd_nullvoidptr
+#define oasys_close_and_cleanup _bfd_generic_close_and_cleanup
+#define oasys_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define oasys_slurp_armap bfd_true
+#define oasys_slurp_extended_name_table bfd_true
+#define oasys_construct_extended_name_table ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_true)
+#define oasys_truncate_arname bfd_dont_truncate_arname
+#define oasys_write_armap ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) bfd_true)
+#define oasys_read_ar_hdr bfd_nullvoidptr
#define oasys_write_ar_hdr ((bfd_boolean (*) (bfd *, bfd *)) bfd_false)
-#define oasys_get_elt_at_index _bfd_generic_get_elt_at_index
-#define oasys_update_armap_timestamp bfd_true
-#define oasys_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define oasys_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define oasys_get_lineno _bfd_nosymbols_get_lineno
+#define oasys_get_elt_at_index _bfd_generic_get_elt_at_index
+#define oasys_update_armap_timestamp bfd_true
+#define oasys_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define oasys_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#define oasys_get_lineno _bfd_nosymbols_get_lineno
#define oasys_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define oasys_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define oasys_read_minisymbols _bfd_generic_read_minisymbols
-#define oasys_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-#define oasys_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
-#define oasys_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
-#define oasys_set_arch_mach bfd_default_set_arch_mach
-#define oasys_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define oasys_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define oasys_read_minisymbols _bfd_generic_read_minisymbols
+#define oasys_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define oasys_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+#define oasys_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
+#define oasys_set_arch_mach bfd_default_set_arch_mach
+#define oasys_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
#define oasys_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define oasys_bfd_relax_section bfd_generic_relax_section
-#define oasys_bfd_gc_sections bfd_generic_gc_sections
-#define oasys_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define oasys_bfd_merge_sections bfd_generic_merge_sections
-#define oasys_bfd_is_group_section bfd_generic_is_group_section
-#define oasys_bfd_discard_group bfd_generic_discard_group
-#define oasys_section_already_linked _bfd_generic_section_already_linked
-#define oasys_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define oasys_bfd_define_start_stop bfd_generic_define_start_stop
-#define oasys_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define oasys_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define oasys_bfd_link_just_syms _bfd_generic_link_just_syms
+#define oasys_bfd_relax_section bfd_generic_relax_section
+#define oasys_bfd_gc_sections bfd_generic_gc_sections
+#define oasys_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define oasys_bfd_merge_sections bfd_generic_merge_sections
+#define oasys_bfd_is_group_section bfd_generic_is_group_section
+#define oasys_bfd_discard_group bfd_generic_discard_group
+#define oasys_section_already_linked _bfd_generic_section_already_linked
+#define oasys_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define oasys_bfd_define_start_stop bfd_generic_define_start_stop
+#define oasys_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define oasys_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define oasys_bfd_link_just_syms _bfd_generic_link_just_syms
#define oasys_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
-#define oasys_bfd_final_link _bfd_generic_final_link
-#define oasys_bfd_link_split_section _bfd_generic_link_split_section
-#define oasys_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define oasys_bfd_final_link _bfd_generic_final_link
+#define oasys_bfd_link_split_section _bfd_generic_link_split_section
+#define oasys_bfd_link_check_relocs _bfd_generic_link_check_relocs
#define oasys_set_reloc _bfd_generic_set_reloc
const bfd_target oasys_vec =
SYNOPSIS
bfd *bfd_fopen (const char *filename, const char *target,
- const char *mode, int fd);
+ const char *mode, int fd);
DESCRIPTION
Open the file @var{filename} with the target @var{target}.
SYNOPSIS
bfd *bfd_openstreamr (const char * filename, const char * target,
- void * stream);
+ void * stream);
DESCRIPTION
Open a BFD for read access on an existing stdio stream. When
bfd_openr_iovec
SYNOPSIS
- bfd *bfd_openr_iovec (const char *filename, const char *target,
- void *(*open_func) (struct bfd *nbfd,
- void *open_closure),
- void *open_closure,
- file_ptr (*pread_func) (struct bfd *nbfd,
- void *stream,
- void *buf,
- file_ptr nbytes,
- file_ptr offset),
- int (*close_func) (struct bfd *nbfd,
- void *stream),
+ bfd *bfd_openr_iovec (const char *filename, const char *target,
+ void *(*open_func) (struct bfd *nbfd,
+ void *open_closure),
+ void *open_closure,
+ file_ptr (*pread_func) (struct bfd *nbfd,
+ void *stream,
+ void *buf,
+ file_ptr nbytes,
+ file_ptr offset),
+ int (*close_func) (struct bfd *nbfd,
+ void *stream),
int (*stat_func) (struct bfd *abfd,
- void *stream,
- struct stat *sb));
+ void *stream,
+ struct stat *sb));
DESCRIPTION
- Create and return a BFD backed by a read-only @var{stream}.
- The @var{stream} is created using @var{open_func}, accessed using
- @var{pread_func} and destroyed using @var{close_func}.
+ Create and return a BFD backed by a read-only @var{stream}.
+ The @var{stream} is created using @var{open_func}, accessed using
+ @var{pread_func} and destroyed using @var{close_func}.
Calls <<bfd_find_target>>, so @var{target} is interpreted as by
that function.
int prot ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED,
file_ptr offset ATTRIBUTE_UNUSED,
- void **map_addr ATTRIBUTE_UNUSED,
- bfd_size_type *map_len ATTRIBUTE_UNUSED)
+ void **map_addr ATTRIBUTE_UNUSED,
+ bfd_size_type *map_len ATTRIBUTE_UNUSED)
{
return (void *) -1;
}
SYNOPSIS
char *bfd_get_alt_debug_link_info (bfd * abfd,
bfd_size_type *buildid_len,
- bfd_byte **buildid_out);
+ bfd_byte **buildid_out);
DESCRIPTION
Fetch the filename and BuildID value for any alternate debuginfo
typedef bfd_boolean (* check_func_type) (const char *, void *);
static char *
-find_separate_debug_file (bfd * abfd,
- const char * debug_file_directory,
- bfd_boolean include_dirs,
- get_func_type get_func,
+find_separate_debug_file (bfd * abfd,
+ const char * debug_file_directory,
+ bfd_boolean include_dirs,
+ get_func_type get_func,
check_func_type check_func,
- void * func_data)
+ void * func_data)
{
char *base;
char *dir;
debugfile = (char *)
bfd_malloc (strlen (debug_file_directory) + 1
- + (canon_dirlen > dirlen ? canon_dirlen : dirlen)
- + strlen (".debug/")
+ + (canon_dirlen > dirlen ? canon_dirlen : dirlen)
+ + strlen (".debug/")
#ifdef EXTRA_DEBUG_ROOT1
+ strlen (EXTRA_DEBUG_ROOT1)
#endif
#ifdef EXTRA_DEBUG_ROOT2
+ strlen (EXTRA_DEBUG_ROOT2)
#endif
- + strlen (base)
- + 1);
+ + strlen (base)
+ + 1);
if (debugfile == NULL)
goto found; /* Actually this returns NULL. */
/* Written by Ian Dall
- 19-Apr-94
+ 19-Apr-94
Formerly part of aout-pc532-mach.c. Split out to allow more
flexibility with multiple formats. */
#define SEGMENT__SIZE TARGET_PAGE_SIZE
#define DEFAULT_ARCH bfd_arch_pdp11
-#define DEFAULT_MID M_PDP11
+#define DEFAULT_MID M_PDP11
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
bfd_byte e_entry[2]; /* Start address. */
bfd_byte e_unused[2]; /* Not used. */
bfd_byte e_flag[2]; /* Relocation info stripped. */
- bfd_byte e_relocatable; /* Ugly hack. */
+ bfd_byte e_relocatable; /* Ugly hack. */
};
#define EXEC_BYTES_SIZE (8 * 2)
reloc_howto_type howto_table_pdp11[] =
{
- /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */
+ /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */
HOWTO( 0, 0, 1, 16, FALSE, 0, complain_overflow_signed,0,"16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
HOWTO( 1, 0, 1, 16, TRUE, 0, complain_overflow_signed,0,"DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
};
static bfd_boolean aout_link_check_archive_element (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, const char *, bfd_boolean *);
-static bfd_boolean aout_link_add_object_symbols (bfd *, struct bfd_link_info *);
-static bfd_boolean aout_link_add_symbols (bfd *, struct bfd_link_info *);
-static bfd_boolean aout_link_write_symbols (struct aout_final_link_info *, bfd *);
+static bfd_boolean aout_link_add_object_symbols (bfd *, struct bfd_link_info *);
+static bfd_boolean aout_link_add_symbols (bfd *, struct bfd_link_info *);
+static bfd_boolean aout_link_write_symbols (struct aout_final_link_info *, bfd *);
reloc_howto_type *
struct stat stat_buf;
/* The original heuristic doesn't work in some important cases.
- The a.out file has no information about the text start
- address. For files (like kernels) linked to non-standard
- addresses (ld -Ttext nnn) the entry point may not be between
- the default text start (obj_textsec(abfd)->vma) and
- (obj_textsec(abfd)->vma) + text size. This is not just a mach
- issue. Many kernels are loaded at non standard addresses. */
+ The a.out file has no information about the text start
+ address. For files (like kernels) linked to non-standard
+ addresses (ld -Ttext nnn) the entry point may not be between
+ the default text start (obj_textsec(abfd)->vma) and
+ (obj_textsec(abfd)->vma) + text size. This is not just a mach
+ issue. Many kernels are loaded at non standard addresses. */
if (abfd->iostream != NULL
&& (abfd->flags & BFD_IN_MEMORY) == 0
&& (fstat(fileno((FILE *) (abfd->iostream)), &stat_buf) == 0)
case 0:
case 2000:
case bfd_mach_mips3000:
- arch_flags = M_MIPS1;
+ arch_flags = M_MIPS1;
break;
case bfd_mach_mips4000: /* MIPS3 */
case bfd_mach_mips4400:
case bfd_mach_mips8000: /* MIPS4 */
case bfd_mach_mips6000: /* Real MIPS2: */
- arch_flags = M_MIPS2;
+ arch_flags = M_MIPS2;
break;
default:
arch_flags = M_UNKNOWN;
case bfd_arch_ns32k:
switch (machine)
{
- case 0: arch_flags = M_NS32532; break;
+ case 0: arch_flags = M_NS32532; break;
case 32032: arch_flags = M_NS32032; break;
case 32532: arch_flags = M_NS32532; break;
default: arch_flags = M_UNKNOWN; break;
else
{
/* The VMA of the .bss section is set by the VMA of the
- .data section plus the size of the .data section. We may
- need to add padding bytes to make this true. */
+ .data section plus the size of the .data section. We may
+ need to add padding bytes to make this true. */
pad = obj_bsssec (abfd)->vma - vma;
if (pad > 0)
{
else
{
/* The .text section is being loaded at an unusual address. We
- may need to pad it such that the .data section starts at a page
- boundary. */
+ may need to pad it such that the .data section starts at a page
+ boundary. */
if (ztih)
text_pad = ((obj_textsec (abfd)->filepos - obj_textsec (abfd)->vma)
& (adata (abfd).page_size - 1));
str;
}),
obj_textsec(abfd)->vma, obj_textsec(abfd)->size,
- obj_textsec(abfd)->alignment_power,
+ obj_textsec(abfd)->alignment_power,
obj_datasec(abfd)->vma, obj_datasec(abfd)->size,
- obj_datasec(abfd)->alignment_power,
+ obj_datasec(abfd)->alignment_power,
obj_bsssec(abfd)->vma, obj_bsssec(abfd)->size,
- obj_bsssec(abfd)->alignment_power);
+ obj_bsssec(abfd)->alignment_power);
#endif
#endif
#ifdef BFD_AOUT_DEBUG
fprintf (stderr, " text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x>\n",
obj_textsec(abfd)->vma, obj_textsec(abfd)->size,
- obj_textsec(abfd)->filepos,
+ obj_textsec(abfd)->filepos,
obj_datasec(abfd)->vma, obj_datasec(abfd)->size,
- obj_datasec(abfd)->filepos,
+ obj_datasec(abfd)->filepos,
obj_bsssec(abfd)->vma, obj_bsssec(abfd)->size);
#endif
to give the true offset from the section */
-#define MOVE_ADDRESS(ad) \
- if (r_extern) \
+#define MOVE_ADDRESS(ad) \
+ if (r_extern) \
{ \
/* Undefined symbol. */ \
cache_ptr->sym_ptr_ptr = symbols + r_index; \
} \
else \
{ \
- /* Defined, section relative. replace symbol with pointer to \
+ /* Defined, section relative. replace symbol with pointer to \
symbol which points to section. */ \
switch (r_index) \
{ \
}
static void
-pdp11_aout_swap_reloc_in (bfd * abfd,
- bfd_byte * bytes,
- arelent * cache_ptr,
- bfd_size_type offset,
- asymbol ** symbols,
- bfd_size_type symcount)
+pdp11_aout_swap_reloc_in (bfd * abfd,
+ bfd_byte * bytes,
+ arelent * cache_ptr,
+ bfd_size_type offset,
+ asymbol ** symbols,
+ bfd_size_type symcount)
{
struct aoutdata *su = &(abfd->tdata.aout_data->a);
unsigned int r_index;
if (r_extern && r_index > symcount)
{
/* We could arrange to return an error, but it might be useful
- to see the file even if it is bad. */
+ to see the file even if it is bad. */
r_extern = 0;
r_index = N_ABS;
}
definition of the symbol is undefined or common. If the
current definition is common, we have a case in which we
have already seen an object file including
- int a;
+ int a;
and this object file from the archive includes
- int a = 5;
+ int a = 5;
In such a case we must include this object file.
FIXME: The SunOS 4.1.3 linker will pull in the archive
return TRUE;
case bfd_link_hash_new:
/* This can happen for set symbols when sets are not being
- built. */
+ built. */
return TRUE;
case bfd_link_hash_undefined:
type = N_UNDF | N_EXT;
if (h != NULL)
{
/* We decided to strip this symbol, but it
- turns out that we can't. Note that we
- lose the other and desc information here.
- I don't think that will ever matter for a
- global symbol. */
+ turns out that we can't. Note that we
+ lose the other and desc information here.
+ I don't think that will ever matter for a
+ global symbol. */
if (h->indx < 0)
{
h->indx = -2;
}
/* Now warn if a global symbol is undefined. We could not
- do this earlier, because check_dynamic_reloc might want
- to skip this reloc. */
+ do this earlier, because check_dynamic_reloc might want
+ to skip this reloc. */
if (hundef && ! bfd_link_pic (flaginfo->info))
{
const char *name;
bfd_boolean copy;
/* We set *symbol_map to 0 above for all symbols. If it has
- already been set to -1 for this symbol, it means that we are
- discarding it because it appears in a duplicate header file.
- See the N_BINCL code below. */
+ already been set to -1 for this symbol, it means that we are
+ discarding it because it appears in a duplicate header file.
+ See the N_BINCL code below. */
if (*symbol_map == -1)
continue;
/* Initialize *symbol_map to -1, which means that the symbol was
- not copied into the output file. We will change it later if
- we do copy the symbol over. */
+ not copied into the output file. We will change it later if
+ we do copy the symbol over. */
*symbol_map = -1;
type = H_GET_8 (input_bfd, sym->e_type);
h = *sym_hash;
/* Use the name from the hash table, in case the symbol was
- wrapped. */
+ wrapped. */
if (h != NULL)
name = h->root.root.string;
}
/* If we have already included a header file with the
- same value, then replace this one with an N_EXCL
- symbol. */
+ same value, then replace this one with an N_EXCL
+ symbol. */
copy = ! flaginfo->info->keep_memory;
incl_entry = aout_link_includes_lookup (&flaginfo->includes,
name, TRUE, copy);
if (t == NULL)
{
/* This is the first time we have seen this header
- file with this set of stabs strings. */
+ file with this set of stabs strings. */
t = bfd_hash_allocate (&flaginfo->includes.root,
sizeof *t);
if (t == NULL)
int *incl_map;
/* This is a duplicate header file. We must change
- it to be an N_EXCL entry, and mark all the
- included symbols to prevent outputting them. */
+ it to be an N_EXCL entry, and mark all the
+ included symbols to prevent outputting them. */
type = N_EXCL;
nest = 0;
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
bfd_getp32, bfd_getp_signed_32, bfd_putp32,
bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Headers. */
- {_bfd_dummy_target, MY_object_p, /* bfd_check_format. */
+ {_bfd_dummy_target, MY_object_p, /* bfd_check_format. */
bfd_generic_archive_p, MY_core_file_p},
{bfd_false, MY_mkobject, /* bfd_set_format. */
_bfd_generic_mkarchive, bfd_false},
- {bfd_false, MY_write_object_contents, /* bfd_write_contents. */
+ {bfd_false, MY_write_object_contents, /* bfd_write_contents. */
_bfd_write_archive_contents, bfd_false},
BFD_JUMP_TABLE_GENERIC (MY),
#ifndef TARGET_LITTLE_SYM
#define TARGET_LITTLE_SYM arm_pe_le_vec
#define TARGET_LITTLE_NAME "pe-arm-little"
-#define TARGET_BIG_SYM arm_pe_be_vec
-#define TARGET_BIG_NAME "pe-arm-big"
+#define TARGET_BIG_SYM arm_pe_be_vec
+#define TARGET_BIG_NAME "pe-arm-big"
#endif
#define COFF_WITH_PE
-#define PCRELOFFSET TRUE
+#define PCRELOFFSET TRUE
#define COFF_LONG_SECTION_NAMES
#define COFF_SECTION_ALIGNMENT_ENTRIES \
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SYM i386_pe_vec
-#define TARGET_NAME "pe-i386"
+#define TARGET_SYM i386_pe_vec
+#define TARGET_NAME "pe-i386"
#define COFF_WITH_PE
-#define PCRELOFFSET TRUE
-#define TARGET_UNDERSCORE '_'
+#define PCRELOFFSET TRUE
+#define TARGET_UNDERSCORE '_'
#define COFF_LONG_SECTION_NAMES
#define COFF_SUPPORT_GNU_LINKONCE
#define COFF_LONG_FILENAMES
#include "bfd.h"
#ifndef TARGET_BIG_SYM
-#define TARGET_BIG_SYM mcore_pe_be_vec
-#define TARGET_BIG_NAME "pe-mcore-big"
+#define TARGET_BIG_SYM mcore_pe_be_vec
+#define TARGET_BIG_NAME "pe-mcore-big"
#define TARGET_LITTLE_SYM mcore_pe_le_vec
#define TARGET_LITTLE_NAME "pe-mcore-little"
#endif
#define COFF_WITH_PE
-#define PCRELOFFSET TRUE
+#define PCRELOFFSET TRUE
#define COFF_LONG_SECTION_NAMES
#define MCORE_PE
FALSE, /* PC_relative. */
0, /* Bitpos. */
complain_overflow_dont, /* Complain_on_overflow. */
- /* This needs complex overflow
+ /* This needs complex overflow
detection, because the upper four
bits must match the PC. */
coff_mips_reloc, /* Special_function. */
EMPTY_HOWTO (31),
EMPTY_HOWTO (32),
EMPTY_HOWTO (33),
- HOWTO (MIPS_R_RVA, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (MIPS_R_RVA, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- coff_mips_reloc, /* Special_function. */
- "rva32", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffffffff, /* Src_mask. */
- 0xffffffff, /* Dst_mask. */
- FALSE), /* Pcrel_offset. */
+ coff_mips_reloc, /* Special_function. */
+ "rva32", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffffffff, /* Src_mask. */
+ 0xffffffff, /* Dst_mask. */
+ FALSE), /* Pcrel_offset. */
EMPTY_HOWTO (35),
EMPTY_HOWTO (36),
- HOWTO (MIPS_R_PAIR, /* Type. */
- 0, /* Rightshift. */
- 2, /* Size (0 = byte, 1 = short, 2 = long). */
- 32, /* Bitsize. */
- FALSE, /* PC_relative. */
- 0, /* Bitpos. */
+ HOWTO (MIPS_R_PAIR, /* Type. */
+ 0, /* Rightshift. */
+ 2, /* Size (0 = byte, 1 = short, 2 = long). */
+ 32, /* Bitsize. */
+ FALSE, /* PC_relative. */
+ 0, /* Bitpos. */
complain_overflow_bitfield, /* Complain_on_overflow. */
- coff_mips_reloc, /* Special_function. */
- "PAIR", /* Name. */
- TRUE, /* Partial_inplace. */
- 0xffffffff, /* Src_mask. */
- 0xffffffff, /* Dst_mask. */
- FALSE), /* Pcrel_offset. */
+ coff_mips_reloc, /* Special_function. */
+ "PAIR", /* Name. */
+ TRUE, /* Partial_inplace. */
+ 0xffffffff, /* Src_mask. */
+ 0xffffffff, /* Dst_mask. */
+ FALSE), /* Pcrel_offset. */
};
#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0]))
/* Turn a howto into a reloc nunmber. */
#define SELECT_RELOC(x, howto) { x.r_type = howto->type; }
-#define BADMAG(x) MIPSBADMAG (x)
+#define BADMAG(x) MIPSBADMAG (x)
/* Customize coffcode.h. */
#define MIPS 1
coff_symbol_type *coffsym = NULL; \
if (ptr && bfd_asymbol_bfd (ptr) != abfd) \
coffsym = (obj_symbols (abfd) \
- + (cache_ptr->sym_ptr_ptr - symbols)); \
+ + (cache_ptr->sym_ptr_ptr - symbols)); \
else if (ptr) \
coffsym = coff_symbol_from (ptr); \
if (coffsym != NULL \
*addendp -= 4;
/* If the symbol is defined, then the generic code is going to
- add back the symbol value in order to cancel out an
- adjustment it made to the addend. However, we set the addend
- to 0 at the start of this function. We need to adjust here,
- to avoid the adjustment the generic code will make. FIXME:
- This is getting a bit hackish. */
+ add back the symbol value in order to cancel out an
+ adjustment it made to the addend. However, we set the addend
+ to 0 at the start of this function. We need to adjust here,
+ to avoid the adjustment the generic code will make. FIXME:
+ This is getting a bit hackish. */
if (sym != NULL && sym->n_scnum != 0)
*addendp -= sym->n_value;
}
return howto;
}
-#define coff_rtype_to_howto coff_mips_rtype_to_howto
+#define coff_rtype_to_howto coff_mips_rtype_to_howto
#define coff_bfd_reloc_type_lookup coff_mips_reloc_type_lookup
#define coff_bfd_reloc_name_lookup coff_mips_reloc_name_lookup
}
/* COFF treats common symbols in one of two ways. Either the
- size of the symbol is included in the section contents, or it
- is not. We assume that the size is not included, and force
- the rtype_to_howto function to adjust the addend as needed. */
+ size of the symbol is included in the section contents, or it
+ is not. We assume that the size is not included, and force
+ the rtype_to_howto function to adjust the addend as needed. */
if (sym != NULL && sym->n_scnum != 0)
addend = - sym->n_value;
return FALSE;
/* If we are doing a relocatable link, then we can just ignore
- a PC relative reloc that is pcrel_offset. It will already
- have the correct value. If this is not a relocatable link,
- then we should ignore the symbol value. */
+ a PC relative reloc that is pcrel_offset. It will already
+ have the correct value. If this is not a relocatable link,
+ then we should ignore the symbol value. */
if (howto->pc_relative && howto->pcrel_offset)
{
if (bfd_link_relocatable (info))
else
{
sec = sections[symndx];
- val = (sec->output_section->vma
+ val = (sec->output_section->vma
+ sec->output_offset
+ sym->n_value);
if (! obj_pe (input_bfd))
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SYM x86_64_pe_vec
-#define TARGET_NAME "pe-x86-64"
+#define TARGET_SYM x86_64_pe_vec
+#define TARGET_NAME "pe-x86-64"
#define COFF_WITH_PE
#define COFF_WITH_pex64
#define COFF_WITH_PE_BIGOBJ
-#define PCRELOFFSET TRUE
+#define PCRELOFFSET TRUE
#if defined (USE_MINGW64_LEADING_UNDERSCORES)
-#define TARGET_UNDERSCORE '_'
+#define TARGET_UNDERSCORE '_'
#else
-#define TARGET_UNDERSCORE 0
+#define TARGET_UNDERSCORE 0
#endif
#define COFF_LONG_SECTION_NAMES
#define COFF_SUPPORT_GNU_LINKONCE
int in_class,
int indx ATTRIBUTE_UNUSED,
int numaux ATTRIBUTE_UNUSED,
- void * in1)
+ void * in1)
{
AUXENT *ext = (AUXENT *) ext1;
union internal_auxent *in = (union internal_auxent *) in1;
for (idx = 0; idx < a->NumberOfRvaAndSizes; idx++)
{
- /* If data directory is empty, rva also should be 0. */
+ /* If data directory is empty, rva also should be 0. */
int size =
H_GET_32 (abfd, src->DataDirectory[idx][1]);
}
else
{
- ps = 0;
- ss = scnhdr_int->s_size;
+ ps = 0;
+ ss = scnhdr_int->s_size;
}
}
else
typedef struct
{
- const char * section_name;
+ const char * section_name;
unsigned long must_have;
}
pe_required_section_flags;
}
/* Although we could encode 0xffff relocs here, we do not, to be
- consistent with other parts of bfd. Also it lets us warn, as
- we should never see 0xffff here w/o having the overflow flag
- set. */
+ consistent with other parts of bfd. Also it lets us warn, as
+ we should never see 0xffff here w/o having the overflow flag
+ set. */
if (scnhdr_int->s_nreloc < 0xffff)
H_PUT_16 (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc);
else
cvinfo->Age = H_GET_32(abfd, cvinfo70->Age);
/* A GUID consists of 4,2,2 byte values in little-endian order, followed
- by 8 single bytes. Byte swap them so we can conveniently treat the GUID
- as 16 bytes in big-endian order. */
+ by 8 single bytes. Byte swap them so we can conveniently treat the GUID
+ as 16 bytes in big-endian order. */
bfd_putb32 (bfd_getl32 (cvinfo70->Signature), cvinfo->Signature);
bfd_putb16 (bfd_getl16 (&(cvinfo70->Signature[4])), &(cvinfo->Signature[4]));
bfd_putb16 (bfd_getl16 (&(cvinfo70->Signature[6])), &(cvinfo->Signature[6]));
return cvinfo;
}
else if ((cvinfo->CVSignature == CVINFO_PDB20_CVSIGNATURE)
- && (length > sizeof (CV_INFO_PDB20)))
+ && (length > sizeof (CV_INFO_PDB20)))
{
CV_INFO_PDB20 *cvinfo20 = (CV_INFO_PDB20 *)(buffer);
cvinfo->Age = H_GET_32(abfd, cvinfo20->Age);
return TRUE;
}
else if (!(section->flags & SEC_HAS_CONTENTS))
- {
+ {
fprintf (file,
_("\nThere is an import table in %s, but that section has no contents\n"),
section->name);
return TRUE;
- }
+ }
}
/* xgettext:c-format */
offset = abfd->start_address - rel_section->vma;
if (offset >= rel_section->size || offset + 8 > rel_section->size)
- {
- if (data != NULL)
- free (data);
- return FALSE;
- }
+ {
+ if (data != NULL)
+ free (data);
+ return FALSE;
+ }
start_address = bfd_get_32 (abfd, data + offset);
loadable_toc_address = bfd_get_32 (abfd, data + offset + 4);
break;
if (dll_name - adj >= section->size)
- break;
+ break;
dll = (char *) data + dll_name - adj;
/* PR 17512 file: 078-12277-0.004. */
bfd_vma adj;
struct EDT_type
{
- long export_flags; /* Reserved - should be zero. */
+ long export_flags; /* Reserved - should be zero. */
long time_stamp;
short major_ver;
short minor_ver;
- bfd_vma name; /* RVA - relative to image base. */
- long base; /* Ordinal base. */
+ bfd_vma name; /* RVA - relative to image base. */
+ long base; /* Ordinal base. */
unsigned long num_functions;/* Number in the export address table. */
- unsigned long num_names; /* Number in the name pointer table. */
+ unsigned long num_names; /* Number in the name pointer table. */
bfd_vma eat_addr; /* RVA to the export address table. */
bfd_vma npt_addr; /* RVA to the Export Name Pointer Table. */
bfd_vma ot_addr; /* RVA to the Ordinal Table. */
return TRUE;
}
else if (!(section->flags & SEC_HAS_CONTENTS))
- {
+ {
fprintf (file,
_("\nThere is an export table in %s, but that section has no contents\n"),
section->name);
return TRUE;
- }
+ }
dataoff = addr - section->vma;
datasize = extra->DataDirectory[PE_EXPORT_TABLE].Size;
return FALSE;
/* Go get Export Directory Table. */
- edt.export_flags = bfd_get_32 (abfd, data + 0);
- edt.time_stamp = bfd_get_32 (abfd, data + 4);
- edt.major_ver = bfd_get_16 (abfd, data + 8);
- edt.minor_ver = bfd_get_16 (abfd, data + 10);
- edt.name = bfd_get_32 (abfd, data + 12);
- edt.base = bfd_get_32 (abfd, data + 16);
+ edt.export_flags = bfd_get_32 (abfd, data + 0);
+ edt.time_stamp = bfd_get_32 (abfd, data + 4);
+ edt.major_ver = bfd_get_16 (abfd, data + 8);
+ edt.minor_ver = bfd_get_16 (abfd, data + 10);
+ edt.name = bfd_get_32 (abfd, data + 12);
+ edt.base = bfd_get_32 (abfd, data + 16);
edt.num_functions = bfd_get_32 (abfd, data + 20);
- edt.num_names = bfd_get_32 (abfd, data + 24);
- edt.eat_addr = bfd_get_32 (abfd, data + 28);
- edt.npt_addr = bfd_get_32 (abfd, data + 32);
- edt.ot_addr = bfd_get_32 (abfd, data + 36);
+ edt.num_names = bfd_get_32 (abfd, data + 24);
+ edt.eat_addr = bfd_get_32 (abfd, data + 28);
+ edt.npt_addr = bfd_get_32 (abfd, data + 32);
+ edt.ot_addr = bfd_get_32 (abfd, data + 36);
adj = section->vma - extra->ImageBase + dataoff;
forward the call to another dll. Something like:
typedef union
{
- long export_rva;
- long forwarder_rva;
+ long export_rva;
+ long forwarder_rva;
} export_address_table_entry; */
fprintf (file,
if (i + PDATA_ROW_SIZE > stop)
break;
- begin_addr = GET_PDATA_ENTRY (abfd, data + i );
- end_addr = GET_PDATA_ENTRY (abfd, data + i + 4);
+ begin_addr = GET_PDATA_ENTRY (abfd, data + i );
+ end_addr = GET_PDATA_ENTRY (abfd, data + i + 4);
eh_handler = GET_PDATA_ENTRY (abfd, data + i + 8);
- eh_data = GET_PDATA_ENTRY (abfd, data + i + 12);
+ eh_data = GET_PDATA_ENTRY (abfd, data + i + 12);
prolog_end_addr = GET_PDATA_ENTRY (abfd, data + i + 16);
if (begin_addr == 0 && end_addr == 0 && eh_handler == 0
typedef struct sym_cache
{
- int symcount;
+ int symcount;
asymbol ** syms;
} sym_cache;
fprintf (file, "%2d %2d ", flag32bit, exception_flag);
/* Get the exception handler's address and the data passed from the
- .text section. This is really the data that belongs with the .pdata
- but got "compressed" out for the ARM and SH4 architectures. */
+ .text section. This is really the data that belongs with the .pdata
+ but got "compressed" out for the ARM and SH4 architectures. */
tsection = bfd_get_section_by_name (abfd, ".text");
if (tsection && coff_section_data (abfd, tsection)
&& pei_section_data (abfd, tsection))
or section_end + 1 upon failure. */
static bfd_byte *
-rsrc_print_resource_entries (FILE * file,
- bfd * abfd,
+rsrc_print_resource_entries (FILE * file,
+ bfd * abfd,
unsigned int indent,
bfd_boolean is_name,
- bfd_byte * data,
+ bfd_byte * data,
rsrc_regions * regions,
- bfd_vma rva_bias)
+ bfd_vma rva_bias)
{
unsigned long entry, addr, size;
bfd_byte * leaf;
#define min(a,b) ((a) < (b) ? (a) : (b))
static bfd_byte *
-rsrc_print_resource_directory (FILE * file,
- bfd * abfd,
+rsrc_print_resource_directory (FILE * file,
+ bfd * abfd,
unsigned int indent,
bfd_byte * data,
rsrc_regions * regions,
- bfd_vma rva_bias)
+ bfd_vma rva_bias)
{
unsigned int num_names, num_ids;
bfd_byte * highest_data = data;
for (section = abfd->sections; section != NULL; section = section->next)
{
if ((addr >= section->vma) && (addr < (section->vma + section->size)))
- break;
+ break;
}
if (section == NULL)
{
fprintf (file,
- _("\nThere is a debug directory, but the section containing it could not be found\n"));
+ _("\nThere is a debug directory, but the section containing it could not be found\n"));
return TRUE;
}
else if (!(section->flags & SEC_HAS_CONTENTS))
{
fprintf (file,
- _("\nThere is a debug directory in %s, but that section has no contents\n"),
- section->name);
+ _("\nThere is a debug directory in %s, but that section has no contents\n"),
+ section->name);
return TRUE;
}
else if (section->size < size)
{
fprintf (file,
- _("\nError: section %s contains the debug data starting address but it is too small\n"),
- section->name);
+ _("\nError: section %s contains the debug data starting address but it is too small\n"),
+ section->name);
return FALSE;
}
_bfd_XXi_swap_debugdir_in (abfd, ext, &idd);
if ((idd.Type) >= IMAGE_NUMBEROF_DEBUG_TYPES)
- type_name = debug_type_names[0];
+ type_name = debug_type_names[0];
else
- type_name = debug_type_names[idd.Type];
+ type_name = debug_type_names[idd.Type];
fprintf (file, " %2ld %14s %08lx %08lx %08lx\n",
idd.Type, type_name, idd.SizeOfData,
idd.AddressOfRawData, idd.PointerToRawData);
if (idd.Type == PE_IMAGE_DEBUG_TYPE_CODEVIEW)
- {
- char signature[CV_INFO_SIGNATURE_LENGTH * 2 + 1];
+ {
+ char signature[CV_INFO_SIGNATURE_LENGTH * 2 + 1];
/* PR 17512: file: 065-29434-0.001:0.1
We need to use a 32-bit aligned buffer
to safely read in a codeview record. */
- char buffer[256 + 1] ATTRIBUTE_ALIGNED_ALIGNOF (CODEVIEW_INFO);
+ char buffer[256 + 1] ATTRIBUTE_ALIGNED_ALIGNOF (CODEVIEW_INFO);
- CODEVIEW_INFO *cvinfo = (CODEVIEW_INFO *) buffer;
+ CODEVIEW_INFO *cvinfo = (CODEVIEW_INFO *) buffer;
- /* The debug entry doesn't have to have to be in a section,
+ /* The debug entry doesn't have to have to be in a section,
in which case AddressOfRawData is 0, so always use PointerToRawData. */
- if (!_bfd_XXi_slurp_codeview_record (abfd, (file_ptr) idd.PointerToRawData,
+ if (!_bfd_XXi_slurp_codeview_record (abfd, (file_ptr) idd.PointerToRawData,
idd.SizeOfData, cvinfo))
- continue;
+ continue;
- for (i = 0; i < cvinfo->SignatureLength; i++)
- sprintf (&signature[i*2], "%02x", cvinfo->Signature[i] & 0xff);
+ for (i = 0; i < cvinfo->SignatureLength; i++)
+ sprintf (&signature[i*2], "%02x", cvinfo->Signature[i] & 0xff);
/* xgettext:c-format */
- fprintf (file, _("(format %c%c%c%c signature %s age %ld)\n"),
+ fprintf (file, _("(format %c%c%c%c signature %s age %ld)\n"),
buffer[0], buffer[1], buffer[2], buffer[3],
signature, cvinfo->Age);
- }
+ }
}
if (size % sizeof (struct external_IMAGE_DEBUG_DIRECTORY) != 0)
fprintf (file,
- _("The debug directory size is not a multiple of the debug directory entry size\n"));
+ _("The debug directory size is not a multiple of the debug directory entry size\n"));
return TRUE;
}
bfd_byte *data;
if (section && bfd_malloc_and_get_section (obfd, section, &data))
- {
- unsigned int i;
- struct external_IMAGE_DEBUG_DIRECTORY *dd =
+ {
+ unsigned int i;
+ struct external_IMAGE_DEBUG_DIRECTORY *dd =
(struct external_IMAGE_DEBUG_DIRECTORY *)(data + (addr - section->vma));
/* PR 17512: file: 0f15796a. */
return FALSE;
}
- for (i = 0; i < ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size
+ for (i = 0; i < ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size
/ sizeof (struct external_IMAGE_DEBUG_DIRECTORY); i++)
- {
- asection *ddsection;
- struct external_IMAGE_DEBUG_DIRECTORY *edd = &(dd[i]);
- struct internal_IMAGE_DEBUG_DIRECTORY idd;
+ {
+ asection *ddsection;
+ struct external_IMAGE_DEBUG_DIRECTORY *edd = &(dd[i]);
+ struct internal_IMAGE_DEBUG_DIRECTORY idd;
- _bfd_XXi_swap_debugdir_in (obfd, edd, &idd);
+ _bfd_XXi_swap_debugdir_in (obfd, edd, &idd);
- if (idd.AddressOfRawData == 0)
- continue; /* RVA 0 means only offset is valid, not handled yet. */
+ if (idd.AddressOfRawData == 0)
+ continue; /* RVA 0 means only offset is valid, not handled yet. */
- ddsection = find_section_by_vma (obfd, idd.AddressOfRawData + ope->pe_opthdr.ImageBase);
- if (!ddsection)
- continue; /* Not in a section! */
+ ddsection = find_section_by_vma (obfd, idd.AddressOfRawData + ope->pe_opthdr.ImageBase);
+ if (!ddsection)
+ continue; /* Not in a section! */
- idd.PointerToRawData = ddsection->filepos + (idd.AddressOfRawData
+ idd.PointerToRawData = ddsection->filepos + (idd.AddressOfRawData
+ ope->pe_opthdr.ImageBase) - ddsection->vma;
- _bfd_XXi_swap_debugdir_out (obfd, &idd, edd);
- }
+ _bfd_XXi_swap_debugdir_out (obfd, &idd, edd);
+ }
- if (!bfd_set_section_contents (obfd, section, data, 0, section->size))
+ if (!bfd_set_section_contents (obfd, section, data, 0, section->size))
{
_bfd_error_handler (_("Failed to update file offsets in debug directory"));
return FALSE;
}
- }
+ }
else if (section)
{
_bfd_error_handler (_("%B: Failed to read debug data section"), obfd);
rsrc_count_directory (bfd *, bfd_byte *, bfd_byte *, bfd_byte *, bfd_vma);
static bfd_byte *
-rsrc_count_entries (bfd * abfd,
- bfd_boolean is_name,
- bfd_byte * datastart,
- bfd_byte * data,
- bfd_byte * dataend,
- bfd_vma rva_bias)
+rsrc_count_entries (bfd * abfd,
+ bfd_boolean is_name,
+ bfd_byte * datastart,
+ bfd_byte * data,
+ bfd_byte * dataend,
+ bfd_vma rva_bias)
{
unsigned long entry, addr, size;
}
static bfd_byte *
-rsrc_count_directory (bfd * abfd,
+rsrc_count_directory (bfd * abfd,
bfd_byte * datastart,
bfd_byte * data,
bfd_byte * dataend,
- bfd_vma rva_bias)
+ bfd_vma rva_bias)
{
unsigned int num_entries, num_ids;
bfd_byte * highest_data = data;
typedef struct rsrc_dir_chain
{
- unsigned int num_entries;
+ unsigned int num_entries;
struct rsrc_entry * first_entry;
struct rsrc_entry * last_entry;
} rsrc_dir_chain;
typedef struct rsrc_string
{
- unsigned int len;
- bfd_byte * string;
+ unsigned int len;
+ bfd_byte * string;
} rsrc_string;
typedef struct rsrc_leaf
{
- unsigned int size;
- unsigned int codepage;
- bfd_byte * data;
+ unsigned int size;
+ unsigned int codepage;
+ bfd_byte * data;
} rsrc_leaf;
typedef struct rsrc_entry
bfd_boolean is_name;
union
{
- unsigned int id;
- struct rsrc_string name;
+ unsigned int id;
+ struct rsrc_string name;
} name_id;
bfd_boolean is_dir;
union
{
struct rsrc_directory * directory;
- struct rsrc_leaf * leaf;
+ struct rsrc_leaf * leaf;
} value;
- struct rsrc_entry * next_entry;
+ struct rsrc_entry * next_entry;
struct rsrc_directory * parent;
} rsrc_entry;
bfd_byte *, bfd_byte *, bfd_vma, rsrc_entry *);
static bfd_byte *
-rsrc_parse_entry (bfd * abfd,
- bfd_boolean is_name,
- rsrc_entry * entry,
- bfd_byte * datastart,
- bfd_byte * data,
- bfd_byte * dataend,
- bfd_vma rva_bias,
+rsrc_parse_entry (bfd * abfd,
+ bfd_boolean is_name,
+ rsrc_entry * entry,
+ bfd_byte * datastart,
+ bfd_byte * data,
+ bfd_byte * dataend,
+ bfd_vma rva_bias,
rsrc_directory * parent)
{
unsigned long val, addr, size;
}
static bfd_byte *
-rsrc_parse_entries (bfd * abfd,
+rsrc_parse_entries (bfd * abfd,
rsrc_dir_chain * chain,
- bfd_boolean is_name,
- bfd_byte * highest_data,
- bfd_byte * datastart,
- bfd_byte * data,
- bfd_byte * dataend,
- bfd_vma rva_bias,
+ bfd_boolean is_name,
+ bfd_byte * highest_data,
+ bfd_byte * datastart,
+ bfd_byte * data,
+ bfd_byte * dataend,
+ bfd_vma rva_bias,
rsrc_directory * parent)
{
unsigned int i;
}
static bfd_byte *
-rsrc_parse_directory (bfd * abfd,
+rsrc_parse_directory (bfd * abfd,
rsrc_directory * table,
bfd_byte * datastart,
bfd_byte * data,
bfd_byte * dataend,
- bfd_vma rva_bias,
+ bfd_vma rva_bias,
rsrc_entry * entry)
{
bfd_byte * highest_data = data;
static inline unsigned int
rsrc_compute_rva (rsrc_write_data * data,
- bfd_byte * addr)
+ bfd_byte * addr)
{
return (addr - data->datastart) + data->rva_bias;
}
static void
rsrc_write_leaf (rsrc_write_data * data,
- rsrc_leaf * leaf)
+ rsrc_leaf * leaf)
{
bfd_put_32 (data->abfd, rsrc_compute_rva (data, data->next_data),
data->next_leaf);
static void
rsrc_write_entry (rsrc_write_data * data,
- bfd_byte * where,
- rsrc_entry * entry)
+ bfd_byte * where,
+ rsrc_entry * entry)
{
if (entry->is_name)
{
if (c < 0xdc00)
{
if (n >= 2)
- {
- if (s[1] >= 0xdc00 && s[1] < 0xe000)
- {
- *puc = 0x10000 + ((c - 0xd800) << 10) + (s[1] - 0xdc00);
- return 2;
- }
- }
+ {
+ if (s[1] >= 0xdc00 && s[1] < 0xe000)
+ {
+ *puc = 0x10000 + ((c - 0xd800) << 10) + (s[1] - 0xdc00);
+ return 2;
+ }
+ }
else
- {
- /* Incomplete multibyte character. */
- *puc = 0xfffd;
- return n;
- }
+ {
+ /* Incomplete multibyte character. */
+ *puc = 0xfffd;
+ return n;
+ }
}
/* Invalid multibyte character. */
case 1: strcat (buffer, " (CURSOR)"); break;
case 2: strcat (buffer, " (BITMAP)"); break;
case 3: strcat (buffer, " (ICON)"); break;
- case 4: strcat (buffer, " (MENU)"); break;
+ case 4: strcat (buffer, " (MENU)"); break;
case 5: strcat (buffer, " (DIALOG)"); break;
case 6: strcat (buffer, " (STRING)"); is_string = TRUE; break;
case 7: strcat (buffer, " (FONTDIR)"); break;
struct coff_final_link_info * pfinfo)
{
rsrc_directory new_table;
- bfd_size_type size;
- asection * sec;
+ bfd_size_type size;
+ asection * sec;
pe_data_type * pe;
- bfd_vma rva_bias;
- bfd_byte * data;
- bfd_byte * datastart;
- bfd_byte * dataend;
- bfd_byte * new_data;
- unsigned int num_resource_sets;
+ bfd_vma rva_bias;
+ bfd_byte * data;
+ bfd_byte * datastart;
+ bfd_byte * dataend;
+ bfd_byte * new_data;
+ unsigned int num_resource_sets;
rsrc_directory * type_tables;
rsrc_write_data write_data;
- unsigned int indx;
- bfd * input;
- unsigned int num_input_rsrc = 0;
- unsigned int max_num_input_rsrc = 4;
- ptrdiff_t * rsrc_sizes = NULL;
+ unsigned int indx;
+ bfd * input;
+ unsigned int num_input_rsrc = 0;
+ unsigned int max_num_input_rsrc = 4;
+ ptrdiff_t * rsrc_sizes = NULL;
new_table.names.num_entries = 0;
new_table.ids.num_entries = 0;
/* FIXME: Should we verify that all type tables are the same ? */
new_table.characteristics = type_tables[0].characteristics;
- new_table.time = type_tables[0].time;
- new_table.major = type_tables[0].major;
- new_table.minor = type_tables[0].minor;
+ new_table.time = type_tables[0].time;
+ new_table.major = type_tables[0].major;
+ new_table.minor = type_tables[0].minor;
/* Chain the NAME entries onto the table. */
new_table.names.first_entry = NULL;
if (new_data == NULL)
goto end;
- write_data.abfd = abfd;
- write_data.datastart = new_data;
- write_data.next_table = new_data;
- write_data.next_leaf = new_data + sizeof_tables_and_entries;
+ write_data.abfd = abfd;
+ write_data.datastart = new_data;
+ write_data.next_table = new_data;
+ write_data.next_leaf = new_data + sizeof_tables_and_entries;
write_data.next_string = write_data.next_leaf + sizeof_leaves;
- write_data.next_data = write_data.next_string + sizeof_strings;
- write_data.rva_bias = sec->vma - pe->pe_opthdr.ImageBase;
+ write_data.next_data = write_data.next_string + sizeof_strings;
+ write_data.rva_bias = sec->vma - pe->pe_opthdr.ImageBase;
rsrc_write_directory (& write_data, & new_table);
}
/* The import address table. This is the size/address of
- .idata$5. */
+ .idata$5. */
h1 = coff_link_hash_lookup (coff_hash_table (info),
".idata$5", FALSE, FALSE, TRUE);
if (h1 != NULL
" because .idata$6 is missing"), abfd);
result = FALSE;
}
- }
+ }
}
h1 = coff_link_hash_lookup (coff_hash_table (info),
#define BFD_IO_FUNCS 0
#endif
-#define bfd_pef_close_and_cleanup _bfd_generic_close_and_cleanup
-#define bfd_pef_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define bfd_pef_new_section_hook _bfd_generic_new_section_hook
-#define bfd_pef_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define bfd_pef_close_and_cleanup _bfd_generic_close_and_cleanup
+#define bfd_pef_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define bfd_pef_new_section_hook _bfd_generic_new_section_hook
+#define bfd_pef_bfd_is_local_label_name bfd_generic_is_local_label_name
#define bfd_pef_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define bfd_pef_get_lineno _bfd_nosymbols_get_lineno
-#define bfd_pef_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define bfd_pef_find_line _bfd_nosymbols_find_line
-#define bfd_pef_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define bfd_pef_get_lineno _bfd_nosymbols_get_lineno
+#define bfd_pef_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_pef_find_line _bfd_nosymbols_find_line
+#define bfd_pef_find_inliner_info _bfd_nosymbols_find_inliner_info
#define bfd_pef_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define bfd_pef_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define bfd_pef_read_minisymbols _bfd_generic_read_minisymbols
-#define bfd_pef_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-#define bfd_pef_set_arch_mach _bfd_generic_set_arch_mach
-#define bfd_pef_get_section_contents _bfd_generic_get_section_contents
-#define bfd_pef_set_section_contents _bfd_generic_set_section_contents
+#define bfd_pef_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define bfd_pef_read_minisymbols _bfd_generic_read_minisymbols
+#define bfd_pef_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define bfd_pef_set_arch_mach _bfd_generic_set_arch_mach
+#define bfd_pef_get_section_contents _bfd_generic_get_section_contents
+#define bfd_pef_set_section_contents _bfd_generic_set_section_contents
#define bfd_pef_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define bfd_pef_bfd_relax_section bfd_generic_relax_section
-#define bfd_pef_bfd_gc_sections bfd_generic_gc_sections
-#define bfd_pef_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define bfd_pef_bfd_merge_sections bfd_generic_merge_sections
+#define bfd_pef_bfd_relax_section bfd_generic_relax_section
+#define bfd_pef_bfd_gc_sections bfd_generic_gc_sections
+#define bfd_pef_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define bfd_pef_bfd_merge_sections bfd_generic_merge_sections
#define bfd_pef_bfd_is_group_section bfd_generic_is_group_section
-#define bfd_pef_bfd_discard_group bfd_generic_discard_group
-#define bfd_pef_section_already_linked _bfd_generic_section_already_linked
-#define bfd_pef_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define bfd_pef_bfd_define_start_stop bfd_generic_define_start_stop
-#define bfd_pef_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define bfd_pef_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define bfd_pef_bfd_link_just_syms _bfd_generic_link_just_syms
+#define bfd_pef_bfd_discard_group bfd_generic_discard_group
+#define bfd_pef_section_already_linked _bfd_generic_section_already_linked
+#define bfd_pef_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define bfd_pef_bfd_define_start_stop bfd_generic_define_start_stop
+#define bfd_pef_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define bfd_pef_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define bfd_pef_bfd_link_just_syms _bfd_generic_link_just_syms
#define bfd_pef_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
-#define bfd_pef_bfd_final_link _bfd_generic_final_link
-#define bfd_pef_bfd_link_split_section _bfd_generic_link_split_section
-#define bfd_pef_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-#define bfd_pef_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define bfd_pef_bfd_final_link _bfd_generic_final_link
+#define bfd_pef_bfd_link_split_section _bfd_generic_link_split_section
+#define bfd_pef_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define bfd_pef_bfd_link_check_relocs _bfd_generic_link_check_relocs
static int
bfd_pef_parse_traceback_table (bfd *abfd,
NULL
};
-#define bfd_pef_xlib_close_and_cleanup _bfd_generic_close_and_cleanup
-#define bfd_pef_xlib_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define bfd_pef_xlib_new_section_hook _bfd_generic_new_section_hook
-#define bfd_pef_xlib_get_section_contents _bfd_generic_get_section_contents
-#define bfd_pef_xlib_set_section_contents _bfd_generic_set_section_contents
+#define bfd_pef_xlib_close_and_cleanup _bfd_generic_close_and_cleanup
+#define bfd_pef_xlib_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define bfd_pef_xlib_new_section_hook _bfd_generic_new_section_hook
+#define bfd_pef_xlib_get_section_contents _bfd_generic_get_section_contents
+#define bfd_pef_xlib_set_section_contents _bfd_generic_set_section_contents
#define bfd_pef_xlib_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
#define bfd_pef_xlib_set_section_contents_in_window _bfd_generic_set_section_contents_in_window
void bfd_pef_print_loader_header (bfd *, bfd_pef_loader_header *, FILE *);
int bfd_pef_parse_imported_library (bfd *, unsigned char *, size_t, bfd_pef_imported_library *);
int bfd_pef_parse_imported_symbol (bfd *, unsigned char *, size_t, bfd_pef_imported_symbol *);
-int bfd_pef_scan_section (bfd *, bfd_pef_section *);
-int bfd_pef_scan_start_address (bfd *);
-int bfd_pef_scan (bfd *, bfd_pef_header *, bfd_pef_data_struct *);
+int bfd_pef_scan_section (bfd *, bfd_pef_section *);
+int bfd_pef_scan_start_address (bfd *);
+int bfd_pef_scan (bfd *, bfd_pef_header *, bfd_pef_data_struct *);
#define COFF_IMAGE_WITH_PE
#define COFF_WITH_PE
-#define PCRELOFFSET TRUE
+#define PCRELOFFSET TRUE
/* Long section names not allowed in executable images, only object files. */
#define COFF_LONG_SECTION_NAMES 0
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SYM i386_pei_vec
-#define TARGET_NAME "pei-i386"
+#define TARGET_SYM i386_pei_vec
+#define TARGET_NAME "pei-i386"
#define COFF_IMAGE_WITH_PE
#define COFF_WITH_PE
-#define PCRELOFFSET TRUE
-#define TARGET_UNDERSCORE '_'
+#define PCRELOFFSET TRUE
+#define TARGET_UNDERSCORE '_'
/* Long section names not allowed in executable images, only object files. */
#define COFF_LONG_SECTION_NAMES 0
#define COFF_SUPPORT_GNU_LINKONCE
#define COFF_IMAGE_WITH_PE
#define COFF_WITH_PE
-#define PCRELOFFSET TRUE
+#define PCRELOFFSET TRUE
/* Long section names not allowed in executable images, only object files. */
#define COFF_LONG_SECTION_NAMES 0
#include "sysdep.h"
#include "bfd.h"
-#define TARGET_SYM x86_64_pei_vec
-#define TARGET_NAME "pei-x86-64"
+#define TARGET_SYM x86_64_pei_vec
+#define TARGET_NAME "pei-x86-64"
#define COFF_IMAGE_WITH_PE
#define COFF_WITH_PE
#define COFF_WITH_pex64
-#define PCRELOFFSET TRUE
+#define PCRELOFFSET TRUE
#if defined (USE_MINGW64_LEADING_UNDERSCORES)
-#define TARGET_UNDERSCORE '_'
+#define TARGET_UNDERSCORE '_'
#else
-#define TARGET_UNDERSCORE 0
+#define TARGET_UNDERSCORE 0
#endif
/* Long section names not allowed in executable images, only object files. */
#define COFF_LONG_SECTION_NAMES 0
&& PEX64_UNWCODE_CODE (ui->rawUnwindCodes[1]) == UWOP_EPILOG)
{
/* Display epilog opcode (whose docoding is not fully documented).
- Looks to be designed to speed-up unwinding, as there is no need
+ Looks to be designed to speed-up unwinding, as there is no need
to decode instruction flow if outside an epilog. */
unsigned int func_size = rf->rva_EndAddress - rf->rva_BeginAddress;
seen_error = 1;
fprintf (file, " has %s begin address as predecessor\n",
(rf.rva_BeginAddress < prev_beginaddress ? "smaller" : "same"));
- }
+ }
prev_beginaddress = rf.rva_BeginAddress;
/* Now we check for negative addresses. */
if ((prev_beginaddress & 0x80000000) != 0)
/* We are probably into the padding of the section now. */
break;
if (i == 0)
- fprintf (file, _("\nDump of %s\n"), xdata_section->name);
+ fprintf (file, _("\nDump of %s\n"), xdata_section->name);
fputc (' ', file);
fprintf_vma (file, rf.rva_UnwindData + imagebase);
/* Search for the current entry in the sorted array. */
p = (bfd_vma *)
- bsearch (&rf.rva_UnwindData, xdata_arr,
+ bsearch (&rf.rva_UnwindData, xdata_arr,
(size_t) xdata_arr_cnt, sizeof (bfd_vma),
sort_xdata_arr);
sac@cygnus.com
PE/PEI rearrangement (and code added): Donn Terry
- Softway Systems, Inc. */
+ Softway Systems, Inc. */
/* Hey look, some documentation [and in a place you expect to find it]!
#undef coff_bfd_print_private_bfd_data
#endif
-static bfd_boolean pe_print_private_bfd_data (bfd *, void *);
+static bfd_boolean pe_print_private_bfd_data (bfd *, void *);
#define coff_bfd_print_private_bfd_data pe_print_private_bfd_data
static bfd_boolean (*pe_saved_coff_bfd_copy_private_bfd_data) (bfd *, bfd *) =
#undef coff_bfd_copy_private_bfd_data
#endif
-static bfd_boolean pe_bfd_copy_private_bfd_data (bfd *, bfd *);
+static bfd_boolean pe_bfd_copy_private_bfd_data (bfd *, bfd *);
#define coff_bfd_copy_private_bfd_data pe_bfd_copy_private_bfd_data
-#define coff_mkobject pe_mkobject
+#define coff_mkobject pe_mkobject
#define coff_mkobject_hook pe_mkobject_hook
#ifdef COFF_IMAGE_WITH_PE
bfd * abfd;
bfd_byte * data;
struct bfd_in_memory * bim;
- unsigned short magic;
+ unsigned short magic;
arelent * reltab;
- unsigned int relcount;
+ unsigned int relcount;
- coff_symbol_type * sym_cache;
- coff_symbol_type * sym_ptr;
- unsigned int sym_index;
+ coff_symbol_type * sym_cache;
+ coff_symbol_type * sym_ptr;
+ unsigned int sym_index;
- unsigned int * sym_table;
- unsigned int * table_ptr;
+ unsigned int * sym_table;
+ unsigned int * table_ptr;
combined_entry_type * native_syms;
combined_entry_type * native_ptr;
unsigned int sec_index;
- char * string_table;
- char * string_ptr;
+ char * string_table;
+ char * string_ptr;
char * end_string_ptr;
- SYMENT * esym_table;
- SYMENT * esym_ptr;
+ SYMENT * esym_table;
+ SYMENT * esym_ptr;
struct internal_reloc * int_reltab;
}
if (scnhdr_int->s_paddr > 0
&& (((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0
&& (! bfd_pei_p (abfd) || scnhdr_int->s_size == 0))
- || (bfd_pei_p (abfd) && (scnhdr_int->s_size > scnhdr_int->s_paddr))))
+ || (bfd_pei_p (abfd) && (scnhdr_int->s_size > scnhdr_int->s_paddr))))
/* This code used to set scnhdr_int->s_paddr to 0. However,
coff_set_alignment_hook stores s_paddr in virt_size, which
only works if it correctly holds the virtual size of the
the table in order to for the string lookup code in coffgen/coffcode to
work. */
#define NUM_ILF_RELOCS 8
-#define NUM_ILF_SECTIONS 6
-#define NUM_ILF_SYMS (2 + NUM_ILF_SECTIONS)
+#define NUM_ILF_SECTIONS 6
+#define NUM_ILF_SYMS (2 + NUM_ILF_SECTIONS)
#define SIZEOF_ILF_SYMS (NUM_ILF_SYMS * sizeof (* vars.sym_cache))
#define SIZEOF_ILF_SYM_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_table))
#define SIZEOF_IDATA6 (2 + strlen (symbol_name) + 1 + 1)
#define SIZEOF_IDATA7 (strlen (source_dll) + 1 + 1)
-#define SIZEOF_ILF_SECTIONS (NUM_ILF_SECTIONS * sizeof (struct coff_section_tdata))
+#define SIZEOF_ILF_SECTIONS (NUM_ILF_SECTIONS * sizeof (struct coff_section_tdata))
#define ILF_DATA_SIZE \
+ SIZEOF_ILF_SYMS \
/* Create an empty relocation against the given symbol. */
static void
-pe_ILF_make_a_symbol_reloc (pe_ILF_vars * vars,
- bfd_vma address,
- bfd_reloc_code_real_type reloc,
- struct bfd_symbol ** sym,
- unsigned int sym_index)
+pe_ILF_make_a_symbol_reloc (pe_ILF_vars * vars,
+ bfd_vma address,
+ bfd_reloc_code_real_type reloc,
+ struct bfd_symbol ** sym,
+ unsigned int sym_index)
{
arelent * entry;
struct internal_reloc * internal;
/* Create an empty relocation against the given section. */
static void
-pe_ILF_make_a_reloc (pe_ILF_vars * vars,
- bfd_vma address,
+pe_ILF_make_a_reloc (pe_ILF_vars * vars,
+ bfd_vma address,
bfd_reloc_code_real_type reloc,
- asection_ptr sec)
+ asection_ptr sec)
{
pe_ILF_make_a_symbol_reloc (vars, address, reloc, sec->symbol_ptr_ptr,
coff_section_data (vars->abfd, sec)->i);
zero initialised. They are just kept here as reminders. */
/* Initialise the internal symbol structure. */
- ent->u.syment.n_sclass = sclass;
- ent->u.syment.n_scnum = section->target_index;
+ ent->u.syment.n_sclass = sclass;
+ ent->u.syment.n_scnum = section->target_index;
ent->u.syment._n._n_n._n_offset = (bfd_hostptr_t) sym;
ent->is_sym = TRUE;
sym->symbol.name = vars->string_ptr;
sym->symbol.flags = BSF_EXPORT | BSF_GLOBAL | extra_flags;
sym->symbol.section = section;
- sym->native = ent;
+ sym->native = ent;
* vars->table_ptr = vars->sym_index;
* vars->sym_ptr_ptr = sym;
/* Build a full BFD from the information supplied in a ILF object. */
static bfd_boolean
-pe_ILF_build_a_bfd (bfd * abfd,
+pe_ILF_build_a_bfd (bfd * abfd,
unsigned int magic,
- char * symbol_name,
- char * source_dll,
+ char * symbol_name,
+ char * source_dll,
unsigned int ordinal,
unsigned int types)
{
- bfd_byte * ptr;
- pe_ILF_vars vars;
+ bfd_byte * ptr;
+ pe_ILF_vars vars;
struct internal_filehdr internal_f;
- unsigned int import_type;
- unsigned int import_name_type;
- asection_ptr id4, id5, id6 = NULL, text = NULL;
- coff_symbol_type ** imp_sym;
- unsigned int imp_index;
+ unsigned int import_type;
+ unsigned int import_name_type;
+ asection_ptr id4, id5, id6 = NULL, text = NULL;
+ coff_symbol_type ** imp_sym;
+ unsigned int imp_index;
/* Decode and verify the types field of the ILF structure. */
import_type = types & 0x3;
case IMPORT_CODE:
/* CODE functions are special, in that they get a trampoline that
- jumps to the main import symbol. Create a .text section to hold it.
+ jumps to the main import symbol. Create a .text section to hold it.
First we need to look up its contents in the jump table. */
for (i = NUM_ENTRIES (jtab); i--;)
{
static const bfd_target *
pe_ILF_object_p (bfd * abfd)
{
- bfd_byte buffer[14];
- bfd_byte * ptr;
- char * symbol_name;
- char * source_dll;
- unsigned int machine;
- bfd_size_type size;
- unsigned int ordinal;
- unsigned int types;
- unsigned int magic;
+ bfd_byte buffer[14];
+ bfd_byte * ptr;
+ char * symbol_name;
+ char * source_dll;
+ unsigned int machine;
+ bfd_size_type size;
+ unsigned int ordinal;
+ unsigned int types;
+ unsigned int magic;
/* Upon entry the first six bytes of the ILF header have
already been read. Now read the rest of the header. */
for (section = abfd->sections; section != NULL; section = section->next)
{
if ((addr >= section->vma) && (addr < (section->vma + section->size)))
- break;
+ break;
}
if (section == NULL)
abfd);
return;
}
-
+
/* Read the whole section. */
if (!bfd_malloc_and_get_section (abfd, section, &data))
{
_bfd_XXi_swap_debugdir_in (abfd, ext, &idd);
if (idd.Type == PE_IMAGE_DEBUG_TYPE_CODEVIEW)
- {
- char buffer[256 + 1];
- CODEVIEW_INFO *cvinfo = (CODEVIEW_INFO *) buffer;
-
- /*
- The debug entry doesn't have to have to be in a section, in which
- case AddressOfRawData is 0, so always use PointerToRawData.
- */
- if (_bfd_XXi_slurp_codeview_record (abfd,
- (file_ptr) idd.PointerToRawData,
- idd.SizeOfData, cvinfo))
- {
- struct bfd_build_id* build_id = bfd_alloc (abfd,
- sizeof (struct bfd_build_id) + cvinfo->SignatureLength);
- if (build_id)
- {
- build_id->size = cvinfo->SignatureLength;
- memcpy(build_id->data, cvinfo->Signature,
- cvinfo->SignatureLength);
- abfd->build_id = build_id;
- }
- }
- break;
- }
+ {
+ char buffer[256 + 1];
+ CODEVIEW_INFO *cvinfo = (CODEVIEW_INFO *) buffer;
+
+ /*
+ The debug entry doesn't have to have to be in a section, in which
+ case AddressOfRawData is 0, so always use PointerToRawData.
+ */
+ if (_bfd_XXi_slurp_codeview_record (abfd,
+ (file_ptr) idd.PointerToRawData,
+ idd.SizeOfData, cvinfo))
+ {
+ struct bfd_build_id* build_id = bfd_alloc (abfd,
+ sizeof (struct bfd_build_id) + cvinfo->SignatureLength);
+ if (build_id)
+ {
+ build_id->size = cvinfo->SignatureLength;
+ memcpy(build_id->data, cvinfo->Signature,
+ cvinfo->SignatureLength);
+ abfd->build_id = build_id;
+ }
+ }
+ break;
+ }
}
}
result = coff_real_object_p (abfd, internal_f.f_nscns, &internal_f,
- (opt_hdr_size != 0
- ? &internal_a
- : (struct internal_aouthdr *) NULL));
+ (opt_hdr_size != 0
+ ? &internal_a
+ : (struct internal_aouthdr *) NULL));
if (result)
#endif /* !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) */
-#define bfd_plugin_close_and_cleanup _bfd_generic_close_and_cleanup
-#define bfd_plugin_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define bfd_plugin_new_section_hook _bfd_generic_new_section_hook
-#define bfd_plugin_get_section_contents _bfd_generic_get_section_contents
+#define bfd_plugin_close_and_cleanup _bfd_generic_close_and_cleanup
+#define bfd_plugin_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define bfd_plugin_new_section_hook _bfd_generic_new_section_hook
+#define bfd_plugin_get_section_contents _bfd_generic_get_section_contents
#define bfd_plugin_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-#define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
-#define bfd_plugin_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
-#define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
-#define bfd_plugin_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
+#define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
+#define bfd_plugin_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
+#define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
+#define bfd_plugin_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
#define bfd_plugin_core_file_matches_executable_p generic_core_file_matches_executable_p
-#define bfd_plugin_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
-#define bfd_plugin_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define bfd_plugin_get_lineno _bfd_nosymbols_get_lineno
-#define bfd_plugin_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define bfd_plugin_find_line _bfd_nosymbols_find_line
-#define bfd_plugin_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define bfd_plugin_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
+#define bfd_plugin_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#define bfd_plugin_get_lineno _bfd_nosymbols_get_lineno
+#define bfd_plugin_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_plugin_find_line _bfd_nosymbols_find_line
+#define bfd_plugin_find_inliner_info _bfd_nosymbols_find_inliner_info
#define bfd_plugin_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define bfd_plugin_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define bfd_plugin_read_minisymbols _bfd_generic_read_minisymbols
-#define bfd_plugin_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-#define bfd_plugin_set_arch_mach bfd_default_set_arch_mach
-#define bfd_plugin_set_section_contents _bfd_generic_set_section_contents
+#define bfd_plugin_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define bfd_plugin_read_minisymbols _bfd_generic_read_minisymbols
+#define bfd_plugin_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define bfd_plugin_set_arch_mach bfd_default_set_arch_mach
+#define bfd_plugin_set_section_contents _bfd_generic_set_section_contents
#define bfd_plugin_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define bfd_plugin_bfd_relax_section bfd_generic_relax_section
-#define bfd_plugin_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define bfd_plugin_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define bfd_plugin_bfd_link_just_syms _bfd_generic_link_just_syms
-#define bfd_plugin_bfd_final_link _bfd_generic_final_link
-#define bfd_plugin_bfd_link_split_section _bfd_generic_link_split_section
-#define bfd_plugin_bfd_gc_sections bfd_generic_gc_sections
-#define bfd_plugin_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define bfd_plugin_bfd_merge_sections bfd_generic_merge_sections
-#define bfd_plugin_bfd_is_group_section bfd_generic_is_group_section
-#define bfd_plugin_bfd_discard_group bfd_generic_discard_group
-#define bfd_plugin_section_already_linked _bfd_generic_section_already_linked
-#define bfd_plugin_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define bfd_plugin_bfd_define_start_stop bfd_generic_define_start_stop
+#define bfd_plugin_bfd_relax_section bfd_generic_relax_section
+#define bfd_plugin_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define bfd_plugin_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define bfd_plugin_bfd_link_just_syms _bfd_generic_link_just_syms
+#define bfd_plugin_bfd_final_link _bfd_generic_final_link
+#define bfd_plugin_bfd_link_split_section _bfd_generic_link_split_section
+#define bfd_plugin_bfd_gc_sections bfd_generic_gc_sections
+#define bfd_plugin_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define bfd_plugin_bfd_merge_sections bfd_generic_merge_sections
+#define bfd_plugin_bfd_is_group_section bfd_generic_is_group_section
+#define bfd_plugin_bfd_discard_group bfd_generic_discard_group
+#define bfd_plugin_section_already_linked _bfd_generic_section_already_linked
+#define bfd_plugin_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define bfd_plugin_bfd_define_start_stop bfd_generic_define_start_stop
#define bfd_plugin_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
-#define bfd_plugin_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define bfd_plugin_bfd_link_check_relocs _bfd_generic_link_check_relocs
static enum ld_plugin_status
message (int level ATTRIBUTE_UNUSED,
{
struct stat stat_buf;
if (fstat (file->fd, &stat_buf))
- return 0;
+ return 0;
file->offset = 0;
file->filesize = stat_buf.st_size;
}
NULL,
- NULL /* backend_data. */
+ NULL /* backend_data. */
};
#endif /* BFD_SUPPORTS_PLUGIN */
asection *s;
/* The lowest section VMA sets the virtual address of the start
- of the file. We use the set the file position of all the
- sections. */
+ of the file. We use the set the file position of all the
+ sections. */
low = abfd->sections->vma;
for (s = abfd->sections->next; s != NULL; s = s->next)
if (s->vma < low)
HAS_LINENO | HAS_DEBUG |
HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
(SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */
- 0, /* symbol prefix */
+ 0, /* symbol prefix */
' ', /* ar_pad_char */
16, /* ar_max_namelen */
NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit data */
/*
DESCRIPTION
- Here is a description of each of the fields within an <<arelent>>:
-
- o <<sym_ptr_ptr>>
-
- The symbol table pointer points to a pointer to the symbol
- associated with the relocation request. It is the pointer
- into the table returned by the back end's
- <<canonicalize_symtab>> action. @xref{Symbols}. The symbol is
- referenced through a pointer to a pointer so that tools like
- the linker can fix up all the symbols of the same name by
- modifying only one pointer. The relocation routine looks in
- the symbol and uses the base of the section the symbol is
- attached to and the value of the symbol as the initial
- relocation offset. If the symbol pointer is zero, then the
- section provided is looked up.
-
- o <<address>>
-
- The <<address>> field gives the offset in bytes from the base of
- the section data which owns the relocation record to the first
- byte of relocatable information. The actual data relocated
- will be relative to this point; for example, a relocation
- type which modifies the bottom two bytes of a four byte word
- would not touch the first byte pointed to in a big endian
- world.
+ Here is a description of each of the fields within an <<arelent>>:
+
+ o <<sym_ptr_ptr>>
+
+ The symbol table pointer points to a pointer to the symbol
+ associated with the relocation request. It is the pointer
+ into the table returned by the back end's
+ <<canonicalize_symtab>> action. @xref{Symbols}. The symbol is
+ referenced through a pointer to a pointer so that tools like
+ the linker can fix up all the symbols of the same name by
+ modifying only one pointer. The relocation routine looks in
+ the symbol and uses the base of the section the symbol is
+ attached to and the value of the symbol as the initial
+ relocation offset. If the symbol pointer is zero, then the
+ section provided is looked up.
+
+ o <<address>>
+
+ The <<address>> field gives the offset in bytes from the base of
+ the section data which owns the relocation record to the first
+ byte of relocatable information. The actual data relocated
+ will be relative to this point; for example, a relocation
+ type which modifies the bottom two bytes of a four byte word
+ would not touch the first byte pointed to in a big endian
+ world.
o <<addend>>
| return foo[0x12345678];
| }
- Could be compiled into:
+ Could be compiled into:
| linkw fp,#-4
| moveb @@#12345678,d0
| unlk fp
| rts
- This could create a reloc pointing to <<foo>>, but leave the
- offset in the data, something like:
+ This could create a reloc pointing to <<foo>>, but leave the
+ offset in the data, something like:
|RELOCATION RECORDS FOR [.text]:
|offset type value
|0000000c 4e5e ; unlk fp
|0000000e 4e75 ; rts
- Using coff and an 88k, some instructions don't have enough
- space in them to represent the full address range, and
- pointers have to be loaded in two parts. So you'd get something like:
+ Using coff and an 88k, some instructions don't have enough
+ space in them to represent the full address range, and
+ pointers have to be loaded in two parts. So you'd get something like:
| or.u r13,r0,hi16(_foo+0x12345678)
| ld.b r2,r13,lo16(_foo+0x12345678)
| jmp r1
- This should create two relocs, both pointing to <<_foo>>, and with
- 0x12340000 in their addend field. The data would consist of:
+ This should create two relocs, both pointing to <<_foo>>, and with
+ 0x12340000 in their addend field. The data would consist of:
|RELOCATION RECORDS FOR [.text]:
|offset type value
|00000004 1c4d5678 ; ld.b r2,r13,0x5678
|00000008 f400c001 ; jmp r1
- The relocation routine digs out the value from the data, adds
- it to the addend to get the original offset, and then adds the
- value of <<_foo>>. Note that all 32 bits have to be kept around
- somewhere, to cope with carry from bit 15 to bit 16.
+ The relocation routine digs out the value from the data, adds
+ it to the addend to get the original offset, and then adds the
+ value of <<_foo>>. Note that all 32 bits have to be kept around
+ somewhere, to cope with carry from bit 15 to bit 16.
- One further example is the sparc and the a.out format. The
- sparc has a similar problem to the 88k, in that some
- instructions don't have room for an entire offset, but on the
- sparc the parts are created in odd sized lumps. The designers of
- the a.out format chose to not use the data within the section
- for storing part of the offset; all the offset is kept within
- the reloc. Anything in the data should be ignored.
+ One further example is the sparc and the a.out format. The
+ sparc has a similar problem to the 88k, in that some
+ instructions don't have room for an entire offset, but on the
+ sparc the parts are created in odd sized lumps. The designers of
+ the a.out format chose to not use the data within the section
+ for storing part of the offset; all the offset is kept within
+ the reloc. Anything in the data should be ignored.
| save %sp,-112,%sp
| sethi %hi(_foo+0x12345678),%g2
| ret
| restore
- Both relocs contain a pointer to <<foo>>, and the offsets
- contain junk.
+ Both relocs contain a pointer to <<foo>>, and the offsets
+ contain junk.
|RELOCATION RECORDS FOR [.text]:
|offset type value
|0000000c 81c7e008 ; ret
|00000010 81e80000 ; restore
- o <<howto>>
+ o <<howto>>
- The <<howto>> field can be imagined as a
- relocation instruction. It is a pointer to a structure which
- contains information on what to do with all of the other
- information in the reloc record and data section. A back end
- would normally have a relocation instruction set and turn
- relocations into pointers to the correct structure on input -
- but it would be possible to create each howto field on demand.
+ The <<howto>> field can be imagined as a
+ relocation instruction. It is a pointer to a structure which
+ contains information on what to do with all of the other
+ information in the reloc record and data section. A back end
+ would normally have a relocation instruction set and turn
+ relocations into pointers to the correct structure on input -
+ but it would be possible to create each howto field on demand.
*/
/*
SUBSUBSECTION
- <<reloc_howto_type>>
+ <<reloc_howto_type>>
- The <<reloc_howto_type>> is a structure which contains all the
- information that libbfd needs to know to tie up a back end's data.
+ The <<reloc_howto_type>> is a structure which contains all the
+ information that libbfd needs to know to tie up a back end's data.
CODE_FRAGMENT
.struct bfd_symbol; {* Forward declaration. *}
.#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
. HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
-. NAME, FALSE, 0, 0, IN)
+. NAME, FALSE, 0, 0, IN)
.
DESCRIPTION
.#define EMPTY_HOWTO(C) \
. HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
-. NULL, FALSE, 0, 0, FALSE)
+. NULL, FALSE, 0, 0, FALSE)
.
DESCRIPTION
Helper routine to turn a symbol into a relocation value.
-.#define HOWTO_PREPARE(relocation, symbol) \
-. { \
-. if (symbol != NULL) \
-. { \
-. if (bfd_is_com_section (symbol->section)) \
-. { \
-. relocation = 0; \
-. } \
-. else \
-. { \
-. relocation = symbol->value; \
-. } \
-. } \
+.#define HOWTO_PREPARE(relocation, symbol) \
+. { \
+. if (symbol != NULL) \
+. { \
+. if (bfd_is_com_section (symbol->section)) \
+. { \
+. relocation = 0; \
+. } \
+. else \
+. { \
+. relocation = symbol->value; \
+. } \
+. } \
. }
.
*/
case complain_overflow_signed:
/* If any sign bits are set, all sign bits must be set. That
- is, A must be a valid negative address after shifting. */
+ is, A must be a valid negative address after shifting. */
signmask = ~ (fieldmask >> 1);
/* Fall thru */
SYNOPSIS
bfd_boolean bfd_reloc_offset_in_range
- (reloc_howto_type *howto,
- bfd *abfd,
- asection *section,
- bfd_size_type offset);
+ (reloc_howto_type *howto,
+ bfd *abfd,
+ asection *section,
+ bfd_size_type offset);
DESCRIPTION
- Returns TRUE if the reloc described by @var{HOWTO} can be
+ Returns TRUE if the reloc described by @var{HOWTO} can be
applied at @var{OFFSET} octets in @var{SECTION}.
*/
SYNOPSIS
bfd_reloc_status_type bfd_perform_relocation
- (bfd *abfd,
- arelent *reloc_entry,
- void *data,
- asection *input_section,
- bfd *output_bfd,
+ (bfd *abfd,
+ arelent *reloc_entry,
+ void *data,
+ asection *input_section,
+ bfd *output_bfd,
char **error_message);
DESCRIPTION
R result
Do this:
- (( i i i i i o o o o o from bfd_get<size>
- and S S S S S) to get the size offset we want
- + r r r r r r r r r r) to get the final value to place
- and D D D D D to chop to right size
+ (( i i i i i o o o o o from bfd_get<size>
+ and S S S S S) to get the size offset we want
+ + r r r r r r r r r r) to get the final value to place
+ and D D D D D to chop to right size
-----------------------
- = A A A A A
+ = A A A A A
And this:
- ( i i i i i o o o o o from bfd_get<size>
- and N N N N N ) get instruction
+ ( i i i i i o o o o o from bfd_get<size>
+ and N N N N N ) get instruction
-----------------------
- = B B B B B
+ = B B B B B
And then:
- ( B B B B B
- or A A A A A)
+ ( B B B B B
+ or A A A A A)
-----------------------
- = R R R R R R R R R R put into bfd_put<size>
+ = R R R R R R R R R R put into bfd_put<size>
*/
#define DOIT(x) \
SYNOPSIS
bfd_reloc_status_type bfd_install_relocation
- (bfd *abfd,
- arelent *reloc_entry,
- void *data, bfd_vma data_start,
- asection *input_section,
+ (bfd *abfd,
+ arelent *reloc_entry,
+ void *data, bfd_vma data_start,
+ asection *input_section,
char **error_message);
DESCRIPTION
R result
Do this:
- (( i i i i i o o o o o from bfd_get<size>
- and S S S S S) to get the size offset we want
- + r r r r r r r r r r) to get the final value to place
- and D D D D D to chop to right size
+ (( i i i i i o o o o o from bfd_get<size>
+ and S S S S S) to get the size offset we want
+ + r r r r r r r r r r) to get the final value to place
+ and D D D D D to chop to right size
-----------------------
- = A A A A A
+ = A A A A A
And this:
- ( i i i i i o o o o o from bfd_get<size>
- and N N N N N ) get instruction
+ ( i i i i i o o o o o from bfd_get<size>
+ and N N N N N ) get instruction
-----------------------
- = B B B B B
+ = B B B B B
And then:
- ( B B B B B
- or A A A A A)
+ ( B B B B B
+ or A A A A A)
-----------------------
- = R R R R R R R R R R put into bfd_put<size>
+ = R R R R R R R R R R put into bfd_put<size>
*/
#define DOIT(x) \
bfd_vma a, b, sum;
/* Get the values to be added together. For signed and unsigned
- relocations, we assume that all values should be truncated to
- the size of an address. For bitfields, all the bits matter.
- See also bfd_check_overflow. */
+ relocations, we assume that all values should be truncated to
+ the size of an address. For bitfields, all the bits matter.
+ See also bfd_check_overflow. */
fieldmask = N_ONES (howto->bitsize);
signmask = ~fieldmask;
addrmask = (N_ONES (bfd_arch_bits_per_address (input_bfd))
flag = bfd_reloc_overflow;
/* We only need this next bit of code if the sign bit of B
- is below the sign bit of A. This would only happen if
- SRC_MASK had fewer bits than BITSIZE. Note that if
- SRC_MASK has more bits than BITSIZE, we can get into
- trouble; we would need to verify that B is in range, as
- we do for A above. */
+ is below the sign bit of A. This would only happen if
+ SRC_MASK had fewer bits than BITSIZE. Note that if
+ SRC_MASK has more bits than BITSIZE, we can get into
+ trouble; we would need to verify that B is in range, as
+ we do for A above. */
ss = ((~howto->src_mask) >> 1) & howto->src_mask;
ss >>= bitpos;
sum = a + b;
/* See if the result has the correct sign. Bits above the
- sign bit are junk now; ignore them. If the sum is
- positive, make sure we did not have all negative inputs;
- if the sum is negative, make sure we did not have all
- positive inputs. The test below looks only at the sign
- bits, and it really just
- SIGN (A) == SIGN (B) && SIGN (A) != SIGN (SUM)
+ sign bit are junk now; ignore them. If the sum is
+ positive, make sure we did not have all negative inputs;
+ if the sum is negative, make sure we did not have all
+ positive inputs. The test below looks only at the sign
+ bits, and it really just
+ SIGN (A) == SIGN (B) && SIGN (A) != SIGN (SUM)
We mask with addrmask here to explicitly allow an address
wrap-around. The Linux kernel relies on it, and it is
case complain_overflow_unsigned:
/* Checking for an unsigned overflow is relatively easy:
- trim the addresses and add, and trim the result as well.
- Overflow is normally indicated when the result does not
- fit in the field. However, we also need to consider the
- case when, e.g., fieldmask is 0x7fffffff or smaller, an
- input is 0x80000000, and bfd_vma is only 32 bits; then we
- will get sum == 0, but there is an overflow, since the
- inputs did not fit in the field. Instead of doing a
- separate test, we can check for this by or-ing in the
- operands when testing for the sum overflowing its final
- field. */
+ trim the addresses and add, and trim the result as well.
+ Overflow is normally indicated when the result does not
+ fit in the field. However, we also need to consider the
+ case when, e.g., fieldmask is 0x7fffffff or smaller, an
+ input is 0x80000000, and bfd_vma is only 32 bits; then we
+ will get sum == 0, but there is an overflow, since the
+ inputs did not fit in the field. Instead of doing a
+ separate test, we can check for this by or-ing in the
+ operands when testing for the sum overflowing its final
+ field. */
sum = (a + b) & addrmask;
if ((a | b | sum) & signmask)
flag = bfd_reloc_overflow;
away some literal section references. The symbol is ignored (read
as the absolute section symbol), and the "addend" indicates the type
of instruction using the register:
- 1 - "memory" fmt insn
- 2 - byte-manipulation (byte offset reg)
- 3 - jsr (target of branch)
+ 1 - "memory" fmt insn
+ 2 - byte-manipulation (byte offset reg)
+ 3 - jsr (target of branch)
ENUM
BFD_RELOC_ALPHA_HINT
/* The following come from the man page. */
#define SHLIBLEN 60
-#define MF_IMPURE 00200
-#define MF_SQUEEZED 01000
-#define MF_USES_SL 02000
-#define MF_IS_SL 04000
+#define MF_IMPURE 00200
+#define MF_SQUEEZED 01000
+#define MF_USES_SL 02000
+#define MF_IS_SL 04000
/* Common combinations. */
/* Demand load (impure text). */
-#define IMAGIC (MF_IMPURE | ZMAGIC)
+#define IMAGIC (MF_IMPURE | ZMAGIC)
/* OMAGIC with large header.
May contain a ref to a shared lib required by the object. */
-#define SPOMAGIC (MF_USES_SL | OMAGIC)
+#define SPOMAGIC (MF_USES_SL | OMAGIC)
/* A reference to a shared library.
The text portion of the object contains "overflow text" from
the shared library to be linked in with an object. */
-#define SLOMAGIC (MF_IS_SL | OMAGIC)
+#define SLOMAGIC (MF_IS_SL | OMAGIC)
/* Sqeezed demand paged.
NOTE: This interpretation of QMAGIC seems to be at variance
with that used on other architectures. */
-#define QMAGIC (MF_SQUEEZED | ZMAGIC)
+#define QMAGIC (MF_SQUEEZED | ZMAGIC)
/* Program which uses sl. */
-#define SPZMAGIC (MF_USES_SL | ZMAGIC)
+#define SPZMAGIC (MF_USES_SL | ZMAGIC)
/* Sqeezed ditto. */
-#define SPQMAGIC (MF_USES_SL | QMAGIC)
+#define SPQMAGIC (MF_USES_SL | QMAGIC)
/* Shared lib part of prog. */
-#define SLZMAGIC (MF_IS_SL | ZMAGIC)
+#define SLZMAGIC (MF_IS_SL | ZMAGIC)
/* Sl which uses another. */
-#define SLPZMAGIC (MF_USES_SL | SLZMAGIC)
+#define SLPZMAGIC (MF_USES_SL | SLZMAGIC)
#define N_SHARED_LIB(x) ((x)->a_info & MF_USES_SL)
#define MY(OP) CONCAT2 (arm_aout_riscix_,OP)
#define TARGETNAME "a.out-riscix"
#define N_BADMAG(x) ((((x)->a_info & ~007200) != ZMAGIC) \
- && (((x)->a_info & ~006000) != OMAGIC) \
- && ((x)->a_info != NMAGIC))
+ && (((x)->a_info & ~006000) != OMAGIC) \
+ && ((x)->a_info != NMAGIC))
#define N_MAGIC(x) ((x)->a_info & ~07200)
#include "sysdep.h"
{ \
if (adata (abfd).magic == undecided_magic) \
NAME (aout, adjust_sizes_and_vmas) (abfd); \
- \
+ \
execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE; \
execp->a_entry = bfd_get_start_address (abfd); \
- \
+ \
execp->a_trsize = ((obj_textsec (abfd)->reloc_count) * \
obj_reloc_entry_size (abfd)); \
execp->a_drsize = ((obj_datasec (abfd)->reloc_count) * \
obj_reloc_entry_size (abfd)); \
NAME (aout, swap_exec_header_out) (abfd, execp, & exec_bytes); \
- \
+ \
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 \
|| bfd_bwrite ((void *) & exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \
abfd) != EXEC_BYTES_SIZE) \
return FALSE; \
/* Now write out reloc info, followed by syms and strings. */ \
\
- if (bfd_get_outsymbols (abfd) != NULL \
+ if (bfd_get_outsymbols (abfd) != NULL \
&& bfd_get_symcount (abfd) != 0) \
{ \
if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) != 0) \
return FALSE; \
\
if (! NAME (aout, write_syms) (abfd)) \
- return FALSE; \
+ return FALSE; \
\
if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (execp)), SEEK_SET) != 0) \
return FALSE; \
static reloc_howto_type riscix_std_reloc_howto[] =
{
- /* Type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */
- HOWTO( 0, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,0,"8", TRUE, 0x000000ff,0x000000ff, FALSE),
- HOWTO( 1, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
- HOWTO( 2, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"32", TRUE, 0xffffffff,0xffffffff, FALSE),
- HOWTO( 3, 2, 3, 26, TRUE, 0, complain_overflow_signed, riscix_fix_pcrel_26 , "ARM26", TRUE, 0x00ffffff,0x00ffffff, FALSE),
- HOWTO( 4, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0,"DISP8", TRUE, 0x000000ff,0x000000ff, TRUE),
- HOWTO( 5, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0,"DISP16", TRUE, 0x0000ffff,0x0000ffff, TRUE),
- HOWTO( 6, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0,"DISP32", TRUE, 0xffffffff,0xffffffff, TRUE),
- HOWTO( 7, 2, 3, 26, FALSE, 0, complain_overflow_signed, riscix_fix_pcrel_26_done, "ARM26D",TRUE,0x00ffffff,0x00ffffff, FALSE),
+ /* Type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */
+ HOWTO( 0, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,0,"8", TRUE, 0x000000ff,0x000000ff, FALSE),
+ HOWTO( 1, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+ HOWTO( 2, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"32", TRUE, 0xffffffff,0xffffffff, FALSE),
+ HOWTO( 3, 2, 3, 26, TRUE, 0, complain_overflow_signed, riscix_fix_pcrel_26 , "ARM26", TRUE, 0x00ffffff,0x00ffffff, FALSE),
+ HOWTO( 4, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0,"DISP8", TRUE, 0x000000ff,0x000000ff, TRUE),
+ HOWTO( 5, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0,"DISP16", TRUE, 0x0000ffff,0x0000ffff, TRUE),
+ HOWTO( 6, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0,"DISP32", TRUE, 0xffffffff,0xffffffff, TRUE),
+ HOWTO( 7, 2, 3, 26, FALSE, 0, complain_overflow_signed, riscix_fix_pcrel_26_done, "ARM26D",TRUE,0x00ffffff,0x00ffffff, FALSE),
EMPTY_HOWTO (-1),
- HOWTO( 9, 0, -1, 16, FALSE, 0, complain_overflow_bitfield,0,"NEG16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
- HOWTO( 10, 0, -2, 32, FALSE, 0, complain_overflow_bitfield,0,"NEG32", TRUE, 0xffffffff,0xffffffff, FALSE)
+ HOWTO( 9, 0, -1, 16, FALSE, 0, complain_overflow_bitfield,0,"NEG16", TRUE, 0x0000ffff,0x0000ffff, FALSE),
+ HOWTO( 10, 0, -2, 32, FALSE, 0, complain_overflow_bitfield,0,"NEG32", TRUE, 0xffffffff,0xffffffff, FALSE)
};
#define RISCIX_TABLE_SIZE \
switch (bfd_arch_bits_per_address (abfd))
{
case 32:
- code = BFD_RELOC_32;
- break;
+ code = BFD_RELOC_32;
+ break;
default:
return NULL;
}
}
#define MY_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define MY_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define MY_final_link_callback should_not_be_used
-#define MY_bfd_final_link _bfd_generic_final_link
+#define MY_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define MY_final_link_callback should_not_be_used
+#define MY_bfd_final_link _bfd_generic_final_link
#define MY_bfd_reloc_type_lookup riscix_reloc_type_lookup
#define MY_bfd_reloc_name_lookup riscix_reloc_name_lookup
-#define MY_canonicalize_reloc arm_aout_riscix_canonicalize_reloc
-#define MY_object_p arm_aout_riscix_object_p
+#define MY_canonicalize_reloc arm_aout_riscix_canonicalize_reloc
+#define MY_object_p arm_aout_riscix_object_p
static void
riscix_swap_std_reloc_out (bfd *abfd,
if (abfd->iostream != NULL
&& (abfd->flags & BFD_IN_MEMORY) == 0
- && (fstat(fileno((FILE *) (abfd->iostream)), &stat_buf) == 0)
- && ((stat_buf.st_mode & 0111) != 0))
+ && (fstat(fileno((FILE *) (abfd->iostream)), &stat_buf) == 0)
+ && ((stat_buf.st_mode & 0111) != 0))
abfd->flags |= EXEC_P;
}
#else /* ! MACH */
static const bfd_target *
MY (object_p) (bfd *abfd)
{
- struct external_exec exec_bytes; /* Raw exec header from file. */
- struct internal_exec exec; /* Cleaned-up exec header. */
+ struct external_exec exec_bytes; /* Raw exec header from file. */
+ struct internal_exec exec; /* Cleaned-up exec header. */
const bfd_target *target;
if (bfd_bread ((void *) &exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, abfd)
#else
struct core_dump new_dump; /* For simpler coding. */
#endif
-#ifndef BFD64 /* Use old only if gdb is 32-bit. */
+#ifndef BFD64 /* Use old only if gdb is 32-bit. */
struct core_dump old; /* Old AIX 4.2- core dump, still used on
4.3+ with appropriate SMIT config. */
#endif
but that may not be the only such format version number. */
#ifdef AIX_5_CORE
-# define CORE_DUMPXX_VERSION 267312562
+# define CORE_DUMPXX_VERSION 267312562
# define CNEW_IS_CORE_DUMPXX(c) ((c).new_dump.c_version == CORE_DUMPXX_VERSION)
#else
# define CNEW_IS_CORE_DUMPXX(c) 0
common. */
#ifdef AIX_CORE_DUMPX_CORE
#define CORE_COMMONSZ ((long) &((struct core_dumpx *) 0)->c_entries \
- + sizeof (((struct core_dumpx *) 0)->c_entries))
+ + sizeof (((struct core_dumpx *) 0)->c_entries))
#else
#define CORE_COMMONSZ ((int) &((struct core_dump *) 0)->c_entries \
- + sizeof (((struct core_dump *) 0)->c_entries)
+ + sizeof (((struct core_dump *) 0)->c_entries)
#endif
/* Define prototypes for certain functions, to avoid a compiler warning
saying that they are missing. */
const bfd_target * rs6000coff_core_p (bfd *abfd);
bfd_boolean rs6000coff_core_file_matches_executable_p (bfd *core_bfd,
- bfd *exec_bfd);
+ bfd *exec_bfd);
char * rs6000coff_core_file_failing_command (bfd *abfd);
int rs6000coff_core_file_failing_signal (bfd *abfd);
/* If Large Memory Model is used, then the .data segment should start from
BDATAORG which has been defined in the system header files. */
- if (c_flag & CORE_BIGDATA)
- core_dataorg = BDATAORG;
- else
- core_dataorg = CDATA_ADDR (c_datasize);
+ if (c_flag & CORE_BIGDATA)
+ core_dataorg = BDATAORG;
+ else
+ core_dataorg = CDATA_ADDR (c_datasize);
if (!make_bfd_asection (abfd, ".data",
SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS,
#ifndef BFD64
size = CORE_NEW (core) ? sizeof (vminfo.new_dump) : sizeof (vminfo.old);
#else
- size = sizeof (vminfo.new_dump);
+ size = sizeof (vminfo.new_dump);
#endif
if (bfd_bread (&vminfo, size, abfd) != size)
goto fail;
. synthesized from other information. *}
. flagword flags;
.
-.#define SEC_NO_FLAGS 0x000
+.#define SEC_NO_FLAGS 0x0
.
. {* Tells the OS to allocate space for this section when loading.
. This is clear for a section containing debug information only. *}
-.#define SEC_ALLOC 0x001
+.#define SEC_ALLOC 0x1
.
. {* Tells the OS to load the section from the file when loading.
. This is clear for a .bss section. *}
-.#define SEC_LOAD 0x002
+.#define SEC_LOAD 0x2
.
. {* The section contains data still to be relocated, so there is
. some relocation information too. *}
-.#define SEC_RELOC 0x004
+.#define SEC_RELOC 0x4
.
. {* A signal to the OS that the section contains read only data. *}
-.#define SEC_READONLY 0x008
+.#define SEC_READONLY 0x8
.
. {* The section contains code only. *}
-.#define SEC_CODE 0x010
+.#define SEC_CODE 0x10
.
. {* The section contains data only. *}
-.#define SEC_DATA 0x020
+.#define SEC_DATA 0x20
.
. {* The section will reside in ROM. *}
-.#define SEC_ROM 0x040
+.#define SEC_ROM 0x40
.
. {* The section contains constructor information. This section
. type is used by the linker to create lists of constructors and
. sections called <<__CTOR_LIST__>> and relocate the data
. contained within - exactly the operations it would peform on
. standard data. *}
-.#define SEC_CONSTRUCTOR 0x080
+.#define SEC_CONSTRUCTOR 0x80
.
. {* The section has contents - a data section could be
. <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
. <<SEC_HAS_CONTENTS>> *}
-.#define SEC_HAS_CONTENTS 0x100
+.#define SEC_HAS_CONTENTS 0x100
.
. {* An instruction to the linker to not output the section
. even if it has information which would normally be written. *}
-.#define SEC_NEVER_LOAD 0x200
+.#define SEC_NEVER_LOAD 0x200
.
. {* The section contains thread local data. *}
-.#define SEC_THREAD_LOCAL 0x400
+.#define SEC_THREAD_LOCAL 0x400
.
. {* The section has GOT references. This flag is only for the
. linker, and is currently only used by the elf32-hppa back end.
. in this section, which indicate to the linker that the section
. contains PIC code, and must be handled specially when doing a
. static link. *}
-.#define SEC_HAS_GOT_REF 0x800
+.#define SEC_HAS_GOT_REF 0x800
.
. {* The section contains common symbols (symbols may be defined
. multiple times, the value of a symbol is the amount of
. space it requires, and the largest symbol value is the one
. used). Most targets have exactly one of these (which we
. translate to bfd_com_section_ptr), but ECOFF has two. *}
-.#define SEC_IS_COMMON 0x1000
+.#define SEC_IS_COMMON 0x1000
.
. {* The section contains only debugging information. For
. example, this is set for ELF .debug and .stab sections.
. strip tests this flag to see if a section can be
. discarded. *}
-.#define SEC_DEBUGGING 0x2000
+.#define SEC_DEBUGGING 0x2000
.
. {* The contents of this section are held in memory pointed to
. by the contents field. This is checked by bfd_get_section_contents,
. and the data is retrieved from memory if appropriate. *}
-.#define SEC_IN_MEMORY 0x4000
+.#define SEC_IN_MEMORY 0x4000
.
. {* The contents of this section are to be excluded by the
. linker for executable and shared objects unless those
. objects are to be further relocated. *}
-.#define SEC_EXCLUDE 0x8000
+.#define SEC_EXCLUDE 0x8000
.
. {* The contents of this section are to be sorted based on the sum of
. the symbol and addend values specified by the associated relocation
. entries. Entries without associated relocation entries will be
. appended to the end of the section in an unspecified order. *}
-.#define SEC_SORT_ENTRIES 0x10000
+.#define SEC_SORT_ENTRIES 0x10000
.
. {* When linking, duplicate sections of the same name should be
. discarded, rather than being combined into a single section as
. is usually done. This is similar to how common symbols are
. handled. See SEC_LINK_DUPLICATES below. *}
-.#define SEC_LINK_ONCE 0x20000
+.#define SEC_LINK_ONCE 0x20000
.
. {* If SEC_LINK_ONCE is set, this bitfield describes how the linker
. should handle duplicate sections. *}
-.#define SEC_LINK_DUPLICATES 0xc0000
+.#define SEC_LINK_DUPLICATES 0xc0000
.
. {* This value for SEC_LINK_DUPLICATES means that duplicate
. sections with the same name should simply be discarded. *}
-.#define SEC_LINK_DUPLICATES_DISCARD 0x0
+.#define SEC_LINK_DUPLICATES_DISCARD 0x0
.
. {* This value for SEC_LINK_DUPLICATES means that the linker
. should warn if there are any duplicate sections, although
. it should still only link one copy. *}
-.#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
+.#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000
.
. {* This value for SEC_LINK_DUPLICATES means that the linker
. should warn if any duplicate sections are a different size. *}
. relocation or other arcane processing. It is skipped when
. going through the first-pass output, trusting that someone
. else up the line will take care of it later. *}
-.#define SEC_LINKER_CREATED 0x100000
+.#define SEC_LINKER_CREATED 0x100000
.
. {* This section should not be subject to garbage collection.
. Also set to inform the linker that this section should not be
. listed in the link map as discarded. *}
-.#define SEC_KEEP 0x200000
+.#define SEC_KEEP 0x200000
.
. {* This section contains "short" data, and should be placed
. "near" the GP. *}
-.#define SEC_SMALL_DATA 0x400000
+.#define SEC_SMALL_DATA 0x400000
.
. {* Attempt to merge identical entities in the section.
. Entity size is given in the entsize field. *}
-.#define SEC_MERGE 0x800000
+.#define SEC_MERGE 0x800000
.
. {* If given with SEC_MERGE, entities to merge are zero terminated
. strings where entsize specifies character size instead of fixed
. size entries. *}
-.#define SEC_STRINGS 0x1000000
+.#define SEC_STRINGS 0x1000000
.
. {* This section contains data about section groups. *}
-.#define SEC_GROUP 0x2000000
+.#define SEC_GROUP 0x2000000
.
. {* The section is a COFF shared library section. This flag is
. only for the linker. If this type of section appears in
. might be cleaner to have some more general mechanism to
. allow the back end to control what the linker does with
. sections. *}
-.#define SEC_COFF_SHARED_LIBRARY 0x4000000
+.#define SEC_COFF_SHARED_LIBRARY 0x4000000
.
. {* This input section should be copied to output in reverse order
. as an array of pointers. This is for ELF linker internal use
. only. *}
-.#define SEC_ELF_REVERSE_COPY 0x4000000
+.#define SEC_ELF_REVERSE_COPY 0x4000000
.
. {* This section contains data which may be shared with other
. executables or shared objects. This is for COFF only. *}
-.#define SEC_COFF_SHARED 0x8000000
+.#define SEC_COFF_SHARED 0x8000000
.
. {* This section should be compressed. This is for ELF linker
. internal use only. *}
-.#define SEC_ELF_COMPRESS 0x8000000
+.#define SEC_ELF_COMPRESS 0x8000000
.
. {* When a section with this flag is being linked, then if the size of
. the input section is less than a page, it should not cross a page
. boundary. If the size of the input section is one page or more,
. it should be aligned on a page boundary. This is for TI
. TMS320C54X only. *}
-.#define SEC_TIC54X_BLOCK 0x10000000
+.#define SEC_TIC54X_BLOCK 0x10000000
.
. {* This section should be renamed. This is for ELF linker
. internal use only. *}
-.#define SEC_ELF_RENAME 0x10000000
+.#define SEC_ELF_RENAME 0x10000000
.
. {* Conditionally link this section; do not link if there are no
. references found to any symbol in the section. This is for TI
. TMS320C54X only. *}
-.#define SEC_TIC54X_CLINK 0x20000000
+.#define SEC_TIC54X_CLINK 0x20000000
.
. {* This section contains vliw code. This is for Toshiba MeP only. *}
-.#define SEC_MEP_VLIW 0x20000000
+.#define SEC_MEP_VLIW 0x20000000
.
. {* Indicate that section has the no read flag set. This happens
. when memory read flag isn't set. *}
-.#define SEC_COFF_NOREAD 0x40000000
+.#define SEC_COFF_NOREAD 0x40000000
.
. {* Indicate that section has the purecode flag set. *}
-.#define SEC_ELF_PURECODE 0x80000000
+.#define SEC_ELF_PURECODE 0x80000000
.
. {* End of section flags. *}
.
. would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
. compilers will complain about comma expressions that have no effect. *}
.static inline bfd_boolean
-.bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
+.bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
+. void * val)
.{
. ptr->userdata = val;
. return TRUE;
.}
.
.static inline bfd_boolean
-.bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
+.bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
+. unsigned int val)
.{
. ptr->alignment_power = val;
. return TRUE;
Not enough memory exists to create private data for @var{osec}.
.#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
-. BFD_SEND (obfd, _bfd_copy_private_section_data, \
-. (ibfd, isection, obfd, osection))
+. BFD_SEND (obfd, _bfd_copy_private_section_data, \
+. (ibfd, isection, obfd, osection))
*/
/*
static void
som_swap_clock_in (struct som_external_clock *src,
- struct som_clock *dst)
+ struct som_clock *dst)
{
dst->secs = bfd_getb32 (src->secs);
dst->nanosecs = bfd_getb32 (src->nanosecs);
static void
som_swap_clock_out (struct som_clock *src,
- struct som_external_clock *dst)
+ struct som_external_clock *dst)
{
bfd_putb32 (src->secs, dst->secs);
bfd_putb32 (src->nanosecs, dst->nanosecs);
static void
som_swap_header_in (struct som_external_header *src,
- struct som_header *dst)
+ struct som_header *dst)
{
dst->system_id = bfd_getb16 (src->system_id);
dst->a_magic = bfd_getb16 (src->a_magic);
static void
som_swap_header_out (struct som_header *src,
- struct som_external_header *dst)
+ struct som_external_header *dst)
{
bfd_putb16 (src->system_id, dst->system_id);
bfd_putb16 (src->a_magic, dst->a_magic);
static void
som_swap_space_dictionary_in (struct som_external_space_dictionary_record *src,
- struct som_space_dictionary_record *dst)
+ struct som_space_dictionary_record *dst)
{
unsigned int flags;
static void
som_swap_space_dictionary_out (struct som_space_dictionary_record *src,
- struct som_external_space_dictionary_record *dst)
+ struct som_external_space_dictionary_record *dst)
{
unsigned int flags;
static void
som_swap_aux_id_in (struct som_external_aux_id *src,
- struct som_aux_id *dst)
+ struct som_aux_id *dst)
{
unsigned int flags = bfd_getb32 (src->flags);
static void
som_swap_aux_id_out (struct som_aux_id *src,
- struct som_external_aux_id *dst)
+ struct som_external_aux_id *dst)
{
unsigned int flags = 0;
static void
som_swap_string_auxhdr_out (struct som_string_auxhdr *src,
- struct som_external_string_auxhdr *dst)
+ struct som_external_string_auxhdr *dst)
{
som_swap_aux_id_out (&src->header_id, &dst->header_id);
bfd_putb32 (src->string_length, dst->string_length);
static void
som_swap_compilation_unit_out (struct som_compilation_unit *src,
- struct som_external_compilation_unit *dst)
+ struct som_external_compilation_unit *dst)
{
bfd_putb32 (src->name.strx, dst->name);
bfd_putb32 (src->language_name.strx, dst->language_name);
static void
som_swap_exec_auxhdr_in (struct som_external_exec_auxhdr *src,
- struct som_exec_auxhdr *dst)
+ struct som_exec_auxhdr *dst)
{
som_swap_aux_id_in (&src->som_auxhdr, &dst->som_auxhdr);
dst->exec_tsize = bfd_getb32 (src->exec_tsize);
static void
som_swap_exec_auxhdr_out (struct som_exec_auxhdr *src,
- struct som_external_exec_auxhdr *dst)
+ struct som_external_exec_auxhdr *dst)
{
som_swap_aux_id_out (&src->som_auxhdr, &dst->som_auxhdr);
bfd_putb32 (src->exec_tsize, dst->exec_tsize);
static void
som_swap_lst_header_in (struct som_external_lst_header *src,
- struct som_lst_header *dst)
+ struct som_lst_header *dst)
{
dst->system_id = bfd_getb16 (src->system_id);
dst->a_magic = bfd_getb16 (src->a_magic);
subspace_index++)
{
asection *subspace_asect;
- char *subspace_name;
+ char *subspace_name;
/* Read in the next subspace. */
amt = sizeof ext_subspace;
if (bfd_bread (&ext_subspace, amt, abfd) != amt)
goto error_return;
- som_swap_subspace_dictionary_in (&ext_subspace, &subspace);
+ som_swap_subspace_dictionary_in (&ext_subspace, &subspace);
/* Setup the subspace name string. */
subspace_name = subspace.name + space_strings;
else
{
/* The subspace_start field is not initialised in relocatable
- only objects, so it cannot be used for length calculations.
+ only objects, so it cannot be used for length calculations.
Instead we use the space_size value which we have been
accumulating. This isn't an accurate estimate since it
ignores alignment and ordering issues. */
returning from this function.) The same technique is
used a few more times below when a buffer is
reallocated. */
- if (2 * tmp_space_size < length + 5)
- tmp_space_size = length + 5;
- else
- tmp_space_size = 2 * tmp_space_size;
+ if (2 * tmp_space_size < length + 5)
+ tmp_space_size = length + 5;
+ else
+ tmp_space_size = 2 * tmp_space_size;
tmp_space = xrealloc (tmp_space, tmp_space_size);
}
{
for (i = 0; i < 4; i++)
{
- struct som_name_pt *name;
- size_t length;
+ struct som_name_pt *name;
+ size_t length;
switch (i)
{
case 3:
name = &compilation_unit->version_id;
break;
- default:
- abort ();
+ default:
+ abort ();
}
length = strlen (name->name);
if (5 + length > tmp_space_size)
{
/* See alloca above for discussion of new size. */
- if (2 * tmp_space_size < 5 + length)
- tmp_space_size = 5 + length;
- else
- tmp_space_size = 2 * tmp_space_size;
+ if (2 * tmp_space_size < 5 + length)
+ tmp_space_size = 5 + length;
+ else
+ tmp_space_size = 2 * tmp_space_size;
tmp_space = xrealloc (tmp_space, tmp_space_size);
}
/* Next comes the string itself + a null terminator. */
strcpy (p, name->name);
- name->strx = strings_size;
+ name->strx = strings_size;
p += length + 1;
strings_size += length + 1;
if (5 + length > tmp_space_size)
{
/* See alloca above for discussion of new size. */
- if (2 * tmp_space_size < 5 + length)
- tmp_space_size = 5 + length;
- else
- tmp_space_size = 2 * tmp_space_size;
+ if (2 * tmp_space_size < 5 + length)
+ tmp_space_size = 5 + length;
+ else
+ tmp_space_size = 2 * tmp_space_size;
tmp_space = xrealloc (tmp_space, tmp_space_size);
}
obj_som_file_hdr (abfd)->aux_header_size += len;
current_offset += len;
som_swap_string_auxhdr_out
- (obj_som_version_hdr (abfd), &ext_string_auxhdr);
+ (obj_som_version_hdr (abfd), &ext_string_auxhdr);
if (bfd_bwrite (&ext_string_auxhdr, len, abfd) != len)
return FALSE;
obj_som_file_hdr (abfd)->aux_header_size += len;
current_offset += len;
som_swap_string_auxhdr_out
- (obj_som_copyright_hdr (abfd), &ext_string_auxhdr);
+ (obj_som_copyright_hdr (abfd), &ext_string_auxhdr);
if (bfd_bwrite (&ext_string_auxhdr, len, abfd) != len)
return FALSE;
subsection != NULL;
subsection = subsection->next)
{
- struct som_external_subspace_dictionary_record ext_subspace_dict;
+ struct som_external_subspace_dictionary_record ext_subspace_dict;
/* Skip any section which does not correspond to a space
or subspace. Or does not have SEC_ALLOC set (and therefore
som_section_data (subsection)->subspace_dict->space_index = i;
/* Dump the current subspace header. */
- som_swap_subspace_dictionary_record_out
- (som_section_data (subsection)->subspace_dict, &ext_subspace_dict);
+ som_swap_subspace_dictionary_record_out
+ (som_section_data (subsection)->subspace_dict, &ext_subspace_dict);
amt = sizeof (struct som_subspace_dictionary_record);
if (bfd_bwrite (&ext_subspace_dict, amt, abfd) != amt)
return FALSE;
subsection != NULL;
subsection = subsection->next)
{
- struct som_external_subspace_dictionary_record ext_subspace_dict;
+ struct som_external_subspace_dictionary_record ext_subspace_dict;
/* Skip any section which does not correspond to a space or
subspace, or which SEC_ALLOC set (and therefore handled
som_section_data (subsection)->subspace_dict->space_index = i;
/* Dump this subspace header. */
- som_swap_subspace_dictionary_record_out
- (som_section_data (subsection)->subspace_dict, &ext_subspace_dict);
+ som_swap_subspace_dictionary_record_out
+ (som_section_data (subsection)->subspace_dict, &ext_subspace_dict);
amt = sizeof (struct som_subspace_dictionary_record);
if (bfd_bwrite (&ext_subspace_dict, amt, abfd) != amt)
return FALSE;
/* Dump its header. */
som_swap_space_dictionary_out (som_section_data (section)->space_dict,
- &ext_space_dict);
+ &ext_space_dict);
amt = sizeof (struct som_external_space_dictionary_record);
if (bfd_bwrite (&ext_space_dict, amt, abfd) != amt)
return FALSE;
return FALSE;
som_swap_compilation_unit_out
- (obj_som_compilation_unit (abfd), &ext_comp_unit);
+ (obj_som_compilation_unit (abfd), &ext_comp_unit);
amt = sizeof (struct som_external_compilation_unit);
if (bfd_bwrite (&ext_comp_unit, amt, abfd) != amt)
By the time we get here, the index has already been
computed and stored into the name field in the BFD symbol. */
bfd_putb32 (som_symbol_data (bfd_syms[i])->stringtab_offset,
- som_symtab[i].name);
+ som_symtab[i].name);
/* Derive SOM information from the BFD symbol. */
som_bfd_derive_misc_symbol_info (abfd, bfd_syms[i], &info);
/* Now use it. */
flags = (info.symbol_type << SOM_SYMBOL_TYPE_SH)
- | (info.symbol_scope << SOM_SYMBOL_SCOPE_SH)
- | (info.arg_reloc << SOM_SYMBOL_ARG_RELOC_SH)
- | (3 << SOM_SYMBOL_XLEAST_SH)
- | (info.secondary_def ? SOM_SYMBOL_SECONDARY_DEF : 0)
- | (info.is_common ? SOM_SYMBOL_IS_COMMON : 0)
- | (info.dup_common ? SOM_SYMBOL_DUP_COMMON : 0);
+ | (info.symbol_scope << SOM_SYMBOL_SCOPE_SH)
+ | (info.arg_reloc << SOM_SYMBOL_ARG_RELOC_SH)
+ | (3 << SOM_SYMBOL_XLEAST_SH)
+ | (info.secondary_def ? SOM_SYMBOL_SECONDARY_DEF : 0)
+ | (info.is_common ? SOM_SYMBOL_IS_COMMON : 0)
+ | (info.dup_common ? SOM_SYMBOL_DUP_COMMON : 0);
bfd_putb32 (flags, som_symtab[i].flags);
flags = (info.symbol_info << SOM_SYMBOL_SYMBOL_INFO_SH)
- | (info.is_comdat ? SOM_SYMBOL_IS_COMDAT : 0);
+ | (info.is_comdat ? SOM_SYMBOL_IS_COMDAT : 0);
bfd_putb32 (flags, som_symtab[i].info);
bfd_putb32 (info.symbol_value | info.priv_level,
- som_symtab[i].symbol_value);
+ som_symtab[i].symbol_value);
}
/* Everything is ready, seek to the right location and
&& symbol_type != ST_MILLICODE))
{
int idx = (bfd_getb32 (symbol->info) >> SOM_SYMBOL_SYMBOL_INFO_SH)
- & SOM_SYMBOL_SYMBOL_INFO_MASK;
+ & SOM_SYMBOL_SYMBOL_INFO_MASK;
for (section = abfd->sections; section != NULL; section = section->next)
if (section->target_index == idx && som_is_subspace (section))
{
unsigned int flags = bfd_getb32 (bufp->flags);
unsigned int symbol_type =
- (flags >> SOM_SYMBOL_TYPE_SH) & SOM_SYMBOL_TYPE_MASK;
+ (flags >> SOM_SYMBOL_TYPE_SH) & SOM_SYMBOL_TYPE_MASK;
unsigned int symbol_scope =
- (flags >> SOM_SYMBOL_SCOPE_SH) & SOM_SYMBOL_SCOPE_MASK;
+ (flags >> SOM_SYMBOL_SCOPE_SH) & SOM_SYMBOL_SCOPE_MASK;
/* I don't think we care about these. */
if (symbol_type == ST_SYM_EXT || symbol_type == ST_ARG_EXT)
else
som_symbol_data (sym)->som_type = SYMBOL_TYPE_UNKNOWN;
som_symbol_data (sym)->tc_data.ap.hppa_arg_reloc =
- (flags >> SOM_SYMBOL_ARG_RELOC_SH) & SOM_SYMBOL_ARG_RELOC_MASK;
+ (flags >> SOM_SYMBOL_ARG_RELOC_SH) & SOM_SYMBOL_ARG_RELOC_MASK;
/* Some reasonable defaults. */
sym->symbol.the_bfd = abfd;
fprintf (f, " length %#x\n", auxhdr->length);
/* Note that, depending on the HP-UX version, the following fields can be
- either ints, or longs. */
+ either ints, or longs. */
fprintf (f, " text size %#lx\n", (long) exec_header->exec_tsize);
fprintf (f, " text memory offset %#lx\n", (long) exec_header->exec_tmem);
*discriminator_ptr = 0;
if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset,
- & found, filename_ptr,
- functionname_ptr, line_ptr,
- & somdata (abfd).line_info))
+ & found, filename_ptr,
+ functionname_ptr, line_ptr,
+ & somdata (abfd).line_info))
return FALSE;
if (found)
/* Now iterate through the rest of the symbols on this chain. */
while (1)
{
- unsigned int next_entry = bfd_getb32 (ext_lst_symbol.next_entry);
+ unsigned int next_entry = bfd_getb32 (ext_lst_symbol.next_entry);
- if (next_entry == 0)
- break;
+ if (next_entry == 0)
+ break;
/* Seek to the next symbol. */
if (bfd_seek (abfd, lst_filepos + next_entry, SEEK_SET) != 0)
index can point *anywhere* in the archive to save space, so just
using the string table would not be safe. */
if (bfd_seek (abfd, (lst_filepos + string_loc
- + bfd_getb32 (lst_symbol.name) - 4), SEEK_SET) != 0)
+ + bfd_getb32 (lst_symbol.name) - 4), SEEK_SET) != 0)
goto error_return;
if (bfd_bread (&ext_len, (bfd_size_type) 4, abfd) != 4)
/* Fill in the file offset. Note that the "location" field points
to the SOM itself, not the ar_hdr in front of it. */
set->file_offset =
- bfd_getb32 (som_dict[bfd_getb32 (lst_symbol.som_index)].location)
- - sizeof (struct ar_hdr);
+ bfd_getb32 (som_dict[bfd_getb32 (lst_symbol.som_index)].location)
+ - sizeof (struct ar_hdr);
/* Go to the next symbol. */
set++;
/* Iterate through the rest of the chain. */
while (1)
{
- unsigned int next_entry = bfd_getb32 (lst_symbol.next_entry);
+ unsigned int next_entry = bfd_getb32 (lst_symbol.next_entry);
- if (next_entry == 0)
- break;
+ if (next_entry == 0)
+ break;
/* Seek to the next symbol and read it in. */
if (bfd_seek (abfd, lst_filepos + next_entry, SEEK_SET) != 0)
/* Seek to the name length & string and read them in. */
if (bfd_seek (abfd, lst_filepos + string_loc
- + bfd_getb32 (lst_symbol.name) - 4, SEEK_SET) != 0)
+ + bfd_getb32 (lst_symbol.name) - 4, SEEK_SET) != 0)
goto error_return;
if (bfd_bread (&ext_len, (bfd_size_type) 4, abfd) != 4)
goto error_return;
- len = bfd_getb32 (ext_len);
+ len = bfd_getb32 (ext_len);
/* Allocate space for the name and null terminate it too. */
set->name = bfd_zalloc (abfd, (bfd_size_type) len + 1);
/* Fill in the file offset. Note that the "location" field points
to the SOM itself, not the ar_hdr in front of it. */
set->file_offset =
- bfd_getb32 (som_dict[bfd_getb32 (lst_symbol.som_index)].location)
- - sizeof (struct ar_hdr);
+ bfd_getb32 (som_dict[bfd_getb32 (lst_symbol.som_index)].location)
+ - sizeof (struct ar_hdr);
/* Go on to the next symbol. */
set++;
/* Get back to the start of the library symbol table. */
if (bfd_seek (abfd, (ardata->first_file_filepos - parsed_size
+ sizeof (struct som_external_lst_header)),
- SEEK_SET) != 0)
+ SEEK_SET) != 0)
return FALSE;
/* Initialize the cache and allocate space for the library symbols. */
for (i = 0; i < curr_count; i++, sym++)
{
struct som_misc_symbol_info info;
- struct som_external_lst_symbol_record *last;
- unsigned int symbol_pos;
- unsigned int slen;
- unsigned int symbol_key;
- unsigned int flags;
+ struct som_external_lst_symbol_record *last;
+ unsigned int symbol_pos;
+ unsigned int slen;
+ unsigned int symbol_key;
+ unsigned int flags;
/* Derive SOM information from the BFD symbol. */
som_bfd_derive_misc_symbol_info (curr_bfd, &sym->symbol, &info);
bfd_putb32 (arelt_size (curr_bfd), som_dict[som_index].length);
}
- symbol_key = som_bfd_ar_symbol_hash (&sym->symbol);
+ symbol_key = som_bfd_ar_symbol_hash (&sym->symbol);
/* Fill in the lst symbol record. */
- flags = 0;
- if (info.secondary_def)
- flags |= LST_SYMBOL_SECONDARY_DEF;
- flags |= info.symbol_type << LST_SYMBOL_SYMBOL_TYPE_SH;
- flags |= info.symbol_scope << LST_SYMBOL_SYMBOL_SCOPE_SH;
- if (bfd_is_com_section (sym->symbol.section))
- flags |= LST_SYMBOL_IS_COMMON;
- if (info.dup_common)
- flags |= LST_SYMBOL_DUP_COMMON;
- flags |= 3 << LST_SYMBOL_XLEAST_SH;
- flags |= info.arg_reloc << LST_SYMBOL_ARG_RELOC_SH;
- bfd_putb32 (flags, curr_lst_sym->flags);
- bfd_putb32 (p - strings + 4, curr_lst_sym->name);
- bfd_putb32 (0, curr_lst_sym->qualifier_name);
- bfd_putb32 (info.symbol_info, curr_lst_sym->symbol_info);
- bfd_putb32 (info.symbol_value | info.priv_level,
- curr_lst_sym->symbol_value);
- bfd_putb32 (0, curr_lst_sym->symbol_descriptor);
- curr_lst_sym->reserved = 0;
- bfd_putb32 (som_index, curr_lst_sym->som_index);
- bfd_putb32 (symbol_key, curr_lst_sym->symbol_key);
- bfd_putb32 (0, curr_lst_sym->next_entry);
+ flags = 0;
+ if (info.secondary_def)
+ flags |= LST_SYMBOL_SECONDARY_DEF;
+ flags |= info.symbol_type << LST_SYMBOL_SYMBOL_TYPE_SH;
+ flags |= info.symbol_scope << LST_SYMBOL_SYMBOL_SCOPE_SH;
+ if (bfd_is_com_section (sym->symbol.section))
+ flags |= LST_SYMBOL_IS_COMMON;
+ if (info.dup_common)
+ flags |= LST_SYMBOL_DUP_COMMON;
+ flags |= 3 << LST_SYMBOL_XLEAST_SH;
+ flags |= info.arg_reloc << LST_SYMBOL_ARG_RELOC_SH;
+ bfd_putb32 (flags, curr_lst_sym->flags);
+ bfd_putb32 (p - strings + 4, curr_lst_sym->name);
+ bfd_putb32 (0, curr_lst_sym->qualifier_name);
+ bfd_putb32 (info.symbol_info, curr_lst_sym->symbol_info);
+ bfd_putb32 (info.symbol_value | info.priv_level,
+ curr_lst_sym->symbol_value);
+ bfd_putb32 (0, curr_lst_sym->symbol_descriptor);
+ curr_lst_sym->reserved = 0;
+ bfd_putb32 (som_index, curr_lst_sym->som_index);
+ bfd_putb32 (symbol_key, curr_lst_sym->symbol_key);
+ bfd_putb32 (0, curr_lst_sym->next_entry);
/* Insert into the hash table. */
- symbol_pos =
- (curr_lst_sym - lst_syms)
- * sizeof (struct som_external_lst_symbol_record)
- + hash_size * 4
- + module_count * sizeof (struct som_external_som_entry)
- + sizeof (struct som_external_lst_header);
- last = last_hash_entry[symbol_key % hash_size];
+ symbol_pos =
+ (curr_lst_sym - lst_syms)
+ * sizeof (struct som_external_lst_symbol_record)
+ + hash_size * 4
+ + module_count * sizeof (struct som_external_som_entry)
+ + sizeof (struct som_external_lst_header);
+ last = last_hash_entry[symbol_key % hash_size];
if (last != NULL)
{
/* There is already something at the head of this hash chain,
}
else
/* First entry in this hash chain. */
- bfd_putb32 (symbol_pos, hash_table + 4 * (symbol_key % hash_size));
+ bfd_putb32 (symbol_pos, hash_table + 4 * (symbol_key % hash_size));
/* Keep track of the last symbol we added to this chain so we can
easily update its next_entry pointer. */
- last_hash_entry[symbol_key % hash_size] = curr_lst_sym;
+ last_hash_entry[symbol_key % hash_size] = curr_lst_sym;
/* Update the string table. */
- slen = strlen (sym->symbol.name);
+ slen = strlen (sym->symbol.name);
bfd_put_32 (abfd, slen, p);
p += 4;
- slen++; /* Nul terminator. */
+ slen++; /* Nul terminator. */
memcpy (p, sym->symbol.name, slen);
p += slen;
while (slen % 4)
{
bfd_put_8 (abfd, 0, p);
p++;
- slen++;
+ slen++;
}
- BFD_ASSERT (p <= strings + string_size);
+ BFD_ASSERT (p <= strings + string_size);
/* Head to the next symbol. */
curr_lst_sym++;
sprintf (hdr.ar_name, "/ ");
_bfd_ar_spacepad (hdr.ar_date, sizeof (hdr.ar_date), "%-12ld",
- bfd_ardata (abfd)->armap_timestamp);
+ bfd_ardata (abfd)->armap_timestamp);
_bfd_ar_spacepad (hdr.ar_uid, sizeof (hdr.ar_uid), "%ld",
- statbuf.st_uid);
+ statbuf.st_uid);
_bfd_ar_spacepad (hdr.ar_gid, sizeof (hdr.ar_gid), "%ld",
- statbuf.st_gid);
+ statbuf.st_gid);
_bfd_ar_spacepad (hdr.ar_mode, sizeof (hdr.ar_mode), "%-8o",
- (unsigned int)statbuf.st_mode);
+ (unsigned int)statbuf.st_mode);
_bfd_ar_spacepad (hdr.ar_size, sizeof (hdr.ar_size), "%-10d",
- (int) lst_size);
+ (int) lst_size);
hdr.ar_fmag[0] = '`';
hdr.ar_fmag[1] = '\012';
return som_is_subspace (sec) && sec->size > 240000;
}
-#define som_find_line _bfd_nosymbols_find_line
+#define som_find_line _bfd_nosymbols_find_line
#define som_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define som_close_and_cleanup som_bfd_free_cached_info
-#define som_read_ar_hdr _bfd_generic_read_ar_hdr
-#define som_write_ar_hdr _bfd_generic_write_ar_hdr
-#define som_openr_next_archived_file bfd_generic_openr_next_archived_file
-#define som_get_elt_at_index _bfd_generic_get_elt_at_index
-#define som_generic_stat_arch_elt bfd_generic_stat_arch_elt
-#define som_truncate_arname bfd_bsd_truncate_arname
-#define som_slurp_extended_name_table _bfd_slurp_extended_name_table
-#define som_construct_extended_name_table _bfd_archive_coff_construct_extended_name_table
-#define som_update_armap_timestamp bfd_true
+#define som_close_and_cleanup som_bfd_free_cached_info
+#define som_read_ar_hdr _bfd_generic_read_ar_hdr
+#define som_write_ar_hdr _bfd_generic_write_ar_hdr
+#define som_openr_next_archived_file bfd_generic_openr_next_archived_file
+#define som_get_elt_at_index _bfd_generic_get_elt_at_index
+#define som_generic_stat_arch_elt bfd_generic_stat_arch_elt
+#define som_truncate_arname bfd_bsd_truncate_arname
+#define som_slurp_extended_name_table _bfd_slurp_extended_name_table
+#define som_construct_extended_name_table _bfd_archive_coff_construct_extended_name_table
+#define som_update_armap_timestamp bfd_true
#define som_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define som_get_lineno _bfd_nosymbols_get_lineno
-#define som_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define som_read_minisymbols _bfd_generic_read_minisymbols
-#define som_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-#define som_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-#define som_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define som_bfd_relax_section bfd_generic_relax_section
-#define som_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define som_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define som_bfd_link_just_syms _bfd_generic_link_just_syms
+#define som_get_lineno _bfd_nosymbols_get_lineno
+#define som_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define som_read_minisymbols _bfd_generic_read_minisymbols
+#define som_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define som_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define som_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
+#define som_bfd_relax_section bfd_generic_relax_section
+#define som_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define som_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define som_bfd_link_just_syms _bfd_generic_link_just_syms
#define som_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
-#define som_bfd_final_link _bfd_generic_final_link
-#define som_bfd_gc_sections bfd_generic_gc_sections
-#define som_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define som_bfd_merge_sections bfd_generic_merge_sections
-#define som_bfd_is_group_section bfd_generic_is_group_section
-#define som_bfd_discard_group bfd_generic_discard_group
-#define som_section_already_linked _bfd_generic_section_already_linked
-#define som_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define som_bfd_define_start_stop bfd_generic_define_start_stop
+#define som_bfd_final_link _bfd_generic_final_link
+#define som_bfd_gc_sections bfd_generic_gc_sections
+#define som_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define som_bfd_merge_sections bfd_generic_merge_sections
+#define som_bfd_is_group_section bfd_generic_is_group_section
+#define som_bfd_discard_group bfd_generic_discard_group
+#define som_section_already_linked _bfd_generic_section_already_linked
+#define som_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define som_bfd_define_start_stop bfd_generic_define_start_stop
#define som_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
#define som_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
#define som_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
#define som_find_inliner_info _bfd_nosymbols_find_inliner_info
-#define som_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define som_bfd_link_check_relocs _bfd_generic_link_check_relocs
#define som_set_reloc _bfd_generic_set_reloc
const bfd_target hppa_som_vec =
#define obj_som_stringtab_size(bfd) (somdata (bfd).stringtab_size)
#define obj_som_reloc_filepos(bfd) (somdata (bfd).reloc_filepos)
#define obj_som_sorted_syms(bfd) (somdata (bfd).sorted_syms)
-#define som_section_data(sec) ((struct som_section_data_struct *) sec->used_by_bfd)
+#define som_section_data(sec) ((struct som_section_data_struct *) sec->used_by_bfd)
#define som_symbol_data(symbol) ((som_symbol_type *) symbol)
/* Defines groups of basic relocations. FIXME: These should
/* Exported functions, mostly for use by GAS. */
bfd_boolean bfd_som_set_section_attributes (asection *, int, int, unsigned int, int);
bfd_boolean bfd_som_set_subsection_attributes (asection *, asection *, int, unsigned int, int, int, int, int);
-void bfd_som_set_symbol_type (asymbol *, unsigned int);
-bfd_boolean bfd_som_attach_aux_hdr (bfd *, int, char *);
-int ** hppa_som_gen_reloc_type (bfd *, int, int, enum hppa_reloc_field_selector_type_alt, int, asymbol *);
+void bfd_som_set_symbol_type (asymbol *, unsigned int);
+bfd_boolean bfd_som_attach_aux_hdr (bfd *, int, char *);
+int ** hppa_som_gen_reloc_type (bfd *, int, int, enum hppa_reloc_field_selector_type_alt, int, asymbol *);
bfd_boolean bfd_som_attach_compilation_unit (bfd *, const char *, const char *, const char *, const char *);
asection * bfd_section_from_som_symbol (bfd *abfd, struct som_external_symbol_dictionary_record *symbol);
#include "aout/aout64.h"
#include "aout/stab_gnu.h"
#include "aout/ar.h"
-#include "libaout.h" /* BFD a.out internal data structures */
+#include "libaout.h" /* BFD a.out internal data structures */
#define DEFAULT_ARCH bfd_arch_sparc
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
#define TARGET_PAGE_SIZE 0x2000
#define DEFAULT_ARCH bfd_arch_sparc
-#define DEFAULT_MID M_SPARC_NETBSD
+#define DEFAULT_MID M_SPARC_NETBSD
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
_start $14
_etext $8036
_edata $8036
- _end $8036
+ _end $8036
$$
DESCRIPTION
return FALSE;
if (! srec_read_section (abfd, section,
- (bfd_byte *) section->used_by_bfd))
+ (bfd_byte *) section->used_by_bfd))
return FALSE;
}
}
}
-#define srec_close_and_cleanup _bfd_generic_close_and_cleanup
-#define srec_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define srec_new_section_hook _bfd_generic_new_section_hook
-#define srec_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define srec_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define srec_get_lineno _bfd_nosymbols_get_lineno
-#define srec_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define srec_find_line _bfd_nosymbols_find_line
-#define srec_find_inliner_info _bfd_nosymbols_find_inliner_info
-#define srec_make_empty_symbol _bfd_generic_make_empty_symbol
+#define srec_close_and_cleanup _bfd_generic_close_and_cleanup
+#define srec_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define srec_new_section_hook _bfd_generic_new_section_hook
+#define srec_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#define srec_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define srec_get_lineno _bfd_nosymbols_get_lineno
+#define srec_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define srec_find_line _bfd_nosymbols_find_line
+#define srec_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define srec_make_empty_symbol _bfd_generic_make_empty_symbol
#define srec_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define srec_read_minisymbols _bfd_generic_read_minisymbols
-#define srec_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-#define srec_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-#define srec_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define srec_bfd_relax_section bfd_generic_relax_section
-#define srec_bfd_gc_sections bfd_generic_gc_sections
-#define srec_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define srec_bfd_merge_sections bfd_generic_merge_sections
-#define srec_bfd_is_group_section bfd_generic_is_group_section
-#define srec_bfd_discard_group bfd_generic_discard_group
-#define srec_section_already_linked _bfd_generic_section_already_linked
-#define srec_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define srec_bfd_define_start_stop bfd_generic_define_start_stop
-#define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define srec_bfd_link_just_syms _bfd_generic_link_just_syms
-#define srec_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
-#define srec_bfd_final_link _bfd_generic_final_link
-#define srec_bfd_link_split_section _bfd_generic_link_split_section
-#define srec_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define srec_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define srec_read_minisymbols _bfd_generic_read_minisymbols
+#define srec_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define srec_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define srec_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
+#define srec_bfd_relax_section bfd_generic_relax_section
+#define srec_bfd_gc_sections bfd_generic_gc_sections
+#define srec_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define srec_bfd_merge_sections bfd_generic_merge_sections
+#define srec_bfd_is_group_section bfd_generic_is_group_section
+#define srec_bfd_discard_group bfd_generic_discard_group
+#define srec_section_already_linked _bfd_generic_section_already_linked
+#define srec_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define srec_bfd_define_start_stop bfd_generic_define_start_stop
+#define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define srec_bfd_link_just_syms _bfd_generic_link_just_syms
+#define srec_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
+#define srec_bfd_final_link _bfd_generic_final_link
+#define srec_bfd_link_split_section _bfd_generic_link_split_section
+#define srec_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target srec_vec =
{
subclass. */
if (ret == NULL)
ret = (struct stab_link_includes_entry *)
- bfd_hash_allocate (table, sizeof (struct stab_link_includes_entry));
+ bfd_hash_allocate (table, sizeof (struct stab_link_includes_entry));
if (ret == NULL)
return NULL;
/* This is the first time we have seen this header file
with this set of stabs strings. */
t = (struct stab_link_includes_totals *)
- bfd_hash_allocate (&sinfo->includes, sizeof *t);
+ bfd_hash_allocate (&sinfo->includes, sizeof *t);
if (t == NULL)
goto error_return;
t->sum_chars = sum_chars;
t->num_chars = num_chars;
- /* Trim data down. */
+ /* Trim data down. */
t->symb = symb = (char *) bfd_realloc_or_free (symb, num_chars);
t->next = incl_entry->totals;
incl_entry->totals = t;
&& bfd_lookup_arch (bfd_arch_m68k, 0) != NULL))
#define MY_get_dynamic_symtab_upper_bound sunos_get_dynamic_symtab_upper_bound
-#define MY_canonicalize_dynamic_symtab sunos_canonicalize_dynamic_symtab
-#define MY_get_synthetic_symtab _bfd_nodynamic_get_synthetic_symtab
+#define MY_canonicalize_dynamic_symtab sunos_canonicalize_dynamic_symtab
+#define MY_get_synthetic_symtab _bfd_nodynamic_get_synthetic_symtab
#define MY_get_dynamic_reloc_upper_bound sunos_get_dynamic_reloc_upper_bound
-#define MY_canonicalize_dynamic_reloc sunos_canonicalize_dynamic_reloc
-#define MY_bfd_link_hash_table_create sunos_link_hash_table_create
-#define MY_add_dynamic_symbols sunos_add_dynamic_symbols
-#define MY_add_one_symbol sunos_add_one_symbol
-#define MY_link_dynamic_object sunos_link_dynamic_object
-#define MY_write_dynamic_symbol sunos_write_dynamic_symbol
-#define MY_check_dynamic_reloc sunos_check_dynamic_reloc
-#define MY_finish_dynamic_link sunos_finish_dynamic_link
-
-static bfd_boolean sunos_add_dynamic_symbols (bfd *, struct bfd_link_info *, struct external_nlist **, bfd_size_type *, char **);
-static bfd_boolean sunos_add_one_symbol (struct bfd_link_info *, bfd *, const char *, flagword, asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, struct bfd_link_hash_entry **);
-static bfd_boolean sunos_link_dynamic_object (struct bfd_link_info *, bfd *);
-static bfd_boolean sunos_write_dynamic_symbol (bfd *, struct bfd_link_info *, struct aout_link_hash_entry *);
-static bfd_boolean sunos_check_dynamic_reloc (struct bfd_link_info *, bfd *, asection *, struct aout_link_hash_entry *, void *, bfd_byte *, bfd_boolean *, bfd_vma *);
-static bfd_boolean sunos_finish_dynamic_link (bfd *, struct bfd_link_info *);
-static struct bfd_link_hash_table *sunos_link_hash_table_create (bfd *);
-static long sunos_get_dynamic_symtab_upper_bound (bfd *);
-static long sunos_canonicalize_dynamic_symtab (bfd *, asymbol **);
-static long sunos_get_dynamic_reloc_upper_bound (bfd *);
-static long sunos_canonicalize_dynamic_reloc (bfd *, arelent **, asymbol **);
+#define MY_canonicalize_dynamic_reloc sunos_canonicalize_dynamic_reloc
+#define MY_bfd_link_hash_table_create sunos_link_hash_table_create
+#define MY_add_dynamic_symbols sunos_add_dynamic_symbols
+#define MY_add_one_symbol sunos_add_one_symbol
+#define MY_link_dynamic_object sunos_link_dynamic_object
+#define MY_write_dynamic_symbol sunos_write_dynamic_symbol
+#define MY_check_dynamic_reloc sunos_check_dynamic_reloc
+#define MY_finish_dynamic_link sunos_finish_dynamic_link
+
+static bfd_boolean sunos_add_dynamic_symbols (bfd *, struct bfd_link_info *, struct external_nlist **, bfd_size_type *, char **);
+static bfd_boolean sunos_add_one_symbol (struct bfd_link_info *, bfd *, const char *, flagword, asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, struct bfd_link_hash_entry **);
+static bfd_boolean sunos_link_dynamic_object (struct bfd_link_info *, bfd *);
+static bfd_boolean sunos_write_dynamic_symbol (bfd *, struct bfd_link_info *, struct aout_link_hash_entry *);
+static bfd_boolean sunos_check_dynamic_reloc (struct bfd_link_info *, bfd *, asection *, struct aout_link_hash_entry *, void *, bfd_byte *, bfd_boolean *, bfd_vma *);
+static bfd_boolean sunos_finish_dynamic_link (bfd *, struct bfd_link_info *);
+static struct bfd_link_hash_table *sunos_link_hash_table_create (bfd *);
+static long sunos_get_dynamic_symtab_upper_bound (bfd *);
+static long sunos_canonicalize_dynamic_symtab (bfd *, asymbol **);
+static long sunos_get_dynamic_reloc_upper_bound (bfd *);
+static long sunos_canonicalize_dynamic_reloc (bfd *, arelent **, asymbol **);
/* Include the usual a.out support. */
#include "aoutf1.h"
allocating storage, and the actual reading process. This is an
excerpt from an application which reads the symbol table:
-| long storage_needed;
-| asymbol **symbol_table;
-| long number_of_symbols;
-| long i;
+| long storage_needed;
+| asymbol **symbol_table;
+| long number_of_symbols;
+| long i;
|
-| storage_needed = bfd_get_symtab_upper_bound (abfd);
+| storage_needed = bfd_get_symtab_upper_bound (abfd);
|
| if (storage_needed < 0)
| FAIL
|
-| if (storage_needed == 0)
-| return;
+| if (storage_needed == 0)
+| return;
|
-| symbol_table = xmalloc (storage_needed);
-| ...
-| number_of_symbols =
-| bfd_canonicalize_symtab (abfd, symbol_table);
+| symbol_table = xmalloc (storage_needed);
+| ...
+| number_of_symbols =
+| bfd_canonicalize_symtab (abfd, symbol_table);
|
| if (number_of_symbols < 0)
| FAIL
|
-| for (i = 0; i < number_of_symbols; i++)
-| process_symbol (symbol_table[i]);
+| for (i = 0; i < number_of_symbols; i++)
+| process_symbol (symbol_table[i]);
All storage for the symbols themselves is in an objalloc
connected to the BFD; it is freed when the BFD is closed.
which has been created using <<bfd_make_empty_symbol>>. Here is an
example showing the creation of a symbol table with only one element:
-| #include "sysdep.h"
-| #include "bfd.h"
-| int main (void)
-| {
-| bfd *abfd;
-| asymbol *ptrs[2];
-| asymbol *new;
+| #include "sysdep.h"
+| #include "bfd.h"
+| int main (void)
+| {
+| bfd *abfd;
+| asymbol *ptrs[2];
+| asymbol *new;
|
-| abfd = bfd_openw ("foo","a.out-sunos-big");
-| bfd_set_format (abfd, bfd_object);
-| new = bfd_make_empty_symbol (abfd);
-| new->name = "dummy_symbol";
-| new->section = bfd_make_section_old_way (abfd, ".text");
-| new->flags = BSF_GLOBAL;
-| new->value = 0x12345;
+| abfd = bfd_openw ("foo","a.out-sunos-big");
+| bfd_set_format (abfd, bfd_object);
+| new = bfd_make_empty_symbol (abfd);
+| new->name = "dummy_symbol";
+| new->section = bfd_make_section_old_way (abfd, ".text");
+| new->flags = BSF_GLOBAL;
+| new->value = 0x12345;
|
-| ptrs[0] = new;
-| ptrs[1] = 0;
+| ptrs[0] = new;
+| ptrs[1] = 0;
|
-| bfd_set_symtab (abfd, ptrs, 1);
-| bfd_close (abfd);
-| return 0;
-| }
+| bfd_set_symtab (abfd, ptrs, 1);
+| bfd_close (abfd);
+| return 0;
+| }
|
-| ./makesym
-| nm foo
-| 00012345 A dummy_symbol
+| ./makesym
+| nm foo
+| 00012345 A dummy_symbol
Many formats cannot represent arbitrary symbol information; for
- instance, the <<a.out>> object format does not allow an
+ instance, the <<a.out>> object format does not allow an
arbitrary number of sections. A symbol pointing to a section
which is not one of <<.text>>, <<.data>> or <<.bss>> cannot
be described.
. symvalue value;
.
. {* Attributes of a symbol. *}
-.#define BSF_NO_FLAGS 0x00
+.#define BSF_NO_FLAGS 0
.
. {* The symbol has local scope; <<static>> in <<C>>. The value
. is the offset into the section of the data. *}
-.#define BSF_LOCAL (1 << 0)
+.#define BSF_LOCAL (1 << 0)
.
. {* The symbol has global scope; initialized data in <<C>>. The
. value is the offset into the section of the data. *}
-.#define BSF_GLOBAL (1 << 1)
+.#define BSF_GLOBAL (1 << 1)
.
. {* The symbol has global scope and is exported. The value is
. the offset into the section of the data. *}
-.#define BSF_EXPORT BSF_GLOBAL {* No real difference. *}
+.#define BSF_EXPORT BSF_GLOBAL {* No real difference. *}
.
. {* A normal C symbol would be one of:
. <<BSF_LOCAL>>, <<BSF_UNDEFINED>> or <<BSF_GLOBAL>>. *}
.
. {* The symbol is a debugging record. The value has an arbitrary
. meaning, unless BSF_DEBUGGING_RELOC is also set. *}
-.#define BSF_DEBUGGING (1 << 2)
+.#define BSF_DEBUGGING (1 << 2)
.
. {* The symbol denotes a function entry point. Used in ELF,
. perhaps others someday. *}
-.#define BSF_FUNCTION (1 << 3)
+.#define BSF_FUNCTION (1 << 3)
.
. {* Used by the linker. *}
-.#define BSF_KEEP (1 << 5)
+.#define BSF_KEEP (1 << 5)
.
. {* An ELF common symbol. *}
-.#define BSF_ELF_COMMON (1 << 6)
+.#define BSF_ELF_COMMON (1 << 6)
.
. {* A weak global symbol, overridable without warnings by
. a regular global symbol of the same name. *}
-.#define BSF_WEAK (1 << 7)
+.#define BSF_WEAK (1 << 7)
.
. {* This symbol was created to point to a section, e.g. ELF's
. STT_SECTION symbols. *}
-.#define BSF_SECTION_SYM (1 << 8)
+.#define BSF_SECTION_SYM (1 << 8)
.
. {* The symbol used to be a common symbol, but now it is
. allocated. *}
-.#define BSF_OLD_COMMON (1 << 9)
+.#define BSF_OLD_COMMON (1 << 9)
.
. {* In some files the type of a symbol sometimes alters its
. location in an output file - ie in coff a <<ISFCN>> symbol
. which is also <<C_EXT>> symbol appears where it was
. declared and not at the end of a section. This bit is set
. by the target BFD part to convey this information. *}
-.#define BSF_NOT_AT_END (1 << 10)
+.#define BSF_NOT_AT_END (1 << 10)
.
. {* Signal that the symbol is the label of constructor section. *}
-.#define BSF_CONSTRUCTOR (1 << 11)
+.#define BSF_CONSTRUCTOR (1 << 11)
.
. {* Signal that the symbol is a warning symbol. The name is a
. warning. The name of the next symbol is the one to warn about;
. if a reference is made to a symbol with the same name as the next
. symbol, a warning is issued by the linker. *}
-.#define BSF_WARNING (1 << 12)
+.#define BSF_WARNING (1 << 12)
.
. {* Signal that the symbol is indirect. This symbol is an indirect
. pointer to the symbol with the same name as the next symbol. *}
-.#define BSF_INDIRECT (1 << 13)
+.#define BSF_INDIRECT (1 << 13)
.
. {* BSF_FILE marks symbols that contain a file name. This is used
. for ELF STT_FILE symbols. *}
-.#define BSF_FILE (1 << 14)
+.#define BSF_FILE (1 << 14)
.
. {* Symbol is from dynamic linking information. *}
-.#define BSF_DYNAMIC (1 << 15)
+.#define BSF_DYNAMIC (1 << 15)
.
. {* The symbol denotes a data object. Used in ELF, and perhaps
. others someday. *}
-.#define BSF_OBJECT (1 << 16)
+.#define BSF_OBJECT (1 << 16)
.
. {* This symbol is a debugging symbol. The value is the offset
. into the section of the data. BSF_DEBUGGING should be set
. as well. *}
-.#define BSF_DEBUGGING_RELOC (1 << 17)
+.#define BSF_DEBUGGING_RELOC (1 << 17)
.
. {* This symbol is thread local. Used in ELF. *}
-.#define BSF_THREAD_LOCAL (1 << 18)
+.#define BSF_THREAD_LOCAL (1 << 18)
.
. {* This symbol represents a complex relocation expression,
. with the expression tree serialized in the symbol name. *}
-.#define BSF_RELC (1 << 19)
+.#define BSF_RELC (1 << 19)
.
. {* This symbol represents a signed complex relocation expression,
. with the expression tree serialized in the symbol name. *}
-.#define BSF_SRELC (1 << 20)
+.#define BSF_SRELC (1 << 20)
.
. {* This symbol was created by bfd_get_synthetic_symtab. *}
-.#define BSF_SYNTHETIC (1 << 21)
+.#define BSF_SYNTHETIC (1 << 21)
.
. {* This symbol is an indirect code object. Unrelated to BSF_INDIRECT.
. The dynamic linker will compute the value of this symbol by
. {* This symbol is a globally unique data object. The dynamic linker
. will make sure that in the entire process there is just one symbol
. with this name and type in use. BSF_OBJECT must also be set. *}
-.#define BSF_GNU_UNIQUE (1 << 23)
+.#define BSF_GNU_UNIQUE (1 << 23)
.
. flagword flags;
.
the BFD, then return 0. If an error occurs, return -1.
.#define bfd_get_symtab_upper_bound(abfd) \
-. BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
+. BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
.
*/
bfd_is_local_label
SYNOPSIS
- bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
+ bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
DESCRIPTION
Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is
bfd_is_local_label_name
SYNOPSIS
- bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
+ bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
DESCRIPTION
Return TRUE if a symbol with the name @var{name} in the BFD
local label.
.#define bfd_is_local_label_name(abfd, name) \
-. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
+. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
.
*/
bfd_is_target_special_symbol
SYNOPSIS
- bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
+ bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
DESCRIPTION
Return TRUE iff a symbol @var{sym} in the BFD @var{abfd} is something
should normally not be mentioned to the user.
.#define bfd_is_target_special_symbol(abfd, sym) \
-. BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
+. BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
.
*/
including the NULL.
.#define bfd_canonicalize_symtab(abfd, location) \
-. BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
+. BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
.
*/
information, and will cause problems later on.
.#define bfd_make_empty_symbol(abfd) \
-. BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
+. BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
.
*/
yet to be worked out.
.#define bfd_make_debug_symbol(abfd,ptr,size) \
-. BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
+. BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
.
*/
{"code", 't'}, /* MRI .text */
{".data", 'd'},
{"*DEBUG*", 'N'},
- {".debug", 'N'}, /* MSVC's .debug (non-standard debug syms) */
- {".drectve", 'i'}, /* MSVC's .drective section */
- {".edata", 'e'}, /* MSVC's .edata (export) section */
+ {".debug", 'N'}, /* MSVC's .debug (non-standard debug syms) */
+ {".drectve", 'i'}, /* MSVC's .drective section */
+ {".edata", 'e'}, /* MSVC's .edata (export) section */
{".fini", 't'}, /* ELF fini section */
- {".idata", 'i'}, /* MSVC's .idata (import) section */
+ {".idata", 'i'}, /* MSVC's .idata (import) section */
{".init", 't'}, /* ELF init section */
- {".pdata", 'p'}, /* MSVC's .pdata (stack unwind) section */
+ {".pdata", 'p'}, /* MSVC's .pdata (stack unwind) section */
{".rdata", 'r'}, /* Read only data. */
{".rodata", 'r'}, /* Read only data. */
{".sbss", 's'}, /* Small BSS (uninitialized data). */
Not enough memory exists to create private data for @var{osec}.
.#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
-. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
-. (ibfd, isymbol, obfd, osymbol))
+. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
+. (ibfd, isymbol, obfd, osymbol))
.
*/
/* The main file name. */
/* The following code creates a new indextable entry with
- a NULL function name if there were no N_FUNs in a file.
- Note that a N_SO without a file name is an EOF and
- there could be 2 N_SO following it with the new filename
- and directory. */
+ a NULL function name if there were no N_FUNs in a file.
+ Note that a N_SO without a file name is an EOF and
+ there could be 2 N_SO following it with the new filename
+ and directory. */
if (nul_fun != NULL)
{
info->indextable[i].val = bfd_get_32 (abfd, nul_fun + VALOFF);
long mid = -1;
/* Cache non-existent or invalid. Do binary search on
- indextable. */
+ indextable. */
indexentry = NULL;
low = 0;
char *s;
/* This will typically be something like main:F(0,1), so we want
- to clobber the colon. It's OK to change the name, since the
- string is in our own local storage anyhow. */
+ to clobber the colon. It's OK to change the name, since the
+ string is in our own local storage anyhow. */
s = strchr (indexentry->function_name, ':');
if (s != NULL)
*s = '\0';
. {* Entries for byte swapping for data. These are different from the
. other entry points, since they don't take a BFD as the first argument.
. Certain other handlers could do the same. *}
-. bfd_uint64_t (*bfd_getx64) (const void *);
-. bfd_int64_t (*bfd_getx_signed_64) (const void *);
-. void (*bfd_putx64) (bfd_uint64_t, void *);
-. bfd_vma (*bfd_getx32) (const void *);
+. bfd_uint64_t (*bfd_getx64) (const void *);
+. bfd_int64_t (*bfd_getx_signed_64) (const void *);
+. void (*bfd_putx64) (bfd_uint64_t, void *);
+. bfd_vma (*bfd_getx32) (const void *);
. bfd_signed_vma (*bfd_getx_signed_32) (const void *);
-. void (*bfd_putx32) (bfd_vma, void *);
-. bfd_vma (*bfd_getx16) (const void *);
+. void (*bfd_putx32) (bfd_vma, void *);
+. bfd_vma (*bfd_getx16) (const void *);
. bfd_signed_vma (*bfd_getx_signed_16) (const void *);
-. void (*bfd_putx16) (bfd_vma, void *);
+. void (*bfd_putx16) (bfd_vma, void *);
.
. {* Byte swapping for the headers. *}
-. bfd_uint64_t (*bfd_h_getx64) (const void *);
-. bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
-. void (*bfd_h_putx64) (bfd_uint64_t, void *);
-. bfd_vma (*bfd_h_getx32) (const void *);
+. bfd_uint64_t (*bfd_h_getx64) (const void *);
+. bfd_int64_t (*bfd_h_getx_signed_64) (const void *);
+. void (*bfd_h_putx64) (bfd_uint64_t, void *);
+. bfd_vma (*bfd_h_getx32) (const void *);
. bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
-. void (*bfd_h_putx32) (bfd_vma, void *);
-. bfd_vma (*bfd_h_getx16) (const void *);
+. void (*bfd_h_putx32) (bfd_vma, void *);
+. bfd_vma (*bfd_h_getx16) (const void *);
. bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
-. void (*bfd_h_putx16) (bfd_vma, void *);
+. void (*bfd_h_putx16) (bfd_vma, void *);
.
. {* Format dependent routines: these are vectors of entry points
. within the target vector structure, one for each format to check. *}
.
. {* Check the format of a file being read. Return a <<bfd_target *>> or zero. *}
-. const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
+. const struct bfd_target *
+. (*_bfd_check_format[bfd_type_end]) (bfd *);
.
. {* Set the format of a file being written. *}
. bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
. {* Called when a new section is created. *}
. bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
. {* Read the contents of a section. *}
-. bfd_boolean (*_bfd_get_section_contents)
-. (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
-. bfd_boolean (*_bfd_get_section_contents_in_window)
-. (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
+. bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr,
+. bfd_size_type);
+. bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr,
+. bfd_window *, file_ptr,
+. bfd_size_type);
.
. {* Entry points to copy private data. *}
.#define BFD_JUMP_TABLE_COPY(NAME) \
. {* Called to initialize BFD private section data from one object file
. to another. *}
.#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
-. BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info))
-. bfd_boolean (*_bfd_init_private_section_data)
-. (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *);
+. BFD_SEND (obfd, _bfd_init_private_section_data, \
+. (ibfd, isec, obfd, osec, link_info))
+. bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *,
+. sec_ptr,
+. struct bfd_link_info *);
. {* Called to copy BFD private section data from one object file
. to another. *}
-. bfd_boolean (*_bfd_copy_private_section_data)
-. (bfd *, sec_ptr, bfd *, sec_ptr);
+. bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *,
+. sec_ptr);
. {* Called to copy BFD private symbol data from one symbol
. to another. *}
-. bfd_boolean (*_bfd_copy_private_symbol_data)
-. (bfd *, asymbol *, bfd *, asymbol *);
+. bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *,
+. asymbol *);
. {* Called to copy BFD private header data from one object file
. to another. *}
-. bfd_boolean (*_bfd_copy_private_header_data)
-. (bfd *, bfd *);
+. bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *);
. {* Called to set private backend flags. *}
. bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
.
. NAME##_core_file_pid
.
. char * (*_core_file_failing_command) (bfd *);
-. int (*_core_file_failing_signal) (bfd *);
+. int (*_core_file_failing_signal) (bfd *);
. bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
-. int (*_core_file_pid) (bfd *);
+. int (*_core_file_pid) (bfd *);
.
. {* Archive entry points. *}
.#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
.
. bfd_boolean (*_bfd_slurp_armap) (bfd *);
. bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
-. bfd_boolean (*_bfd_construct_extended_name_table)
-. (bfd *, char **, bfd_size_type *, const char **);
-. void (*_bfd_truncate_arname) (bfd *, const char *, char *);
-. bfd_boolean (*write_armap)
-. (bfd *, unsigned int, struct orl *, unsigned int, int);
+. bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **,
+. bfd_size_type *,
+. const char **);
+. void (*_bfd_truncate_arname) (bfd *, const char *, char *);
+. bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *,
+. unsigned int, int);
. void * (*_bfd_read_ar_hdr_fn) (bfd *);
. bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *);
. bfd * (*openr_next_archived_file) (bfd *, bfd *);
-.#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
+.#define bfd_get_elt_at_index(b,i) \
+. BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
. bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);
-. int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
+. int (*_bfd_stat_arch_elt) (bfd *, struct stat *);
. bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
.
. {* Entry points used for symbols. *}
. NAME##_read_minisymbols, \
. NAME##_minisymbol_to_symbol
.
-. long (*_bfd_get_symtab_upper_bound) (bfd *);
-. long (*_bfd_canonicalize_symtab)
-. (bfd *, struct bfd_symbol **);
+. long (*_bfd_get_symtab_upper_bound) (bfd *);
+. long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **);
. struct bfd_symbol *
-. (*_bfd_make_empty_symbol) (bfd *);
-. void (*_bfd_print_symbol)
-. (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
-.#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
-. void (*_bfd_get_symbol_info)
-. (bfd *, struct bfd_symbol *, symbol_info *);
-.#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
-. const char *(*_bfd_get_symbol_version_string)
-. (bfd *, struct bfd_symbol *, bfd_boolean *);
-.#define bfd_get_symbol_version_string(b,s,h) BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
+. (*_bfd_make_empty_symbol) (bfd *);
+. void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *,
+. bfd_print_symbol_type);
+.#define bfd_print_symbol(b,p,s,e) \
+. BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
+. void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *,
+. symbol_info *);
+.#define bfd_get_symbol_info(b,p,e) \
+. BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
+. const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *,
+. bfd_boolean *);
+.#define bfd_get_symbol_version_string(b,s,h) \
+. BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h))
. bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
. bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
. alent * (*_get_lineno) (bfd *, struct bfd_symbol *);
-. bfd_boolean (*_bfd_find_nearest_line)
-. (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma,
-. const char **, const char **, unsigned int *, unsigned int *);
-. bfd_boolean (*_bfd_find_line)
-. (bfd *, struct bfd_symbol **, struct bfd_symbol *,
-. const char **, unsigned int *);
+. bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **,
+. struct bfd_section *, bfd_vma,
+. const char **, const char **,
+. unsigned int *, unsigned int *);
+. bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **,
+. struct bfd_symbol *, const char **,
+. unsigned int *);
. bfd_boolean (*_bfd_find_inliner_info)
. (bfd *, const char **, const char **, unsigned int *);
. {* Back-door to allow format-aware applications to create debug symbols
. while using BFD for everything else. Currently used by the assembler
. when creating COFF files. *}
-. asymbol * (*_bfd_make_debug_symbol)
-. (bfd *, void *, unsigned long size);
+. asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size);
.#define bfd_read_minisymbols(b, d, m, s) \
-. BFD_SEND (b, _read_minisymbols, (b, d, m, s))
-. long (*_read_minisymbols)
-. (bfd *, bfd_boolean, void **, unsigned int *);
+. BFD_SEND (b, _read_minisymbols, (b, d, m, s))
+. long (*_read_minisymbols) (bfd *, bfd_boolean, void **,
+. unsigned int *);
.#define bfd_minisymbol_to_symbol(b, d, m, f) \
-. BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
-. asymbol * (*_minisymbol_to_symbol)
-. (bfd *, bfd_boolean, const void *, asymbol *);
+. BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
+. asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *,
+. asymbol *);
.
. {* Routines for relocs. *}
.#define BFD_JUMP_TABLE_RELOCS(NAME) \
. NAME##_bfd_reloc_type_lookup, \
. NAME##_bfd_reloc_name_lookup
.
-. long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
-. long (*_bfd_canonicalize_reloc)
-. (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
-. void (*_bfd_set_reloc)
-. (bfd *, sec_ptr, arelent **, unsigned int);
+. long (*_get_reloc_upper_bound) (bfd *, sec_ptr);
+. long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **,
+. struct bfd_symbol **);
+. void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int);
. {* See documentation on reloc types. *}
. reloc_howto_type *
-. (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
+. (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
. reloc_howto_type *
-. (*reloc_name_lookup) (bfd *, const char *);
-.
+. (*reloc_name_lookup) (bfd *, const char *);
.
. {* Routines used when writing an object file. *}
.#define BFD_JUMP_TABLE_WRITE(NAME) \
. NAME##_set_arch_mach, \
. NAME##_set_section_contents
.
-. bfd_boolean (*_bfd_set_arch_mach)
-. (bfd *, enum bfd_architecture, unsigned long);
-. bfd_boolean (*_bfd_set_section_contents)
-. (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
+. bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture,
+. unsigned long);
+. bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *,
+. file_ptr, bfd_size_type);
.
. {* Routines used by the linker. *}
.#define BFD_JUMP_TABLE_LINK(NAME) \
. NAME##_bfd_define_common_symbol, \
. NAME##_bfd_define_start_stop
.
-. int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
-. bfd_byte * (*_bfd_get_relocated_section_contents)
-. (bfd *, struct bfd_link_info *, struct bfd_link_order *,
-. bfd_byte *, bfd_boolean, struct bfd_symbol **);
+. int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
+. bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *,
+. struct bfd_link_info *,
+. struct bfd_link_order *,
+. bfd_byte *, bfd_boolean,
+. struct bfd_symbol **);
.
-. bfd_boolean (*_bfd_relax_section)
-. (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
+. bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *,
+. struct bfd_link_info *, bfd_boolean *);
.
. {* Create a hash table for the linker. Different backends store
. different information in this table. *}
. struct bfd_link_hash_table *
-. (*_bfd_link_hash_table_create) (bfd *);
+. (*_bfd_link_hash_table_create) (bfd *);
.
. {* Add symbols from this object file into the hash table. *}
. bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
.
. {* Indicate that we are only retrieving symbol values from this section. *}
-. void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
+. void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
.
. {* Copy the symbol type and other attributes for a linker script
. assignment of one symbol to another. *}
.#define bfd_copy_link_hash_symbol_type(b, t, f) \
-. BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
-. void (*_bfd_copy_link_hash_symbol_type)
-. (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
+. BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
+. void (*_bfd_copy_link_hash_symbol_type) (bfd *,
+. struct bfd_link_hash_entry *,
+. struct bfd_link_hash_entry *);
.
. {* Do a link based on the link_order structures attached to each
. section of the BFD. *}
.
. {* Sets the bitmask of allowed and disallowed section flags. *}
. bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *,
-. struct flag_info *,
-. asection *);
+. struct flag_info *, asection *);
.
. {* Attempt to merge SEC_MERGE sections. *}
. bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
. struct bfd_link_hash_entry *);
.
. {* Define a __start, __stop, .startof. or .sizeof. symbol. *}
-. struct bfd_link_hash_entry *(*_bfd_define_start_stop) (struct bfd_link_info *,
-. const char *,
-. asection *);
+. struct bfd_link_hash_entry *
+. (*_bfd_define_start_stop) (struct bfd_link_info *, const char *,
+. asection *);
.
. {* Routines to handle dynamic symbols and relocs. *}
.#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
. NAME##_canonicalize_dynamic_reloc
.
. {* Get the amount of memory required to hold the dynamic symbols. *}
-. long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
+. long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
. {* Read in the dynamic symbols. *}
-. long (*_bfd_canonicalize_dynamic_symtab)
-. (bfd *, struct bfd_symbol **);
+. long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **);
. {* Create synthetized symbols. *}
-. long (*_bfd_get_synthetic_symtab)
-. (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
-. struct bfd_symbol **);
+. long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **,
+. long, struct bfd_symbol **,
+. struct bfd_symbol **);
. {* Get the amount of memory required to hold the dynamic relocs. *}
-. long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
+. long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
. {* Read in the dynamic relocs. *}
-. long (*_bfd_canonicalize_dynamic_reloc)
-. (bfd *, arelent **, struct bfd_symbol **);
+. long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **,
+. struct bfd_symbol **);
.
A pointer to an alternative bfd_target in case the current one is not
to find an alternative output format that is suitable.
. {* Opposite endian version of this target. *}
-. const struct bfd_target * alternative_target;
+. const struct bfd_target *alternative_target;
.
. {* Data for use by back-end routines, which isn't
&w65_coff_vec,
- &wasm_vec,
- &wasm32_elf32_vec,
+ &wasm_vec,
+ &wasm32_elf32_vec,
&we32k_coff_vec,
char end_ch = (in_a ? in_a[strlen (tname)] : 0);
if (in_a && (in_a == *arch || in_a[-1] == ':')
- && end_ch == 0)
- {
- *def_target_arch = *arch;
- return TRUE;
- }
+ && end_ch == 0)
+ {
+ *def_target_arch = *arch;
+ return TRUE;
+ }
arch++;
}
return FALSE;
int *underscoring,
const char **def_target_arch);
DESCRIPTION
- Return a pointer to the transfer vector for the object target
- named @var{target_name}. If @var{target_name} is <<NULL>>,
- choose the one in the environment variable <<GNUTARGET>>; if
- that is null or not defined, then choose the first entry in the
- target list. Passing in the string "default" or setting the
- environment variable to "default" will cause the first entry in
- the target list to be returned, and "target_defaulted" will be
- set in the BFD if @var{abfd} isn't <<NULL>>. This causes
- <<bfd_check_format>> to loop over all the targets to find the
- one that matches the file being read.
+ Return a pointer to the transfer vector for the object target
+ named @var{target_name}. If @var{target_name} is <<NULL>>,
+ choose the one in the environment variable <<GNUTARGET>>; if
+ that is null or not defined, then choose the first entry in the
+ target list. Passing in the string "default" or setting the
+ environment variable to "default" will cause the first entry in
+ the target list to be returned, and "target_defaulted" will be
+ set in the BFD if @var{abfd} isn't <<NULL>>. This causes
+ <<bfd_check_format>> to loop over all the targets to find the
+ one that matches the file being read.
If @var{is_bigendian} is not <<NULL>>, then set this value to target's
endian mode. True for big-endian, FALSE for little-endian or for
invalid target.
const char **arches = bfd_arch_list ();
if (arches && tname)
- {
- char *hyp = strchr (tname, '-');
+ {
+ char *hyp = strchr (tname, '-');
- if (hyp != NULL)
- {
- tname = ++hyp;
+ if (hyp != NULL)
+ {
+ tname = ++hyp;
/* Make sure we detect architecture names
for triplets like "pe-arm-wince-little". */
}
if (arches)
- free (arches);
+ free (arches);
}
return target_vec;
}
devices like PROM programmers and ICE equipment.
It seems that the sections are described as being really big,
- the example I have says that the text section is 0..ffffffff.
+ the example I have says that the text section is 0..ffffffff.
BFD would barf with this, many apps would try to alloc 4GB to
read in the file.
one section for each block of data, called "blknnnn" which we
stick all the data into.
- TekHex may come out of order and there is no header, so an
+ TekHex may come out of order and there is no header, so an
initial scan is required to discover the minimum and maximum
addresses used to create the vma and size of the sections we
create.
<---------------------- 3a (58 chars) ------------------->
%1B3709T_SEGMENT1108FFFFFFFF
- ^ ^^ ^- 8 character integer 0xffffffff
- | |+- 1 character integer 0
- | +-- type 1 symbol (section definition)
- +------------ 9 char symbol T_SEGMENT
+ ^ ^^ ^- 8 character integer 0xffffffff
+ | |+- 1 character integer 0
+ | +-- type 1 symbol (section definition)
+ +------------ 9 char symbol T_SEGMENT
%2B3AB9T_SEGMENT7Dgcc_compiled$1087hello$c10
%373829T_SEGMENT80int$t1$r1$$214741080char$t2$r2$0$12710
{
/* No chunk for this address, so make one up. */
d = (struct data_struct *)
- bfd_zalloc (abfd, (bfd_size_type) sizeof (struct data_struct));
+ bfd_zalloc (abfd, (bfd_size_type) sizeof (struct data_struct));
if (!d)
return NULL;
val = section->vma;
section->size = val - section->vma;
/* PR 17512: file: objdump-s-endless-loop.tekhex.
- Check for overlarge section sizes. */
+ Check for overlarge section sizes. */
if (section->size & 0x80000000)
return FALSE;
section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
{
bfd_size_type amt = sizeof (tekhex_symbol_type);
tekhex_symbol_type *new_symbol = (tekhex_symbol_type *)
- bfd_alloc (abfd, amt);
+ bfd_alloc (abfd, amt);
char stype = (*src);
if (!new_symbol)
if (!getsym (sym, &src, &len, src_end))
return FALSE;
new_symbol->symbol.name = (const char *)
- bfd_alloc (abfd, (bfd_size_type) len + 1);
+ bfd_alloc (abfd, (bfd_size_type) len + 1);
if (!new_symbol->symbol.name)
return FALSE;
memcpy ((char *) (new_symbol->symbol.name), sym, len + 1);
{
bfd_size_type amt = sizeof (struct tekhex_symbol_struct);
tekhex_symbol_type *new_symbol = (tekhex_symbol_type *) bfd_zalloc (abfd,
- amt);
+ amt);
if (!new_symbol)
return NULL;
}
}
-#define tekhex_close_and_cleanup _bfd_generic_close_and_cleanup
-#define tekhex_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define tekhex_new_section_hook _bfd_generic_new_section_hook
+#define tekhex_close_and_cleanup _bfd_generic_close_and_cleanup
+#define tekhex_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define tekhex_new_section_hook _bfd_generic_new_section_hook
#define tekhex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define tekhex_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define tekhex_get_lineno _bfd_nosymbols_get_lineno
-#define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define tekhex_find_line _bfd_nosymbols_find_line
-#define tekhex_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define tekhex_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define tekhex_get_lineno _bfd_nosymbols_get_lineno
+#define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define tekhex_find_line _bfd_nosymbols_find_line
+#define tekhex_find_inliner_info _bfd_nosymbols_find_inliner_info
#define tekhex_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define tekhex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define tekhex_read_minisymbols _bfd_generic_read_minisymbols
-#define tekhex_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define tekhex_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define tekhex_read_minisymbols _bfd_generic_read_minisymbols
+#define tekhex_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
#define tekhex_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define tekhex_bfd_relax_section bfd_generic_relax_section
-#define tekhex_bfd_gc_sections bfd_generic_gc_sections
+#define tekhex_bfd_relax_section bfd_generic_relax_section
+#define tekhex_bfd_gc_sections bfd_generic_gc_sections
#define tekhex_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define tekhex_bfd_merge_sections bfd_generic_merge_sections
-#define tekhex_bfd_is_group_section bfd_generic_is_group_section
-#define tekhex_bfd_discard_group bfd_generic_discard_group
-#define tekhex_section_already_linked _bfd_generic_section_already_linked
-#define tekhex_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define tekhex_bfd_define_start_stop bfd_generic_define_start_stop
-#define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define tekhex_bfd_link_just_syms _bfd_generic_link_just_syms
-#define tekhex_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
-#define tekhex_bfd_final_link _bfd_generic_final_link
-#define tekhex_bfd_link_split_section _bfd_generic_link_split_section
-#define tekhex_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-#define tekhex_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define tekhex_bfd_merge_sections bfd_generic_merge_sections
+#define tekhex_bfd_is_group_section bfd_generic_is_group_section
+#define tekhex_bfd_discard_group bfd_generic_discard_group
+#define tekhex_section_already_linked _bfd_generic_section_already_linked
+#define tekhex_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define tekhex_bfd_define_start_stop bfd_generic_define_start_stop
+#define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define tekhex_bfd_link_just_syms _bfd_generic_link_just_syms
+#define tekhex_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
+#define tekhex_bfd_final_link _bfd_generic_final_link
+#define tekhex_bfd_link_split_section _bfd_generic_link_split_section
+#define tekhex_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define tekhex_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target tekhex_vec =
{
#include "sysdep.h"
#include "bfd.h"
#include "libbfd.h"
-#include "libaout.h" /* BFD a.out internal data structures */
+#include "libaout.h" /* BFD a.out internal data structures */
#include <sys/param.h>
#ifdef HAVE_DIRENT_H
#define SEGMENT_SIZE TARGET_PAGE_SIZE
#define DEFAULT_ARCH bfd_arch_vax
-#define DEFAULT_MID M_VAX_NETBSD
+#define DEFAULT_MID M_VAX_NETBSD
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
#define SEGMENT_SIZE TARGET_PAGE_SIZE
#define DEFAULT_ARCH bfd_arch_vax
-#define DEFAULT_MID M_VAX4K_NETBSD
+#define DEFAULT_MID M_VAX4K_NETBSD
/* Do not "beautify" the CONCAT* macro args. Traditional C will not
remove whitespace added here, and thus will fail to concatenate
EXAMPLE
@1000
- 01 ae 3f 45 12
+ 01 ae 3f 45 12
DESCRIPTION
@1000 specifies the starting address for the memory data.
return TRUE;
}
-#define verilog_close_and_cleanup _bfd_generic_close_and_cleanup
-#define verilog_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define verilog_new_section_hook _bfd_generic_new_section_hook
-#define verilog_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define verilog_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define verilog_get_lineno _bfd_nosymbols_get_lineno
-#define verilog_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define verilog_find_inliner_info _bfd_nosymbols_find_inliner_info
-#define verilog_make_empty_symbol _bfd_generic_make_empty_symbol
-#define verilog_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define verilog_read_minisymbols _bfd_generic_read_minisymbols
-#define verilog_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-#define verilog_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define verilog_close_and_cleanup _bfd_generic_close_and_cleanup
+#define verilog_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define verilog_new_section_hook _bfd_generic_new_section_hook
+#define verilog_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#define verilog_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define verilog_get_lineno _bfd_nosymbols_get_lineno
+#define verilog_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define verilog_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define verilog_make_empty_symbol _bfd_generic_make_empty_symbol
+#define verilog_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define verilog_read_minisymbols _bfd_generic_read_minisymbols
+#define verilog_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define verilog_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
#define verilog_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define verilog_bfd_relax_section bfd_generic_relax_section
-#define verilog_bfd_gc_sections bfd_generic_gc_sections
-#define verilog_bfd_merge_sections bfd_generic_merge_sections
-#define verilog_bfd_is_group_section bfd_generic_is_group_section
-#define verilog_bfd_discard_group bfd_generic_discard_group
-#define verilog_section_already_linked _bfd_generic_section_already_linked
-#define verilog_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define verilog_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define verilog_bfd_link_just_syms _bfd_generic_link_just_syms
-#define verilog_bfd_final_link _bfd_generic_final_link
-#define verilog_bfd_link_split_section _bfd_generic_link_split_section
+#define verilog_bfd_relax_section bfd_generic_relax_section
+#define verilog_bfd_gc_sections bfd_generic_gc_sections
+#define verilog_bfd_merge_sections bfd_generic_merge_sections
+#define verilog_bfd_is_group_section bfd_generic_is_group_section
+#define verilog_bfd_discard_group bfd_generic_discard_group
+#define verilog_section_already_linked _bfd_generic_section_already_linked
+#define verilog_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define verilog_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define verilog_bfd_link_just_syms _bfd_generic_link_just_syms
+#define verilog_bfd_final_link _bfd_generic_final_link
+#define verilog_bfd_link_split_section _bfd_generic_link_split_section
const bfd_target verilog_vec =
{
unsigned char esd_entries[1];
};
-#define ESD_ABS 0
-#define ESD_COMMON 1
+#define ESD_ABS 0
+#define ESD_COMMON 1
#define ESD_STD_REL_SEC 2
#define ESD_SHRT_REL_SEC 3
#define ESD_XDEF_IN_SEC 4
return section->reloc_count;
}
-#define versados_close_and_cleanup _bfd_generic_close_and_cleanup
-#define versados_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define versados_new_section_hook _bfd_generic_new_section_hook
-#define versados_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define versados_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define versados_get_lineno _bfd_nosymbols_get_lineno
-#define versados_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define versados_find_line _bfd_nosymbols_find_line
-#define versados_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define versados_close_and_cleanup _bfd_generic_close_and_cleanup
+#define versados_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define versados_new_section_hook _bfd_generic_new_section_hook
+#define versados_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#define versados_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define versados_get_lineno _bfd_nosymbols_get_lineno
+#define versados_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define versados_find_line _bfd_nosymbols_find_line
+#define versados_find_inliner_info _bfd_nosymbols_find_inliner_info
#define versados_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define versados_make_empty_symbol _bfd_generic_make_empty_symbol
-#define versados_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define versados_read_minisymbols _bfd_generic_read_minisymbols
-#define versados_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-#define versados_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
-#define versados_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
-#define versados_set_arch_mach bfd_default_set_arch_mach
+#define versados_make_empty_symbol _bfd_generic_make_empty_symbol
+#define versados_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define versados_read_minisymbols _bfd_generic_read_minisymbols
+#define versados_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define versados_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup
+#define versados_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup
+#define versados_set_arch_mach bfd_default_set_arch_mach
#define versados_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define versados_bfd_relax_section bfd_generic_relax_section
-#define versados_bfd_gc_sections bfd_generic_gc_sections
-#define versados_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define versados_bfd_merge_sections bfd_generic_merge_sections
-#define versados_bfd_is_group_section bfd_generic_is_group_section
-#define versados_bfd_discard_group bfd_generic_discard_group
-#define versados_section_already_linked _bfd_generic_section_already_linked
-#define versados_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define versados_bfd_define_start_stop bfd_generic_define_start_stop
-#define versados_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define versados_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define versados_bfd_link_just_syms _bfd_generic_link_just_syms
+#define versados_bfd_relax_section bfd_generic_relax_section
+#define versados_bfd_gc_sections bfd_generic_gc_sections
+#define versados_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define versados_bfd_merge_sections bfd_generic_merge_sections
+#define versados_bfd_is_group_section bfd_generic_is_group_section
+#define versados_bfd_discard_group bfd_generic_discard_group
+#define versados_section_already_linked _bfd_generic_section_already_linked
+#define versados_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define versados_bfd_define_start_stop bfd_generic_define_start_stop
+#define versados_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define versados_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define versados_bfd_link_just_syms _bfd_generic_link_just_syms
#define versados_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
-#define versados_bfd_final_link _bfd_generic_final_link
-#define versados_bfd_link_split_section _bfd_generic_link_split_section
-#define versados_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define versados_bfd_final_link _bfd_generic_final_link
+#define versados_bfd_link_split_section _bfd_generic_link_split_section
+#define versados_bfd_link_check_relocs _bfd_generic_link_check_relocs
#define versados_set_reloc _bfd_generic_set_reloc
const bfd_target m68k_versados_vec =
/* Debugger symbol definitions. */
-#define DBG_S_L_DMT_MODBEG 0
-#define DBG_S_L_DST_SIZE 4
-#define DBG_S_W_DMT_PSECT_COUNT 8
+#define DBG_S_L_DMT_MODBEG 0
+#define DBG_S_L_DST_SIZE 4
+#define DBG_S_W_DMT_PSECT_COUNT 8
#define DBG_S_C_DMT_HEADER_SIZE 12
-#define DBG_S_L_DMT_PSECT_START 0
+#define DBG_S_L_DMT_PSECT_START 0
#define DBG_S_L_DMT_PSECT_LENGTH 4
-#define DBG_S_C_DMT_PSECT_SIZE 8
+#define DBG_S_C_DMT_PSECT_SIZE 8
/* VMS module header. */
bfd_vma transfer_address[4];
/* Array of GSD sections to get the correspond BFD one. */
- unsigned int section_max; /* Size of the sections array. */
+ unsigned int section_max; /* Size of the sections array. */
unsigned int section_count; /* Number of GSD sections. */
asection **sections;
static void alpha_vms_add_fixup_lp (struct bfd_link_info *, bfd *, bfd *);
static void alpha_vms_add_fixup_ca (struct bfd_link_info *, bfd *, bfd *);
static void alpha_vms_add_fixup_qr (struct bfd_link_info *, bfd *, bfd *,
- bfd_vma);
+ bfd_vma);
static void alpha_vms_add_fixup_lr (struct bfd_link_info *, unsigned int,
- bfd_vma);
+ bfd_vma);
static void alpha_vms_add_lw_reloc (struct bfd_link_info *);
static void alpha_vms_add_qw_reloc (struct bfd_link_info *);
#define VEC_EL(VEC, TYPE, N) (((TYPE *)((VEC).els))[N])
-#define VEC_INIT(VEC) \
- do { \
- (VEC).max_el = 0; \
- (VEC).nbr_el = 0; \
- (VEC).els = NULL; \
+#define VEC_INIT(VEC) \
+ do { \
+ (VEC).max_el = 0; \
+ (VEC).nbr_el = 0; \
+ (VEC).els = NULL; \
} while (0)
/* Be sure there is room for a new element. */
/* Allocate room for a new element and return its address. */
-#define VEC_APPEND(VEC, TYPE) \
+#define VEC_APPEND(VEC, TYPE) \
(vector_grow1 (&VEC, sizeof (TYPE)), &VEC_EL(VEC, TYPE, (VEC).nbr_el++))
/* Append an element. */
-#define VEC_APPEND_EL(VEC, TYPE, EL) \
+#define VEC_APPEND_EL(VEC, TYPE, EL) \
(*(VEC_APPEND (VEC, TYPE)) = EL)
struct alpha_vms_vma_ref
static bfd_boolean
_bfd_vms_slurp_eihd (bfd *abfd, unsigned int *eisd_offset,
- unsigned int *eihs_offset)
+ unsigned int *eihs_offset)
{
unsigned int imgtype, size;
bfd_vma symvva;
*eihs_offset = bfd_getl32 (eihd->symdbgoff);
vms_debug2 ((4, "EIHD size %d imgtype %d symvva 0x%lx eisd %d eihs %d\n",
- size, imgtype, (unsigned long)symvva,
- *eisd_offset, *eihs_offset));
+ size, imgtype, (unsigned long)symvva,
+ *eisd_offset, *eihs_offset));
return TRUE;
}
eisd = (struct vms_eisd *)(PRIV (recrd.rec) + offset);
rec_size = bfd_getl32 (eisd->eisdsize);
if (rec_size == 0)
- break;
+ break;
/* Skip to next block if pad. */
if (rec_size == 0xffffffff)
- {
- offset = (offset + VMS_BLOCK_SIZE) & ~(VMS_BLOCK_SIZE - 1);
- continue;
- }
+ {
+ offset = (offset + VMS_BLOCK_SIZE) & ~(VMS_BLOCK_SIZE - 1);
+ continue;
+ }
/* Make sure that there is enough data present in the record. */
/* FIXME: Should we use sizeof (struct vms_eisd) rather than just 32 here ? */
vbn = bfd_getl32 (eisd->vbn);
vms_debug2 ((4, "EISD at 0x%x size 0x%x addr 0x%lx flags 0x%x blk %d\n",
- offset, size, (unsigned long)vaddr, flags, vbn));
+ offset, size, (unsigned long)vaddr, flags, vbn));
/* VMS combines psects from .obj files into isects in the .exe. This
process doesn't preserve enough information to reliably determine
especially true of DWARF debug sections. */
bfd_flags = SEC_ALLOC;
if (vbn != 0)
- bfd_flags |= SEC_HAS_CONTENTS | SEC_LOAD;
+ bfd_flags |= SEC_HAS_CONTENTS | SEC_LOAD;
if (flags & EISD__M_EXE)
bfd_flags |= SEC_CODE;
bfd_flags &= ~(SEC_ALLOC | SEC_LOAD);
}
else if (flags & EISD__M_FIXUPVEC)
- name = "$FIXUPVEC$";
+ name = "$FIXUPVEC$";
else if (eisd->type == EISD__K_USRSTACK)
- name = "$STACK$";
+ name = "$STACK$";
else
{
- const char *pfx;
+ const char *pfx;
name = (char*) bfd_alloc (abfd, 32);
- if (flags & EISD__M_DZRO)
- pfx = "BSS";
- else if (flags & EISD__M_EXE)
- pfx = "CODE";
- else if (!(flags & EISD__M_WRT))
- pfx = "RO";
- else
- pfx = "LOCAL";
- BFD_ASSERT (section_count < 999);
+ if (flags & EISD__M_DZRO)
+ pfx = "BSS";
+ else if (flags & EISD__M_EXE)
+ pfx = "CODE";
+ else if (!(flags & EISD__M_WRT))
+ pfx = "RO";
+ else
+ pfx = "LOCAL";
+ BFD_ASSERT (section_count < 999);
sprintf (name, "$%s_%03d$", pfx, section_count++);
}
/* PR 21611: Check that offset is valid. */
if (offset > PRIV (recrd.rec_size) - (EIHS__L_DMTBYTES + 4))
{
- _bfd_error_handler (_("Unable to read EIHS record at offset %#x"), offset);
+ _bfd_error_handler (_("Unable to read EIHS record at offset %#x"), offset);
bfd_set_error (bfd_error_file_truncated);
return FALSE;
}
if (PRIV (recrd.file_format) == FF_FOREIGN && (bfd_tell (abfd) & 1))
{
if (bfd_bread (PRIV (recrd.buf), 1, abfd) != 1)
- {
- bfd_set_error (bfd_error_file_truncated);
- return -1;
- }
+ {
+ bfd_set_error (bfd_error_file_truncated);
+ return -1;
+ }
}
/* Read the record header */
type = bfd_getl16 (PRIV (recrd.rec));
vms_debug2 ((8, "_bfd_vms_get_obj_record: rec %p, size %d, type %d\n",
- PRIV (recrd.rec), PRIV (recrd.rec_size), type));
+ PRIV (recrd.rec), PRIV (recrd.rec_size), type));
return type;
}
if (to_read > PRIV (recrd.buf_size))
{
PRIV (recrd.buf)
- = (unsigned char *) bfd_realloc (PRIV (recrd.buf), to_read);
+ = (unsigned char *) bfd_realloc (PRIV (recrd.buf), to_read);
if (PRIV (recrd.buf) == NULL)
- return 0;
+ return 0;
PRIV (recrd.buf_size) = to_read;
}
/* PR 17512: file: 025-1974-0.004. */
maybe_adjust_record_pointer_for_object (abfd);
vms_debug2 ((8, "vms_get_remaining_obj_record: size %d\n",
- PRIV (recrd.rec_size)));
+ PRIV (recrd.rec_size)));
return PRIV (recrd.rec_size);
}
if (vms_rec + PRIV (recrd.rec_size - 6) > end)
goto fail;
PRIV (hdr_data).hdr_c_lnm =
- _bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
+ _bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
break;
case EMH__C_SRC:
if (vms_rec + PRIV (recrd.rec_size - 6) > end)
goto fail;
PRIV (hdr_data).hdr_c_src =
- _bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
+ _bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
break;
case EMH__C_TTL:
if (vms_rec + PRIV (recrd.rec_size - 6) > end)
goto fail;
PRIV (hdr_data).hdr_c_ttl =
- _bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
+ _bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
break;
case EMH__C_CPR:
while (section_flags[i].name != NULL)
{
if (strcmp (name, section_flags[i].name) == 0)
- {
+ {
if (hassize)
return section_flags[i].flags_hassize;
else
static flagword
vms_esecflag_by_name (const struct sec_flags_struct *section_flags,
const char *name,
- int hassize)
+ int hassize)
{
int i = 0;
if (PRIV (gsd_sym_count) >= PRIV (max_sym_count))
{
if (PRIV (max_sym_count) == 0)
- {
- PRIV (max_sym_count) = 128;
- PRIV (syms) = bfd_malloc
- (PRIV (max_sym_count) * sizeof (struct vms_symbol_entry *));
- }
+ {
+ PRIV (max_sym_count) = 128;
+ PRIV (syms) = bfd_malloc
+ (PRIV (max_sym_count) * sizeof (struct vms_symbol_entry *));
+ }
else
- {
- PRIV (max_sym_count) *= 2;
- PRIV (syms) = bfd_realloc
- (PRIV (syms),
- (PRIV (max_sym_count) * sizeof (struct vms_symbol_entry *)));
- }
+ {
+ PRIV (max_sym_count) *= 2;
+ PRIV (syms) = bfd_realloc
+ (PRIV (syms),
+ (PRIV (max_sym_count) * sizeof (struct vms_symbol_entry *)));
+ }
if (PRIV (syms) == NULL)
- return FALSE;
+ return FALSE;
}
PRIV (syms)[PRIV (gsd_sym_count)++] = sym;
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
-
+
PRIV (recrd.rec) += 8; /* Skip type, size, align pad. */
PRIV (recrd.rec_size) -= 8;
switch (gsd_type)
{
case EGSD__C_PSC:
- /* Program section definition. */
+ /* Program section definition. */
{
- struct vms_egps *egps = (struct vms_egps *)vms_rec;
- flagword new_flags, vms_flags;
- asection *section;
+ struct vms_egps *egps = (struct vms_egps *)vms_rec;
+ flagword new_flags, vms_flags;
+ asection *section;
vms_flags = bfd_getl16 (egps->flags);
- if ((vms_flags & EGPS__V_REL) == 0)
- {
- /* Use the global absolute section for all
- absolute sections. */
- section = bfd_abs_section_ptr;
- }
- else
- {
- char *name;
- unsigned long align_addr;
+ if ((vms_flags & EGPS__V_REL) == 0)
+ {
+ /* Use the global absolute section for all
+ absolute sections. */
+ section = bfd_abs_section_ptr;
+ }
+ else
+ {
+ char *name;
+ unsigned long align_addr;
name = _bfd_vms_save_counted_string (&egps->namlng, gsd_size - 4);
- section = bfd_make_section (abfd, name);
- if (!section)
- return FALSE;
-
- section->filepos = 0;
- section->size = bfd_getl32 (egps->alloc);
- section->alignment_power = egps->align;
-
- vms_section_data (section)->flags = vms_flags;
- vms_section_data (section)->no_flags = 0;
-
- new_flags = vms_secflag_by_name (evax_section_flags, name,
- section->size > 0);
- if (section->size > 0)
- new_flags |= SEC_LOAD;
- if (!(vms_flags & EGPS__V_NOMOD) && section->size > 0)
- {
- /* Set RELOC and HAS_CONTENTS if the section is not
- demand-zero and not empty. */
- new_flags |= SEC_HAS_CONTENTS;
- if (vms_flags & EGPS__V_REL)
- new_flags |= SEC_RELOC;
- }
- if (vms_flags & EGPS__V_EXE)
- {
- /* Set CODE if section is executable. */
- new_flags |= SEC_CODE;
- new_flags &= ~SEC_DATA;
- }
- if (!bfd_set_section_flags (abfd, section, new_flags))
- return FALSE;
-
- /* Give a non-overlapping vma to non absolute sections. */
- align_addr = (1 << section->alignment_power);
- if ((base_addr % align_addr) != 0)
- base_addr += (align_addr - (base_addr % align_addr));
- section->vma = (bfd_vma)base_addr;
- base_addr += section->size;
- }
-
- /* Append it to the section array. */
- if (PRIV (section_count) >= PRIV (section_max))
- {
- if (PRIV (section_max) == 0)
- PRIV (section_max) = 16;
- else
- PRIV (section_max) *= 2;
- PRIV (sections) = bfd_realloc_or_free
- (PRIV (sections), PRIV (section_max) * sizeof (asection *));
- if (PRIV (sections) == NULL)
- return FALSE;
- }
-
- PRIV (sections)[PRIV (section_count)] = section;
- PRIV (section_count)++;
+ section = bfd_make_section (abfd, name);
+ if (!section)
+ return FALSE;
+
+ section->filepos = 0;
+ section->size = bfd_getl32 (egps->alloc);
+ section->alignment_power = egps->align;
+
+ vms_section_data (section)->flags = vms_flags;
+ vms_section_data (section)->no_flags = 0;
+
+ new_flags = vms_secflag_by_name (evax_section_flags, name,
+ section->size > 0);
+ if (section->size > 0)
+ new_flags |= SEC_LOAD;
+ if (!(vms_flags & EGPS__V_NOMOD) && section->size > 0)
+ {
+ /* Set RELOC and HAS_CONTENTS if the section is not
+ demand-zero and not empty. */
+ new_flags |= SEC_HAS_CONTENTS;
+ if (vms_flags & EGPS__V_REL)
+ new_flags |= SEC_RELOC;
+ }
+ if (vms_flags & EGPS__V_EXE)
+ {
+ /* Set CODE if section is executable. */
+ new_flags |= SEC_CODE;
+ new_flags &= ~SEC_DATA;
+ }
+ if (!bfd_set_section_flags (abfd, section, new_flags))
+ return FALSE;
+
+ /* Give a non-overlapping vma to non absolute sections. */
+ align_addr = (1 << section->alignment_power);
+ if ((base_addr % align_addr) != 0)
+ base_addr += (align_addr - (base_addr % align_addr));
+ section->vma = (bfd_vma)base_addr;
+ base_addr += section->size;
+ }
+
+ /* Append it to the section array. */
+ if (PRIV (section_count) >= PRIV (section_max))
+ {
+ if (PRIV (section_max) == 0)
+ PRIV (section_max) = 16;
+ else
+ PRIV (section_max) *= 2;
+ PRIV (sections) = bfd_realloc_or_free
+ (PRIV (sections), PRIV (section_max) * sizeof (asection *));
+ if (PRIV (sections) == NULL)
+ return FALSE;
+ }
+
+ PRIV (sections)[PRIV (section_count)] = section;
+ PRIV (section_count)++;
}
break;
case EGSD__C_SYM:
{
- int nameoff;
- struct vms_symbol_entry *entry;
- struct vms_egsy *egsy = (struct vms_egsy *) vms_rec;
- flagword old_flags;
+ int nameoff;
+ struct vms_symbol_entry *entry;
+ struct vms_egsy *egsy = (struct vms_egsy *) vms_rec;
+ flagword old_flags;
old_flags = bfd_getl16 (egsy->flags);
if (old_flags & EGSY__V_DEF)
- nameoff = ESDF__B_NAMLNG;
- else
- nameoff = ESRF__B_NAMLNG;
+ nameoff = ESDF__B_NAMLNG;
+ else
+ nameoff = ESRF__B_NAMLNG;
- entry = add_symbol (abfd, vms_rec + nameoff);
- if (entry == NULL)
- return FALSE;
+ entry = add_symbol (abfd, vms_rec + nameoff);
+ if (entry == NULL)
+ return FALSE;
- /* Allow only duplicate reference. */
- if ((entry->flags & EGSY__V_DEF) && (old_flags & EGSY__V_DEF))
- abort ();
+ /* Allow only duplicate reference. */
+ if ((entry->flags & EGSY__V_DEF) && (old_flags & EGSY__V_DEF))
+ abort ();
- if (entry->typ == 0)
- {
- entry->typ = gsd_type;
- entry->data_type = egsy->datyp;
- entry->flags = old_flags;
- }
+ if (entry->typ == 0)
+ {
+ entry->typ = gsd_type;
+ entry->data_type = egsy->datyp;
+ entry->flags = old_flags;
+ }
if (old_flags & EGSY__V_DEF)
- {
- struct vms_esdf *esdf = (struct vms_esdf *)vms_rec;
+ {
+ struct vms_esdf *esdf = (struct vms_esdf *)vms_rec;
long psindx;
entry->value = bfd_getl64 (esdf->value);
}
entry->section = PRIV (sections)[psindx];
- if (old_flags & EGSY__V_NORM)
- {
- PRIV (norm_sym_count)++;
+ if (old_flags & EGSY__V_NORM)
+ {
+ PRIV (norm_sym_count)++;
- entry->code_value = bfd_getl64 (esdf->code_address);
+ entry->code_value = bfd_getl64 (esdf->code_address);
psindx = bfd_getl32 (esdf->ca_psindx);
/* PR 21813: Check for an out of range index. */
if (psindx < 0 || psindx >= (int) PRIV (section_count))
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
- entry->code_section = PRIV (sections)[psindx];
- }
- }
+ entry->code_section = PRIV (sections)[psindx];
+ }
+ }
}
break;
case EGSD__C_SYMG:
{
- struct vms_symbol_entry *entry;
- struct vms_egst *egst = (struct vms_egst *)vms_rec;
- flagword old_flags;
+ struct vms_symbol_entry *entry;
+ struct vms_egst *egst = (struct vms_egst *)vms_rec;
+ flagword old_flags;
old_flags = bfd_getl16 (egst->header.flags);
- entry = add_symbol (abfd, &egst->namlng);
+ entry = add_symbol (abfd, &egst->namlng);
- if (entry == NULL)
- return FALSE;
+ if (entry == NULL)
+ return FALSE;
- entry->typ = gsd_type;
- entry->data_type = egst->header.datyp;
- entry->flags = old_flags;
+ entry->typ = gsd_type;
+ entry->data_type = egst->header.datyp;
+ entry->flags = old_flags;
- entry->symbol_vector = bfd_getl32 (egst->value);
+ entry->symbol_vector = bfd_getl32 (egst->value);
- if (old_flags & EGSY__V_REL)
+ if (old_flags & EGSY__V_REL)
{
long psindx;
}
entry->section = PRIV (sections)[psindx];
}
- else
- entry->section = bfd_abs_section_ptr;
+ else
+ entry->section = bfd_abs_section_ptr;
- entry->value = bfd_getl64 (egst->lp_2);
+ entry->value = bfd_getl64 (egst->lp_2);
- if (old_flags & EGSY__V_NORM)
- {
- PRIV (norm_sym_count)++;
+ if (old_flags & EGSY__V_NORM)
+ {
+ PRIV (norm_sym_count)++;
- entry->code_value = bfd_getl64 (egst->lp_1);
- entry->code_section = bfd_abs_section_ptr;
- }
- }
+ entry->code_value = bfd_getl64 (egst->lp_1);
+ entry->code_section = bfd_abs_section_ptr;
+ }
+ }
break;
- case EGSD__C_SPSC:
- case EGSD__C_IDC:
- /* Currently ignored. */
- break;
+ case EGSD__C_SPSC:
+ case EGSD__C_IDC:
+ /* Currently ignored. */
+ break;
case EGSD__C_SYMM:
case EGSD__C_SYMV:
default:
_bfd_vms_push (bfd *abfd, bfd_vma val, unsigned int reloc)
{
vms_debug2 ((4, "<push %08lx (0x%08x) at %d>\n",
- (unsigned long)val, reloc, PRIV (stackptr)));
+ (unsigned long)val, reloc, PRIV (stackptr)));
PRIV (stack[PRIV (stackptr)]).value = val;
PRIV (stack[PRIV (stackptr)]).reloc = reloc;
/* Reading contents to an output bfd. */
if (sec->output_section == NULL)
- {
- /* Section discarded. */
- vms_debug2 ((5, " section %s discarded\n", sec->name));
-
- /* This is not used. */
- PRIV (image_section) = NULL;
- PRIV (image_offset) = 0;
- return;
- }
+ {
+ /* Section discarded. */
+ vms_debug2 ((5, " section %s discarded\n", sec->name));
+
+ /* This is not used. */
+ PRIV (image_section) = NULL;
+ PRIV (image_offset) = 0;
+ return;
+ }
PRIV (image_offset) = sec->output_offset + vma;
PRIV (image_section) = sec->output_section;
}
{
#if VMS_DEBUG
_bfd_vms_debug (8, "image_write from (%p, %d) to (%ld)\n", ptr, size,
- (long)PRIV (image_offset));
+ (long)PRIV (image_offset));
_bfd_hexdump (9, ptr, size, 0);
#endif
/* Check bounds. */
if (off > (file_ptr)sec->size
- || size > (file_ptr)sec->size
- || off + size > (file_ptr)sec->size)
- {
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
+ || size > (file_ptr)sec->size
+ || off + size > (file_ptr)sec->size)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
memcpy (sec->contents + off, ptr, size);
}
_bfd_vms_get_value (bfd *abfd,
const unsigned char *ascic,
const unsigned char *max_ascic,
- struct bfd_link_info *info,
- bfd_vma *vma,
- struct alpha_vms_link_hash_entry **hp)
+ struct bfd_link_info *info,
+ bfd_vma *vma,
+ struct alpha_vms_link_hash_entry **hp)
{
char name[257];
unsigned int len;
if (h != NULL
&& (h->root.type == bfd_link_hash_defined
- || h->root.type == bfd_link_hash_defweak))
+ || h->root.type == bfd_link_hash_defweak))
*vma = h->root.u.def.value
+ h->root.u.def.section->output_offset
+ h->root.u.def.section->output_section->vma;
if (h->sym->typ == EGSD__C_SYMG)
{
if (h->sym->flags & EGSY__V_REL)
- return RELC_SHR_BASE + PRIV2 (h->sym->owner, shr_index);
+ return RELC_SHR_BASE + PRIV2 (h->sym->owner, shr_index);
else
- {
- /* Can this happen (non-relocatable symg) ? I'd like to see
- an example. */
- abort ();
- }
+ {
+ /* Can this happen (non-relocatable symg) ? I'd like to see
+ an example. */
+ abort ();
+ }
}
if (h->sym->typ == EGSD__C_SYM)
{
if (h->sym->flags & EGSY__V_REL)
- return RELC_REL;
+ return RELC_REL;
else
- return RELC_NONE;
+ return RELC_NONE;
}
abort ();
}
static bfd_vma
alpha_vms_fix_sec_rel (bfd *abfd, struct bfd_link_info *info,
- unsigned int rel, bfd_vma vma)
+ unsigned int rel, bfd_vma vma)
{
asection *sec;
if (info)
{
if (sec->output_section == NULL)
- abort ();
+ abort ();
return vma + sec->output_section->vma + sec->output_offset;
}
else
#if VMS_DEBUG
_bfd_vms_debug (4, "etir: %s(%d)\n",
- _bfd_vms_etir_name (cmd), cmd);
+ _bfd_vms_etir_name (cmd), cmd);
_bfd_hexdump (8, ptr, cmd_length - 4, 0);
#endif
switch (cmd)
- {
- /* Stack global
- arg: cs symbol name
+ {
+ /* Stack global
+ arg: cs symbol name
- stack 32 bit value of symbol (high bits set to 0). */
- case ETIR__C_STA_GBL:
- _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
- _bfd_vms_push (abfd, op1, alpha_vms_sym_to_ctxt (h));
- break;
+ stack 32 bit value of symbol (high bits set to 0). */
+ case ETIR__C_STA_GBL:
+ _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
+ _bfd_vms_push (abfd, op1, alpha_vms_sym_to_ctxt (h));
+ break;
- /* Stack longword
- arg: lw value
+ /* Stack longword
+ arg: lw value
- stack 32 bit value, sign extend to 64 bit. */
- case ETIR__C_STA_LW:
+ stack 32 bit value, sign extend to 64 bit. */
+ case ETIR__C_STA_LW:
if (ptr + 4 >= maxptr)
goto corrupt_etir;
- _bfd_vms_push (abfd, bfd_getl32 (ptr), RELC_NONE);
- break;
+ _bfd_vms_push (abfd, bfd_getl32 (ptr), RELC_NONE);
+ break;
- /* Stack quadword
- arg: qw value
+ /* Stack quadword
+ arg: qw value
- stack 64 bit value of symbol. */
- case ETIR__C_STA_QW:
+ stack 64 bit value of symbol. */
+ case ETIR__C_STA_QW:
if (ptr + 8 >= maxptr)
goto corrupt_etir;
- _bfd_vms_push (abfd, bfd_getl64 (ptr), RELC_NONE);
- break;
+ _bfd_vms_push (abfd, bfd_getl64 (ptr), RELC_NONE);
+ break;
- /* Stack psect base plus quadword offset
- arg: lw section index
- qw signed quadword offset (low 32 bits)
+ /* Stack psect base plus quadword offset
+ arg: lw section index
+ qw signed quadword offset (low 32 bits)
- Stack qw argument and section index
- (see ETIR__C_STO_OFF, ETIR__C_CTL_SETRB). */
- case ETIR__C_STA_PQ:
- {
- int psect;
+ Stack qw argument and section index
+ (see ETIR__C_STO_OFF, ETIR__C_CTL_SETRB). */
+ case ETIR__C_STA_PQ:
+ {
+ int psect;
if (ptr + 12 >= maxptr)
goto corrupt_etir;
- psect = bfd_getl32 (ptr);
- if ((unsigned int) psect >= PRIV (section_count))
- {
+ psect = bfd_getl32 (ptr);
+ if ((unsigned int) psect >= PRIV (section_count))
+ {
_bfd_error_handler (_("bad section index in %s"),
_bfd_vms_etir_name (cmd));
- bfd_set_error (bfd_error_bad_value);
- return FALSE;
- }
- op1 = bfd_getl64 (ptr + 4);
- _bfd_vms_push (abfd, op1, psect | RELC_SEC_BASE);
- }
- break;
-
- case ETIR__C_STA_LI:
- case ETIR__C_STA_MOD:
- case ETIR__C_STA_CKARG:
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+ op1 = bfd_getl64 (ptr + 4);
+ _bfd_vms_push (abfd, op1, psect | RELC_SEC_BASE);
+ }
+ break;
+
+ case ETIR__C_STA_LI:
+ case ETIR__C_STA_MOD:
+ case ETIR__C_STA_CKARG:
_bfd_error_handler (_("unsupported STA cmd %s"),
_bfd_vms_etir_name (cmd));
- return FALSE;
- break;
-
- /* Store byte: pop stack, write byte
- arg: -. */
- case ETIR__C_STO_B:
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (rel1 != RELC_NONE)
- goto bad_context;
- image_write_b (abfd, (unsigned int) op1 & 0xff);
- break;
-
- /* Store word: pop stack, write word
- arg: -. */
- case ETIR__C_STO_W:
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (rel1 != RELC_NONE)
- goto bad_context;
- image_write_w (abfd, (unsigned int) op1 & 0xffff);
- break;
-
- /* Store longword: pop stack, write longword
- arg: -. */
- case ETIR__C_STO_LW:
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (rel1 & RELC_SEC_BASE)
- {
- op1 = alpha_vms_fix_sec_rel (abfd, info, rel1, op1);
- rel1 = RELC_REL;
- }
- else if (rel1 & RELC_SHR_BASE)
- {
- alpha_vms_add_fixup_lr (info, rel1 & RELC_MASK, op1);
- rel1 = RELC_NONE;
- }
- if (rel1 != RELC_NONE)
- {
- if (rel1 != RELC_REL)
- abort ();
- alpha_vms_add_lw_reloc (info);
- }
- image_write_l (abfd, op1);
- break;
-
- /* Store quadword: pop stack, write quadword
- arg: -. */
- case ETIR__C_STO_QW:
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (rel1 & RELC_SEC_BASE)
- {
- op1 = alpha_vms_fix_sec_rel (abfd, info, rel1, op1);
- rel1 = RELC_REL;
- }
- else if (rel1 & RELC_SHR_BASE)
- abort ();
- if (rel1 != RELC_NONE)
- {
- if (rel1 != RELC_REL)
- abort ();
- alpha_vms_add_qw_reloc (info);
- }
- image_write_q (abfd, op1);
- break;
-
- /* Store immediate repeated: pop stack for repeat count
- arg: lw byte count
- da data. */
- case ETIR__C_STO_IMMR:
- {
- int size;
+ return FALSE;
+ break;
+
+ /* Store byte: pop stack, write byte
+ arg: -. */
+ case ETIR__C_STO_B:
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (rel1 != RELC_NONE)
+ goto bad_context;
+ image_write_b (abfd, (unsigned int) op1 & 0xff);
+ break;
+
+ /* Store word: pop stack, write word
+ arg: -. */
+ case ETIR__C_STO_W:
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (rel1 != RELC_NONE)
+ goto bad_context;
+ image_write_w (abfd, (unsigned int) op1 & 0xffff);
+ break;
+
+ /* Store longword: pop stack, write longword
+ arg: -. */
+ case ETIR__C_STO_LW:
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (rel1 & RELC_SEC_BASE)
+ {
+ op1 = alpha_vms_fix_sec_rel (abfd, info, rel1, op1);
+ rel1 = RELC_REL;
+ }
+ else if (rel1 & RELC_SHR_BASE)
+ {
+ alpha_vms_add_fixup_lr (info, rel1 & RELC_MASK, op1);
+ rel1 = RELC_NONE;
+ }
+ if (rel1 != RELC_NONE)
+ {
+ if (rel1 != RELC_REL)
+ abort ();
+ alpha_vms_add_lw_reloc (info);
+ }
+ image_write_l (abfd, op1);
+ break;
+
+ /* Store quadword: pop stack, write quadword
+ arg: -. */
+ case ETIR__C_STO_QW:
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (rel1 & RELC_SEC_BASE)
+ {
+ op1 = alpha_vms_fix_sec_rel (abfd, info, rel1, op1);
+ rel1 = RELC_REL;
+ }
+ else if (rel1 & RELC_SHR_BASE)
+ abort ();
+ if (rel1 != RELC_NONE)
+ {
+ if (rel1 != RELC_REL)
+ abort ();
+ alpha_vms_add_qw_reloc (info);
+ }
+ image_write_q (abfd, op1);
+ break;
+
+ /* Store immediate repeated: pop stack for repeat count
+ arg: lw byte count
+ da data. */
+ case ETIR__C_STO_IMMR:
+ {
+ int size;
if (ptr + 4 >= maxptr)
goto corrupt_etir;
- size = bfd_getl32 (ptr);
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (rel1 != RELC_NONE)
- goto bad_context;
- while (op1-- > 0)
- image_write (abfd, ptr + 4, size);
- }
- break;
-
- /* Store global: write symbol value
- arg: cs global symbol name. */
- case ETIR__C_STO_GBL:
- _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
- if (h && h->sym)
- {
- if (h->sym->typ == EGSD__C_SYMG)
- {
- alpha_vms_add_fixup_qr
- (info, abfd, h->sym->owner, h->sym->symbol_vector);
- op1 = 0;
- }
- else
- {
- op1 = alpha_vms_get_sym_value (h->sym->section,
- h->sym->value);
- alpha_vms_add_qw_reloc (info);
- }
- }
- image_write_q (abfd, op1);
- break;
-
- /* Store code address: write address of entry point
- arg: cs global symbol name (procedure). */
- case ETIR__C_STO_CA:
- _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
- if (h && h->sym)
- {
- if (h->sym->flags & EGSY__V_NORM)
- {
- /* That's really a procedure. */
- if (h->sym->typ == EGSD__C_SYMG)
- {
- alpha_vms_add_fixup_ca (info, abfd, h->sym->owner);
- op1 = h->sym->symbol_vector;
- }
- else
- {
- op1 = alpha_vms_get_sym_value (h->sym->code_section,
- h->sym->code_value);
- alpha_vms_add_qw_reloc (info);
- }
- }
- else
- {
- /* Symbol is not a procedure. */
- abort ();
- }
- }
- image_write_q (abfd, op1);
- break;
-
- /* Store offset to psect: pop stack, add low 32 bits to base of psect
- arg: none. */
- case ETIR__C_STO_OFF:
- _bfd_vms_pop (abfd, &op1, &rel1);
-
- if (!(rel1 & RELC_SEC_BASE))
- abort ();
-
- op1 = alpha_vms_fix_sec_rel (abfd, info, rel1, op1);
- rel1 = RELC_REL;
- image_write_q (abfd, op1);
- break;
-
- /* Store immediate
- arg: lw count of bytes
- da data. */
- case ETIR__C_STO_IMM:
- {
- unsigned int size;
+ size = bfd_getl32 (ptr);
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (rel1 != RELC_NONE)
+ goto bad_context;
+ while (op1-- > 0)
+ image_write (abfd, ptr + 4, size);
+ }
+ break;
+
+ /* Store global: write symbol value
+ arg: cs global symbol name. */
+ case ETIR__C_STO_GBL:
+ _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
+ if (h && h->sym)
+ {
+ if (h->sym->typ == EGSD__C_SYMG)
+ {
+ alpha_vms_add_fixup_qr
+ (info, abfd, h->sym->owner, h->sym->symbol_vector);
+ op1 = 0;
+ }
+ else
+ {
+ op1 = alpha_vms_get_sym_value (h->sym->section,
+ h->sym->value);
+ alpha_vms_add_qw_reloc (info);
+ }
+ }
+ image_write_q (abfd, op1);
+ break;
+
+ /* Store code address: write address of entry point
+ arg: cs global symbol name (procedure). */
+ case ETIR__C_STO_CA:
+ _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
+ if (h && h->sym)
+ {
+ if (h->sym->flags & EGSY__V_NORM)
+ {
+ /* That's really a procedure. */
+ if (h->sym->typ == EGSD__C_SYMG)
+ {
+ alpha_vms_add_fixup_ca (info, abfd, h->sym->owner);
+ op1 = h->sym->symbol_vector;
+ }
+ else
+ {
+ op1 = alpha_vms_get_sym_value (h->sym->code_section,
+ h->sym->code_value);
+ alpha_vms_add_qw_reloc (info);
+ }
+ }
+ else
+ {
+ /* Symbol is not a procedure. */
+ abort ();
+ }
+ }
+ image_write_q (abfd, op1);
+ break;
+
+ /* Store offset to psect: pop stack, add low 32 bits to base of psect
+ arg: none. */
+ case ETIR__C_STO_OFF:
+ _bfd_vms_pop (abfd, &op1, &rel1);
+
+ if (!(rel1 & RELC_SEC_BASE))
+ abort ();
+
+ op1 = alpha_vms_fix_sec_rel (abfd, info, rel1, op1);
+ rel1 = RELC_REL;
+ image_write_q (abfd, op1);
+ break;
+
+ /* Store immediate
+ arg: lw count of bytes
+ da data. */
+ case ETIR__C_STO_IMM:
+ {
+ unsigned int size;
if (ptr + 4 >= maxptr)
goto corrupt_etir;
- size = bfd_getl32 (ptr);
- image_write (abfd, ptr + 4, size);
- }
- break;
-
- /* This code is 'reserved to digital' according to the openVMS
- linker manual, however it is generated by the DEC C compiler
- and defined in the include file.
- FIXME, since the following is just a guess
- store global longword: store 32bit value of symbol
- arg: cs symbol name. */
- case ETIR__C_STO_GBL_LW:
- _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
+ size = bfd_getl32 (ptr);
+ image_write (abfd, ptr + 4, size);
+ }
+ break;
+
+ /* This code is 'reserved to digital' according to the openVMS
+ linker manual, however it is generated by the DEC C compiler
+ and defined in the include file.
+ FIXME, since the following is just a guess
+ store global longword: store 32bit value of symbol
+ arg: cs symbol name. */
+ case ETIR__C_STO_GBL_LW:
+ _bfd_vms_get_value (abfd, ptr, maxptr, info, &op1, &h);
#if 0
- abort ();
+ abort ();
#endif
- image_write_l (abfd, op1);
- break;
+ image_write_l (abfd, op1);
+ break;
- case ETIR__C_STO_RB:
- case ETIR__C_STO_AB:
- case ETIR__C_STO_LP_PSB:
+ case ETIR__C_STO_RB:
+ case ETIR__C_STO_AB:
+ case ETIR__C_STO_LP_PSB:
_bfd_error_handler (_("%s: not supported"),
_bfd_vms_etir_name (cmd));
- return FALSE;
- break;
- case ETIR__C_STO_HINT_GBL:
- case ETIR__C_STO_HINT_PS:
+ return FALSE;
+ break;
+ case ETIR__C_STO_HINT_GBL:
+ case ETIR__C_STO_HINT_PS:
_bfd_error_handler (_("%s: not implemented"),
_bfd_vms_etir_name (cmd));
- return FALSE;
- break;
+ return FALSE;
+ break;
- /* 200 Store-conditional Linkage Pair
- arg: none. */
- case ETIR__C_STC_LP:
+ /* 200 Store-conditional Linkage Pair
+ arg: none. */
+ case ETIR__C_STC_LP:
- /* 202 Store-conditional Address at global address
- lw linkage index
- cs global name. */
+ /* 202 Store-conditional Address at global address
+ lw linkage index
+ cs global name. */
- case ETIR__C_STC_GBL:
+ case ETIR__C_STC_GBL:
- /* 203 Store-conditional Code Address at global address
- lw linkage index
- cs procedure name. */
- case ETIR__C_STC_GCA:
+ /* 203 Store-conditional Code Address at global address
+ lw linkage index
+ cs procedure name. */
+ case ETIR__C_STC_GCA:
- /* 204 Store-conditional Address at psect + offset
- lw linkage index
- lw psect index
- qw offset. */
- case ETIR__C_STC_PS:
+ /* 204 Store-conditional Address at psect + offset
+ lw linkage index
+ lw psect index
+ qw offset. */
+ case ETIR__C_STC_PS:
_bfd_error_handler (_("%s: not supported"),
_bfd_vms_etir_name (cmd));
- return FALSE;
- break;
-
- /* 201 Store-conditional Linkage Pair with Procedure Signature
- lw linkage index
- cs procedure name
- by signature length
- da signature. */
-
- case ETIR__C_STC_LP_PSB:
- _bfd_vms_get_value (abfd, ptr + 4, maxptr, info, &op1, &h);
- if (h && h->sym)
- {
- if (h->sym->typ == EGSD__C_SYMG)
- {
- alpha_vms_add_fixup_lp (info, abfd, h->sym->owner);
- op1 = h->sym->symbol_vector;
- op2 = 0;
- }
- else
- {
- op1 = alpha_vms_get_sym_value (h->sym->code_section,
- h->sym->code_value);
- op2 = alpha_vms_get_sym_value (h->sym->section,
- h->sym->value);
- }
- }
- else
- {
- /* Undefined symbol. */
- op1 = 0;
- op2 = 0;
- }
- image_write_q (abfd, op1);
- image_write_q (abfd, op2);
- break;
-
- /* 205 Store-conditional NOP at address of global
- arg: none. */
- case ETIR__C_STC_NOP_GBL:
- /* ALPHA_R_NOP */
-
- /* 207 Store-conditional BSR at global address
- arg: none. */
-
- case ETIR__C_STC_BSR_GBL:
- /* ALPHA_R_BSR */
-
- /* 209 Store-conditional LDA at global address
- arg: none. */
-
- case ETIR__C_STC_LDA_GBL:
- /* ALPHA_R_LDA */
-
- /* 211 Store-conditional BSR or Hint at global address
- arg: none. */
-
- case ETIR__C_STC_BOH_GBL:
- /* Currentl ignored. */
- break;
-
- /* 213 Store-conditional NOP,BSR or HINT at global address
- arg: none. */
-
- case ETIR__C_STC_NBH_GBL:
-
- /* 206 Store-conditional NOP at pect + offset
- arg: none. */
-
- case ETIR__C_STC_NOP_PS:
-
- /* 208 Store-conditional BSR at pect + offset
- arg: none. */
-
- case ETIR__C_STC_BSR_PS:
-
- /* 210 Store-conditional LDA at psect + offset
- arg: none. */
-
- case ETIR__C_STC_LDA_PS:
-
- /* 212 Store-conditional BSR or Hint at pect + offset
- arg: none. */
-
- case ETIR__C_STC_BOH_PS:
-
- /* 214 Store-conditional NOP, BSR or HINT at psect + offset
- arg: none. */
- case ETIR__C_STC_NBH_PS:
+ return FALSE;
+ break;
+
+ /* 201 Store-conditional Linkage Pair with Procedure Signature
+ lw linkage index
+ cs procedure name
+ by signature length
+ da signature. */
+
+ case ETIR__C_STC_LP_PSB:
+ _bfd_vms_get_value (abfd, ptr + 4, maxptr, info, &op1, &h);
+ if (h && h->sym)
+ {
+ if (h->sym->typ == EGSD__C_SYMG)
+ {
+ alpha_vms_add_fixup_lp (info, abfd, h->sym->owner);
+ op1 = h->sym->symbol_vector;
+ op2 = 0;
+ }
+ else
+ {
+ op1 = alpha_vms_get_sym_value (h->sym->code_section,
+ h->sym->code_value);
+ op2 = alpha_vms_get_sym_value (h->sym->section,
+ h->sym->value);
+ }
+ }
+ else
+ {
+ /* Undefined symbol. */
+ op1 = 0;
+ op2 = 0;
+ }
+ image_write_q (abfd, op1);
+ image_write_q (abfd, op2);
+ break;
+
+ /* 205 Store-conditional NOP at address of global
+ arg: none. */
+ case ETIR__C_STC_NOP_GBL:
+ /* ALPHA_R_NOP */
+
+ /* 207 Store-conditional BSR at global address
+ arg: none. */
+
+ case ETIR__C_STC_BSR_GBL:
+ /* ALPHA_R_BSR */
+
+ /* 209 Store-conditional LDA at global address
+ arg: none. */
+
+ case ETIR__C_STC_LDA_GBL:
+ /* ALPHA_R_LDA */
+
+ /* 211 Store-conditional BSR or Hint at global address
+ arg: none. */
+
+ case ETIR__C_STC_BOH_GBL:
+ /* Currentl ignored. */
+ break;
+
+ /* 213 Store-conditional NOP,BSR or HINT at global address
+ arg: none. */
+
+ case ETIR__C_STC_NBH_GBL:
+
+ /* 206 Store-conditional NOP at pect + offset
+ arg: none. */
+
+ case ETIR__C_STC_NOP_PS:
+
+ /* 208 Store-conditional BSR at pect + offset
+ arg: none. */
+
+ case ETIR__C_STC_BSR_PS:
+
+ /* 210 Store-conditional LDA at psect + offset
+ arg: none. */
+
+ case ETIR__C_STC_LDA_PS:
+
+ /* 212 Store-conditional BSR or Hint at pect + offset
+ arg: none. */
+
+ case ETIR__C_STC_BOH_PS:
+
+ /* 214 Store-conditional NOP, BSR or HINT at psect + offset
+ arg: none. */
+ case ETIR__C_STC_NBH_PS:
_bfd_error_handler (_("%s: not supported"),
_bfd_vms_etir_name (cmd));
- return FALSE;
- break;
-
- /* Det relocation base: pop stack, set image location counter
- arg: none. */
- case ETIR__C_CTL_SETRB:
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (!(rel1 & RELC_SEC_BASE))
- abort ();
- image_set_ptr (abfd, op1, rel1 & RELC_MASK, info);
- break;
-
- /* Augment relocation base: increment image location counter by offset
- arg: lw offset value. */
- case ETIR__C_CTL_AUGRB:
+ return FALSE;
+ break;
+
+ /* Det relocation base: pop stack, set image location counter
+ arg: none. */
+ case ETIR__C_CTL_SETRB:
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (!(rel1 & RELC_SEC_BASE))
+ abort ();
+ image_set_ptr (abfd, op1, rel1 & RELC_MASK, info);
+ break;
+
+ /* Augment relocation base: increment image location counter by offset
+ arg: lw offset value. */
+ case ETIR__C_CTL_AUGRB:
if (ptr + 4 >= maxptr)
goto corrupt_etir;
- op1 = bfd_getl32 (ptr);
- image_inc_ptr (abfd, op1);
- break;
-
- /* Define location: pop index, save location counter under index
- arg: none. */
- case ETIR__C_CTL_DFLOC:
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (rel1 != RELC_NONE)
- goto bad_context;
- dst_define_location (abfd, op1);
- break;
-
- /* Set location: pop index, restore location counter from index
- arg: none. */
- case ETIR__C_CTL_STLOC:
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (rel1 != RELC_NONE)
- goto bad_context;
- dst_restore_location (abfd, op1);
- break;
-
- /* Stack defined location: pop index, push location counter from index
- arg: none. */
- case ETIR__C_CTL_STKDL:
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (rel1 != RELC_NONE)
- goto bad_context;
- _bfd_vms_push (abfd, dst_retrieve_location (abfd, op1), RELC_NONE);
- break;
-
- case ETIR__C_OPR_NOP: /* No-op. */
- break;
-
- case ETIR__C_OPR_ADD: /* Add. */
- _bfd_vms_pop (abfd, &op1, &rel1);
- _bfd_vms_pop (abfd, &op2, &rel2);
- if (rel1 == RELC_NONE && rel2 != RELC_NONE)
- rel1 = rel2;
- else if (rel1 != RELC_NONE && rel2 != RELC_NONE)
- goto bad_context;
- _bfd_vms_push (abfd, op1 + op2, rel1);
- break;
-
- case ETIR__C_OPR_SUB: /* Subtract. */
- _bfd_vms_pop (abfd, &op1, &rel1);
- _bfd_vms_pop (abfd, &op2, &rel2);
- if (rel1 == RELC_NONE && rel2 != RELC_NONE)
- rel1 = rel2;
- else if ((rel1 & RELC_SEC_BASE) && (rel2 & RELC_SEC_BASE))
- {
- op1 = alpha_vms_fix_sec_rel (abfd, info, rel1, op1);
- op2 = alpha_vms_fix_sec_rel (abfd, info, rel2, op2);
- rel1 = RELC_NONE;
- }
- else if (rel1 != RELC_NONE && rel2 != RELC_NONE)
- goto bad_context;
- _bfd_vms_push (abfd, op2 - op1, rel1);
- break;
-
- case ETIR__C_OPR_MUL: /* Multiply. */
- _bfd_vms_pop (abfd, &op1, &rel1);
- _bfd_vms_pop (abfd, &op2, &rel2);
- if (rel1 != RELC_NONE || rel2 != RELC_NONE)
- goto bad_context;
- _bfd_vms_push (abfd, op1 * op2, RELC_NONE);
- break;
-
- case ETIR__C_OPR_DIV: /* Divide. */
- _bfd_vms_pop (abfd, &op1, &rel1);
- _bfd_vms_pop (abfd, &op2, &rel2);
- if (rel1 != RELC_NONE || rel2 != RELC_NONE)
- goto bad_context;
- if (op2 == 0)
- _bfd_vms_push (abfd, 0, RELC_NONE);
- else
- _bfd_vms_push (abfd, op2 / op1, RELC_NONE);
- break;
-
- case ETIR__C_OPR_AND: /* Logical AND. */
- _bfd_vms_pop (abfd, &op1, &rel1);
- _bfd_vms_pop (abfd, &op2, &rel2);
- if (rel1 != RELC_NONE || rel2 != RELC_NONE)
- goto bad_context;
- _bfd_vms_push (abfd, op1 & op2, RELC_NONE);
- break;
-
- case ETIR__C_OPR_IOR: /* Logical inclusive OR. */
- _bfd_vms_pop (abfd, &op1, &rel1);
- _bfd_vms_pop (abfd, &op2, &rel2);
- if (rel1 != RELC_NONE || rel2 != RELC_NONE)
- goto bad_context;
- _bfd_vms_push (abfd, op1 | op2, RELC_NONE);
- break;
-
- case ETIR__C_OPR_EOR: /* Logical exclusive OR. */
- _bfd_vms_pop (abfd, &op1, &rel1);
- _bfd_vms_pop (abfd, &op2, &rel2);
- if (rel1 != RELC_NONE || rel2 != RELC_NONE)
- goto bad_context;
- _bfd_vms_push (abfd, op1 ^ op2, RELC_NONE);
- break;
-
- case ETIR__C_OPR_NEG: /* Negate. */
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (rel1 != RELC_NONE)
- goto bad_context;
- _bfd_vms_push (abfd, -op1, RELC_NONE);
- break;
-
- case ETIR__C_OPR_COM: /* Complement. */
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (rel1 != RELC_NONE)
- goto bad_context;
- _bfd_vms_push (abfd, ~op1, RELC_NONE);
- break;
-
- case ETIR__C_OPR_ASH: /* Arithmetic shift. */
- _bfd_vms_pop (abfd, &op1, &rel1);
- _bfd_vms_pop (abfd, &op2, &rel2);
- if (rel1 != RELC_NONE || rel2 != RELC_NONE)
- {
- bad_context:
+ op1 = bfd_getl32 (ptr);
+ image_inc_ptr (abfd, op1);
+ break;
+
+ /* Define location: pop index, save location counter under index
+ arg: none. */
+ case ETIR__C_CTL_DFLOC:
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (rel1 != RELC_NONE)
+ goto bad_context;
+ dst_define_location (abfd, op1);
+ break;
+
+ /* Set location: pop index, restore location counter from index
+ arg: none. */
+ case ETIR__C_CTL_STLOC:
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (rel1 != RELC_NONE)
+ goto bad_context;
+ dst_restore_location (abfd, op1);
+ break;
+
+ /* Stack defined location: pop index, push location counter from index
+ arg: none. */
+ case ETIR__C_CTL_STKDL:
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (rel1 != RELC_NONE)
+ goto bad_context;
+ _bfd_vms_push (abfd, dst_retrieve_location (abfd, op1), RELC_NONE);
+ break;
+
+ case ETIR__C_OPR_NOP: /* No-op. */
+ break;
+
+ case ETIR__C_OPR_ADD: /* Add. */
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ _bfd_vms_pop (abfd, &op2, &rel2);
+ if (rel1 == RELC_NONE && rel2 != RELC_NONE)
+ rel1 = rel2;
+ else if (rel1 != RELC_NONE && rel2 != RELC_NONE)
+ goto bad_context;
+ _bfd_vms_push (abfd, op1 + op2, rel1);
+ break;
+
+ case ETIR__C_OPR_SUB: /* Subtract. */
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ _bfd_vms_pop (abfd, &op2, &rel2);
+ if (rel1 == RELC_NONE && rel2 != RELC_NONE)
+ rel1 = rel2;
+ else if ((rel1 & RELC_SEC_BASE) && (rel2 & RELC_SEC_BASE))
+ {
+ op1 = alpha_vms_fix_sec_rel (abfd, info, rel1, op1);
+ op2 = alpha_vms_fix_sec_rel (abfd, info, rel2, op2);
+ rel1 = RELC_NONE;
+ }
+ else if (rel1 != RELC_NONE && rel2 != RELC_NONE)
+ goto bad_context;
+ _bfd_vms_push (abfd, op2 - op1, rel1);
+ break;
+
+ case ETIR__C_OPR_MUL: /* Multiply. */
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ _bfd_vms_pop (abfd, &op2, &rel2);
+ if (rel1 != RELC_NONE || rel2 != RELC_NONE)
+ goto bad_context;
+ _bfd_vms_push (abfd, op1 * op2, RELC_NONE);
+ break;
+
+ case ETIR__C_OPR_DIV: /* Divide. */
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ _bfd_vms_pop (abfd, &op2, &rel2);
+ if (rel1 != RELC_NONE || rel2 != RELC_NONE)
+ goto bad_context;
+ if (op2 == 0)
+ _bfd_vms_push (abfd, 0, RELC_NONE);
+ else
+ _bfd_vms_push (abfd, op2 / op1, RELC_NONE);
+ break;
+
+ case ETIR__C_OPR_AND: /* Logical AND. */
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ _bfd_vms_pop (abfd, &op2, &rel2);
+ if (rel1 != RELC_NONE || rel2 != RELC_NONE)
+ goto bad_context;
+ _bfd_vms_push (abfd, op1 & op2, RELC_NONE);
+ break;
+
+ case ETIR__C_OPR_IOR: /* Logical inclusive OR. */
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ _bfd_vms_pop (abfd, &op2, &rel2);
+ if (rel1 != RELC_NONE || rel2 != RELC_NONE)
+ goto bad_context;
+ _bfd_vms_push (abfd, op1 | op2, RELC_NONE);
+ break;
+
+ case ETIR__C_OPR_EOR: /* Logical exclusive OR. */
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ _bfd_vms_pop (abfd, &op2, &rel2);
+ if (rel1 != RELC_NONE || rel2 != RELC_NONE)
+ goto bad_context;
+ _bfd_vms_push (abfd, op1 ^ op2, RELC_NONE);
+ break;
+
+ case ETIR__C_OPR_NEG: /* Negate. */
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (rel1 != RELC_NONE)
+ goto bad_context;
+ _bfd_vms_push (abfd, -op1, RELC_NONE);
+ break;
+
+ case ETIR__C_OPR_COM: /* Complement. */
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (rel1 != RELC_NONE)
+ goto bad_context;
+ _bfd_vms_push (abfd, ~op1, RELC_NONE);
+ break;
+
+ case ETIR__C_OPR_ASH: /* Arithmetic shift. */
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ _bfd_vms_pop (abfd, &op2, &rel2);
+ if (rel1 != RELC_NONE || rel2 != RELC_NONE)
+ {
+ bad_context:
_bfd_error_handler (_("invalid use of %s with contexts"),
_bfd_vms_etir_name (cmd));
- return FALSE;
- }
- if ((int)op2 < 0) /* Shift right. */
- op1 >>= -(int)op2;
- else /* Shift left. */
- op1 <<= (int)op2;
- _bfd_vms_push (abfd, op1, RELC_NONE); /* FIXME: sym. */
- break;
-
- case ETIR__C_OPR_INSV: /* Insert field. */
- case ETIR__C_OPR_USH: /* Unsigned shift. */
- case ETIR__C_OPR_ROT: /* Rotate. */
- case ETIR__C_OPR_REDEF: /* Redefine symbol to current location. */
- case ETIR__C_OPR_DFLIT: /* Define a literal. */
+ return FALSE;
+ }
+ if ((int)op2 < 0) /* Shift right. */
+ op1 >>= -(int)op2;
+ else /* Shift left. */
+ op1 <<= (int)op2;
+ _bfd_vms_push (abfd, op1, RELC_NONE); /* FIXME: sym. */
+ break;
+
+ case ETIR__C_OPR_INSV: /* Insert field. */
+ case ETIR__C_OPR_USH: /* Unsigned shift. */
+ case ETIR__C_OPR_ROT: /* Rotate. */
+ case ETIR__C_OPR_REDEF: /* Redefine symbol to current location. */
+ case ETIR__C_OPR_DFLIT: /* Define a literal. */
_bfd_error_handler (_("%s: not supported"),
_bfd_vms_etir_name (cmd));
- return FALSE;
- break;
-
- case ETIR__C_OPR_SEL: /* Select. */
- _bfd_vms_pop (abfd, &op1, &rel1);
- if (op1 & 0x01L)
- _bfd_vms_pop (abfd, &op1, &rel1);
- else
- {
- _bfd_vms_pop (abfd, &op1, &rel1);
- _bfd_vms_pop (abfd, &op2, &rel2);
- _bfd_vms_push (abfd, op1, rel1);
- }
- break;
-
- default:
+ return FALSE;
+ break;
+
+ case ETIR__C_OPR_SEL: /* Select. */
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ if (op1 & 0x01L)
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ else
+ {
+ _bfd_vms_pop (abfd, &op1, &rel1);
+ _bfd_vms_pop (abfd, &op2, &rel2);
+ _bfd_vms_push (abfd, op1, rel1);
+ }
+ break;
+
+ default:
_bfd_error_handler (_("reserved cmd %d"), cmd);
- return FALSE;
- break;
- }
+ return FALSE;
+ break;
+ }
ptr += cmd_length - 4;
}
is in an object file, so pick an initial amount and grow it as
needed later. */
flagword flags = SEC_HAS_CONTENTS | SEC_DEBUGGING | SEC_RELOC
- | SEC_IN_MEMORY;
+ | SEC_IN_MEMORY;
section = bfd_make_section (abfd, "$DST$");
if (!section)
switch (type)
{
- case EOBJ__C_EMH:
- err = _bfd_vms_slurp_ehdr (abfd);
- break;
- case EOBJ__C_EEOM:
- err = _bfd_vms_slurp_eeom (abfd);
- break;
- case EOBJ__C_EGSD:
- err = _bfd_vms_slurp_egsd (abfd);
- break;
- case EOBJ__C_ETIR:
- err = TRUE; /* _bfd_vms_slurp_etir (abfd); */
- break;
- case EOBJ__C_EDBG:
- err = _bfd_vms_slurp_edbg (abfd);
- break;
- case EOBJ__C_ETBT:
- err = _bfd_vms_slurp_etbt (abfd);
- break;
- default:
- err = FALSE;
+ case EOBJ__C_EMH:
+ err = _bfd_vms_slurp_ehdr (abfd);
+ break;
+ case EOBJ__C_EEOM:
+ err = _bfd_vms_slurp_eeom (abfd);
+ break;
+ case EOBJ__C_EGSD:
+ err = _bfd_vms_slurp_egsd (abfd);
+ break;
+ case EOBJ__C_ETIR:
+ err = TRUE; /* _bfd_vms_slurp_etir (abfd); */
+ break;
+ case EOBJ__C_EDBG:
+ err = _bfd_vms_slurp_edbg (abfd);
+ break;
+ case EOBJ__C_ETBT:
+ err = _bfd_vms_slurp_etbt (abfd);
+ break;
+ default:
+ err = FALSE;
}
if (!err)
{
/* The header size is 0 for DSF files. */
if (PRIV (recrd.rec_size) == 0)
- PRIV (recrd.rec_size) = sizeof (struct vms_eihd);
+ PRIV (recrd.rec_size) = sizeof (struct vms_eihd);
if (PRIV (recrd.rec_size) > PRIV (recrd.buf_size))
- {
- buf = bfd_realloc_or_free (buf, PRIV (recrd.rec_size));
-
- if (buf == NULL)
- {
- PRIV (recrd.buf) = NULL;
- goto error_ret;
- }
- PRIV (recrd.buf) = buf;
- PRIV (recrd.buf_size) = PRIV (recrd.rec_size);
- }
+ {
+ buf = bfd_realloc_or_free (buf, PRIV (recrd.rec_size));
+
+ if (buf == NULL)
+ {
+ PRIV (recrd.buf) = NULL;
+ goto error_ret;
+ }
+ PRIV (recrd.buf) = buf;
+ PRIV (recrd.buf_size) = PRIV (recrd.rec_size);
+ }
/* PR 21813: Check for a truncated record. */
if (PRIV (recrd.rec_size < test_len))
read_so_far = test_len;
while (remaining > 0)
- {
- if (bfd_bread (buf + read_so_far, to_read, abfd) != to_read)
+ {
+ if (bfd_bread (buf + read_so_far, to_read, abfd) != to_read)
goto err_wrong_format;
- read_so_far += to_read;
- remaining -= to_read;
+ read_so_far += to_read;
+ remaining -= to_read;
- to_read = MIN (VMS_BLOCK_SIZE, remaining);
- }
+ to_read = MIN (VMS_BLOCK_SIZE, remaining);
+ }
/* Reset the record pointer. */
PRIV (recrd.rec) = buf;
vms_debug2 ((2, "file type is image\n"));
if (!_bfd_vms_slurp_eihd (abfd, &eisd_offset, &eihs_offset))
- goto err_wrong_format;
+ goto err_wrong_format;
if (!_bfd_vms_slurp_eisd (abfd, eisd_offset))
- goto err_wrong_format;
+ goto err_wrong_format;
/* EIHS is optional. */
if (eihs_offset != 0 && !_bfd_vms_slurp_eihs (abfd, eihs_offset))
- goto err_wrong_format;
+ goto err_wrong_format;
}
else
{
/* But is it really a module? */
if (bfd_getl16 (PRIV (recrd.rec)) <= EOBJ__C_MAXRECTYP
- && bfd_getl16 (PRIV (recrd.rec) + 2) <= EOBJ__C_MAXRECSIZ)
- {
- if (vms_get_remaining_object_record (abfd, test_len) <= 0)
- goto err_wrong_format;
+ && bfd_getl16 (PRIV (recrd.rec) + 2) <= EOBJ__C_MAXRECSIZ)
+ {
+ if (vms_get_remaining_object_record (abfd, test_len) <= 0)
+ goto err_wrong_format;
- vms_debug2 ((2, "file type is module\n"));
+ vms_debug2 ((2, "file type is module\n"));
- type = bfd_getl16 (PRIV (recrd.rec));
- if (type != EOBJ__C_EMH || !_bfd_vms_slurp_ehdr (abfd))
- goto err_wrong_format;
+ type = bfd_getl16 (PRIV (recrd.rec));
+ if (type != EOBJ__C_EMH || !_bfd_vms_slurp_ehdr (abfd))
+ goto err_wrong_format;
- if (!_bfd_vms_slurp_object_records (abfd))
- goto err_wrong_format;
- }
+ if (!_bfd_vms_slurp_object_records (abfd))
+ goto err_wrong_format;
+ }
else
- goto err_wrong_format;
+ goto err_wrong_format;
}
/* Set arch_info to alpha. */
_bfd_vms_output_begin (recwr, EOBJ__C_EMH);
_bfd_vms_output_short (recwr, EMH__C_LNM);
snprintf (version, sizeof (version), "%s %d.%d.%d", name,
- ver / 10000, (ver / 100) % 100, ver % 100);
+ ver / 10000, (ver / 100) % 100, ver % 100);
_bfd_vms_output_dump (recwr, (unsigned char *)version, strlen (version));
_bfd_vms_output_end (abfd, recwr);
}
static void
alpha_vms_swap_eisd_out (struct vms_internal_eisd_map *src,
- struct vms_eisd *dst)
+ struct vms_eisd *dst)
{
bfd_putl32 (src->u.eisd.majorid, dst->majorid);
bfd_putl32 (src->u.eisd.minorid, dst->minorid);
{
bfd_putl32 (src->u.gbl_eisd.ident, dst->ident);
memcpy (dst->gblnam, src->u.gbl_eisd.gblnam,
- src->u.gbl_eisd.gblnam[0] + 1);
+ src->u.gbl_eisd.gblnam[0] + 1);
}
}
eisd->u.gbl_eisd.ident = PRIV2 (shrimg, ident);
eisd->u.gbl_eisd.gblnam[0] = namlen + 4;
memcpy (eisd->u.gbl_eisd.gblnam + 1, PRIV2 (shrimg, hdr_data.hdr_t_name),
- namlen);
+ namlen);
memcpy (eisd->u.gbl_eisd.gblnam + 1 + namlen, "_001", 4);
/* Append it to the list. */
if (sec->flags & SEC_LINKER_CREATED)
{
if (strcmp (sec->name, "$FIXUP$") == 0)
- eisd->u.eisd.flags |= EISD__M_FIXUPVEC;
+ eisd->u.eisd.flags |= EISD__M_FIXUPVEC;
}
/* Append it to the list. */
bfd_putl32 (-1, eihd.privreqs + 4);
bfd_putl32 ((sizeof (eihd) + VMS_BLOCK_SIZE - 1) / VMS_BLOCK_SIZE,
- eihd.hdrblkcnt);
+ eihd.hdrblkcnt);
bfd_putl32 (0, eihd.ident);
bfd_putl32 (0, eihd.sysver);
for (sec = abfd->sections; sec; sec = sec->next)
{
if (!alpha_vms_create_eisd_for_section (abfd, sec))
- return FALSE;
+ return FALSE;
}
/* Merge section EIDS which extra ones. */
{
eisd = bfd_zalloc (abfd, sizeof (*eisd));
if (eisd == NULL)
- return FALSE;
+ return FALSE;
eisd->u.eisd.majorid = 0;
eisd->u.eisd.minorid = 0;
eisd->u.eisd.eisdsize = 0;
/* First block is a little bit special: there is a word at the end. */
if (PRIV (file_pos) < VMS_BLOCK_SIZE && room > 2)
- room -= 2;
+ room -= 2;
if (room < eisd->u.eisd.eisdsize + EISD__K_LENEND)
- alpha_vms_file_position_block (abfd);
+ alpha_vms_file_position_block (abfd);
eisd->file_pos = PRIV (file_pos);
PRIV (file_pos) += eisd->u.eisd.eisdsize;
if (eisd->u.eisd.flags & EISD__M_FIXUPVEC)
- bfd_putl64 (eisd->u.eisd.virt_addr, eihd.iafva);
+ bfd_putl64 (eisd->u.eisd.virt_addr, eihd.iafva);
}
if (first_eisd != NULL)
bfd_putl32 (PRIV (file_pos), eihd.size);
bfd_putl32 ((PRIV (file_pos) + VMS_BLOCK_SIZE - 1) / VMS_BLOCK_SIZE,
- eihd.hdrblkcnt);
+ eihd.hdrblkcnt);
/* Place sections. */
for (sec = abfd->sections; sec; sec = sec->next)
{
if (!(sec->flags & SEC_HAS_CONTENTS))
- continue;
+ continue;
eisd = vms_section_data (sec)->eisd;
sec->filepos = PRIV (file_pos);
if (eisd != NULL)
- eisd->u.eisd.vbn = (sec->filepos / VMS_BLOCK_SIZE) + 1;
+ eisd->u.eisd.vbn = (sec->filepos / VMS_BLOCK_SIZE) + 1;
PRIV (file_pos) += sec->size;
}
bfd_putl32 (dst->size, eihs->dstsize);
if (dmt != NULL)
- {
- lnkflags |= EIHD__M_DBGDMT;
- bfd_putl32 ((dmt->filepos / VMS_BLOCK_SIZE) + 1, eihs->dmtvbn);
- bfd_putl32 (dmt->size, eihs->dmtsize);
- }
+ {
+ lnkflags |= EIHD__M_DBGDMT;
+ bfd_putl32 ((dmt->filepos / VMS_BLOCK_SIZE) + 1, eihs->dmtvbn);
+ bfd_putl32 (dmt->size, eihs->dmtsize);
+ }
if (PRIV (gsd_sym_count) != 0)
- {
- alpha_vms_file_position_block (abfd);
- gst_filepos = PRIV (file_pos);
- bfd_putl32 ((gst_filepos / VMS_BLOCK_SIZE) + 1, eihs->gstvbn);
- bfd_putl32 ((PRIV (gsd_sym_count) + 4) / 5 + 4, eihs->gstsize);
- }
+ {
+ alpha_vms_file_position_block (abfd);
+ gst_filepos = PRIV (file_pos);
+ bfd_putl32 ((gst_filepos / VMS_BLOCK_SIZE) + 1, eihs->gstvbn);
+ bfd_putl32 ((PRIV (gsd_sym_count) + 4) / 5 + 4, eihs->gstsize);
+ }
}
/* Write EISD in hdr. */
memset (blk, 0xff, sizeof (blk));
while (eisd != NULL)
- {
- alpha_vms_swap_eisd_out
- (eisd,
- (struct vms_eisd *)(blk + (eisd->file_pos % VMS_BLOCK_SIZE)));
-
- next_eisd = eisd->next;
- if (next_eisd == NULL
- || (next_eisd->file_pos / VMS_BLOCK_SIZE
- != eisd->file_pos / VMS_BLOCK_SIZE))
- {
- if (bfd_bwrite (blk, sizeof (blk), abfd) != sizeof (blk))
- return FALSE;
+ {
+ alpha_vms_swap_eisd_out
+ (eisd,
+ (struct vms_eisd *)(blk + (eisd->file_pos % VMS_BLOCK_SIZE)));
+
+ next_eisd = eisd->next;
+ if (next_eisd == NULL
+ || (next_eisd->file_pos / VMS_BLOCK_SIZE
+ != eisd->file_pos / VMS_BLOCK_SIZE))
+ {
+ if (bfd_bwrite (blk, sizeof (blk), abfd) != sizeof (blk))
+ return FALSE;
- memset (blk, 0xff, sizeof (blk));
- }
- eisd = next_eisd;
- }
+ memset (blk, 0xff, sizeof (blk));
+ }
+ eisd = next_eisd;
+ }
}
/* Write sections. */
bfd_size_type len;
if (sec->size == 0 || !(sec->flags & SEC_HAS_CONTENTS))
- continue;
+ continue;
if (bfd_bwrite (sec->contents, sec->size, abfd) != sec->size)
- return FALSE;
+ return FALSE;
/* Pad. */
len = VMS_BLOCK_SIZE - sec->size % VMS_BLOCK_SIZE;
if (len != VMS_BLOCK_SIZE)
- {
- memset (blk, 0, len);
- if (bfd_bwrite (blk, len, abfd) != len)
- return FALSE;
- }
+ {
+ memset (blk, 0, len);
+ if (bfd_bwrite (blk, len, abfd) != len)
+ return FALSE;
+ }
}
/* Write GST. */
_bfd_vms_output_end (abfd, recwr);
for (i = 0; i < PRIV (gsd_sym_count); i++)
- {
- struct vms_symbol_entry *sym = PRIV (syms)[i];
- bfd_vma val;
- bfd_vma ep;
-
- if ((i % 5) == 0)
- {
- _bfd_vms_output_alignment (recwr, 8);
- _bfd_vms_output_begin (recwr, EOBJ__C_EGSD);
- _bfd_vms_output_long (recwr, 0);
- }
- _bfd_vms_output_begin_subrec (recwr, EGSD__C_SYMG);
- _bfd_vms_output_short (recwr, 0); /* Data type, alignment. */
- _bfd_vms_output_short (recwr, sym->flags);
-
- if (sym->code_section)
- ep = alpha_vms_get_sym_value (sym->code_section, sym->code_value);
- else
- {
- BFD_ASSERT (sym->code_value == 0);
- ep = 0;
- }
- val = alpha_vms_get_sym_value (sym->section, sym->value);
- _bfd_vms_output_quad
- (recwr, sym->typ == EGSD__C_SYMG ? sym->symbol_vector : val);
- _bfd_vms_output_quad (recwr, ep);
- _bfd_vms_output_quad (recwr, val);
- _bfd_vms_output_long (recwr, 0);
- _bfd_vms_output_counted (recwr, sym->name);
- _bfd_vms_output_end_subrec (recwr);
- if ((i % 5) == 4)
- _bfd_vms_output_end (abfd, recwr);
- }
+ {
+ struct vms_symbol_entry *sym = PRIV (syms)[i];
+ bfd_vma val;
+ bfd_vma ep;
+
+ if ((i % 5) == 0)
+ {
+ _bfd_vms_output_alignment (recwr, 8);
+ _bfd_vms_output_begin (recwr, EOBJ__C_EGSD);
+ _bfd_vms_output_long (recwr, 0);
+ }
+ _bfd_vms_output_begin_subrec (recwr, EGSD__C_SYMG);
+ _bfd_vms_output_short (recwr, 0); /* Data type, alignment. */
+ _bfd_vms_output_short (recwr, sym->flags);
+
+ if (sym->code_section)
+ ep = alpha_vms_get_sym_value (sym->code_section, sym->code_value);
+ else
+ {
+ BFD_ASSERT (sym->code_value == 0);
+ ep = 0;
+ }
+ val = alpha_vms_get_sym_value (sym->section, sym->value);
+ _bfd_vms_output_quad
+ (recwr, sym->typ == EGSD__C_SYMG ? sym->symbol_vector : val);
+ _bfd_vms_output_quad (recwr, ep);
+ _bfd_vms_output_quad (recwr, val);
+ _bfd_vms_output_long (recwr, 0);
+ _bfd_vms_output_counted (recwr, sym->name);
+ _bfd_vms_output_end_subrec (recwr);
+ if ((i % 5) == 4)
+ _bfd_vms_output_end (abfd, recwr);
+ }
if ((i % 5) != 0)
- _bfd_vms_output_end (abfd, recwr);
+ _bfd_vms_output_end (abfd, recwr);
if (!_bfd_vms_write_eeom (abfd))
- return FALSE;
+ return FALSE;
}
return TRUE;
}
for (section = abfd->sections; section != NULL; section = section->next)
{
if (section->flags & SEC_DEBUGGING)
- continue;
+ continue;
if (!strcmp (section->name, ".vmsdebug"))
- {
- section->flags |= SEC_DEBUGGING;
- continue;
- }
+ {
+ section->flags |= SEC_DEBUGGING;
+ continue;
+ }
section->target_index = target_index++;
}
for (section = abfd->sections; section != NULL; section = section->next)
{
vms_debug2 ((3, "Section #%d %s, %d bytes\n",
- section->target_index, section->name, (int)section->size));
+ section->target_index, section->name, (int)section->size));
/* Don't write out the VMS debug info section since it is in the
- ETBT and EDBG sections in etir. */
+ ETBT and EDBG sections in etir. */
if (section->flags & SEC_DEBUGGING)
- continue;
+ continue;
/* 13 bytes egsd, max 31 chars name -> should be 44 bytes. */
if (_bfd_vms_output_check (recwr, 64) < 0)
sname = section->name;
if (*sname == '.')
{
- /* Remove leading dot. */
+ /* Remove leading dot. */
sname++;
if ((*sname == 't') && (strcmp (sname, "text") == 0))
sname = EVAX_CODE_NAME;
else if ((*sname == 'l') && (strcmp (sname, "literal") == 0))
sname = EVAX_LITERAL_NAME;
else if ((*sname == 'l') && (strcmp (sname, "literals") == 0))
- sname = EVAX_LITERALS_NAME;
+ sname = EVAX_LITERALS_NAME;
else if ((*sname == 'c') && (strcmp (sname, "comm") == 0))
sname = EVAX_COMMON_NAME;
else if ((*sname == 'l') && (strcmp (sname, "lcomm") == 0))
vms_debug2 ((3, "sec flags %x\n", section->flags));
vms_debug2 ((3, "new_flags %x, _raw_size %lu\n",
- new_flags, (unsigned long)section->size));
+ new_flags, (unsigned long)section->size));
_bfd_vms_output_begin_subrec (recwr, EGSD__C_PSC);
_bfd_vms_output_short (recwr, section->alignment_power & 0xff);
_bfd_vms_output_end_subrec (recwr);
/* If the section is an obsolute one, remind its index as it will be
- used later for absolute symbols. */
+ used later for absolute symbols. */
if ((new_flags & EGPS__V_REL) == 0 && abs_section_index < 0)
- abs_section_index = section->target_index;
+ abs_section_index = section->target_index;
}
/* Output symbols. */
old_flags = symbol->flags;
/* Work-around a missing feature: consider __main as the main entry
- point. */
+ point. */
if (symbol->name[0] == '_' && strcmp (symbol->name, "__main") == 0)
bfd_set_start_address (abfd, (bfd_vma)symbol->value);
continue;
if ((old_flags & BSF_GLOBAL) == 0 && !bfd_is_und_section (symbol->section))
- {
- /* If the LIB$INITIIALIZE section is present, add a reference to
- LIB$INITIALIZE symbol. FIXME: this should be done explicitely
- in the assembly file. */
- if (!((old_flags & BSF_SECTION_SYM) != 0
- && strcmp (symbol->section->name, "LIB$INITIALIZE") == 0))
- continue;
- }
+ {
+ /* If the LIB$INITIIALIZE section is present, add a reference to
+ LIB$INITIALIZE symbol. FIXME: this should be done explicitely
+ in the assembly file. */
+ if (!((old_flags & BSF_SECTION_SYM) != 0
+ && strcmp (symbol->section->name, "LIB$INITIALIZE") == 0))
+ continue;
+ }
/* 13 bytes egsd, max 64 chars name -> should be 77 bytes. Add 16 more
- bytes for a possible ABS section. */
+ bytes for a possible ABS section. */
if (_bfd_vms_output_check (recwr, 80 + 16) < 0)
{
_bfd_vms_output_end (abfd, recwr);
}
if ((old_flags & BSF_GLOBAL) != 0
- && bfd_is_abs_section (symbol->section)
- && abs_section_index <= 0)
- {
- /* Create an absolute section if none was defined. It is highly
- unlikely that the name $ABS$ clashes with a user defined
- non-absolute section name. */
- _bfd_vms_output_begin_subrec (recwr, EGSD__C_PSC);
- _bfd_vms_output_short (recwr, 4);
- _bfd_vms_output_short (recwr, EGPS__V_SHR);
- _bfd_vms_output_long (recwr, 0);
- _bfd_vms_output_counted (recwr, "$ABS$");
- _bfd_vms_output_end_subrec (recwr);
-
- abs_section_index = target_index++;
- }
+ && bfd_is_abs_section (symbol->section)
+ && abs_section_index <= 0)
+ {
+ /* Create an absolute section if none was defined. It is highly
+ unlikely that the name $ABS$ clashes with a user defined
+ non-absolute section name. */
+ _bfd_vms_output_begin_subrec (recwr, EGSD__C_PSC);
+ _bfd_vms_output_short (recwr, 4);
+ _bfd_vms_output_short (recwr, EGPS__V_SHR);
+ _bfd_vms_output_long (recwr, 0);
+ _bfd_vms_output_counted (recwr, "$ABS$");
+ _bfd_vms_output_end_subrec (recwr);
+
+ abs_section_index = target_index++;
+ }
_bfd_vms_output_begin_subrec (recwr, EGSD__C_SYM);
{
asymbol *sym;
- sym =
- ((struct evax_private_udata_struct *)symbol->udata.p)->enbsym;
+ sym =
+ ((struct evax_private_udata_struct *)symbol->udata.p)->enbsym;
code_address = sym->value;
ca_psindx = sym->section->target_index;
}
_bfd_vms_output_begin (recwr, EOBJ__C_EMH);
_bfd_vms_output_short (recwr, EMH__C_CPR);
_bfd_vms_output_dump (recwr,
- (unsigned char *)"GNU BFD ported by Klaus Kämpf 1994-1996",
+ (unsigned char *)"GNU BFD ported by Klaus Kämpf 1994-1996",
39);
_bfd_vms_output_end (abfd, recwr);
_bfd_vms_output_begin (recwr, EOBJ__C_ETBT);
if (offset == 0)
- {
- /* Push start offset. */
- _bfd_vms_output_begin_subrec (recwr, ETIR__C_STA_LW);
- _bfd_vms_output_long (recwr, (unsigned long) 0);
- _bfd_vms_output_end_subrec (recwr);
-
- /* Set location. */
- _bfd_vms_output_begin_subrec (recwr, ETIR__C_CTL_DFLOC);
- _bfd_vms_output_end_subrec (recwr);
- }
+ {
+ /* Push start offset. */
+ _bfd_vms_output_begin_subrec (recwr, ETIR__C_STA_LW);
+ _bfd_vms_output_long (recwr, (unsigned long) 0);
+ _bfd_vms_output_end_subrec (recwr);
+
+ /* Set location. */
+ _bfd_vms_output_begin_subrec (recwr, ETIR__C_CTL_DFLOC);
+ _bfd_vms_output_end_subrec (recwr);
+ }
}
else
{
_bfd_vms_output_begin (recwr, EOBJ__C_ETIR);
if (offset == 0)
- {
- /* Push start offset. */
- _bfd_vms_output_begin_subrec (recwr, ETIR__C_STA_PQ);
- _bfd_vms_output_long (recwr, (unsigned long) section->target_index);
- _bfd_vms_output_quad (recwr, offset);
- _bfd_vms_output_end_subrec (recwr);
-
- /* Start = pop (). */
- _bfd_vms_output_begin_subrec (recwr, ETIR__C_CTL_SETRB);
- _bfd_vms_output_end_subrec (recwr);
- }
+ {
+ /* Push start offset. */
+ _bfd_vms_output_begin_subrec (recwr, ETIR__C_STA_PQ);
+ _bfd_vms_output_long (recwr, (unsigned long) section->target_index);
+ _bfd_vms_output_quad (recwr, offset);
+ _bfd_vms_output_end_subrec (recwr);
+
+ /* Start = pop (). */
+ _bfd_vms_output_begin_subrec (recwr, ETIR__C_CTL_SETRB);
+ _bfd_vms_output_end_subrec (recwr);
+ }
}
}
static void
sto_imm (bfd *abfd, asection *section,
- bfd_size_type ssize, unsigned char *cptr, bfd_vma vaddr)
+ bfd_size_type ssize, unsigned char *cptr, bfd_vma vaddr)
{
bfd_size_type size;
struct vms_rec_wr *recwr = &PRIV (recwr);
/* Doesn't fit, split ! */
end_etir_record (abfd);
- start_etir_or_etbt_record (abfd, section, vaddr);
+ start_etir_or_etbt_record (abfd, section, vaddr);
size = _bfd_vms_output_check (recwr, 0); /* get max size */
if (size > ssize) /* more than what's left ? */
for (section = abfd->sections; section; section = section->next)
{
vms_debug2 ((4, "writing %d. section '%s' (%d bytes)\n",
- section->target_index, section->name, (int) (section->size)));
+ section->target_index, section->name, (int) (section->size)));
if (!(section->flags & SEC_HAS_CONTENTS)
|| bfd_is_com_section (section))
(*(*rptr)->sym_ptr_ptr)->section->name,
(long) (*(*rptr)->sym_ptr_ptr)->value,
(unsigned long)(*rptr)->address,
- (unsigned long)(*rptr)->addend,
+ (unsigned long)(*rptr)->addend,
bfd_get_reloc_size ((*rptr)->howto),
- ( *rptr)->howto->name);
+ ( *rptr)->howto->name);
rptr++;
}
}
}
/* Regular relocs are intertwined with binary data. */
- if (curr_addr > addr)
+ if (curr_addr > addr)
_bfd_error_handler (_("Size error in section %A"),
section);
size = addr - curr_addr;
size = bfd_get_reloc_size (rptr->howto);
switch (rptr->howto->type)
- {
+ {
case ALPHA_R_IGNORE:
break;
else
{
_bfd_vms_output_begin_subrec
- (recwr, ETIR__C_STO_GBL_LW);
+ (recwr, ETIR__C_STO_GBL_LW);
_bfd_vms_output_counted (recwr, sym->name);
_bfd_vms_output_end_subrec (recwr);
}
etir_output_check (abfd, section, curr_addr, 32);
_bfd_vms_output_begin_subrec (recwr, ETIR__C_STA_PQ);
_bfd_vms_output_long (recwr,
- (unsigned long) sec->target_index);
+ (unsigned long) sec->target_index);
_bfd_vms_output_quad (recwr, rptr->addend + sym->value);
_bfd_vms_output_end_subrec (recwr);
/* ??? Table B-8 of the OpenVMS Linker Utilily Manual
etir_output_check (abfd, section, curr_addr, 32);
_bfd_vms_output_begin_subrec (recwr, ETIR__C_STA_PQ);
_bfd_vms_output_long (recwr,
- (unsigned long) sec->target_index);
+ (unsigned long) sec->target_index);
_bfd_vms_output_quad (recwr, rptr->addend + sym->value);
_bfd_vms_output_end_subrec (recwr);
_bfd_vms_output_begin_subrec (recwr, ETIR__C_STO_OFF);
_bfd_vms_output_begin_subrec (recwr, ETIR__C_STC_LP_PSB);
_bfd_vms_output_long
(recwr, (unsigned long) rptr->addend);
- if (rptr->addend > PRIV (vms_linkage_index))
- PRIV (vms_linkage_index) = rptr->addend;
+ if (rptr->addend > PRIV (vms_linkage_index))
+ PRIV (vms_linkage_index) = rptr->addend;
_bfd_vms_output_counted (recwr, sym->name);
_bfd_vms_output_byte (recwr, 0);
_bfd_vms_output_end_subrec (recwr);
else
{
if (abfd->section_count > 0) /* we have sections */
- {
- if (!_bfd_vms_write_ehdr (abfd))
- return FALSE;
- if (!_bfd_vms_write_egsd (abfd))
- return FALSE;
- if (!_bfd_vms_write_etir (abfd, EOBJ__C_ETIR))
- return FALSE;
- if (!_bfd_vms_write_eeom (abfd))
- return FALSE;
- }
+ {
+ if (!_bfd_vms_write_ehdr (abfd))
+ return FALSE;
+ if (!_bfd_vms_write_egsd (abfd))
+ return FALSE;
+ if (!_bfd_vms_write_etir (abfd, EOBJ__C_ETIR))
+ return FALSE;
+ if (!_bfd_vms_write_eeom (abfd))
+ return FALSE;
+ }
}
return TRUE;
}
vms_debug2 ((2, "DST record: leng %d, type %d\n", rec_length, rec_type));
if (length == -1 && rec_type == DST__K_MODEND)
- break;
+ break;
switch (rec_type)
{
curr_linenum = 0;
prev_linum = 0;
- vms_debug2 ((3, "module: %s\n", module->name));
+ vms_debug2 ((3, "module: %s\n", module->name));
break;
case DST__K_MODEND:
case DST__K_RTNBEG:
funcinfo = (struct funcinfo *)
bfd_zalloc (abfd, sizeof (struct funcinfo));
- funcinfo->name
+ funcinfo->name
= _bfd_vms_save_counted_string (ptr + DST_S_B_RTNBEG_NAME,
maxptr - (ptr + DST_S_B_RTNBEG_NAME));
funcinfo->low = bfd_getl32 (ptr + DST_S_L_RTNBEG_ADDRESS);
funcinfo->next = module->func_table;
module->func_table = funcinfo;
- vms_debug2 ((3, "routine: %s at 0x%lx\n",
- funcinfo->name, (unsigned long) funcinfo->low));
+ vms_debug2 ((3, "routine: %s at 0x%lx\n",
+ funcinfo->name, (unsigned long) funcinfo->low));
break;
case DST__K_RTNEND:
if (module->func_table->high > module->high)
module->high = module->func_table->high;
- vms_debug2 ((3, "end routine\n"));
+ vms_debug2 ((3, "end routine\n"));
break;
case DST__K_PROLOG:
- vms_debug2 ((3, "prologue\n"));
+ vms_debug2 ((3, "prologue\n"));
break;
case DST__K_EPILOG:
- vms_debug2 ((3, "epilog\n"));
+ vms_debug2 ((3, "epilog\n"));
break;
case DST__K_BLKBEG:
- vms_debug2 ((3, "block\n"));
+ vms_debug2 ((3, "block\n"));
break;
case DST__K_BLKEND:
- vms_debug2 ((3, "end block\n"));
+ vms_debug2 ((3, "end block\n"));
break;
case DST__K_SOURCE:
module->file_table [fileid].srec = 1;
cmd_length = src_ptr[DST_S_B_SRC_DF_LENGTH] + 2;
vms_debug2 ((4, "DST_S_C_SRC_DECLFILE: %d, %s\n",
- fileid, module->file_table [fileid].name));
+ fileid, module->file_table [fileid].name));
}
break;
curr_linenum += 1;
cmd_length = 1;
vms_debug2 ((4, "bump pc to 0x%lx and line to %d\n",
- (unsigned long)curr_pc, curr_linenum));
+ (unsigned long)curr_pc, curr_linenum));
}
else
{
prev_linum = curr_linenum;
prev_pc = curr_pc;
vms_debug2 ((4, "-> correlate pc 0x%lx with line %d\n",
- (unsigned long)curr_pc, curr_linenum));
+ (unsigned long)curr_pc, curr_linenum));
}
pcl_ptr += cmd_length;
ptr += DBG_S_C_DMT_HEADER_SIZE;
vms_debug2 ((3, "module: modbeg = %d, size = %d, count = %d\n",
- modbeg, msize, count));
+ modbeg, msize, count));
/* We create a 'module' structure for each program section since
we only support contiguous addresses in a 'module' structure.
ptr += DBG_S_C_DMT_PSECT_SIZE;
vms_debug2 ((4, "section: start = 0x%x, length = %d\n",
- start, length));
+ start, length));
}
}
}
void *dst = PRIV (dst_section)->contents;
if (dst == NULL)
- return NULL;
+ return NULL;
module = new_module (abfd);
parse_module (abfd, module, PRIV (dst_section)->contents, -1);
for (funcinfo = module->func_table; funcinfo; funcinfo = funcinfo->next)
if (addr >= funcinfo->low && addr <= funcinfo->high)
{
- *func = funcinfo->name;
+ *func = funcinfo->name;
ret = TRUE;
break;
}
{
PRIV (modules) = build_module_list (abfd);
if (PRIV (modules) == NULL)
- return FALSE;
+ return FALSE;
}
for (module = PRIV (modules); module; module = module->next)
{
case EGSD__C_SYM:
if (e->flags & EGSY__V_WEAK)
- flags |= BSF_WEAK;
+ flags |= BSF_WEAK;
if (e->flags & EGSY__V_DEF)
- {
- /* Symbol definition. */
- flags |= BSF_GLOBAL;
- if (e->flags & EGSY__V_NORM)
- flags |= BSF_FUNCTION;
- value = e->value;
- sec = e->section;
- }
+ {
+ /* Symbol definition. */
+ flags |= BSF_GLOBAL;
+ if (e->flags & EGSY__V_NORM)
+ flags |= BSF_FUNCTION;
+ value = e->value;
+ sec = e->section;
+ }
else
- {
- /* Symbol reference. */
- sec = bfd_und_section_ptr;
- }
+ {
+ /* Symbol reference. */
+ sec = bfd_und_section_ptr;
+ }
break;
case EGSD__C_SYMG:
/* ...and dynamic in shared libraries. */
if (abfd->flags & DYNAMIC)
- flags |= BSF_DYNAMIC;
+ flags |= BSF_DYNAMIC;
if (e->flags & EGSY__V_WEAK)
- flags |= BSF_WEAK;
+ flags |= BSF_WEAK;
if (!(e->flags & EGSY__V_DEF))
- abort ();
+ abort ();
if (e->flags & EGSY__V_NORM)
- flags |= BSF_FUNCTION;
+ flags |= BSF_FUNCTION;
value = e->value;
/* sec = e->section; */
alpha_vms_get_symtab_upper_bound (bfd *abfd)
{
vms_debug2 ((1, "alpha_vms_get_symtab_upper_bound (%p), %d symbols\n",
- abfd, PRIV (gsd_sym_count)));
+ abfd, PRIV (gsd_sym_count)));
return (PRIV (gsd_sym_count) + 1) * sizeof (asymbol *);
}
if (PRIV (csymbols) == NULL)
{
PRIV (csymbols) = (asymbol **) bfd_alloc
- (abfd, PRIV (gsd_sym_count) * sizeof (asymbol *));
+ (abfd, PRIV (gsd_sym_count) * sizeof (asymbol *));
/* Traverse table and fill symbols vector. */
for (i = 0; i < PRIV (gsd_sym_count); i++)
- {
- struct vms_symbol_entry *e = PRIV (syms)[i];
- asymbol *sym;
+ {
+ struct vms_symbol_entry *e = PRIV (syms)[i];
+ asymbol *sym;
- sym = bfd_make_empty_symbol (abfd);
- if (sym == NULL || !alpha_vms_convert_symbol (abfd, e, sym))
- {
- bfd_release (abfd, PRIV (csymbols));
- PRIV (csymbols) = NULL;
- return -1;
- }
+ sym = bfd_make_empty_symbol (abfd);
+ if (sym == NULL || !alpha_vms_convert_symbol (abfd, e, sym))
+ {
+ bfd_release (abfd, PRIV (csymbols));
+ PRIV (csymbols) = NULL;
+ return -1;
+ }
- PRIV (csymbols)[i] = sym;
- }
+ PRIV (csymbols)[i] = sym;
+ }
}
if (symbols != NULL)
{
for (i = 0; i < PRIV (gsd_sym_count); i++)
- symbols[i] = PRIV (csymbols)[i];
+ symbols[i] = PRIV (csymbols)[i];
symbols[i] = NULL;
}
/* Skip non-ETIR records. */
type = _bfd_vms_get_object_record (abfd);
if (type == EOBJ__C_EEOM)
- break;
+ break;
if (type != EOBJ__C_ETIR)
- continue;
+ continue;
begin = PRIV (recrd.rec) + 4;
end = PRIV (recrd.rec) + PRIV (recrd.rec_size);
for (ptr = begin; ptr < end; ptr += length)
- {
- int cmd;
-
- cmd = bfd_getl16 (ptr);
- length = bfd_getl16 (ptr + 2);
-
- cur_address = vaddr;
-
- vms_debug2 ((4, "alpha_vms_slurp_relocs: etir %s\n",
- _bfd_vms_etir_name (cmd)));
-
- switch (cmd)
- {
- case ETIR__C_STA_GBL: /* ALPHA_R_REFLONG und_section, step 1 */
- /* ALPHA_R_REFQUAD und_section, step 1 */
- cur_sym = ptr + 4;
- prev_cmd = cmd;
- continue;
-
- case ETIR__C_STA_PQ: /* ALPHA_R_REF{LONG|QUAD}, others part 1 */
- cur_psidx = bfd_getl32 (ptr + 4);
- cur_addend = bfd_getl64 (ptr + 8);
- prev_cmd = cmd;
- continue;
-
- case ETIR__C_CTL_SETRB:
- if (prev_cmd != ETIR__C_STA_PQ)
- {
+ {
+ int cmd;
+
+ cmd = bfd_getl16 (ptr);
+ length = bfd_getl16 (ptr + 2);
+
+ cur_address = vaddr;
+
+ vms_debug2 ((4, "alpha_vms_slurp_relocs: etir %s\n",
+ _bfd_vms_etir_name (cmd)));
+
+ switch (cmd)
+ {
+ case ETIR__C_STA_GBL: /* ALPHA_R_REFLONG und_section, step 1 */
+ /* ALPHA_R_REFQUAD und_section, step 1 */
+ cur_sym = ptr + 4;
+ prev_cmd = cmd;
+ continue;
+
+ case ETIR__C_STA_PQ: /* ALPHA_R_REF{LONG|QUAD}, others part 1 */
+ cur_psidx = bfd_getl32 (ptr + 4);
+ cur_addend = bfd_getl64 (ptr + 8);
+ prev_cmd = cmd;
+ continue;
+
+ case ETIR__C_CTL_SETRB:
+ if (prev_cmd != ETIR__C_STA_PQ)
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("Unknown reloc %s + %s"), _bfd_vms_etir_name (prev_cmd),
- _bfd_vms_etir_name (cmd));
- return FALSE;
- }
- cur_psect = cur_psidx;
- vaddr = cur_addend;
- cur_psidx = -1;
- cur_addend = 0;
- continue;
-
- case ETIR__C_STA_LW: /* ALPHA_R_REFLONG abs_section, step 1 */
- /* ALPHA_R_REFLONG und_section, step 2 */
- if (prev_cmd != -1)
- {
- if (prev_cmd != ETIR__C_STA_GBL)
- {
+ (_("Unknown reloc %s + %s"), _bfd_vms_etir_name (prev_cmd),
+ _bfd_vms_etir_name (cmd));
+ return FALSE;
+ }
+ cur_psect = cur_psidx;
+ vaddr = cur_addend;
+ cur_psidx = -1;
+ cur_addend = 0;
+ continue;
+
+ case ETIR__C_STA_LW: /* ALPHA_R_REFLONG abs_section, step 1 */
+ /* ALPHA_R_REFLONG und_section, step 2 */
+ if (prev_cmd != -1)
+ {
+ if (prev_cmd != ETIR__C_STA_GBL)
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("Unknown reloc %s + %s"), _bfd_vms_etir_name (cmd),
- _bfd_vms_etir_name (ETIR__C_STA_LW));
- return FALSE;
- }
- }
- cur_addend = bfd_getl32 (ptr + 4);
- prev_cmd = cmd;
- continue;
-
- case ETIR__C_STA_QW: /* ALPHA_R_REFQUAD abs_section, step 1 */
- /* ALPHA_R_REFQUAD und_section, step 2 */
- if (prev_cmd != -1 && prev_cmd != ETIR__C_STA_GBL)
- {
+ (_("Unknown reloc %s + %s"), _bfd_vms_etir_name (cmd),
+ _bfd_vms_etir_name (ETIR__C_STA_LW));
+ return FALSE;
+ }
+ }
+ cur_addend = bfd_getl32 (ptr + 4);
+ prev_cmd = cmd;
+ continue;
+
+ case ETIR__C_STA_QW: /* ALPHA_R_REFQUAD abs_section, step 1 */
+ /* ALPHA_R_REFQUAD und_section, step 2 */
+ if (prev_cmd != -1 && prev_cmd != ETIR__C_STA_GBL)
+ {
_bfd_error_handler
/* xgettext:c-format */
- (_("Unknown reloc %s + %s"), _bfd_vms_etir_name (cmd),
- _bfd_vms_etir_name (ETIR__C_STA_QW));
- return FALSE;
- }
- cur_addend = bfd_getl64 (ptr + 4);
- prev_cmd = cmd;
- continue;
-
- case ETIR__C_STO_LW: /* ALPHA_R_REFLONG und_section, step 4 */
- /* ALPHA_R_REFLONG abs_section, step 2 */
- /* ALPHA_R_REFLONG others, step 2 */
- if (prev_cmd != ETIR__C_OPR_ADD
- && prev_cmd != ETIR__C_STA_LW
- && prev_cmd != ETIR__C_STA_PQ)
- {
+ (_("Unknown reloc %s + %s"), _bfd_vms_etir_name (cmd),
+ _bfd_vms_etir_name (ETIR__C_STA_QW));
+ return FALSE;
+ }
+ cur_addend = bfd_getl64 (ptr + 4);
+ prev_cmd = cmd;
+ continue;
+
+ case ETIR__C_STO_LW: /* ALPHA_R_REFLONG und_section, step 4 */
+ /* ALPHA_R_REFLONG abs_section, step 2 */
+ /* ALPHA_R_REFLONG others, step 2 */
+ if (prev_cmd != ETIR__C_OPR_ADD
+ && prev_cmd != ETIR__C_STA_LW
+ && prev_cmd != ETIR__C_STA_PQ)
+ {
/* xgettext:c-format */
_bfd_error_handler (_("Unknown reloc %s + %s"),
_bfd_vms_etir_name (prev_cmd),
_bfd_vms_etir_name (ETIR__C_STO_LW));
- return FALSE;
- }
- reloc_code = BFD_RELOC_32;
- break;
-
- case ETIR__C_STO_QW: /* ALPHA_R_REFQUAD und_section, step 4 */
- /* ALPHA_R_REFQUAD abs_section, step 2 */
- if (prev_cmd != ETIR__C_OPR_ADD && prev_cmd != ETIR__C_STA_QW)
- {
+ return FALSE;
+ }
+ reloc_code = BFD_RELOC_32;
+ break;
+
+ case ETIR__C_STO_QW: /* ALPHA_R_REFQUAD und_section, step 4 */
+ /* ALPHA_R_REFQUAD abs_section, step 2 */
+ if (prev_cmd != ETIR__C_OPR_ADD && prev_cmd != ETIR__C_STA_QW)
+ {
/* xgettext:c-format */
_bfd_error_handler (_("Unknown reloc %s + %s"),
_bfd_vms_etir_name (prev_cmd),
_bfd_vms_etir_name (ETIR__C_STO_QW));
- return FALSE;
- }
- reloc_code = BFD_RELOC_64;
- break;
-
- case ETIR__C_STO_OFF: /* ALPHA_R_REFQUAD others, step 2 */
- if (prev_cmd != ETIR__C_STA_PQ)
- {
+ return FALSE;
+ }
+ reloc_code = BFD_RELOC_64;
+ break;
+
+ case ETIR__C_STO_OFF: /* ALPHA_R_REFQUAD others, step 2 */
+ if (prev_cmd != ETIR__C_STA_PQ)
+ {
/* xgettext:c-format */
_bfd_error_handler (_("Unknown reloc %s + %s"),
_bfd_vms_etir_name (prev_cmd),
_bfd_vms_etir_name (ETIR__C_STO_OFF));
- return FALSE;
- }
- reloc_code = BFD_RELOC_64;
- break;
-
- case ETIR__C_OPR_ADD: /* ALPHA_R_REFLONG und_section, step 3 */
- /* ALPHA_R_REFQUAD und_section, step 3 */
- if (prev_cmd != ETIR__C_STA_LW && prev_cmd != ETIR__C_STA_QW)
- {
+ return FALSE;
+ }
+ reloc_code = BFD_RELOC_64;
+ break;
+
+ case ETIR__C_OPR_ADD: /* ALPHA_R_REFLONG und_section, step 3 */
+ /* ALPHA_R_REFQUAD und_section, step 3 */
+ if (prev_cmd != ETIR__C_STA_LW && prev_cmd != ETIR__C_STA_QW)
+ {
/* xgettext:c-format */
_bfd_error_handler (_("Unknown reloc %s + %s"),
_bfd_vms_etir_name (prev_cmd),
_bfd_vms_etir_name (ETIR__C_OPR_ADD));
- return FALSE;
- }
- prev_cmd = ETIR__C_OPR_ADD;
- continue;
-
- case ETIR__C_STO_CA: /* ALPHA_R_CODEADDR */
- reloc_code = BFD_RELOC_ALPHA_CODEADDR;
- cur_sym = ptr + 4;
- break;
-
- case ETIR__C_STO_GBL: /* ALPHA_R_REFQUAD und_section */
- reloc_code = BFD_RELOC_64;
- cur_sym = ptr + 4;
- break;
-
- case ETIR__C_STO_GBL_LW: /* ALPHA_R_REFLONG und_section */
- reloc_code = BFD_RELOC_32;
- cur_sym = ptr + 4;
- break;
-
- case ETIR__C_STC_LP_PSB: /* ALPHA_R_LINKAGE */
- reloc_code = BFD_RELOC_ALPHA_LINKAGE;
- cur_sym = ptr + 8;
- break;
-
- case ETIR__C_STC_NOP_GBL: /* ALPHA_R_NOP */
- reloc_code = BFD_RELOC_ALPHA_NOP;
- goto call_reloc;
-
- case ETIR__C_STC_BSR_GBL: /* ALPHA_R_BSR */
- reloc_code = BFD_RELOC_ALPHA_BSR;
- goto call_reloc;
-
- case ETIR__C_STC_LDA_GBL: /* ALPHA_R_LDA */
- reloc_code = BFD_RELOC_ALPHA_LDA;
- goto call_reloc;
-
- case ETIR__C_STC_BOH_GBL: /* ALPHA_R_BOH */
- reloc_code = BFD_RELOC_ALPHA_BOH;
- goto call_reloc;
-
- call_reloc:
- cur_sym = ptr + 4 + 32;
- cur_address = bfd_getl64 (ptr + 4 + 8);
- cur_addend = bfd_getl64 (ptr + 4 + 24);
- break;
-
- case ETIR__C_STO_IMM:
- vaddr += bfd_getl32 (ptr + 4);
- continue;
-
- default:
+ return FALSE;
+ }
+ prev_cmd = ETIR__C_OPR_ADD;
+ continue;
+
+ case ETIR__C_STO_CA: /* ALPHA_R_CODEADDR */
+ reloc_code = BFD_RELOC_ALPHA_CODEADDR;
+ cur_sym = ptr + 4;
+ break;
+
+ case ETIR__C_STO_GBL: /* ALPHA_R_REFQUAD und_section */
+ reloc_code = BFD_RELOC_64;
+ cur_sym = ptr + 4;
+ break;
+
+ case ETIR__C_STO_GBL_LW: /* ALPHA_R_REFLONG und_section */
+ reloc_code = BFD_RELOC_32;
+ cur_sym = ptr + 4;
+ break;
+
+ case ETIR__C_STC_LP_PSB: /* ALPHA_R_LINKAGE */
+ reloc_code = BFD_RELOC_ALPHA_LINKAGE;
+ cur_sym = ptr + 8;
+ break;
+
+ case ETIR__C_STC_NOP_GBL: /* ALPHA_R_NOP */
+ reloc_code = BFD_RELOC_ALPHA_NOP;
+ goto call_reloc;
+
+ case ETIR__C_STC_BSR_GBL: /* ALPHA_R_BSR */
+ reloc_code = BFD_RELOC_ALPHA_BSR;
+ goto call_reloc;
+
+ case ETIR__C_STC_LDA_GBL: /* ALPHA_R_LDA */
+ reloc_code = BFD_RELOC_ALPHA_LDA;
+ goto call_reloc;
+
+ case ETIR__C_STC_BOH_GBL: /* ALPHA_R_BOH */
+ reloc_code = BFD_RELOC_ALPHA_BOH;
+ goto call_reloc;
+
+ call_reloc:
+ cur_sym = ptr + 4 + 32;
+ cur_address = bfd_getl64 (ptr + 4 + 8);
+ cur_addend = bfd_getl64 (ptr + 4 + 24);
+ break;
+
+ case ETIR__C_STO_IMM:
+ vaddr += bfd_getl32 (ptr + 4);
+ continue;
+
+ default:
_bfd_error_handler (_("Unknown reloc %s"),
_bfd_vms_etir_name (cmd));
- return FALSE;
- }
+ return FALSE;
+ }
- {
- asection *sec;
- struct vms_section_data_struct *vms_sec;
- arelent *reloc;
+ {
+ asection *sec;
+ struct vms_section_data_struct *vms_sec;
+ arelent *reloc;
- /* Get section to which the relocation applies. */
- if (cur_psect < 0 || cur_psect > (int)PRIV (section_count))
- {
+ /* Get section to which the relocation applies. */
+ if (cur_psect < 0 || cur_psect > (int)PRIV (section_count))
+ {
_bfd_error_handler (_("Invalid section index in ETIR"));
- return FALSE;
- }
+ return FALSE;
+ }
if (PRIV (sections) == NULL)
return FALSE;
- sec = PRIV (sections)[cur_psect];
- if (sec == bfd_abs_section_ptr)
- {
+ sec = PRIV (sections)[cur_psect];
+ if (sec == bfd_abs_section_ptr)
+ {
_bfd_error_handler (_("Relocation for non-REL psect"));
- return FALSE;
- }
-
- vms_sec = vms_section_data (sec);
-
- /* Allocate a reloc entry. */
- if (sec->reloc_count >= vms_sec->reloc_max)
- {
- if (vms_sec->reloc_max == 0)
- {
- vms_sec->reloc_max = 64;
- sec->relocation = bfd_zmalloc
- (vms_sec->reloc_max * sizeof (arelent));
- }
- else
- {
- vms_sec->reloc_max *= 2;
- sec->relocation = bfd_realloc
- (sec->relocation, vms_sec->reloc_max * sizeof (arelent));
- }
- }
- reloc = &sec->relocation[sec->reloc_count];
- sec->reloc_count++;
-
- reloc->howto = bfd_reloc_type_lookup (abfd, reloc_code);
-
- if (cur_sym != NULL)
- {
- unsigned int j;
- unsigned int symlen = *cur_sym;
- asymbol **sym;
-
- /* Linear search. */
- symlen = *cur_sym;
- cur_sym++;
- sym = NULL;
-
- for (j = 0; j < PRIV (gsd_sym_count); j++)
- if (PRIV (syms)[j]->namelen == symlen
- && memcmp (PRIV (syms)[j]->name, cur_sym, symlen) == 0)
- {
- sym = &PRIV (csymbols)[j];
- break;
- }
- if (sym == NULL)
- {
+ return FALSE;
+ }
+
+ vms_sec = vms_section_data (sec);
+
+ /* Allocate a reloc entry. */
+ if (sec->reloc_count >= vms_sec->reloc_max)
+ {
+ if (vms_sec->reloc_max == 0)
+ {
+ vms_sec->reloc_max = 64;
+ sec->relocation = bfd_zmalloc
+ (vms_sec->reloc_max * sizeof (arelent));
+ }
+ else
+ {
+ vms_sec->reloc_max *= 2;
+ sec->relocation = bfd_realloc
+ (sec->relocation, vms_sec->reloc_max * sizeof (arelent));
+ }
+ }
+ reloc = &sec->relocation[sec->reloc_count];
+ sec->reloc_count++;
+
+ reloc->howto = bfd_reloc_type_lookup (abfd, reloc_code);
+
+ if (cur_sym != NULL)
+ {
+ unsigned int j;
+ unsigned int symlen = *cur_sym;
+ asymbol **sym;
+
+ /* Linear search. */
+ symlen = *cur_sym;
+ cur_sym++;
+ sym = NULL;
+
+ for (j = 0; j < PRIV (gsd_sym_count); j++)
+ if (PRIV (syms)[j]->namelen == symlen
+ && memcmp (PRIV (syms)[j]->name, cur_sym, symlen) == 0)
+ {
+ sym = &PRIV (csymbols)[j];
+ break;
+ }
+ if (sym == NULL)
+ {
_bfd_error_handler (_("Unknown symbol in command %s"),
_bfd_vms_etir_name (cmd));
- reloc->sym_ptr_ptr = NULL;
- }
- else
- reloc->sym_ptr_ptr = sym;
- }
- else if (cur_psidx >= 0)
+ reloc->sym_ptr_ptr = NULL;
+ }
+ else
+ reloc->sym_ptr_ptr = sym;
+ }
+ else if (cur_psidx >= 0)
{
if (PRIV (sections) == NULL || cur_psidx >= (int) PRIV (section_count))
return FALSE;
reloc->sym_ptr_ptr =
PRIV (sections)[cur_psidx]->symbol_ptr_ptr;
}
- else
- reloc->sym_ptr_ptr = NULL;
+ else
+ reloc->sym_ptr_ptr = NULL;
- reloc->address = cur_address;
- reloc->addend = cur_addend;
+ reloc->address = cur_address;
+ reloc->addend = cur_addend;
- vaddr += bfd_get_reloc_size (reloc->howto);
- }
+ vaddr += bfd_get_reloc_size (reloc->howto);
+ }
- cur_addend = 0;
- prev_cmd = -1;
- cur_sym = NULL;
- cur_psidx = -1;
- }
+ cur_addend = 0;
+ prev_cmd = -1;
+ cur_sym = NULL;
+ cur_psidx = -1;
+ }
}
vms_debug2 ((3, "alpha_vms_slurp_relocs: result = TRUE\n"));
static long
alpha_vms_canonicalize_reloc (bfd *abfd, asection *section, arelent **relptr,
- asymbol **symbols ATTRIBUTE_UNUSED)
+ asymbol **symbols ATTRIBUTE_UNUSED)
{
arelent *tblptr;
int count;
static const struct reloc_howto_struct *
alpha_vms_bfd_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
- bfd_reloc_code_real_type code)
+ bfd_reloc_code_real_type code)
{
int alpha_type;
static reloc_howto_type *
alpha_vms_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
- const char *r_name)
+ const char *r_name)
{
unsigned int i;
\f
static long
alpha_vms_get_synthetic_symtab (bfd *abfd,
- long symcount ATTRIBUTE_UNUSED,
- asymbol **usyms ATTRIBUTE_UNUSED,
- long dynsymcount ATTRIBUTE_UNUSED,
- asymbol **dynsyms ATTRIBUTE_UNUSED,
- asymbol **ret)
+ long symcount ATTRIBUTE_UNUSED,
+ asymbol **usyms ATTRIBUTE_UNUSED,
+ long dynsymcount ATTRIBUTE_UNUSED,
+ asymbol **dynsyms ATTRIBUTE_UNUSED,
+ asymbol **ret)
{
asymbol *syms;
unsigned int i;
sec = NULL;
switch (e->typ)
- {
- case EGSD__C_SYM:
- case EGSD__C_SYMG:
- if ((e->flags & EGSY__V_DEF) && (e->flags & EGSY__V_NORM))
- {
- value = e->code_value;
- sec = e->code_section;
- }
- else
- continue;
- break;
-
- default:
- continue;
- }
+ {
+ case EGSD__C_SYM:
+ case EGSD__C_SYMG:
+ if ((e->flags & EGSY__V_DEF) && (e->flags & EGSY__V_NORM))
+ {
+ value = e->code_value;
+ sec = e->code_section;
+ }
+ else
+ continue;
+ break;
+
+ default:
+ continue;
+ }
l = strlen (name);
sname = bfd_alloc (abfd, l + 5);
if (sname == NULL)
- return FALSE;
+ return FALSE;
memcpy (sname, name, l);
memcpy (sname + l, "..en", 5);
{
case EMH__C_MHD:
{
- struct vms_emh_mhd *mhd = (struct vms_emh_mhd *) rec;
- const char * name;
+ struct vms_emh_mhd *mhd = (struct vms_emh_mhd *) rec;
+ const char * name;
const char * nextname;
const char * maxname;
fprintf (file, _(" Error: The record length is less than the size of an EMH_MHD record\n"));
return;
}
- fprintf (file, _("Module header\n"));
- fprintf (file, _(" structure level: %u\n"), mhd->strlvl);
- fprintf (file, _(" max record size: %u\n"),
- (unsigned) bfd_getl32 (mhd->recsiz));
- name = (char *)(mhd + 1);
+ fprintf (file, _("Module header\n"));
+ fprintf (file, _(" structure level: %u\n"), mhd->strlvl);
+ fprintf (file, _(" max record size: %u\n"),
+ (unsigned) bfd_getl32 (mhd->recsiz));
+ name = (char *)(mhd + 1);
maxname = (char *) rec + rec_len;
if (name > maxname - 2)
{
fprintf (file, _(" Error: The module name is too long\n"));
return;
}
- fprintf (file, _(" module name : %.*s\n"), name[0], name + 1);
- name = nextname;
+ fprintf (file, _(" module name : %.*s\n"), name[0], name + 1);
+ name = nextname;
if (name > maxname - 2)
{
fprintf (file, _(" Error: The module version is missing\n"));
fprintf (file, _(" Error: The module version is too long\n"));
return;
}
- fprintf (file, _(" module version : %.*s\n"), name[0], name + 1);
- name = nextname;
+ fprintf (file, _(" module version : %.*s\n"), name[0], name + 1);
+ name = nextname;
if ((maxname - name) < 17 && maxname[-1] != 0)
fprintf (file, _(" Error: The compile date is truncated\n"));
else
fprintf (file, _(" Error: The length is less than the length of an EEOM record\n"));
return;
}
-
+
fprintf (file, _(" number of cond linkage pairs: %u\n"),
- (unsigned)bfd_getl32 (eeom->total_lps));
+ (unsigned)bfd_getl32 (eeom->total_lps));
fprintf (file, _(" completion code: %u\n"),
- (unsigned)bfd_getl16 (eeom->comcod));
+ (unsigned)bfd_getl16 (eeom->comcod));
if (rec_len > 10)
{
fprintf (file, _(" transfer addr flags: 0x%02x\n"), eeom->tfrflg);
fprintf (file, _(" transfer addr psect: %u\n"),
- (unsigned)bfd_getl32 (eeom->psindx));
+ (unsigned)bfd_getl32 (eeom->psindx));
fprintf (file, _(" transfer address : 0x%08x\n"),
- (unsigned)bfd_getl32 (eeom->tfradr));
+ (unsigned)bfd_getl32 (eeom->tfradr));
}
}
/* xgettext:c-format */
fprintf (file, _(" EGSD entry %2u (type: %u, len: %u): "),
- n, type, len);
+ n, type, len);
n++;
if (off + len > rec_len || off + len < off)
}
switch (type)
- {
- case EGSD__C_PSC:
- {
- struct vms_egps *egps = (struct vms_egps *)e;
- unsigned int flags = bfd_getl16 (egps->flags);
- unsigned int l;
-
- fprintf (file, _("PSC - Program section definition\n"));
- fprintf (file, _(" alignment : 2**%u\n"), egps->align);
- fprintf (file, _(" flags : 0x%04x"), flags);
- evax_bfd_print_egsd_flags (file, flags);
- fputc ('\n', file);
- l = bfd_getl32 (egps->alloc);
- fprintf (file, _(" alloc (len): %u (0x%08x)\n"), l, l);
- fprintf (file, _(" name : %.*s\n"),
- egps->namlng, egps->name);
- }
- break;
- case EGSD__C_SPSC:
- {
- struct vms_esgps *esgps = (struct vms_esgps *)e;
- unsigned int flags = bfd_getl16 (esgps->flags);
- unsigned int l;
-
- fprintf (file, _("SPSC - Shared Image Program section def\n"));
- fprintf (file, _(" alignment : 2**%u\n"), esgps->align);
- fprintf (file, _(" flags : 0x%04x"), flags);
- evax_bfd_print_egsd_flags (file, flags);
- fputc ('\n', file);
- l = bfd_getl32 (esgps->alloc);
- fprintf (file, _(" alloc (len) : %u (0x%08x)\n"), l, l);
- fprintf (file, _(" image offset : 0x%08x\n"),
- (unsigned int)bfd_getl32 (esgps->base));
- fprintf (file, _(" symvec offset : 0x%08x\n"),
- (unsigned int)bfd_getl32 (esgps->value));
- fprintf (file, _(" name : %.*s\n"),
- esgps->namlng, esgps->name);
- }
- break;
- case EGSD__C_SYM:
- {
- struct vms_egsy *egsy = (struct vms_egsy *)e;
- unsigned int flags = bfd_getl16 (egsy->flags);
-
- if (flags & EGSY__V_DEF)
- {
- struct vms_esdf *esdf = (struct vms_esdf *)e;
-
- fprintf (file, _("SYM - Global symbol definition\n"));
- fprintf (file, _(" flags: 0x%04x"), flags);
- exav_bfd_print_egsy_flags (flags, file);
- fputc ('\n', file);
- fprintf (file, _(" psect offset: 0x%08x\n"),
- (unsigned)bfd_getl32 (esdf->value));
- if (flags & EGSY__V_NORM)
- {
- fprintf (file, _(" code address: 0x%08x\n"),
- (unsigned)bfd_getl32 (esdf->code_address));
- fprintf (file, _(" psect index for entry point : %u\n"),
- (unsigned)bfd_getl32 (esdf->ca_psindx));
- }
- fprintf (file, _(" psect index : %u\n"),
- (unsigned)bfd_getl32 (esdf->psindx));
- fprintf (file, _(" name : %.*s\n"),
- esdf->namlng, esdf->name);
- }
- else
- {
- struct vms_esrf *esrf = (struct vms_esrf *)e;
-
- fprintf (file, _("SYM - Global symbol reference\n"));
- fprintf (file, _(" name : %.*s\n"),
- esrf->namlng, esrf->name);
- }
- }
- break;
- case EGSD__C_IDC:
- {
- struct vms_eidc *eidc = (struct vms_eidc *)e;
- unsigned int flags = bfd_getl32 (eidc->flags);
- unsigned char *p;
-
- fprintf (file, _("IDC - Ident Consistency check\n"));
- fprintf (file, _(" flags : 0x%08x"), flags);
- if (flags & EIDC__V_BINIDENT)
- fputs (" BINDENT", file);
- fputc ('\n', file);
- fprintf (file, _(" id match : %x\n"),
- (flags >> EIDC__V_IDMATCH_SH) & EIDC__V_IDMATCH_MASK);
- fprintf (file, _(" error severity: %x\n"),
- (flags >> EIDC__V_ERRSEV_SH) & EIDC__V_ERRSEV_MASK);
- p = eidc->name;
- fprintf (file, _(" entity name : %.*s\n"), p[0], p + 1);
- p += 1 + p[0];
- fprintf (file, _(" object name : %.*s\n"), p[0], p + 1);
- p += 1 + p[0];
- if (flags & EIDC__V_BINIDENT)
- fprintf (file, _(" binary ident : 0x%08x\n"),
- (unsigned)bfd_getl32 (p + 1));
- else
- fprintf (file, _(" ascii ident : %.*s\n"), p[0], p + 1);
- }
- break;
- case EGSD__C_SYMG:
- {
- struct vms_egst *egst = (struct vms_egst *)e;
- unsigned int flags = bfd_getl16 (egst->header.flags);
-
- fprintf (file, _("SYMG - Universal symbol definition\n"));
- fprintf (file, _(" flags: 0x%04x"), flags);
- exav_bfd_print_egsy_flags (flags, file);
- fputc ('\n', file);
- fprintf (file, _(" symbol vector offset: 0x%08x\n"),
- (unsigned)bfd_getl32 (egst->value));
- fprintf (file, _(" entry point: 0x%08x\n"),
- (unsigned)bfd_getl32 (egst->lp_1));
- fprintf (file, _(" proc descr : 0x%08x\n"),
- (unsigned)bfd_getl32 (egst->lp_2));
- fprintf (file, _(" psect index: %u\n"),
- (unsigned)bfd_getl32 (egst->psindx));
- fprintf (file, _(" name : %.*s\n"),
- egst->namlng, egst->name);
- }
- break;
- case EGSD__C_SYMV:
- {
- struct vms_esdfv *esdfv = (struct vms_esdfv *)e;
- unsigned int flags = bfd_getl16 (esdfv->flags);
-
- fprintf (file, _("SYMV - Vectored symbol definition\n"));
- fprintf (file, _(" flags: 0x%04x"), flags);
- exav_bfd_print_egsy_flags (flags, file);
- fputc ('\n', file);
- fprintf (file, _(" vector : 0x%08x\n"),
- (unsigned)bfd_getl32 (esdfv->vector));
- fprintf (file, _(" psect offset: %u\n"),
- (unsigned)bfd_getl32 (esdfv->value));
- fprintf (file, _(" psect index : %u\n"),
- (unsigned)bfd_getl32 (esdfv->psindx));
- fprintf (file, _(" name : %.*s\n"),
- esdfv->namlng, esdfv->name);
- }
- break;
- case EGSD__C_SYMM:
- {
- struct vms_esdfm *esdfm = (struct vms_esdfm *)e;
- unsigned int flags = bfd_getl16 (esdfm->flags);
-
- fprintf (file, _("SYMM - Global symbol definition with version\n"));
- fprintf (file, _(" flags: 0x%04x"), flags);
- exav_bfd_print_egsy_flags (flags, file);
- fputc ('\n', file);
- fprintf (file, _(" version mask: 0x%08x\n"),
- (unsigned)bfd_getl32 (esdfm->version_mask));
- fprintf (file, _(" psect offset: %u\n"),
- (unsigned)bfd_getl32 (esdfm->value));
- fprintf (file, _(" psect index : %u\n"),
- (unsigned)bfd_getl32 (esdfm->psindx));
- fprintf (file, _(" name : %.*s\n"),
- esdfm->namlng, esdfm->name);
- }
- break;
- default:
- fprintf (file, _("unhandled egsd entry type %u\n"), type);
- break;
- }
+ {
+ case EGSD__C_PSC:
+ {
+ struct vms_egps *egps = (struct vms_egps *)e;
+ unsigned int flags = bfd_getl16 (egps->flags);
+ unsigned int l;
+
+ fprintf (file, _("PSC - Program section definition\n"));
+ fprintf (file, _(" alignment : 2**%u\n"), egps->align);
+ fprintf (file, _(" flags : 0x%04x"), flags);
+ evax_bfd_print_egsd_flags (file, flags);
+ fputc ('\n', file);
+ l = bfd_getl32 (egps->alloc);
+ fprintf (file, _(" alloc (len): %u (0x%08x)\n"), l, l);
+ fprintf (file, _(" name : %.*s\n"),
+ egps->namlng, egps->name);
+ }
+ break;
+ case EGSD__C_SPSC:
+ {
+ struct vms_esgps *esgps = (struct vms_esgps *)e;
+ unsigned int flags = bfd_getl16 (esgps->flags);
+ unsigned int l;
+
+ fprintf (file, _("SPSC - Shared Image Program section def\n"));
+ fprintf (file, _(" alignment : 2**%u\n"), esgps->align);
+ fprintf (file, _(" flags : 0x%04x"), flags);
+ evax_bfd_print_egsd_flags (file, flags);
+ fputc ('\n', file);
+ l = bfd_getl32 (esgps->alloc);
+ fprintf (file, _(" alloc (len) : %u (0x%08x)\n"), l, l);
+ fprintf (file, _(" image offset : 0x%08x\n"),
+ (unsigned int)bfd_getl32 (esgps->base));
+ fprintf (file, _(" symvec offset : 0x%08x\n"),
+ (unsigned int)bfd_getl32 (esgps->value));
+ fprintf (file, _(" name : %.*s\n"),
+ esgps->namlng, esgps->name);
+ }
+ break;
+ case EGSD__C_SYM:
+ {
+ struct vms_egsy *egsy = (struct vms_egsy *)e;
+ unsigned int flags = bfd_getl16 (egsy->flags);
+
+ if (flags & EGSY__V_DEF)
+ {
+ struct vms_esdf *esdf = (struct vms_esdf *)e;
+
+ fprintf (file, _("SYM - Global symbol definition\n"));
+ fprintf (file, _(" flags: 0x%04x"), flags);
+ exav_bfd_print_egsy_flags (flags, file);
+ fputc ('\n', file);
+ fprintf (file, _(" psect offset: 0x%08x\n"),
+ (unsigned)bfd_getl32 (esdf->value));
+ if (flags & EGSY__V_NORM)
+ {
+ fprintf (file, _(" code address: 0x%08x\n"),
+ (unsigned)bfd_getl32 (esdf->code_address));
+ fprintf (file, _(" psect index for entry point : %u\n"),
+ (unsigned)bfd_getl32 (esdf->ca_psindx));
+ }
+ fprintf (file, _(" psect index : %u\n"),
+ (unsigned)bfd_getl32 (esdf->psindx));
+ fprintf (file, _(" name : %.*s\n"),
+ esdf->namlng, esdf->name);
+ }
+ else
+ {
+ struct vms_esrf *esrf = (struct vms_esrf *)e;
+
+ fprintf (file, _("SYM - Global symbol reference\n"));
+ fprintf (file, _(" name : %.*s\n"),
+ esrf->namlng, esrf->name);
+ }
+ }
+ break;
+ case EGSD__C_IDC:
+ {
+ struct vms_eidc *eidc = (struct vms_eidc *)e;
+ unsigned int flags = bfd_getl32 (eidc->flags);
+ unsigned char *p;
+
+ fprintf (file, _("IDC - Ident Consistency check\n"));
+ fprintf (file, _(" flags : 0x%08x"), flags);
+ if (flags & EIDC__V_BINIDENT)
+ fputs (" BINDENT", file);
+ fputc ('\n', file);
+ fprintf (file, _(" id match : %x\n"),
+ (flags >> EIDC__V_IDMATCH_SH) & EIDC__V_IDMATCH_MASK);
+ fprintf (file, _(" error severity: %x\n"),
+ (flags >> EIDC__V_ERRSEV_SH) & EIDC__V_ERRSEV_MASK);
+ p = eidc->name;
+ fprintf (file, _(" entity name : %.*s\n"), p[0], p + 1);
+ p += 1 + p[0];
+ fprintf (file, _(" object name : %.*s\n"), p[0], p + 1);
+ p += 1 + p[0];
+ if (flags & EIDC__V_BINIDENT)
+ fprintf (file, _(" binary ident : 0x%08x\n"),
+ (unsigned)bfd_getl32 (p + 1));
+ else
+ fprintf (file, _(" ascii ident : %.*s\n"), p[0], p + 1);
+ }
+ break;
+ case EGSD__C_SYMG:
+ {
+ struct vms_egst *egst = (struct vms_egst *)e;
+ unsigned int flags = bfd_getl16 (egst->header.flags);
+
+ fprintf (file, _("SYMG - Universal symbol definition\n"));
+ fprintf (file, _(" flags: 0x%04x"), flags);
+ exav_bfd_print_egsy_flags (flags, file);
+ fputc ('\n', file);
+ fprintf (file, _(" symbol vector offset: 0x%08x\n"),
+ (unsigned)bfd_getl32 (egst->value));
+ fprintf (file, _(" entry point: 0x%08x\n"),
+ (unsigned)bfd_getl32 (egst->lp_1));
+ fprintf (file, _(" proc descr : 0x%08x\n"),
+ (unsigned)bfd_getl32 (egst->lp_2));
+ fprintf (file, _(" psect index: %u\n"),
+ (unsigned)bfd_getl32 (egst->psindx));
+ fprintf (file, _(" name : %.*s\n"),
+ egst->namlng, egst->name);
+ }
+ break;
+ case EGSD__C_SYMV:
+ {
+ struct vms_esdfv *esdfv = (struct vms_esdfv *)e;
+ unsigned int flags = bfd_getl16 (esdfv->flags);
+
+ fprintf (file, _("SYMV - Vectored symbol definition\n"));
+ fprintf (file, _(" flags: 0x%04x"), flags);
+ exav_bfd_print_egsy_flags (flags, file);
+ fputc ('\n', file);
+ fprintf (file, _(" vector : 0x%08x\n"),
+ (unsigned)bfd_getl32 (esdfv->vector));
+ fprintf (file, _(" psect offset: %u\n"),
+ (unsigned)bfd_getl32 (esdfv->value));
+ fprintf (file, _(" psect index : %u\n"),
+ (unsigned)bfd_getl32 (esdfv->psindx));
+ fprintf (file, _(" name : %.*s\n"),
+ esdfv->namlng, esdfv->name);
+ }
+ break;
+ case EGSD__C_SYMM:
+ {
+ struct vms_esdfm *esdfm = (struct vms_esdfm *)e;
+ unsigned int flags = bfd_getl16 (esdfm->flags);
+
+ fprintf (file, _("SYMM - Global symbol definition with version\n"));
+ fprintf (file, _(" flags: 0x%04x"), flags);
+ exav_bfd_print_egsy_flags (flags, file);
+ fputc ('\n', file);
+ fprintf (file, _(" version mask: 0x%08x\n"),
+ (unsigned)bfd_getl32 (esdfm->version_mask));
+ fprintf (file, _(" psect offset: %u\n"),
+ (unsigned)bfd_getl32 (esdfm->value));
+ fprintf (file, _(" psect index : %u\n"),
+ (unsigned)bfd_getl32 (esdfm->psindx));
+ fprintf (file, _(" name : %.*s\n"),
+ esdfm->namlng, esdfm->name);
+ }
+ break;
+ default:
+ fprintf (file, _("unhandled egsd entry type %u\n"), type);
+ break;
+ }
off += len;
}
}
static void
evax_bfd_print_hex (FILE *file, const char *pfx,
- const unsigned char *buf, unsigned int len)
+ const unsigned char *buf, unsigned int len)
{
unsigned int i;
unsigned int n;
for (i = 0; i < len; i++)
{
if (n == 0)
- fputs (pfx, file);
+ fputs (pfx, file);
fprintf (file, " %02x", buf[i]);
n++;
if (n == 16)
- {
- n = 0;
- fputc ('\n', file);
- }
+ {
+ n = 0;
+ fputc ('\n', file);
+ }
}
if (n != 0)
fputc ('\n', file);
{
/* xgettext:c-format */
fprintf (file, _(" linkage index: %u, replacement insn: 0x%08x\n"),
- (unsigned)bfd_getl32 (buf),
- (unsigned)bfd_getl32 (buf + 16));
+ (unsigned)bfd_getl32 (buf),
+ (unsigned)bfd_getl32 (buf + 16));
/* xgettext:c-format */
fprintf (file, _(" psect idx 1: %u, offset 1: 0x%08x %08x\n"),
- (unsigned)bfd_getl32 (buf + 4),
- (unsigned)bfd_getl32 (buf + 12),
- (unsigned)bfd_getl32 (buf + 8));
+ (unsigned)bfd_getl32 (buf + 4),
+ (unsigned)bfd_getl32 (buf + 12),
+ (unsigned)bfd_getl32 (buf + 8));
/* xgettext:c-format */
fprintf (file, _(" psect idx 2: %u, offset 2: 0x%08x %08x\n"),
- (unsigned)bfd_getl32 (buf + 20),
- (unsigned)bfd_getl32 (buf + 28),
- (unsigned)bfd_getl32 (buf + 24));
+ (unsigned)bfd_getl32 (buf + 20),
+ (unsigned)bfd_getl32 (buf + 28),
+ (unsigned)bfd_getl32 (buf + 24));
if (is_ps)
/* xgettext:c-format */
fprintf (file, _(" psect idx 3: %u, offset 3: 0x%08x %08x\n"),
- (unsigned)bfd_getl32 (buf + 32),
- (unsigned)bfd_getl32 (buf + 40),
- (unsigned)bfd_getl32 (buf + 36));
+ (unsigned)bfd_getl32 (buf + 32),
+ (unsigned)bfd_getl32 (buf + 40),
+ (unsigned)bfd_getl32 (buf + 36));
else
fprintf (file, _(" global name: %.*s\n"), buf[32], buf + 33);
}
static void
evax_bfd_print_etir (FILE *file, const char *name,
- unsigned char *rec, unsigned int rec_len)
+ unsigned char *rec, unsigned int rec_len)
{
unsigned int off = sizeof (struct vms_egsd);
unsigned int sec_len = 0;
/* xgettext:c-format */
fprintf (file, _(" %s (len=%u+%u):\n"), name,
- (unsigned)(rec_len - sizeof (struct vms_eobjrec)),
- (unsigned)sizeof (struct vms_eobjrec));
+ (unsigned)(rec_len - sizeof (struct vms_eobjrec)),
+ (unsigned)sizeof (struct vms_eobjrec));
for (off = sizeof (struct vms_eobjrec); off < rec_len; )
{
/* xgettext:c-format */
fprintf (file, _(" (type: %3u, size: 4+%3u): "), type, size - 4);
switch (type)
- {
- case ETIR__C_STA_GBL:
- fprintf (file, _("STA_GBL (stack global) %.*s\n"),
- buf[0], buf + 1);
- break;
- case ETIR__C_STA_LW:
- fprintf (file, _("STA_LW (stack longword) 0x%08x\n"),
- (unsigned)bfd_getl32 (buf));
- break;
- case ETIR__C_STA_QW:
- fprintf (file, _("STA_QW (stack quadword) 0x%08x %08x\n"),
- (unsigned)bfd_getl32 (buf + 4),
- (unsigned)bfd_getl32 (buf + 0));
- break;
- case ETIR__C_STA_PQ:
- fprintf (file, _("STA_PQ (stack psect base + offset)\n"));
+ {
+ case ETIR__C_STA_GBL:
+ fprintf (file, _("STA_GBL (stack global) %.*s\n"),
+ buf[0], buf + 1);
+ break;
+ case ETIR__C_STA_LW:
+ fprintf (file, _("STA_LW (stack longword) 0x%08x\n"),
+ (unsigned)bfd_getl32 (buf));
+ break;
+ case ETIR__C_STA_QW:
+ fprintf (file, _("STA_QW (stack quadword) 0x%08x %08x\n"),
+ (unsigned)bfd_getl32 (buf + 4),
+ (unsigned)bfd_getl32 (buf + 0));
+ break;
+ case ETIR__C_STA_PQ:
+ fprintf (file, _("STA_PQ (stack psect base + offset)\n"));
/* xgettext:c-format */
- fprintf (file, _(" psect: %u, offset: 0x%08x %08x\n"),
- (unsigned)bfd_getl32 (buf + 0),
- (unsigned)bfd_getl32 (buf + 8),
- (unsigned)bfd_getl32 (buf + 4));
- break;
- case ETIR__C_STA_LI:
- fprintf (file, _("STA_LI (stack literal)\n"));
- break;
- case ETIR__C_STA_MOD:
- fprintf (file, _("STA_MOD (stack module)\n"));
- break;
- case ETIR__C_STA_CKARG:
- fprintf (file, _("STA_CKARG (compare procedure argument)\n"));
- break;
-
- case ETIR__C_STO_B:
- fprintf (file, _("STO_B (store byte)\n"));
- break;
- case ETIR__C_STO_W:
- fprintf (file, _("STO_W (store word)\n"));
- break;
- case ETIR__C_STO_LW:
- fprintf (file, _("STO_LW (store longword)\n"));
- break;
- case ETIR__C_STO_QW:
- fprintf (file, _("STO_QW (store quadword)\n"));
- break;
- case ETIR__C_STO_IMMR:
- {
- unsigned int len = bfd_getl32 (buf);
- fprintf (file,
- _("STO_IMMR (store immediate repeat) %u bytes\n"),
- len);
- evax_bfd_print_hex (file, " ", buf + 4, len);
- sec_len += len;
- }
- break;
- case ETIR__C_STO_GBL:
- fprintf (file, _("STO_GBL (store global) %.*s\n"),
- buf[0], buf + 1);
- break;
- case ETIR__C_STO_CA:
- fprintf (file, _("STO_CA (store code address) %.*s\n"),
- buf[0], buf + 1);
- break;
- case ETIR__C_STO_RB:
- fprintf (file, _("STO_RB (store relative branch)\n"));
- break;
- case ETIR__C_STO_AB:
- fprintf (file, _("STO_AB (store absolute branch)\n"));
- break;
- case ETIR__C_STO_OFF:
- fprintf (file, _("STO_OFF (store offset to psect)\n"));
- break;
- case ETIR__C_STO_IMM:
- {
- unsigned int len = bfd_getl32 (buf);
- fprintf (file,
- _("STO_IMM (store immediate) %u bytes\n"),
- len);
- evax_bfd_print_hex (file, " ", buf + 4, len);
- sec_len += len;
- }
- break;
- case ETIR__C_STO_GBL_LW:
- fprintf (file, _("STO_GBL_LW (store global longword) %.*s\n"),
- buf[0], buf + 1);
- break;
- case ETIR__C_STO_LP_PSB:
- fprintf (file, _("STO_OFF (store LP with procedure signature)\n"));
- break;
- case ETIR__C_STO_HINT_GBL:
- fprintf (file, _("STO_BR_GBL (store branch global) *todo*\n"));
- break;
- case ETIR__C_STO_HINT_PS:
- fprintf (file, _("STO_BR_PS (store branch psect + offset) *todo*\n"));
- break;
-
- case ETIR__C_OPR_NOP:
- fprintf (file, _("OPR_NOP (no-operation)\n"));
- break;
- case ETIR__C_OPR_ADD:
- fprintf (file, _("OPR_ADD (add)\n"));
- break;
- case ETIR__C_OPR_SUB:
- fprintf (file, _("OPR_SUB (subtract)\n"));
- break;
- case ETIR__C_OPR_MUL:
- fprintf (file, _("OPR_MUL (multiply)\n"));
- break;
- case ETIR__C_OPR_DIV:
- fprintf (file, _("OPR_DIV (divide)\n"));
- break;
- case ETIR__C_OPR_AND:
- fprintf (file, _("OPR_AND (logical and)\n"));
- break;
- case ETIR__C_OPR_IOR:
- fprintf (file, _("OPR_IOR (logical inclusive or)\n"));
- break;
- case ETIR__C_OPR_EOR:
- fprintf (file, _("OPR_EOR (logical exclusive or)\n"));
- break;
- case ETIR__C_OPR_NEG:
- fprintf (file, _("OPR_NEG (negate)\n"));
- break;
- case ETIR__C_OPR_COM:
- fprintf (file, _("OPR_COM (complement)\n"));
- break;
- case ETIR__C_OPR_INSV:
- fprintf (file, _("OPR_INSV (insert field)\n"));
- break;
- case ETIR__C_OPR_ASH:
- fprintf (file, _("OPR_ASH (arithmetic shift)\n"));
- break;
- case ETIR__C_OPR_USH:
- fprintf (file, _("OPR_USH (unsigned shift)\n"));
- break;
- case ETIR__C_OPR_ROT:
- fprintf (file, _("OPR_ROT (rotate)\n"));
- break;
- case ETIR__C_OPR_SEL:
- fprintf (file, _("OPR_SEL (select)\n"));
- break;
- case ETIR__C_OPR_REDEF:
- fprintf (file, _("OPR_REDEF (redefine symbol to curr location)\n"));
- break;
- case ETIR__C_OPR_DFLIT:
- fprintf (file, _("OPR_REDEF (define a literal)\n"));
- break;
-
- case ETIR__C_STC_LP:
- fprintf (file, _("STC_LP (store cond linkage pair)\n"));
- break;
- case ETIR__C_STC_LP_PSB:
- fprintf (file,
- _("STC_LP_PSB (store cond linkage pair + signature)\n"));
+ fprintf (file, _(" psect: %u, offset: 0x%08x %08x\n"),
+ (unsigned)bfd_getl32 (buf + 0),
+ (unsigned)bfd_getl32 (buf + 8),
+ (unsigned)bfd_getl32 (buf + 4));
+ break;
+ case ETIR__C_STA_LI:
+ fprintf (file, _("STA_LI (stack literal)\n"));
+ break;
+ case ETIR__C_STA_MOD:
+ fprintf (file, _("STA_MOD (stack module)\n"));
+ break;
+ case ETIR__C_STA_CKARG:
+ fprintf (file, _("STA_CKARG (compare procedure argument)\n"));
+ break;
+
+ case ETIR__C_STO_B:
+ fprintf (file, _("STO_B (store byte)\n"));
+ break;
+ case ETIR__C_STO_W:
+ fprintf (file, _("STO_W (store word)\n"));
+ break;
+ case ETIR__C_STO_LW:
+ fprintf (file, _("STO_LW (store longword)\n"));
+ break;
+ case ETIR__C_STO_QW:
+ fprintf (file, _("STO_QW (store quadword)\n"));
+ break;
+ case ETIR__C_STO_IMMR:
+ {
+ unsigned int len = bfd_getl32 (buf);
+ fprintf (file,
+ _("STO_IMMR (store immediate repeat) %u bytes\n"),
+ len);
+ evax_bfd_print_hex (file, " ", buf + 4, len);
+ sec_len += len;
+ }
+ break;
+ case ETIR__C_STO_GBL:
+ fprintf (file, _("STO_GBL (store global) %.*s\n"),
+ buf[0], buf + 1);
+ break;
+ case ETIR__C_STO_CA:
+ fprintf (file, _("STO_CA (store code address) %.*s\n"),
+ buf[0], buf + 1);
+ break;
+ case ETIR__C_STO_RB:
+ fprintf (file, _("STO_RB (store relative branch)\n"));
+ break;
+ case ETIR__C_STO_AB:
+ fprintf (file, _("STO_AB (store absolute branch)\n"));
+ break;
+ case ETIR__C_STO_OFF:
+ fprintf (file, _("STO_OFF (store offset to psect)\n"));
+ break;
+ case ETIR__C_STO_IMM:
+ {
+ unsigned int len = bfd_getl32 (buf);
+ fprintf (file,
+ _("STO_IMM (store immediate) %u bytes\n"),
+ len);
+ evax_bfd_print_hex (file, " ", buf + 4, len);
+ sec_len += len;
+ }
+ break;
+ case ETIR__C_STO_GBL_LW:
+ fprintf (file, _("STO_GBL_LW (store global longword) %.*s\n"),
+ buf[0], buf + 1);
+ break;
+ case ETIR__C_STO_LP_PSB:
+ fprintf (file, _("STO_OFF (store LP with procedure signature)\n"));
+ break;
+ case ETIR__C_STO_HINT_GBL:
+ fprintf (file, _("STO_BR_GBL (store branch global) *todo*\n"));
+ break;
+ case ETIR__C_STO_HINT_PS:
+ fprintf (file, _("STO_BR_PS (store branch psect + offset) *todo*\n"));
+ break;
+
+ case ETIR__C_OPR_NOP:
+ fprintf (file, _("OPR_NOP (no-operation)\n"));
+ break;
+ case ETIR__C_OPR_ADD:
+ fprintf (file, _("OPR_ADD (add)\n"));
+ break;
+ case ETIR__C_OPR_SUB:
+ fprintf (file, _("OPR_SUB (subtract)\n"));
+ break;
+ case ETIR__C_OPR_MUL:
+ fprintf (file, _("OPR_MUL (multiply)\n"));
+ break;
+ case ETIR__C_OPR_DIV:
+ fprintf (file, _("OPR_DIV (divide)\n"));
+ break;
+ case ETIR__C_OPR_AND:
+ fprintf (file, _("OPR_AND (logical and)\n"));
+ break;
+ case ETIR__C_OPR_IOR:
+ fprintf (file, _("OPR_IOR (logical inclusive or)\n"));
+ break;
+ case ETIR__C_OPR_EOR:
+ fprintf (file, _("OPR_EOR (logical exclusive or)\n"));
+ break;
+ case ETIR__C_OPR_NEG:
+ fprintf (file, _("OPR_NEG (negate)\n"));
+ break;
+ case ETIR__C_OPR_COM:
+ fprintf (file, _("OPR_COM (complement)\n"));
+ break;
+ case ETIR__C_OPR_INSV:
+ fprintf (file, _("OPR_INSV (insert field)\n"));
+ break;
+ case ETIR__C_OPR_ASH:
+ fprintf (file, _("OPR_ASH (arithmetic shift)\n"));
+ break;
+ case ETIR__C_OPR_USH:
+ fprintf (file, _("OPR_USH (unsigned shift)\n"));
+ break;
+ case ETIR__C_OPR_ROT:
+ fprintf (file, _("OPR_ROT (rotate)\n"));
+ break;
+ case ETIR__C_OPR_SEL:
+ fprintf (file, _("OPR_SEL (select)\n"));
+ break;
+ case ETIR__C_OPR_REDEF:
+ fprintf (file, _("OPR_REDEF (redefine symbol to curr location)\n"));
+ break;
+ case ETIR__C_OPR_DFLIT:
+ fprintf (file, _("OPR_REDEF (define a literal)\n"));
+ break;
+
+ case ETIR__C_STC_LP:
+ fprintf (file, _("STC_LP (store cond linkage pair)\n"));
+ break;
+ case ETIR__C_STC_LP_PSB:
+ fprintf (file,
+ _("STC_LP_PSB (store cond linkage pair + signature)\n"));
/* xgettext:c-format */
- fprintf (file, _(" linkage index: %u, procedure: %.*s\n"),
- (unsigned)bfd_getl32 (buf), buf[4], buf + 5);
- buf += 4 + 1 + buf[4];
- fprintf (file, _(" signature: %.*s\n"), buf[0], buf + 1);
- break;
- case ETIR__C_STC_GBL:
- fprintf (file, _("STC_GBL (store cond global)\n"));
+ fprintf (file, _(" linkage index: %u, procedure: %.*s\n"),
+ (unsigned)bfd_getl32 (buf), buf[4], buf + 5);
+ buf += 4 + 1 + buf[4];
+ fprintf (file, _(" signature: %.*s\n"), buf[0], buf + 1);
+ break;
+ case ETIR__C_STC_GBL:
+ fprintf (file, _("STC_GBL (store cond global)\n"));
/* xgettext:c-format */
- fprintf (file, _(" linkage index: %u, global: %.*s\n"),
- (unsigned)bfd_getl32 (buf), buf[4], buf + 5);
- break;
- case ETIR__C_STC_GCA:
- fprintf (file, _("STC_GCA (store cond code address)\n"));
+ fprintf (file, _(" linkage index: %u, global: %.*s\n"),
+ (unsigned)bfd_getl32 (buf), buf[4], buf + 5);
+ break;
+ case ETIR__C_STC_GCA:
+ fprintf (file, _("STC_GCA (store cond code address)\n"));
/* xgettext:c-format */
- fprintf (file, _(" linkage index: %u, procedure name: %.*s\n"),
- (unsigned)bfd_getl32 (buf), buf[4], buf + 5);
- break;
- case ETIR__C_STC_PS:
- fprintf (file, _("STC_PS (store cond psect + offset)\n"));
- fprintf (file,
+ fprintf (file, _(" linkage index: %u, procedure name: %.*s\n"),
+ (unsigned)bfd_getl32 (buf), buf[4], buf + 5);
+ break;
+ case ETIR__C_STC_PS:
+ fprintf (file, _("STC_PS (store cond psect + offset)\n"));
+ fprintf (file,
/* xgettext:c-format */
- _(" linkage index: %u, psect: %u, offset: 0x%08x %08x\n"),
- (unsigned)bfd_getl32 (buf),
- (unsigned)bfd_getl32 (buf + 4),
- (unsigned)bfd_getl32 (buf + 12),
- (unsigned)bfd_getl32 (buf + 8));
- break;
- case ETIR__C_STC_NOP_GBL:
- fprintf (file, _("STC_NOP_GBL (store cond NOP at global addr)\n"));
- evax_bfd_print_etir_stc_ir (file, buf, 0);
- break;
- case ETIR__C_STC_NOP_PS:
- fprintf (file, _("STC_NOP_PS (store cond NOP at psect + offset)\n"));
- evax_bfd_print_etir_stc_ir (file, buf, 1);
- break;
- case ETIR__C_STC_BSR_GBL:
- fprintf (file, _("STC_BSR_GBL (store cond BSR at global addr)\n"));
- evax_bfd_print_etir_stc_ir (file, buf, 0);
- break;
- case ETIR__C_STC_BSR_PS:
- fprintf (file, _("STC_BSR_PS (store cond BSR at psect + offset)\n"));
- evax_bfd_print_etir_stc_ir (file, buf, 1);
- break;
- case ETIR__C_STC_LDA_GBL:
- fprintf (file, _("STC_LDA_GBL (store cond LDA at global addr)\n"));
- evax_bfd_print_etir_stc_ir (file, buf, 0);
- break;
- case ETIR__C_STC_LDA_PS:
- fprintf (file, _("STC_LDA_PS (store cond LDA at psect + offset)\n"));
- evax_bfd_print_etir_stc_ir (file, buf, 1);
- break;
- case ETIR__C_STC_BOH_GBL:
- fprintf (file, _("STC_BOH_GBL (store cond BOH at global addr)\n"));
- evax_bfd_print_etir_stc_ir (file, buf, 0);
- break;
- case ETIR__C_STC_BOH_PS:
- fprintf (file, _("STC_BOH_PS (store cond BOH at psect + offset)\n"));
- evax_bfd_print_etir_stc_ir (file, buf, 1);
- break;
- case ETIR__C_STC_NBH_GBL:
- fprintf (file,
- _("STC_NBH_GBL (store cond or hint at global addr)\n"));
- break;
- case ETIR__C_STC_NBH_PS:
- fprintf (file,
- _("STC_NBH_PS (store cond or hint at psect + offset)\n"));
- break;
-
- case ETIR__C_CTL_SETRB:
- fprintf (file, _("CTL_SETRB (set relocation base)\n"));
- sec_len += 4;
- break;
- case ETIR__C_CTL_AUGRB:
- {
- unsigned int val = bfd_getl32 (buf);
- fprintf (file, _("CTL_AUGRB (augment relocation base) %u\n"), val);
- }
- break;
- case ETIR__C_CTL_DFLOC:
- fprintf (file, _("CTL_DFLOC (define location)\n"));
- break;
- case ETIR__C_CTL_STLOC:
- fprintf (file, _("CTL_STLOC (set location)\n"));
- break;
- case ETIR__C_CTL_STKDL:
- fprintf (file, _("CTL_STKDL (stack defined location)\n"));
- break;
- default:
- fprintf (file, _("*unhandled*\n"));
- break;
- }
+ _(" linkage index: %u, psect: %u, offset: 0x%08x %08x\n"),
+ (unsigned)bfd_getl32 (buf),
+ (unsigned)bfd_getl32 (buf + 4),
+ (unsigned)bfd_getl32 (buf + 12),
+ (unsigned)bfd_getl32 (buf + 8));
+ break;
+ case ETIR__C_STC_NOP_GBL:
+ fprintf (file, _("STC_NOP_GBL (store cond NOP at global addr)\n"));
+ evax_bfd_print_etir_stc_ir (file, buf, 0);
+ break;
+ case ETIR__C_STC_NOP_PS:
+ fprintf (file, _("STC_NOP_PS (store cond NOP at psect + offset)\n"));
+ evax_bfd_print_etir_stc_ir (file, buf, 1);
+ break;
+ case ETIR__C_STC_BSR_GBL:
+ fprintf (file, _("STC_BSR_GBL (store cond BSR at global addr)\n"));
+ evax_bfd_print_etir_stc_ir (file, buf, 0);
+ break;
+ case ETIR__C_STC_BSR_PS:
+ fprintf (file, _("STC_BSR_PS (store cond BSR at psect + offset)\n"));
+ evax_bfd_print_etir_stc_ir (file, buf, 1);
+ break;
+ case ETIR__C_STC_LDA_GBL:
+ fprintf (file, _("STC_LDA_GBL (store cond LDA at global addr)\n"));
+ evax_bfd_print_etir_stc_ir (file, buf, 0);
+ break;
+ case ETIR__C_STC_LDA_PS:
+ fprintf (file, _("STC_LDA_PS (store cond LDA at psect + offset)\n"));
+ evax_bfd_print_etir_stc_ir (file, buf, 1);
+ break;
+ case ETIR__C_STC_BOH_GBL:
+ fprintf (file, _("STC_BOH_GBL (store cond BOH at global addr)\n"));
+ evax_bfd_print_etir_stc_ir (file, buf, 0);
+ break;
+ case ETIR__C_STC_BOH_PS:
+ fprintf (file, _("STC_BOH_PS (store cond BOH at psect + offset)\n"));
+ evax_bfd_print_etir_stc_ir (file, buf, 1);
+ break;
+ case ETIR__C_STC_NBH_GBL:
+ fprintf (file,
+ _("STC_NBH_GBL (store cond or hint at global addr)\n"));
+ break;
+ case ETIR__C_STC_NBH_PS:
+ fprintf (file,
+ _("STC_NBH_PS (store cond or hint at psect + offset)\n"));
+ break;
+
+ case ETIR__C_CTL_SETRB:
+ fprintf (file, _("CTL_SETRB (set relocation base)\n"));
+ sec_len += 4;
+ break;
+ case ETIR__C_CTL_AUGRB:
+ {
+ unsigned int val = bfd_getl32 (buf);
+ fprintf (file, _("CTL_AUGRB (augment relocation base) %u\n"), val);
+ }
+ break;
+ case ETIR__C_CTL_DFLOC:
+ fprintf (file, _("CTL_DFLOC (define location)\n"));
+ break;
+ case ETIR__C_CTL_STLOC:
+ fprintf (file, _("CTL_STLOC (set location)\n"));
+ break;
+ case ETIR__C_CTL_STKDL:
+ fprintf (file, _("CTL_STKDL (stack defined location)\n"));
+ break;
+ default:
+ fprintf (file, _("*unhandled*\n"));
+ break;
+ }
off += size;
}
}
unsigned int type;
if (is_first)
- {
- unsigned char buf[6];
-
- is_first = FALSE;
-
- /* Read 6 bytes. */
- if (bfd_bread (buf, sizeof (buf), abfd) != sizeof (buf))
- {
- fprintf (file, _("cannot read GST record length\n"));
- return;
- }
- rec_len = bfd_getl16 (buf + 0);
- if (rec_len == bfd_getl16 (buf + 4)
- && bfd_getl16 (buf + 2) == EOBJ__C_EMH)
- {
- /* The format is raw: record-size, type, record-size. */
- has_records = TRUE;
- pad_len = (rec_len + 1) & ~1U;
- hdr_size = 4;
- }
- else if (rec_len == EOBJ__C_EMH)
- {
- has_records = FALSE;
- pad_len = bfd_getl16 (buf + 2);
- hdr_size = 6;
- }
- else
- {
- /* Ill-formed. */
- fprintf (file, _("cannot find EMH in first GST record\n"));
- return;
- }
- rec = bfd_malloc (pad_len);
- memcpy (rec, buf + sizeof (buf) - hdr_size, hdr_size);
- }
- else
- {
- unsigned int rec_len2 = 0;
- unsigned char hdr[4];
-
- if (has_records)
- {
- unsigned char buf_len[2];
-
- if (bfd_bread (buf_len, sizeof (buf_len), abfd)
- != sizeof (buf_len))
- {
- fprintf (file, _("cannot read GST record length\n"));
- return;
- }
- rec_len2 = (unsigned)bfd_getl16 (buf_len);
- }
-
- if (bfd_bread (hdr, sizeof (hdr), abfd) != sizeof (hdr))
- {
- fprintf (file, _("cannot read GST record header\n"));
- return;
- }
- rec_len = (unsigned)bfd_getl16 (hdr + 2);
- if (has_records)
- pad_len = (rec_len + 1) & ~1U;
- else
- pad_len = rec_len;
- rec = bfd_malloc (pad_len);
- memcpy (rec, hdr, sizeof (hdr));
- hdr_size = sizeof (hdr);
- if (has_records && rec_len2 != rec_len)
- {
- fprintf (file, _(" corrupted GST\n"));
- break;
- }
- }
+ {
+ unsigned char buf[6];
+
+ is_first = FALSE;
+
+ /* Read 6 bytes. */
+ if (bfd_bread (buf, sizeof (buf), abfd) != sizeof (buf))
+ {
+ fprintf (file, _("cannot read GST record length\n"));
+ return;
+ }
+ rec_len = bfd_getl16 (buf + 0);
+ if (rec_len == bfd_getl16 (buf + 4)
+ && bfd_getl16 (buf + 2) == EOBJ__C_EMH)
+ {
+ /* The format is raw: record-size, type, record-size. */
+ has_records = TRUE;
+ pad_len = (rec_len + 1) & ~1U;
+ hdr_size = 4;
+ }
+ else if (rec_len == EOBJ__C_EMH)
+ {
+ has_records = FALSE;
+ pad_len = bfd_getl16 (buf + 2);
+ hdr_size = 6;
+ }
+ else
+ {
+ /* Ill-formed. */
+ fprintf (file, _("cannot find EMH in first GST record\n"));
+ return;
+ }
+ rec = bfd_malloc (pad_len);
+ memcpy (rec, buf + sizeof (buf) - hdr_size, hdr_size);
+ }
+ else
+ {
+ unsigned int rec_len2 = 0;
+ unsigned char hdr[4];
+
+ if (has_records)
+ {
+ unsigned char buf_len[2];
+
+ if (bfd_bread (buf_len, sizeof (buf_len), abfd)
+ != sizeof (buf_len))
+ {
+ fprintf (file, _("cannot read GST record length\n"));
+ return;
+ }
+ rec_len2 = (unsigned)bfd_getl16 (buf_len);
+ }
+
+ if (bfd_bread (hdr, sizeof (hdr), abfd) != sizeof (hdr))
+ {
+ fprintf (file, _("cannot read GST record header\n"));
+ return;
+ }
+ rec_len = (unsigned)bfd_getl16 (hdr + 2);
+ if (has_records)
+ pad_len = (rec_len + 1) & ~1U;
+ else
+ pad_len = rec_len;
+ rec = bfd_malloc (pad_len);
+ memcpy (rec, hdr, sizeof (hdr));
+ hdr_size = sizeof (hdr);
+ if (has_records && rec_len2 != rec_len)
+ {
+ fprintf (file, _(" corrupted GST\n"));
+ break;
+ }
+ }
if (bfd_bread (rec + hdr_size, pad_len - hdr_size, abfd)
- != pad_len - hdr_size)
- {
- fprintf (file, _("cannot read GST record\n"));
- return;
- }
+ != pad_len - hdr_size)
+ {
+ fprintf (file, _("cannot read GST record\n"));
+ return;
+ }
type = (unsigned)bfd_getl16 (rec);
switch (type)
- {
- case EOBJ__C_EMH:
- evax_bfd_print_emh (file, rec, rec_len);
- break;
- case EOBJ__C_EGSD:
- evax_bfd_print_egsd (file, rec, rec_len);
- break;
- case EOBJ__C_EEOM:
- evax_bfd_print_eeom (file, rec, rec_len);
- free (rec);
- return;
- break;
- case EOBJ__C_ETIR:
- evax_bfd_print_etir (file, "ETIR", rec, rec_len);
- break;
- case EOBJ__C_EDBG:
- evax_bfd_print_etir (file, "EDBG", rec, rec_len);
- break;
- case EOBJ__C_ETBT:
- evax_bfd_print_etir (file, "ETBT", rec, rec_len);
- break;
- default:
- fprintf (file, _(" unhandled EOBJ record type %u\n"), type);
- break;
- }
+ {
+ case EOBJ__C_EMH:
+ evax_bfd_print_emh (file, rec, rec_len);
+ break;
+ case EOBJ__C_EGSD:
+ evax_bfd_print_egsd (file, rec, rec_len);
+ break;
+ case EOBJ__C_EEOM:
+ evax_bfd_print_eeom (file, rec, rec_len);
+ free (rec);
+ return;
+ break;
+ case EOBJ__C_ETIR:
+ evax_bfd_print_etir (file, "ETIR", rec, rec_len);
+ break;
+ case EOBJ__C_EDBG:
+ evax_bfd_print_etir (file, "EDBG", rec, rec_len);
+ break;
+ case EOBJ__C_ETBT:
+ evax_bfd_print_etir (file, "ETBT", rec, rec_len);
+ break;
+ default:
+ fprintf (file, _(" unhandled EOBJ record type %u\n"), type);
+ break;
+ }
free (rec);
}
}
static void
evax_bfd_print_relocation_records (FILE *file, const unsigned char *rel,
- unsigned int stride)
+ unsigned int stride)
{
while (1)
{
count = bfd_getl32 (rel + 0);
if (count == 0)
- break;
+ break;
base = bfd_getl32 (rel + 4);
/* xgettext:c-format */
fprintf (file, _(" bitcount: %u, base addr: 0x%08x\n"),
- count, base);
+ count, base);
rel += 8;
for (j = 0; count > 0; j += 4, count -= 32)
- {
- unsigned int k;
- unsigned int n = 0;
- unsigned int val;
+ {
+ unsigned int k;
+ unsigned int n = 0;
+ unsigned int val;
- val = bfd_getl32 (rel);
- rel += 4;
+ val = bfd_getl32 (rel);
+ rel += 4;
/* xgettext:c-format */
- fprintf (file, _(" bitmap: 0x%08x (count: %u):\n"), val, count);
-
- for (k = 0; k < 32; k++)
- if (val & (1 << k))
- {
- if (n == 0)
- fputs (" ", file);
- fprintf (file, _(" %08x"), base + (j * 8 + k) * stride);
- n++;
- if (n == 8)
- {
- fputs ("\n", file);
- n = 0;
- }
- }
- if (n)
- fputs ("\n", file);
- }
+ fprintf (file, _(" bitmap: 0x%08x (count: %u):\n"), val, count);
+
+ for (k = 0; k < 32; k++)
+ if (val & (1 << k))
+ {
+ if (n == 0)
+ fputs (" ", file);
+ fprintf (file, _(" %08x"), base + (j * 8 + k) * stride);
+ n++;
+ if (n == 8)
+ {
+ fputs ("\n", file);
+ n = 0;
+ }
+ }
+ if (n)
+ fputs ("\n", file);
+ }
}
}
count = bfd_getl32 (rel + 0);
if (count == 0)
- return;
+ return;
/* xgettext:c-format */
fprintf (file, _(" image %u (%u entries)\n"),
- (unsigned)bfd_getl32 (rel + 4), count);
+ (unsigned)bfd_getl32 (rel + 4), count);
rel += 8;
for (j = 0; j < count; j++)
- {
+ {
/* xgettext:c-format */
- fprintf (file, _(" offset: 0x%08x, val: 0x%08x\n"),
- (unsigned)bfd_getl32 (rel + 0),
- (unsigned)bfd_getl32 (rel + 4));
- rel += 8;
- }
+ fprintf (file, _(" offset: 0x%08x, val: 0x%08x\n"),
+ (unsigned)bfd_getl32 (rel + 0),
+ (unsigned)bfd_getl32 (rel + 4));
+ rel += 8;
+ }
}
}
count = bfd_getl32 (rel + 0);
if (count == 0)
- break;
+ break;
/* xgettext:c-format */
fprintf (file, _(" image %u (%u entries), offsets:\n"),
- (unsigned)bfd_getl32 (rel + 4), count);
+ (unsigned)bfd_getl32 (rel + 4), count);
rel += 8;
for (j = 0; j < count; j++)
- {
- if (n == 0)
- fputs (" ", file);
- fprintf (file, _(" 0x%08x"), (unsigned)bfd_getl32 (rel));
- n++;
- if (n == 7)
- {
- fputs ("\n", file);
- n = 0;
- }
- rel += 4;
- }
+ {
+ if (n == 0)
+ fputs (" ", file);
+ fprintf (file, _(" 0x%08x"), (unsigned)bfd_getl32 (rel));
+ n++;
+ if (n == 7)
+ {
+ fputs ("\n", file);
+ n = 0;
+ }
+ rel += 4;
+ }
if (n)
- fputs ("\n", file);
+ fputs ("\n", file);
}
}
{
/* xgettext:c-format */
fprintf (file, _("class: %u, dtype: %u, length: %u, pointer: 0x%08x\n"),
- bclass, dtype, len, pointer);
+ bclass, dtype, len, pointer);
switch (bclass)
- {
- case DSC__K_CLASS_NCA:
- {
- const struct vms_dsc_nca *dsc = (const void *)buf;
- unsigned int i;
- const unsigned char *b;
-
- evax_bfd_print_indent (indent, file);
- fprintf (file, _("non-contiguous array of %s\n"),
- evax_bfd_get_dsc_name (dsc->dtype));
- evax_bfd_print_indent (indent + 1, file);
- fprintf (file,
+ {
+ case DSC__K_CLASS_NCA:
+ {
+ const struct vms_dsc_nca *dsc = (const void *)buf;
+ unsigned int i;
+ const unsigned char *b;
+
+ evax_bfd_print_indent (indent, file);
+ fprintf (file, _("non-contiguous array of %s\n"),
+ evax_bfd_get_dsc_name (dsc->dtype));
+ evax_bfd_print_indent (indent + 1, file);
+ fprintf (file,
/* xgettext:c-format */
- _("dimct: %u, aflags: 0x%02x, digits: %u, scale: %u\n"),
- dsc->dimct, dsc->aflags, dsc->digits, dsc->scale);
- evax_bfd_print_indent (indent + 1, file);
- fprintf (file,
+ _("dimct: %u, aflags: 0x%02x, digits: %u, scale: %u\n"),
+ dsc->dimct, dsc->aflags, dsc->digits, dsc->scale);
+ evax_bfd_print_indent (indent + 1, file);
+ fprintf (file,
/* xgettext:c-format */
- _("arsize: %u, a0: 0x%08x\n"),
- (unsigned)bfd_getl32 (dsc->arsize),
- (unsigned)bfd_getl32 (dsc->a0));
- evax_bfd_print_indent (indent + 1, file);
- fprintf (file, _("Strides:\n"));
- b = buf + sizeof (*dsc);
- for (i = 0; i < dsc->dimct; i++)
- {
- evax_bfd_print_indent (indent + 2, file);
- fprintf (file, "[%u]: %u\n", i + 1,
- (unsigned)bfd_getl32 (b));
- b += 4;
- }
- evax_bfd_print_indent (indent + 1, file);
- fprintf (file, _("Bounds:\n"));
- b = buf + sizeof (*dsc);
- for (i = 0; i < dsc->dimct; i++)
- {
- evax_bfd_print_indent (indent + 2, file);
+ _("arsize: %u, a0: 0x%08x\n"),
+ (unsigned)bfd_getl32 (dsc->arsize),
+ (unsigned)bfd_getl32 (dsc->a0));
+ evax_bfd_print_indent (indent + 1, file);
+ fprintf (file, _("Strides:\n"));
+ b = buf + sizeof (*dsc);
+ for (i = 0; i < dsc->dimct; i++)
+ {
+ evax_bfd_print_indent (indent + 2, file);
+ fprintf (file, "[%u]: %u\n", i + 1,
+ (unsigned)bfd_getl32 (b));
+ b += 4;
+ }
+ evax_bfd_print_indent (indent + 1, file);
+ fprintf (file, _("Bounds:\n"));
+ b = buf + sizeof (*dsc);
+ for (i = 0; i < dsc->dimct; i++)
+ {
+ evax_bfd_print_indent (indent + 2, file);
/* xgettext:c-format */
- fprintf (file, _("[%u]: Lower: %u, upper: %u\n"), i + 1,
- (unsigned)bfd_getl32 (b + 0),
- (unsigned)bfd_getl32 (b + 4));
- b += 8;
- }
- }
- break;
- case DSC__K_CLASS_UBS:
- {
- const struct vms_dsc_ubs *ubs = (const void *)buf;
-
- evax_bfd_print_indent (indent, file);
- fprintf (file, _("unaligned bit-string of %s\n"),
- evax_bfd_get_dsc_name (ubs->dtype));
- evax_bfd_print_indent (indent + 1, file);
- fprintf (file,
+ fprintf (file, _("[%u]: Lower: %u, upper: %u\n"), i + 1,
+ (unsigned)bfd_getl32 (b + 0),
+ (unsigned)bfd_getl32 (b + 4));
+ b += 8;
+ }
+ }
+ break;
+ case DSC__K_CLASS_UBS:
+ {
+ const struct vms_dsc_ubs *ubs = (const void *)buf;
+
+ evax_bfd_print_indent (indent, file);
+ fprintf (file, _("unaligned bit-string of %s\n"),
+ evax_bfd_get_dsc_name (ubs->dtype));
+ evax_bfd_print_indent (indent + 1, file);
+ fprintf (file,
/* xgettext:c-format */
- _("base: %u, pos: %u\n"),
- (unsigned)bfd_getl32 (ubs->base),
- (unsigned)bfd_getl32 (ubs->pos));
- }
- break;
- default:
- fprintf (file, _("*unhandled*\n"));
- break;
- }
+ _("base: %u, pos: %u\n"),
+ (unsigned)bfd_getl32 (ubs->base),
+ (unsigned)bfd_getl32 (ubs->pos));
+ }
+ break;
+ default:
+ fprintf (file, _("*unhandled*\n"));
+ break;
+ }
}
}
default:
/* xgettext:c-format */
fprintf (file, _("(reg: %u, disp: %u, indir: %u, kind: "),
- (vflags & DST__K_REGNUM_MASK) >> DST__K_REGNUM_SHIFT,
- vflags & DST__K_DISP ? 1 : 0,
- vflags & DST__K_INDIR ? 1 : 0);
+ (vflags & DST__K_REGNUM_MASK) >> DST__K_REGNUM_SHIFT,
+ vflags & DST__K_DISP ? 1 : 0,
+ vflags & DST__K_INDIR ? 1 : 0);
switch (vflags & DST__K_VALKIND_MASK)
- {
- case DST__K_VALKIND_LITERAL:
- fputs (_("literal"), file);
- break;
- case DST__K_VALKIND_ADDR:
- fputs (_("address"), file);
- break;
- case DST__K_VALKIND_DESC:
- fputs (_("desc"), file);
- break;
- case DST__K_VALKIND_REG:
- fputs (_("reg"), file);
- break;
- }
+ {
+ case DST__K_VALKIND_LITERAL:
+ fputs (_("literal"), file);
+ break;
+ case DST__K_VALKIND_ADDR:
+ fputs (_("address"), file);
+ break;
+ case DST__K_VALKIND_DESC:
+ fputs (_("desc"), file);
+ break;
+ case DST__K_VALKIND_REG:
+ fputs (_("reg"), file);
+ break;
+ }
fputs (")\n", file);
break;
}
case DST__K_TS_ATOM:
/* xgettext:c-format */
fprintf (file, _("atomic, type=0x%02x %s\n"),
- buf[0], evax_bfd_get_dsc_name (buf[0]));
+ buf[0], evax_bfd_get_dsc_name (buf[0]));
break;
case DST__K_TS_IND:
fprintf (file, _("indirect, defined at 0x%08x\n"),
- (unsigned)bfd_getl32 (buf));
+ (unsigned)bfd_getl32 (buf));
break;
case DST__K_TS_TPTR:
fprintf (file, _("typed pointer\n"));
break;
case DST__K_TS_ARRAY:
{
- const unsigned char *vs;
- unsigned int vec_len;
- unsigned int i;
-
- fprintf (file, _("array, dim: %u, bitmap: "), buf[0]);
- vec_len = (buf[0] + 1 + 7) / 8;
- for (i = 0; i < vec_len; i++)
- fprintf (file, " %02x", buf[i + 1]);
- fputc ('\n', file);
- vs = buf + 1 + vec_len;
- evax_bfd_print_indent (indent, file);
- fprintf (file, _("array descriptor:\n"));
- vs += evax_bfd_print_valspec (vs, indent + 1, file);
- for (i = 0; i < buf[0] + 1U; i++)
- if (buf[1 + i / 8] & (1 << (i % 8)))
- {
- evax_bfd_print_indent (indent, file);
- if (i == 0)
- fprintf (file, _("type spec for element:\n"));
- else
- fprintf (file, _("type spec for subscript %u:\n"), i);
- evax_bfd_print_typspec (vs, indent + 1, file);
- vs += bfd_getl16 (vs);
- }
+ const unsigned char *vs;
+ unsigned int vec_len;
+ unsigned int i;
+
+ fprintf (file, _("array, dim: %u, bitmap: "), buf[0]);
+ vec_len = (buf[0] + 1 + 7) / 8;
+ for (i = 0; i < vec_len; i++)
+ fprintf (file, " %02x", buf[i + 1]);
+ fputc ('\n', file);
+ vs = buf + 1 + vec_len;
+ evax_bfd_print_indent (indent, file);
+ fprintf (file, _("array descriptor:\n"));
+ vs += evax_bfd_print_valspec (vs, indent + 1, file);
+ for (i = 0; i < buf[0] + 1U; i++)
+ if (buf[1 + i / 8] & (1 << (i % 8)))
+ {
+ evax_bfd_print_indent (indent, file);
+ if (i == 0)
+ fprintf (file, _("type spec for element:\n"));
+ else
+ fprintf (file, _("type spec for subscript %u:\n"), i);
+ evax_bfd_print_typspec (vs, indent + 1, file);
+ vs += bfd_getl16 (vs);
+ }
}
break;
default:
unsigned char *buf;
if (bfd_bread (&dsth, sizeof (dsth), abfd) != sizeof (dsth))
- {
- fprintf (file, _("cannot read DST header\n"));
- return;
- }
+ {
+ fprintf (file, _("cannot read DST header\n"));
+ return;
+ }
len = bfd_getl16 (dsth.length);
type = bfd_getl16 (dsth.type);
/* xgettext:c-format */
fprintf (file, _(" type: %3u, len: %3u (at 0x%08x): "),
- type, len, off);
+ type, len, off);
if (len == 0)
- {
- fputc ('\n', file);
- break;
- }
+ {
+ fputc ('\n', file);
+ break;
+ }
len++;
dst_size -= len;
off += len;
len -= sizeof (dsth);
buf = bfd_malloc (len);
if (bfd_bread (buf, len, abfd) != len)
- {
- fprintf (file, _("cannot read DST symbol\n"));
- return;
- }
+ {
+ fprintf (file, _("cannot read DST symbol\n"));
+ return;
+ }
switch (type)
- {
- case DSC__K_DTYPE_V:
- case DSC__K_DTYPE_BU:
- case DSC__K_DTYPE_WU:
- case DSC__K_DTYPE_LU:
- case DSC__K_DTYPE_QU:
- case DSC__K_DTYPE_B:
- case DSC__K_DTYPE_W:
- case DSC__K_DTYPE_L:
- case DSC__K_DTYPE_Q:
- case DSC__K_DTYPE_F:
- case DSC__K_DTYPE_D:
- case DSC__K_DTYPE_FC:
- case DSC__K_DTYPE_DC:
- case DSC__K_DTYPE_T:
- case DSC__K_DTYPE_NU:
- case DSC__K_DTYPE_NL:
- case DSC__K_DTYPE_NLO:
- case DSC__K_DTYPE_NR:
- case DSC__K_DTYPE_NRO:
- case DSC__K_DTYPE_NZ:
- case DSC__K_DTYPE_P:
- case DSC__K_DTYPE_ZI:
- case DSC__K_DTYPE_ZEM:
- case DSC__K_DTYPE_DSC:
- case DSC__K_DTYPE_OU:
- case DSC__K_DTYPE_O:
- case DSC__K_DTYPE_G:
- case DSC__K_DTYPE_H:
- case DSC__K_DTYPE_GC:
- case DSC__K_DTYPE_HC:
- case DSC__K_DTYPE_CIT:
- case DSC__K_DTYPE_BPV:
- case DSC__K_DTYPE_BLV:
- case DSC__K_DTYPE_VU:
- case DSC__K_DTYPE_ADT:
- case DSC__K_DTYPE_VT:
- case DSC__K_DTYPE_T2:
- case DSC__K_DTYPE_VT2:
- fprintf (file, _("standard data: %s\n"),
- evax_bfd_get_dsc_name (type));
- evax_bfd_print_valspec (buf, 4, file);
- fprintf (file, _(" name: %.*s\n"), buf[5], buf + 6);
- break;
- case DST__K_MODBEG:
- {
- struct vms_dst_modbeg *dst = (void *)buf;
- const char *name = (const char *)buf + sizeof (*dst);
-
- fprintf (file, _("modbeg\n"));
+ {
+ case DSC__K_DTYPE_V:
+ case DSC__K_DTYPE_BU:
+ case DSC__K_DTYPE_WU:
+ case DSC__K_DTYPE_LU:
+ case DSC__K_DTYPE_QU:
+ case DSC__K_DTYPE_B:
+ case DSC__K_DTYPE_W:
+ case DSC__K_DTYPE_L:
+ case DSC__K_DTYPE_Q:
+ case DSC__K_DTYPE_F:
+ case DSC__K_DTYPE_D:
+ case DSC__K_DTYPE_FC:
+ case DSC__K_DTYPE_DC:
+ case DSC__K_DTYPE_T:
+ case DSC__K_DTYPE_NU:
+ case DSC__K_DTYPE_NL:
+ case DSC__K_DTYPE_NLO:
+ case DSC__K_DTYPE_NR:
+ case DSC__K_DTYPE_NRO:
+ case DSC__K_DTYPE_NZ:
+ case DSC__K_DTYPE_P:
+ case DSC__K_DTYPE_ZI:
+ case DSC__K_DTYPE_ZEM:
+ case DSC__K_DTYPE_DSC:
+ case DSC__K_DTYPE_OU:
+ case DSC__K_DTYPE_O:
+ case DSC__K_DTYPE_G:
+ case DSC__K_DTYPE_H:
+ case DSC__K_DTYPE_GC:
+ case DSC__K_DTYPE_HC:
+ case DSC__K_DTYPE_CIT:
+ case DSC__K_DTYPE_BPV:
+ case DSC__K_DTYPE_BLV:
+ case DSC__K_DTYPE_VU:
+ case DSC__K_DTYPE_ADT:
+ case DSC__K_DTYPE_VT:
+ case DSC__K_DTYPE_T2:
+ case DSC__K_DTYPE_VT2:
+ fprintf (file, _("standard data: %s\n"),
+ evax_bfd_get_dsc_name (type));
+ evax_bfd_print_valspec (buf, 4, file);
+ fprintf (file, _(" name: %.*s\n"), buf[5], buf + 6);
+ break;
+ case DST__K_MODBEG:
+ {
+ struct vms_dst_modbeg *dst = (void *)buf;
+ const char *name = (const char *)buf + sizeof (*dst);
+
+ fprintf (file, _("modbeg\n"));
/* xgettext:c-format */
- fprintf (file, _(" flags: %d, language: %u, "
- "major: %u, minor: %u\n"),
- dst->flags,
- (unsigned)bfd_getl32 (dst->language),
- (unsigned)bfd_getl16 (dst->major),
- (unsigned)bfd_getl16 (dst->minor));
- fprintf (file, _(" module name: %.*s\n"),
- name[0], name + 1);
- name += name[0] + 1;
- fprintf (file, _(" compiler : %.*s\n"),
- name[0], name + 1);
- }
- break;
- case DST__K_MODEND:
- fprintf (file, _("modend\n"));
- break;
- case DST__K_RTNBEG:
- {
- struct vms_dst_rtnbeg *dst = (void *)buf;
- const char *name = (const char *)buf + sizeof (*dst);
-
- fputs (_("rtnbeg\n"), file);
+ fprintf (file, _(" flags: %d, language: %u, "
+ "major: %u, minor: %u\n"),
+ dst->flags,
+ (unsigned)bfd_getl32 (dst->language),
+ (unsigned)bfd_getl16 (dst->major),
+ (unsigned)bfd_getl16 (dst->minor));
+ fprintf (file, _(" module name: %.*s\n"),
+ name[0], name + 1);
+ name += name[0] + 1;
+ fprintf (file, _(" compiler : %.*s\n"),
+ name[0], name + 1);
+ }
+ break;
+ case DST__K_MODEND:
+ fprintf (file, _("modend\n"));
+ break;
+ case DST__K_RTNBEG:
+ {
+ struct vms_dst_rtnbeg *dst = (void *)buf;
+ const char *name = (const char *)buf + sizeof (*dst);
+
+ fputs (_("rtnbeg\n"), file);
/* xgettext:c-format */
- fprintf (file, _(" flags: %u, address: 0x%08x, "
- "pd-address: 0x%08x\n"),
- dst->flags,
- (unsigned)bfd_getl32 (dst->address),
- (unsigned)bfd_getl32 (dst->pd_address));
- fprintf (file, _(" routine name: %.*s\n"),
- name[0], name + 1);
- }
- break;
- case DST__K_RTNEND:
- {
- struct vms_dst_rtnend *dst = (void *)buf;
-
- fprintf (file, _("rtnend: size 0x%08x\n"),
- (unsigned)bfd_getl32 (dst->size));
- }
- break;
- case DST__K_PROLOG:
- {
- struct vms_dst_prolog *dst = (void *)buf;
-
- fprintf (file, _("prolog: bkpt address 0x%08x\n"),
- (unsigned)bfd_getl32 (dst->bkpt_addr));
- }
- break;
- case DST__K_EPILOG:
- {
- struct vms_dst_epilog *dst = (void *)buf;
+ fprintf (file, _(" flags: %u, address: 0x%08x, "
+ "pd-address: 0x%08x\n"),
+ dst->flags,
+ (unsigned)bfd_getl32 (dst->address),
+ (unsigned)bfd_getl32 (dst->pd_address));
+ fprintf (file, _(" routine name: %.*s\n"),
+ name[0], name + 1);
+ }
+ break;
+ case DST__K_RTNEND:
+ {
+ struct vms_dst_rtnend *dst = (void *)buf;
+
+ fprintf (file, _("rtnend: size 0x%08x\n"),
+ (unsigned)bfd_getl32 (dst->size));
+ }
+ break;
+ case DST__K_PROLOG:
+ {
+ struct vms_dst_prolog *dst = (void *)buf;
+
+ fprintf (file, _("prolog: bkpt address 0x%08x\n"),
+ (unsigned)bfd_getl32 (dst->bkpt_addr));
+ }
+ break;
+ case DST__K_EPILOG:
+ {
+ struct vms_dst_epilog *dst = (void *)buf;
/* xgettext:c-format */
- fprintf (file, _("epilog: flags: %u, count: %u\n"),
- dst->flags, (unsigned)bfd_getl32 (dst->count));
- }
- break;
- case DST__K_BLKBEG:
- {
- struct vms_dst_blkbeg *dst = (void *)buf;
- const char *name = (const char *)buf + sizeof (*dst);
+ fprintf (file, _("epilog: flags: %u, count: %u\n"),
+ dst->flags, (unsigned)bfd_getl32 (dst->count));
+ }
+ break;
+ case DST__K_BLKBEG:
+ {
+ struct vms_dst_blkbeg *dst = (void *)buf;
+ const char *name = (const char *)buf + sizeof (*dst);
/* xgettext:c-format */
- fprintf (file, _("blkbeg: address: 0x%08x, name: %.*s\n"),
- (unsigned)bfd_getl32 (dst->address),
- name[0], name + 1);
- }
- break;
- case DST__K_BLKEND:
- {
- struct vms_dst_blkend *dst = (void *)buf;
-
- fprintf (file, _("blkend: size: 0x%08x\n"),
- (unsigned)bfd_getl32 (dst->size));
- }
- break;
- case DST__K_TYPSPEC:
- {
- fprintf (file, _("typspec (len: %u)\n"), len);
- fprintf (file, _(" name: %.*s\n"), buf[0], buf + 1);
- evax_bfd_print_typspec (buf + 1 + buf[0], 5, file);
- }
- break;
- case DST__K_SEPTYP:
- {
- fprintf (file, _("septyp, name: %.*s\n"), buf[5], buf + 6);
- evax_bfd_print_valspec (buf, 4, file);
- }
- break;
- case DST__K_RECBEG:
- {
- struct vms_dst_recbeg *recbeg = (void *)buf;
- const char *name = (const char *)buf + sizeof (*recbeg);
-
- fprintf (file, _("recbeg: name: %.*s\n"), name[0], name + 1);
- evax_bfd_print_valspec (buf, 4, file);
- fprintf (file, _(" len: %u bits\n"),
- (unsigned)bfd_getl32 (name + 1 + name[0]));
- }
- break;
- case DST__K_RECEND:
- fprintf (file, _("recend\n"));
- break;
- case DST__K_ENUMBEG:
+ fprintf (file, _("blkbeg: address: 0x%08x, name: %.*s\n"),
+ (unsigned)bfd_getl32 (dst->address),
+ name[0], name + 1);
+ }
+ break;
+ case DST__K_BLKEND:
+ {
+ struct vms_dst_blkend *dst = (void *)buf;
+
+ fprintf (file, _("blkend: size: 0x%08x\n"),
+ (unsigned)bfd_getl32 (dst->size));
+ }
+ break;
+ case DST__K_TYPSPEC:
+ {
+ fprintf (file, _("typspec (len: %u)\n"), len);
+ fprintf (file, _(" name: %.*s\n"), buf[0], buf + 1);
+ evax_bfd_print_typspec (buf + 1 + buf[0], 5, file);
+ }
+ break;
+ case DST__K_SEPTYP:
+ {
+ fprintf (file, _("septyp, name: %.*s\n"), buf[5], buf + 6);
+ evax_bfd_print_valspec (buf, 4, file);
+ }
+ break;
+ case DST__K_RECBEG:
+ {
+ struct vms_dst_recbeg *recbeg = (void *)buf;
+ const char *name = (const char *)buf + sizeof (*recbeg);
+
+ fprintf (file, _("recbeg: name: %.*s\n"), name[0], name + 1);
+ evax_bfd_print_valspec (buf, 4, file);
+ fprintf (file, _(" len: %u bits\n"),
+ (unsigned)bfd_getl32 (name + 1 + name[0]));
+ }
+ break;
+ case DST__K_RECEND:
+ fprintf (file, _("recend\n"));
+ break;
+ case DST__K_ENUMBEG:
/* xgettext:c-format */
- fprintf (file, _("enumbeg, len: %u, name: %.*s\n"),
- buf[0], buf[1], buf + 2);
- break;
- case DST__K_ENUMELT:
- fprintf (file, _("enumelt, name: %.*s\n"), buf[5], buf + 6);
- evax_bfd_print_valspec (buf, 4, file);
- break;
- case DST__K_ENUMEND:
- fprintf (file, _("enumend\n"));
- break;
- case DST__K_LABEL:
- {
- struct vms_dst_label *lab = (void *)buf;
- fprintf (file, _("label, name: %.*s\n"),
- lab->name[0], lab->name + 1);
- fprintf (file, _(" address: 0x%08x\n"),
- (unsigned)bfd_getl32 (lab->value));
- }
- break;
- case DST__K_DIS_RANGE:
- {
- unsigned int cnt = bfd_getl32 (buf);
- unsigned char *rng = buf + 4;
- unsigned int i;
-
- fprintf (file, _("discontiguous range (nbr: %u)\n"), cnt);
- for (i = 0; i < cnt; i++, rng += 8)
+ fprintf (file, _("enumbeg, len: %u, name: %.*s\n"),
+ buf[0], buf[1], buf + 2);
+ break;
+ case DST__K_ENUMELT:
+ fprintf (file, _("enumelt, name: %.*s\n"), buf[5], buf + 6);
+ evax_bfd_print_valspec (buf, 4, file);
+ break;
+ case DST__K_ENUMEND:
+ fprintf (file, _("enumend\n"));
+ break;
+ case DST__K_LABEL:
+ {
+ struct vms_dst_label *lab = (void *)buf;
+ fprintf (file, _("label, name: %.*s\n"),
+ lab->name[0], lab->name + 1);
+ fprintf (file, _(" address: 0x%08x\n"),
+ (unsigned)bfd_getl32 (lab->value));
+ }
+ break;
+ case DST__K_DIS_RANGE:
+ {
+ unsigned int cnt = bfd_getl32 (buf);
+ unsigned char *rng = buf + 4;
+ unsigned int i;
+
+ fprintf (file, _("discontiguous range (nbr: %u)\n"), cnt);
+ for (i = 0; i < cnt; i++, rng += 8)
/* xgettext:c-format */
- fprintf (file, _(" address: 0x%08x, size: %u\n"),
- (unsigned)bfd_getl32 (rng),
- (unsigned)bfd_getl32 (rng + 4));
-
- }
- break;
- case DST__K_LINE_NUM:
- {
- unsigned char *buf_orig = buf;
-
- fprintf (file, _("line num (len: %u)\n"), len);
-
- while (len > 0)
- {
- signed char cmd;
- unsigned char cmdlen;
- unsigned int val;
-
- cmd = buf[0];
- cmdlen = 0;
-
- fputs (" ", file);
-
- switch (cmd)
- {
- case DST__K_DELTA_PC_W:
- val = bfd_getl16 (buf + 1);
- fprintf (file, _("delta_pc_w %u\n"), val);
- pc += val;
- line++;
- cmdlen = 3;
- break;
- case DST__K_INCR_LINUM:
- val = buf[1];
- fprintf (file, _("incr_linum(b): +%u\n"), val);
- line += val;
- cmdlen = 2;
- break;
- case DST__K_INCR_LINUM_W:
- val = bfd_getl16 (buf + 1);
- fprintf (file, _("incr_linum_w: +%u\n"), val);
- line += val;
- cmdlen = 3;
- break;
- case DST__K_INCR_LINUM_L:
- val = bfd_getl32 (buf + 1);
- fprintf (file, _("incr_linum_l: +%u\n"), val);
- line += val;
- cmdlen = 5;
- break;
- case DST__K_SET_LINUM:
- line = bfd_getl16 (buf + 1);
- fprintf (file, _("set_line_num(w) %u\n"), line);
- cmdlen = 3;
- break;
- case DST__K_SET_LINUM_B:
- line = buf[1];
- fprintf (file, _("set_line_num_b %u\n"), line);
- cmdlen = 2;
- break;
- case DST__K_SET_LINUM_L:
- line = bfd_getl32 (buf + 1);
- fprintf (file, _("set_line_num_l %u\n"), line);
- cmdlen = 5;
- break;
- case DST__K_SET_ABS_PC:
- pc = bfd_getl32 (buf + 1);
- fprintf (file, _("set_abs_pc: 0x%08x\n"), pc);
- cmdlen = 5;
- break;
- case DST__K_DELTA_PC_L:
- fprintf (file, _("delta_pc_l: +0x%08x\n"),
- (unsigned)bfd_getl32 (buf + 1));
- cmdlen = 5;
- break;
- case DST__K_TERM:
- fprintf (file, _("term(b): 0x%02x"), buf[1]);
- pc += buf[1];
- fprintf (file, _(" pc: 0x%08x\n"), pc);
- cmdlen = 2;
- break;
- case DST__K_TERM_W:
- val = bfd_getl16 (buf + 1);
- fprintf (file, _("term_w: 0x%04x"), val);
- pc += val;
- fprintf (file, _(" pc: 0x%08x\n"), pc);
- cmdlen = 3;
- break;
- default:
- if (cmd <= 0)
- {
- fprintf (file, _("delta pc +%-4d"), -cmd);
- line++; /* FIXME: curr increment. */
- pc += -cmd;
+ fprintf (file, _(" address: 0x%08x, size: %u\n"),
+ (unsigned)bfd_getl32 (rng),
+ (unsigned)bfd_getl32 (rng + 4));
+
+ }
+ break;
+ case DST__K_LINE_NUM:
+ {
+ unsigned char *buf_orig = buf;
+
+ fprintf (file, _("line num (len: %u)\n"), len);
+
+ while (len > 0)
+ {
+ signed char cmd;
+ unsigned char cmdlen;
+ unsigned int val;
+
+ cmd = buf[0];
+ cmdlen = 0;
+
+ fputs (" ", file);
+
+ switch (cmd)
+ {
+ case DST__K_DELTA_PC_W:
+ val = bfd_getl16 (buf + 1);
+ fprintf (file, _("delta_pc_w %u\n"), val);
+ pc += val;
+ line++;
+ cmdlen = 3;
+ break;
+ case DST__K_INCR_LINUM:
+ val = buf[1];
+ fprintf (file, _("incr_linum(b): +%u\n"), val);
+ line += val;
+ cmdlen = 2;
+ break;
+ case DST__K_INCR_LINUM_W:
+ val = bfd_getl16 (buf + 1);
+ fprintf (file, _("incr_linum_w: +%u\n"), val);
+ line += val;
+ cmdlen = 3;
+ break;
+ case DST__K_INCR_LINUM_L:
+ val = bfd_getl32 (buf + 1);
+ fprintf (file, _("incr_linum_l: +%u\n"), val);
+ line += val;
+ cmdlen = 5;
+ break;
+ case DST__K_SET_LINUM:
+ line = bfd_getl16 (buf + 1);
+ fprintf (file, _("set_line_num(w) %u\n"), line);
+ cmdlen = 3;
+ break;
+ case DST__K_SET_LINUM_B:
+ line = buf[1];
+ fprintf (file, _("set_line_num_b %u\n"), line);
+ cmdlen = 2;
+ break;
+ case DST__K_SET_LINUM_L:
+ line = bfd_getl32 (buf + 1);
+ fprintf (file, _("set_line_num_l %u\n"), line);
+ cmdlen = 5;
+ break;
+ case DST__K_SET_ABS_PC:
+ pc = bfd_getl32 (buf + 1);
+ fprintf (file, _("set_abs_pc: 0x%08x\n"), pc);
+ cmdlen = 5;
+ break;
+ case DST__K_DELTA_PC_L:
+ fprintf (file, _("delta_pc_l: +0x%08x\n"),
+ (unsigned)bfd_getl32 (buf + 1));
+ cmdlen = 5;
+ break;
+ case DST__K_TERM:
+ fprintf (file, _("term(b): 0x%02x"), buf[1]);
+ pc += buf[1];
+ fprintf (file, _(" pc: 0x%08x\n"), pc);
+ cmdlen = 2;
+ break;
+ case DST__K_TERM_W:
+ val = bfd_getl16 (buf + 1);
+ fprintf (file, _("term_w: 0x%04x"), val);
+ pc += val;
+ fprintf (file, _(" pc: 0x%08x\n"), pc);
+ cmdlen = 3;
+ break;
+ default:
+ if (cmd <= 0)
+ {
+ fprintf (file, _("delta pc +%-4d"), -cmd);
+ line++; /* FIXME: curr increment. */
+ pc += -cmd;
/* xgettext:c-format */
- fprintf (file, _(" pc: 0x%08x line: %5u\n"),
- pc, line);
- cmdlen = 1;
- }
- else
- fprintf (file, _(" *unhandled* cmd %u\n"), cmd);
- break;
- }
- if (cmdlen == 0)
- break;
- len -= cmdlen;
- buf += cmdlen;
- }
- buf = buf_orig;
- }
- break;
- case DST__K_SOURCE:
- {
- unsigned char *buf_orig = buf;
-
- fprintf (file, _("source (len: %u)\n"), len);
-
- while (len > 0)
- {
- signed char cmd = buf[0];
- unsigned char cmdlen = 0;
-
- switch (cmd)
- {
- case DST__K_SRC_DECLFILE:
- {
- struct vms_dst_src_decl_src *src = (void *)(buf + 1);
- const char *name;
+ fprintf (file, _(" pc: 0x%08x line: %5u\n"),
+ pc, line);
+ cmdlen = 1;
+ }
+ else
+ fprintf (file, _(" *unhandled* cmd %u\n"), cmd);
+ break;
+ }
+ if (cmdlen == 0)
+ break;
+ len -= cmdlen;
+ buf += cmdlen;
+ }
+ buf = buf_orig;
+ }
+ break;
+ case DST__K_SOURCE:
+ {
+ unsigned char *buf_orig = buf;
+
+ fprintf (file, _("source (len: %u)\n"), len);
+
+ while (len > 0)
+ {
+ signed char cmd = buf[0];
+ unsigned char cmdlen = 0;
+
+ switch (cmd)
+ {
+ case DST__K_SRC_DECLFILE:
+ {
+ struct vms_dst_src_decl_src *src = (void *)(buf + 1);
+ const char *name;
/* xgettext:c-format */
- fprintf (file, _(" declfile: len: %u, flags: %u, "
- "fileid: %u\n"),
- src->length, src->flags,
- (unsigned)bfd_getl16 (src->fileid));
+ fprintf (file, _(" declfile: len: %u, flags: %u, "
+ "fileid: %u\n"),
+ src->length, src->flags,
+ (unsigned)bfd_getl16 (src->fileid));
/* xgettext:c-format */
- fprintf (file, _(" rms: cdt: 0x%08x %08x, "
- "ebk: 0x%08x, ffb: 0x%04x, "
- "rfo: %u\n"),
- (unsigned)bfd_getl32 (src->rms_cdt + 4),
- (unsigned)bfd_getl32 (src->rms_cdt + 0),
- (unsigned)bfd_getl32 (src->rms_ebk),
- (unsigned)bfd_getl16 (src->rms_ffb),
- src->rms_rfo);
- name = (const char *)buf + 1 + sizeof (*src);
- fprintf (file, _(" filename : %.*s\n"),
- name[0], name + 1);
- name += name[0] + 1;
- fprintf (file, _(" module name: %.*s\n"),
- name[0], name + 1);
- cmdlen = 2 + src->length;
- }
- break;
- case DST__K_SRC_SETFILE:
- fprintf (file, _(" setfile %u\n"),
- (unsigned)bfd_getl16 (buf + 1));
- cmdlen = 3;
- break;
- case DST__K_SRC_SETREC_W:
- fprintf (file, _(" setrec %u\n"),
- (unsigned)bfd_getl16 (buf + 1));
- cmdlen = 3;
- break;
- case DST__K_SRC_SETREC_L:
- fprintf (file, _(" setrec %u\n"),
- (unsigned)bfd_getl32 (buf + 1));
- cmdlen = 5;
- break;
- case DST__K_SRC_SETLNUM_W:
- fprintf (file, _(" setlnum %u\n"),
- (unsigned)bfd_getl16 (buf + 1));
- cmdlen = 3;
- break;
- case DST__K_SRC_SETLNUM_L:
- fprintf (file, _(" setlnum %u\n"),
- (unsigned)bfd_getl32 (buf + 1));
- cmdlen = 5;
- break;
- case DST__K_SRC_DEFLINES_W:
- fprintf (file, _(" deflines %u\n"),
- (unsigned)bfd_getl16 (buf + 1));
- cmdlen = 3;
- break;
- case DST__K_SRC_DEFLINES_B:
- fprintf (file, _(" deflines %u\n"), buf[1]);
- cmdlen = 2;
- break;
- case DST__K_SRC_FORMFEED:
- fprintf (file, _(" formfeed\n"));
- cmdlen = 1;
- break;
- default:
- fprintf (file, _(" *unhandled* cmd %u\n"), cmd);
- break;
- }
- if (cmdlen == 0)
- break;
- len -= cmdlen;
- buf += cmdlen;
- }
- buf = buf_orig;
- }
- break;
- default:
- fprintf (file, _("*unhandled* dst type %u\n"), type);
- break;
- }
+ fprintf (file, _(" rms: cdt: 0x%08x %08x, "
+ "ebk: 0x%08x, ffb: 0x%04x, "
+ "rfo: %u\n"),
+ (unsigned)bfd_getl32 (src->rms_cdt + 4),
+ (unsigned)bfd_getl32 (src->rms_cdt + 0),
+ (unsigned)bfd_getl32 (src->rms_ebk),
+ (unsigned)bfd_getl16 (src->rms_ffb),
+ src->rms_rfo);
+ name = (const char *)buf + 1 + sizeof (*src);
+ fprintf (file, _(" filename : %.*s\n"),
+ name[0], name + 1);
+ name += name[0] + 1;
+ fprintf (file, _(" module name: %.*s\n"),
+ name[0], name + 1);
+ cmdlen = 2 + src->length;
+ }
+ break;
+ case DST__K_SRC_SETFILE:
+ fprintf (file, _(" setfile %u\n"),
+ (unsigned)bfd_getl16 (buf + 1));
+ cmdlen = 3;
+ break;
+ case DST__K_SRC_SETREC_W:
+ fprintf (file, _(" setrec %u\n"),
+ (unsigned)bfd_getl16 (buf + 1));
+ cmdlen = 3;
+ break;
+ case DST__K_SRC_SETREC_L:
+ fprintf (file, _(" setrec %u\n"),
+ (unsigned)bfd_getl32 (buf + 1));
+ cmdlen = 5;
+ break;
+ case DST__K_SRC_SETLNUM_W:
+ fprintf (file, _(" setlnum %u\n"),
+ (unsigned)bfd_getl16 (buf + 1));
+ cmdlen = 3;
+ break;
+ case DST__K_SRC_SETLNUM_L:
+ fprintf (file, _(" setlnum %u\n"),
+ (unsigned)bfd_getl32 (buf + 1));
+ cmdlen = 5;
+ break;
+ case DST__K_SRC_DEFLINES_W:
+ fprintf (file, _(" deflines %u\n"),
+ (unsigned)bfd_getl16 (buf + 1));
+ cmdlen = 3;
+ break;
+ case DST__K_SRC_DEFLINES_B:
+ fprintf (file, _(" deflines %u\n"), buf[1]);
+ cmdlen = 2;
+ break;
+ case DST__K_SRC_FORMFEED:
+ fprintf (file, _(" formfeed\n"));
+ cmdlen = 1;
+ break;
+ default:
+ fprintf (file, _(" *unhandled* cmd %u\n"), cmd);
+ break;
+ }
+ if (cmdlen == 0)
+ break;
+ len -= cmdlen;
+ buf += cmdlen;
+ }
+ buf = buf_orig;
+ }
+ break;
+ default:
+ fprintf (file, _("*unhandled* dst type %u\n"), type);
+ break;
+ }
free (buf);
}
}
}
/* xgettext:c-format */
fprintf (file, _("EIHD: (size: %u, nbr blocks: %u)\n"),
- (unsigned)bfd_getl32 (eihd.size),
- (unsigned)bfd_getl32 (eihd.hdrblkcnt));
+ (unsigned)bfd_getl32 (eihd.size),
+ (unsigned)bfd_getl32 (eihd.hdrblkcnt));
/* xgettext:c-format */
fprintf (file, _(" majorid: %u, minorid: %u\n"),
- (unsigned)bfd_getl32 (eihd.majorid),
- (unsigned)bfd_getl32 (eihd.minorid));
+ (unsigned)bfd_getl32 (eihd.majorid),
+ (unsigned)bfd_getl32 (eihd.minorid));
val = (unsigned)bfd_getl32 (eihd.imgtype);
switch (val)
eihs_off = bfd_getl32 (eihd.symdbgoff);
/* xgettext:c-format */
fprintf (file, _(" offsets: isd: %u, activ: %u, symdbg: %u, "
- "imgid: %u, patch: %u\n"),
- eisd_off, eiha_off, eihs_off, eihi_off,
- (unsigned)bfd_getl32 (eihd.patchoff));
+ "imgid: %u, patch: %u\n"),
+ eisd_off, eiha_off, eihs_off, eihi_off,
+ (unsigned)bfd_getl32 (eihd.patchoff));
fprintf (file, _(" fixup info rva: "));
bfd_fprintf_vma (abfd, file, bfd_getl64 (eihd.iafva));
fprintf (file, _(", symbol vector rva: "));
bfd_fprintf_vma (abfd, file, bfd_getl64 (eihd.symvva));
eihvn_off = bfd_getl32 (eihd.version_array_off);
fprintf (file, _("\n"
- " version array off: %u\n"),
- eihvn_off);
+ " version array off: %u\n"),
+ eihvn_off);
fprintf (file,
/* xgettext:c-format */
- _(" img I/O count: %u, nbr channels: %u, req pri: %08x%08x\n"),
- (unsigned)bfd_getl32 (eihd.imgiocnt),
- (unsigned)bfd_getl32 (eihd.iochancnt),
- (unsigned)bfd_getl32 (eihd.privreqs + 4),
- (unsigned)bfd_getl32 (eihd.privreqs + 0));
+ _(" img I/O count: %u, nbr channels: %u, req pri: %08x%08x\n"),
+ (unsigned)bfd_getl32 (eihd.imgiocnt),
+ (unsigned)bfd_getl32 (eihd.iochancnt),
+ (unsigned)bfd_getl32 (eihd.privreqs + 4),
+ (unsigned)bfd_getl32 (eihd.privreqs + 0));
val = (unsigned)bfd_getl32 (eihd.lnkflags);
fprintf (file, _(" linker flags: %08x:"), val);
if (val & EIHD__M_LNKDEBUG)
fprintf (file, "\n");
/* xgettext:c-format */
fprintf (file, _(" ident: 0x%08x, sysver: 0x%08x, "
- "match ctrl: %u, symvect_size: %u\n"),
- (unsigned)bfd_getl32 (eihd.ident),
- (unsigned)bfd_getl32 (eihd.sysver),
- eihd.matchctl,
- (unsigned)bfd_getl32 (eihd.symvect_size));
+ "match ctrl: %u, symvect_size: %u\n"),
+ (unsigned)bfd_getl32 (eihd.ident),
+ (unsigned)bfd_getl32 (eihd.sysver),
+ eihd.matchctl,
+ (unsigned)bfd_getl32 (eihd.symvect_size));
fprintf (file, _(" BPAGE: %u"),
- (unsigned)bfd_getl32 (eihd.virt_mem_block_size));
+ (unsigned)bfd_getl32 (eihd.virt_mem_block_size));
if (val & (EIHD__M_OMV_READY | EIHD__M_EXT_BIND_SECT))
{
eihef_off = bfd_getl32 (eihd.ext_fixup_off);
eihnp_off = bfd_getl32 (eihd.noopt_psect_off);
/* xgettext:c-format */
fprintf (file, _(", ext fixup offset: %u, no_opt psect off: %u"),
- eihef_off, eihnp_off);
+ eihef_off, eihnp_off);
}
fprintf (file, _(", alias: %u\n"), (unsigned)bfd_getl16 (eihd.alias));
fprintf (file, _("system version array information:\n"));
if (bfd_seek (abfd, (file_ptr) eihvn_off, SEEK_SET)
- || bfd_bread (&eihvn, sizeof (eihvn), abfd) != sizeof (eihvn))
- {
- fprintf (file, _("cannot read EIHVN header\n"));
- return;
- }
+ || bfd_bread (&eihvn, sizeof (eihvn), abfd) != sizeof (eihvn))
+ {
+ fprintf (file, _("cannot read EIHVN header\n"));
+ return;
+ }
mask = bfd_getl32 (eihvn.subsystem_mask);
for (j = 0; j < 32; j++)
- if (mask & (1 << j))
- {
- struct vms_eihvn_subversion ver;
- if (bfd_bread (&ver, sizeof (ver), abfd) != sizeof (ver))
- {
- fprintf (file, _("cannot read EIHVN version\n"));
- return;
- }
- fprintf (file, _(" %02u "), j);
- switch (j)
- {
- case EIHVN__BASE_IMAGE_BIT:
+ if (mask & (1 << j))
+ {
+ struct vms_eihvn_subversion ver;
+ if (bfd_bread (&ver, sizeof (ver), abfd) != sizeof (ver))
+ {
+ fprintf (file, _("cannot read EIHVN version\n"));
+ return;
+ }
+ fprintf (file, _(" %02u "), j);
+ switch (j)
+ {
+ case EIHVN__BASE_IMAGE_BIT:
fputs (_("BASE_IMAGE "), file);
- break;
- case EIHVN__MEMORY_MANAGEMENT_BIT:
- fputs (_("MEMORY_MANAGEMENT"), file);
- break;
- case EIHVN__IO_BIT:
- fputs (_("IO "), file);
- break;
- case EIHVN__FILES_VOLUMES_BIT:
- fputs (_("FILES_VOLUMES "), file);
- break;
- case EIHVN__PROCESS_SCHED_BIT:
- fputs (_("PROCESS_SCHED "), file);
- break;
- case EIHVN__SYSGEN_BIT:
+ break;
+ case EIHVN__MEMORY_MANAGEMENT_BIT:
+ fputs (_("MEMORY_MANAGEMENT"), file);
+ break;
+ case EIHVN__IO_BIT:
+ fputs (_("IO "), file);
+ break;
+ case EIHVN__FILES_VOLUMES_BIT:
+ fputs (_("FILES_VOLUMES "), file);
+ break;
+ case EIHVN__PROCESS_SCHED_BIT:
+ fputs (_("PROCESS_SCHED "), file);
+ break;
+ case EIHVN__SYSGEN_BIT:
fputs (_("SYSGEN "), file);
- break;
- case EIHVN__CLUSTERS_LOCKMGR_BIT:
- fputs (_("CLUSTERS_LOCKMGR "), file);
- break;
- case EIHVN__LOGICAL_NAMES_BIT:
- fputs (_("LOGICAL_NAMES "), file);
- break;
- case EIHVN__SECURITY_BIT:
+ break;
+ case EIHVN__CLUSTERS_LOCKMGR_BIT:
+ fputs (_("CLUSTERS_LOCKMGR "), file);
+ break;
+ case EIHVN__LOGICAL_NAMES_BIT:
+ fputs (_("LOGICAL_NAMES "), file);
+ break;
+ case EIHVN__SECURITY_BIT:
fputs (_("SECURITY "), file);
- break;
- case EIHVN__IMAGE_ACTIVATOR_BIT:
- fputs (_("IMAGE_ACTIVATOR "), file);
- break;
- case EIHVN__NETWORKS_BIT:
+ break;
+ case EIHVN__IMAGE_ACTIVATOR_BIT:
+ fputs (_("IMAGE_ACTIVATOR "), file);
+ break;
+ case EIHVN__NETWORKS_BIT:
fputs (_("NETWORKS "), file);
- break;
- case EIHVN__COUNTERS_BIT:
+ break;
+ case EIHVN__COUNTERS_BIT:
fputs (_("COUNTERS "), file);
- break;
- case EIHVN__STABLE_BIT:
+ break;
+ case EIHVN__STABLE_BIT:
fputs (_("STABLE "), file);
- break;
- case EIHVN__MISC_BIT:
- fputs (_("MISC "), file);
- break;
- case EIHVN__CPU_BIT:
- fputs (_("CPU "), file);
- break;
- case EIHVN__VOLATILE_BIT:
+ break;
+ case EIHVN__MISC_BIT:
+ fputs (_("MISC "), file);
+ break;
+ case EIHVN__CPU_BIT:
+ fputs (_("CPU "), file);
+ break;
+ case EIHVN__VOLATILE_BIT:
fputs (_("VOLATILE "), file);
- break;
- case EIHVN__SHELL_BIT:
+ break;
+ case EIHVN__SHELL_BIT:
fputs (_("SHELL "), file);
- break;
- case EIHVN__POSIX_BIT:
+ break;
+ case EIHVN__POSIX_BIT:
fputs (_("POSIX "), file);
- break;
- case EIHVN__MULTI_PROCESSING_BIT:
- fputs (_("MULTI_PROCESSING "), file);
- break;
- case EIHVN__GALAXY_BIT:
+ break;
+ case EIHVN__MULTI_PROCESSING_BIT:
+ fputs (_("MULTI_PROCESSING "), file);
+ break;
+ case EIHVN__GALAXY_BIT:
fputs (_("GALAXY "), file);
- break;
- default:
- fputs (_("*unknown* "), file);
- break;
- }
- fprintf (file, ": %u.%u\n",
- (unsigned)bfd_getl16 (ver.major),
- (unsigned)bfd_getl16 (ver.minor));
- }
+ break;
+ default:
+ fputs (_("*unknown* "), file);
+ break;
+ }
+ fprintf (file, ": %u.%u\n",
+ (unsigned)bfd_getl16 (ver.major),
+ (unsigned)bfd_getl16 (ver.minor));
+ }
}
if (eiha_off != 0)
struct vms_eiha eiha;
if (bfd_seek (abfd, (file_ptr) eiha_off, SEEK_SET)
- || bfd_bread (&eiha, sizeof (eiha), abfd) != sizeof (eiha))
- {
- fprintf (file, _("cannot read EIHA\n"));
- return;
- }
+ || bfd_bread (&eiha, sizeof (eiha), abfd) != sizeof (eiha))
+ {
+ fprintf (file, _("cannot read EIHA\n"));
+ return;
+ }
fprintf (file, _("Image activation: (size=%u)\n"),
- (unsigned)bfd_getl32 (eiha.size));
+ (unsigned)bfd_getl32 (eiha.size));
/* xgettext:c-format */
fprintf (file, _(" First address : 0x%08x 0x%08x\n"),
- (unsigned)bfd_getl32 (eiha.tfradr1_h),
- (unsigned)bfd_getl32 (eiha.tfradr1));
+ (unsigned)bfd_getl32 (eiha.tfradr1_h),
+ (unsigned)bfd_getl32 (eiha.tfradr1));
/* xgettext:c-format */
fprintf (file, _(" Second address: 0x%08x 0x%08x\n"),
- (unsigned)bfd_getl32 (eiha.tfradr2_h),
- (unsigned)bfd_getl32 (eiha.tfradr2));
+ (unsigned)bfd_getl32 (eiha.tfradr2_h),
+ (unsigned)bfd_getl32 (eiha.tfradr2));
/* xgettext:c-format */
fprintf (file, _(" Third address : 0x%08x 0x%08x\n"),
- (unsigned)bfd_getl32 (eiha.tfradr3_h),
- (unsigned)bfd_getl32 (eiha.tfradr3));
+ (unsigned)bfd_getl32 (eiha.tfradr3_h),
+ (unsigned)bfd_getl32 (eiha.tfradr3));
/* xgettext:c-format */
fprintf (file, _(" Fourth address: 0x%08x 0x%08x\n"),
- (unsigned)bfd_getl32 (eiha.tfradr4_h),
- (unsigned)bfd_getl32 (eiha.tfradr4));
+ (unsigned)bfd_getl32 (eiha.tfradr4_h),
+ (unsigned)bfd_getl32 (eiha.tfradr4));
/* xgettext:c-format */
fprintf (file, _(" Shared image : 0x%08x 0x%08x\n"),
- (unsigned)bfd_getl32 (eiha.inishr_h),
- (unsigned)bfd_getl32 (eiha.inishr));
+ (unsigned)bfd_getl32 (eiha.inishr_h),
+ (unsigned)bfd_getl32 (eiha.inishr));
}
if (eihi_off != 0)
{
struct vms_eihi eihi;
if (bfd_seek (abfd, (file_ptr) eihi_off, SEEK_SET)
- || bfd_bread (&eihi, sizeof (eihi), abfd) != sizeof (eihi))
- {
- fprintf (file, _("cannot read EIHI\n"));
- return;
- }
+ || bfd_bread (&eihi, sizeof (eihi), abfd) != sizeof (eihi))
+ {
+ fprintf (file, _("cannot read EIHI\n"));
+ return;
+ }
/* xgettext:c-format */
fprintf (file, _("Image identification: (major: %u, minor: %u)\n"),
- (unsigned)bfd_getl32 (eihi.majorid),
- (unsigned)bfd_getl32 (eihi.minorid));
+ (unsigned)bfd_getl32 (eihi.majorid),
+ (unsigned)bfd_getl32 (eihi.minorid));
fprintf (file, _(" image name : %.*s\n"),
- eihi.imgnam[0], eihi.imgnam + 1);
+ eihi.imgnam[0], eihi.imgnam + 1);
fprintf (file, _(" link time : %s\n"),
- vms_time_to_str (eihi.linktime));
+ vms_time_to_str (eihi.linktime));
fprintf (file, _(" image ident : %.*s\n"),
- eihi.imgid[0], eihi.imgid + 1);
+ eihi.imgid[0], eihi.imgid + 1);
fprintf (file, _(" linker ident : %.*s\n"),
- eihi.linkid[0], eihi.linkid + 1);
+ eihi.linkid[0], eihi.linkid + 1);
fprintf (file, _(" image build ident: %.*s\n"),
- eihi.imgbid[0], eihi.imgbid + 1);
+ eihi.imgbid[0], eihi.imgbid + 1);
}
if (eihs_off != 0)
{
struct vms_eihs eihs;
if (bfd_seek (abfd, (file_ptr) eihs_off, SEEK_SET)
- || bfd_bread (&eihs, sizeof (eihs), abfd) != sizeof (eihs))
- {
- fprintf (file, _("cannot read EIHS\n"));
- return;
- }
+ || bfd_bread (&eihs, sizeof (eihs), abfd) != sizeof (eihs))
+ {
+ fprintf (file, _("cannot read EIHS\n"));
+ return;
+ }
/* xgettext:c-format */
fprintf (file, _("Image symbol & debug table: (major: %u, minor: %u)\n"),
- (unsigned)bfd_getl32 (eihs.majorid),
- (unsigned)bfd_getl32 (eihs.minorid));
+ (unsigned)bfd_getl32 (eihs.majorid),
+ (unsigned)bfd_getl32 (eihs.minorid));
dst_vbn = bfd_getl32 (eihs.dstvbn);
dst_size = bfd_getl32 (eihs.dstsize);
/* xgettext:c-format */
fprintf (file, _(" debug symbol table : vbn: %u, size: %u (0x%x)\n"),
- dst_vbn, dst_size, dst_size);
+ dst_vbn, dst_size, dst_size);
gst_vbn = bfd_getl32 (eihs.gstvbn);
gst_size = bfd_getl32 (eihs.gstsize);
/* xgettext:c-format */
fprintf (file, _(" global symbol table: vbn: %u, records: %u\n"),
- gst_vbn, gst_size);
+ gst_vbn, gst_size);
dmt_vbn = bfd_getl32 (eihs.dmtvbn);
dmt_size = bfd_getl32 (eihs.dmtsize);
/* xgettext:c-format */
fprintf (file, _(" debug module table : vbn: %u, size: %u\n"),
- dmt_vbn, dmt_size);
+ dmt_vbn, dmt_size);
}
while (eisd_off != 0)
{
unsigned int len;
while (1)
- {
- if (bfd_seek (abfd, (file_ptr) eisd_off, SEEK_SET)
- || bfd_bread (&eisd, sizeof (eisd), abfd) != sizeof (eisd))
- {
- fprintf (file, _("cannot read EISD\n"));
- return;
- }
- len = (unsigned)bfd_getl32 (eisd.eisdsize);
- if (len != (unsigned)-1)
- break;
-
- /* Next block. */
- eisd_off = (eisd_off + VMS_BLOCK_SIZE) & ~(VMS_BLOCK_SIZE - 1);
- }
+ {
+ if (bfd_seek (abfd, (file_ptr) eisd_off, SEEK_SET)
+ || bfd_bread (&eisd, sizeof (eisd), abfd) != sizeof (eisd))
+ {
+ fprintf (file, _("cannot read EISD\n"));
+ return;
+ }
+ len = (unsigned)bfd_getl32 (eisd.eisdsize);
+ if (len != (unsigned)-1)
+ break;
+
+ /* Next block. */
+ eisd_off = (eisd_off + VMS_BLOCK_SIZE) & ~(VMS_BLOCK_SIZE - 1);
+ }
/* xgettext:c-format */
fprintf (file, _("Image section descriptor: (major: %u, minor: %u, "
- "size: %u, offset: %u)\n"),
- (unsigned)bfd_getl32 (eisd.majorid),
- (unsigned)bfd_getl32 (eisd.minorid),
- len, eisd_off);
+ "size: %u, offset: %u)\n"),
+ (unsigned)bfd_getl32 (eisd.majorid),
+ (unsigned)bfd_getl32 (eisd.minorid),
+ len, eisd_off);
if (len == 0)
- break;
+ break;
/* xgettext:c-format */
fprintf (file, _(" section: base: 0x%08x%08x size: 0x%08x\n"),
- (unsigned)bfd_getl32 (eisd.virt_addr + 4),
- (unsigned)bfd_getl32 (eisd.virt_addr + 0),
- (unsigned)bfd_getl32 (eisd.secsize));
+ (unsigned)bfd_getl32 (eisd.virt_addr + 4),
+ (unsigned)bfd_getl32 (eisd.virt_addr + 0),
+ (unsigned)bfd_getl32 (eisd.secsize));
val = (unsigned)bfd_getl32 (eisd.flags);
fprintf (file, _(" flags: 0x%04x"), val);
if (val & EISD__M_GBL)
- fprintf (file, " GBL");
+ fprintf (file, " GBL");
if (val & EISD__M_CRF)
- fprintf (file, " CRF");
+ fprintf (file, " CRF");
if (val & EISD__M_DZRO)
- fprintf (file, " DZRO");
+ fprintf (file, " DZRO");
if (val & EISD__M_WRT)
- fprintf (file, " WRT");
+ fprintf (file, " WRT");
if (val & EISD__M_INITALCODE)
fprintf (file, " INITALCODE");
if (val & EISD__M_BASED)
- fprintf (file, " BASED");
+ fprintf (file, " BASED");
if (val & EISD__M_FIXUPVEC)
fprintf (file, " FIXUPVEC");
if (val & EISD__M_RESIDENT)
fprintf (file, " RESIDENT");
if (val & EISD__M_VECTOR)
- fprintf (file, " VECTOR");
+ fprintf (file, " VECTOR");
if (val & EISD__M_PROTECT)
fprintf (file, " PROTECT");
if (val & EISD__M_LASTCLU)
fprintf (file, " LASTCLU");
if (val & EISD__M_EXE)
- fprintf (file, " EXE");
+ fprintf (file, " EXE");
if (val & EISD__M_NONSHRADR)
fprintf (file, " NONSHRADR");
if (val & EISD__M_QUAD_LENGTH)
fprintf (file, " ALLOC_64BIT");
fprintf (file, "\n");
if (val & EISD__M_FIXUPVEC)
- {
- eiaf_vbn = bfd_getl32 (eisd.vbn);
- eiaf_size = bfd_getl32 (eisd.secsize);
- }
+ {
+ eiaf_vbn = bfd_getl32 (eisd.vbn);
+ eiaf_size = bfd_getl32 (eisd.secsize);
+ }
/* xgettext:c-format */
fprintf (file, _(" vbn: %u, pfc: %u, matchctl: %u type: %u ("),
- (unsigned)bfd_getl32 (eisd.vbn),
- eisd.pfc, eisd.matchctl, eisd.type);
+ (unsigned)bfd_getl32 (eisd.vbn),
+ eisd.pfc, eisd.matchctl, eisd.type);
switch (eisd.type)
- {
- case EISD__K_NORMAL:
- fputs (_("NORMAL"), file);
- break;
- case EISD__K_SHRFXD:
- fputs (_("SHRFXD"), file);
- break;
- case EISD__K_PRVFXD:
- fputs (_("PRVFXD"), file);
- break;
- case EISD__K_SHRPIC:
- fputs (_("SHRPIC"), file);
- break;
- case EISD__K_PRVPIC:
- fputs (_("PRVPIC"), file);
- break;
- case EISD__K_USRSTACK:
- fputs (_("USRSTACK"), file);
- break;
- default:
- fputs (_("*unknown*"), file);
- break;
- }
+ {
+ case EISD__K_NORMAL:
+ fputs (_("NORMAL"), file);
+ break;
+ case EISD__K_SHRFXD:
+ fputs (_("SHRFXD"), file);
+ break;
+ case EISD__K_PRVFXD:
+ fputs (_("PRVFXD"), file);
+ break;
+ case EISD__K_SHRPIC:
+ fputs (_("SHRPIC"), file);
+ break;
+ case EISD__K_PRVPIC:
+ fputs (_("PRVPIC"), file);
+ break;
+ case EISD__K_USRSTACK:
+ fputs (_("USRSTACK"), file);
+ break;
+ default:
+ fputs (_("*unknown*"), file);
+ break;
+ }
fputs (_(")\n"), file);
if (val & EISD__M_GBL)
/* xgettext:c-format */
- fprintf (file, _(" ident: 0x%08x, name: %.*s\n"),
- (unsigned)bfd_getl32 (eisd.ident),
- eisd.gblnam[0], eisd.gblnam + 1);
+ fprintf (file, _(" ident: 0x%08x, name: %.*s\n"),
+ (unsigned)bfd_getl32 (eisd.ident),
+ eisd.gblnam[0], eisd.gblnam + 1);
eisd_off += len;
}
if (dmt_vbn != 0)
{
if (bfd_seek (abfd, (file_ptr) (dmt_vbn - 1) * VMS_BLOCK_SIZE, SEEK_SET))
- {
- fprintf (file, _("cannot read DMT\n"));
- return;
- }
+ {
+ fprintf (file, _("cannot read DMT\n"));
+ return;
+ }
fprintf (file, _("Debug module table:\n"));
while (dmt_size > 0)
- {
- struct vms_dmt_header dmth;
- unsigned int count;
-
- if (bfd_bread (&dmth, sizeof (dmth), abfd) != sizeof (dmth))
- {
- fprintf (file, _("cannot read DMT header\n"));
- return;
- }
- count = bfd_getl16 (dmth.psect_count);
- fprintf (file,
+ {
+ struct vms_dmt_header dmth;
+ unsigned int count;
+
+ if (bfd_bread (&dmth, sizeof (dmth), abfd) != sizeof (dmth))
+ {
+ fprintf (file, _("cannot read DMT header\n"));
+ return;
+ }
+ count = bfd_getl16 (dmth.psect_count);
+ fprintf (file,
/* xgettext:c-format */
- _(" module offset: 0x%08x, size: 0x%08x, (%u psects)\n"),
- (unsigned)bfd_getl32 (dmth.modbeg),
- (unsigned)bfd_getl32 (dmth.size), count);
- dmt_size -= sizeof (dmth);
- while (count > 0)
- {
- struct vms_dmt_psect dmtp;
-
- if (bfd_bread (&dmtp, sizeof (dmtp), abfd) != sizeof (dmtp))
- {
- fprintf (file, _("cannot read DMT psect\n"));
- return;
- }
+ _(" module offset: 0x%08x, size: 0x%08x, (%u psects)\n"),
+ (unsigned)bfd_getl32 (dmth.modbeg),
+ (unsigned)bfd_getl32 (dmth.size), count);
+ dmt_size -= sizeof (dmth);
+ while (count > 0)
+ {
+ struct vms_dmt_psect dmtp;
+
+ if (bfd_bread (&dmtp, sizeof (dmtp), abfd) != sizeof (dmtp))
+ {
+ fprintf (file, _("cannot read DMT psect\n"));
+ return;
+ }
/* xgettext:c-format */
- fprintf (file, _(" psect start: 0x%08x, length: %u\n"),
- (unsigned)bfd_getl32 (dmtp.start),
- (unsigned)bfd_getl32 (dmtp.length));
- count--;
- dmt_size -= sizeof (dmtp);
- }
- }
+ fprintf (file, _(" psect start: 0x%08x, length: %u\n"),
+ (unsigned)bfd_getl32 (dmtp.start),
+ (unsigned)bfd_getl32 (dmtp.length));
+ count--;
+ dmt_size -= sizeof (dmtp);
+ }
+ }
}
if (dst_vbn != 0)
{
if (bfd_seek (abfd, (file_ptr) (dst_vbn - 1) * VMS_BLOCK_SIZE, SEEK_SET))
- {
- fprintf (file, _("cannot read DST\n"));
- return;
- }
+ {
+ fprintf (file, _("cannot read DST\n"));
+ return;
+ }
evax_bfd_print_dst (abfd, dst_size, file);
}
if (gst_vbn != 0)
{
if (bfd_seek (abfd, (file_ptr) (gst_vbn - 1) * VMS_BLOCK_SIZE, SEEK_SET))
- {
- fprintf (file, _("cannot read GST\n"));
- return;
- }
+ {
+ fprintf (file, _("cannot read GST\n"));
+ return;
+ }
fprintf (file, _("Global symbol table:\n"));
evax_bfd_print_eobj (abfd, file);
buf = bfd_malloc (eiaf_size);
if (bfd_seek (abfd, (file_ptr) (eiaf_vbn - 1) * VMS_BLOCK_SIZE, SEEK_SET)
- || bfd_bread (buf, eiaf_size, abfd) != eiaf_size)
- {
- fprintf (file, _("cannot read EIHA\n"));
- free (buf);
- return;
- }
+ || bfd_bread (buf, eiaf_size, abfd) != eiaf_size)
+ {
+ fprintf (file, _("cannot read EIHA\n"));
+ free (buf);
+ return;
+ }
eiaf = (struct vms_eiaf *)buf;
fprintf (file,
/* xgettext:c-format */
- _("Image activator fixup: (major: %u, minor: %u)\n"),
- (unsigned)bfd_getl32 (eiaf->majorid),
- (unsigned)bfd_getl32 (eiaf->minorid));
+ _("Image activator fixup: (major: %u, minor: %u)\n"),
+ (unsigned)bfd_getl32 (eiaf->majorid),
+ (unsigned)bfd_getl32 (eiaf->minorid));
/* xgettext:c-format */
fprintf (file, _(" iaflink : 0x%08x %08x\n"),
- (unsigned)bfd_getl32 (eiaf->iaflink + 0),
- (unsigned)bfd_getl32 (eiaf->iaflink + 4));
+ (unsigned)bfd_getl32 (eiaf->iaflink + 0),
+ (unsigned)bfd_getl32 (eiaf->iaflink + 4));
/* xgettext:c-format */
fprintf (file, _(" fixuplnk: 0x%08x %08x\n"),
- (unsigned)bfd_getl32 (eiaf->fixuplnk + 0),
- (unsigned)bfd_getl32 (eiaf->fixuplnk + 4));
+ (unsigned)bfd_getl32 (eiaf->fixuplnk + 0),
+ (unsigned)bfd_getl32 (eiaf->fixuplnk + 4));
fprintf (file, _(" size : %u\n"),
- (unsigned)bfd_getl32 (eiaf->size));
+ (unsigned)bfd_getl32 (eiaf->size));
fprintf (file, _(" flags: 0x%08x\n"),
- (unsigned)bfd_getl32 (eiaf->flags));
+ (unsigned)bfd_getl32 (eiaf->flags));
qrelfixoff = bfd_getl32 (eiaf->qrelfixoff);
lrelfixoff = bfd_getl32 (eiaf->lrelfixoff);
/* xgettext:c-format */
fprintf (file, _(" qrelfixoff: %5u, lrelfixoff: %5u\n"),
- qrelfixoff, lrelfixoff);
+ qrelfixoff, lrelfixoff);
qdotadroff = bfd_getl32 (eiaf->qdotadroff);
ldotadroff = bfd_getl32 (eiaf->ldotadroff);
/* xgettext:c-format */
fprintf (file, _(" qdotadroff: %5u, ldotadroff: %5u\n"),
- qdotadroff, ldotadroff);
+ qdotadroff, ldotadroff);
codeadroff = bfd_getl32 (eiaf->codeadroff);
lpfixoff = bfd_getl32 (eiaf->lpfixoff);
/* xgettext:c-format */
fprintf (file, _(" codeadroff: %5u, lpfixoff : %5u\n"),
- codeadroff, lpfixoff);
+ codeadroff, lpfixoff);
chgprtoff = bfd_getl32 (eiaf->chgprtoff);
fprintf (file, _(" chgprtoff : %5u\n"), chgprtoff);
shrimgcnt = bfd_getl32 (eiaf->shrimgcnt);
shlstoff = bfd_getl32 (eiaf->shlstoff);
/* xgettext:c-format */
fprintf (file, _(" shlstoff : %5u, shrimgcnt : %5u\n"),
- shlstoff, shrimgcnt);
+ shlstoff, shrimgcnt);
/* xgettext:c-format */
fprintf (file, _(" shlextra : %5u, permctx : %5u\n"),
- (unsigned)bfd_getl32 (eiaf->shlextra),
- (unsigned)bfd_getl32 (eiaf->permctx));
+ (unsigned)bfd_getl32 (eiaf->shlextra),
+ (unsigned)bfd_getl32 (eiaf->permctx));
fprintf (file, _(" base_va : 0x%08x\n"),
- (unsigned)bfd_getl32 (eiaf->base_va));
+ (unsigned)bfd_getl32 (eiaf->base_va));
fprintf (file, _(" lppsbfixoff: %5u\n"),
- (unsigned)bfd_getl32 (eiaf->lppsbfixoff));
+ (unsigned)bfd_getl32 (eiaf->lppsbfixoff));
if (shlstoff)
- {
- struct vms_shl *shl = (struct vms_shl *)(buf + shlstoff);
- unsigned int j;
-
- fprintf (file, _(" Shareable images:\n"));
- for (j = 0; j < shrimgcnt; j++, shl++)
- {
- fprintf (file,
+ {
+ struct vms_shl *shl = (struct vms_shl *)(buf + shlstoff);
+ unsigned int j;
+
+ fprintf (file, _(" Shareable images:\n"));
+ for (j = 0; j < shrimgcnt; j++, shl++)
+ {
+ fprintf (file,
/* xgettext:c-format */
- _(" %u: size: %u, flags: 0x%02x, name: %.*s\n"),
- j, shl->size, shl->flags,
- shl->imgnam[0], shl->imgnam + 1);
- }
- }
+ _(" %u: size: %u, flags: 0x%02x, name: %.*s\n"),
+ j, shl->size, shl->flags,
+ shl->imgnam[0], shl->imgnam + 1);
+ }
+ }
if (qrelfixoff != 0)
- {
- fprintf (file, _(" quad-word relocation fixups:\n"));
- evax_bfd_print_relocation_records (file, buf + qrelfixoff, 8);
- }
+ {
+ fprintf (file, _(" quad-word relocation fixups:\n"));
+ evax_bfd_print_relocation_records (file, buf + qrelfixoff, 8);
+ }
if (lrelfixoff != 0)
- {
- fprintf (file, _(" long-word relocation fixups:\n"));
- evax_bfd_print_relocation_records (file, buf + lrelfixoff, 4);
- }
+ {
+ fprintf (file, _(" long-word relocation fixups:\n"));
+ evax_bfd_print_relocation_records (file, buf + lrelfixoff, 4);
+ }
if (qdotadroff != 0)
- {
- fprintf (file, _(" quad-word .address reference fixups:\n"));
- evax_bfd_print_address_fixups (file, buf + qdotadroff);
- }
+ {
+ fprintf (file, _(" quad-word .address reference fixups:\n"));
+ evax_bfd_print_address_fixups (file, buf + qdotadroff);
+ }
if (ldotadroff != 0)
- {
- fprintf (file, _(" long-word .address reference fixups:\n"));
- evax_bfd_print_address_fixups (file, buf + ldotadroff);
- }
+ {
+ fprintf (file, _(" long-word .address reference fixups:\n"));
+ evax_bfd_print_address_fixups (file, buf + ldotadroff);
+ }
if (codeadroff != 0)
- {
- fprintf (file, _(" Code Address Reference Fixups:\n"));
- evax_bfd_print_reference_fixups (file, buf + codeadroff);
- }
+ {
+ fprintf (file, _(" Code Address Reference Fixups:\n"));
+ evax_bfd_print_reference_fixups (file, buf + codeadroff);
+ }
if (lpfixoff != 0)
- {
- fprintf (file, _(" Linkage Pairs Reference Fixups:\n"));
- evax_bfd_print_reference_fixups (file, buf + lpfixoff);
- }
+ {
+ fprintf (file, _(" Linkage Pairs Reference Fixups:\n"));
+ evax_bfd_print_reference_fixups (file, buf + lpfixoff);
+ }
if (chgprtoff)
- {
- unsigned int count = (unsigned)bfd_getl32 (buf + chgprtoff);
- struct vms_eicp *eicp = (struct vms_eicp *)(buf + chgprtoff + 4);
- unsigned int j;
-
- fprintf (file, _(" Change Protection (%u entries):\n"), count);
- for (j = 0; j < count; j++, eicp++)
- {
- unsigned int prot = bfd_getl32 (eicp->newprt);
- fprintf (file,
+ {
+ unsigned int count = (unsigned)bfd_getl32 (buf + chgprtoff);
+ struct vms_eicp *eicp = (struct vms_eicp *)(buf + chgprtoff + 4);
+ unsigned int j;
+
+ fprintf (file, _(" Change Protection (%u entries):\n"), count);
+ for (j = 0; j < count; j++, eicp++)
+ {
+ unsigned int prot = bfd_getl32 (eicp->newprt);
+ fprintf (file,
/* xgettext:c-format */
- _(" base: 0x%08x %08x, size: 0x%08x, prot: 0x%08x "),
- (unsigned)bfd_getl32 (eicp->baseva + 4),
- (unsigned)bfd_getl32 (eicp->baseva + 0),
- (unsigned)bfd_getl32 (eicp->size),
- (unsigned)bfd_getl32 (eicp->newprt));
- switch (prot)
- {
- case PRT__C_NA:
- fprintf (file, "NA");
- break;
- case PRT__C_RESERVED:
- fprintf (file, "RES");
- break;
- case PRT__C_KW:
- fprintf (file, "KW");
- break;
- case PRT__C_KR:
- fprintf (file, "KR");
- break;
- case PRT__C_UW:
- fprintf (file, "UW");
- break;
- case PRT__C_EW:
- fprintf (file, "EW");
- break;
- case PRT__C_ERKW:
- fprintf (file, "ERKW");
- break;
- case PRT__C_ER:
- fprintf (file, "ER");
- break;
- case PRT__C_SW:
- fprintf (file, "SW");
- break;
- case PRT__C_SREW:
- fprintf (file, "SREW");
- break;
- case PRT__C_SRKW:
- fprintf (file, "SRKW");
- break;
- case PRT__C_SR:
- fprintf (file, "SR");
- break;
- case PRT__C_URSW:
- fprintf (file, "URSW");
- break;
- case PRT__C_UREW:
- fprintf (file, "UREW");
- break;
- case PRT__C_URKW:
- fprintf (file, "URKW");
- break;
- case PRT__C_UR:
- fprintf (file, "UR");
- break;
- default:
- fputs ("??", file);
- break;
- }
- fputc ('\n', file);
- }
- }
+ _(" base: 0x%08x %08x, size: 0x%08x, prot: 0x%08x "),
+ (unsigned)bfd_getl32 (eicp->baseva + 4),
+ (unsigned)bfd_getl32 (eicp->baseva + 0),
+ (unsigned)bfd_getl32 (eicp->size),
+ (unsigned)bfd_getl32 (eicp->newprt));
+ switch (prot)
+ {
+ case PRT__C_NA:
+ fprintf (file, "NA");
+ break;
+ case PRT__C_RESERVED:
+ fprintf (file, "RES");
+ break;
+ case PRT__C_KW:
+ fprintf (file, "KW");
+ break;
+ case PRT__C_KR:
+ fprintf (file, "KR");
+ break;
+ case PRT__C_UW:
+ fprintf (file, "UW");
+ break;
+ case PRT__C_EW:
+ fprintf (file, "EW");
+ break;
+ case PRT__C_ERKW:
+ fprintf (file, "ERKW");
+ break;
+ case PRT__C_ER:
+ fprintf (file, "ER");
+ break;
+ case PRT__C_SW:
+ fprintf (file, "SW");
+ break;
+ case PRT__C_SREW:
+ fprintf (file, "SREW");
+ break;
+ case PRT__C_SRKW:
+ fprintf (file, "SRKW");
+ break;
+ case PRT__C_SR:
+ fprintf (file, "SR");
+ break;
+ case PRT__C_URSW:
+ fprintf (file, "URSW");
+ break;
+ case PRT__C_UREW:
+ fprintf (file, "UREW");
+ break;
+ case PRT__C_URKW:
+ fprintf (file, "URKW");
+ break;
+ case PRT__C_UR:
+ fprintf (file, "UR");
+ break;
+ default:
+ fputs ("??", file);
+ break;
+ }
+ fputc ('\n', file);
+ }
+ }
free (buf);
}
}
else
{
if (bfd_seek (abfd, 0, SEEK_SET))
- return FALSE;
+ return FALSE;
evax_bfd_print_eobj (abfd, file);
}
return TRUE;
if (info)
{
if (info->strip == strip_all || info->strip == strip_debugger)
- {
- /* Discard the DST section. */
- dst_offset = 0;
- dst_section = NULL;
- }
+ {
+ /* Discard the DST section. */
+ dst_offset = 0;
+ dst_section = NULL;
+ }
else if (dst_section)
- {
- dst_offset = dst_section->output_offset;
- dst_section = dst_section->output_section;
- }
+ {
+ dst_offset = dst_section->output_offset;
+ dst_section = dst_section->output_section;
+ }
}
while (1)
return FALSE;
}
switch (type)
- {
- case EOBJ__C_ETIR:
- PRIV (image_section) = cur_section;
- PRIV (image_offset) = cur_offset;
- res = _bfd_vms_slurp_etir (abfd, info);
- cur_section = PRIV (image_section);
- cur_offset = PRIV (image_offset);
- break;
- case EOBJ__C_EDBG:
- case EOBJ__C_ETBT:
- if (dst_section == NULL)
- continue;
- PRIV (image_section) = dst_section;
- PRIV (image_offset) = dst_offset;
- res = _bfd_vms_slurp_etir (abfd, info);
- dst_offset = PRIV (image_offset);
- break;
- case EOBJ__C_EEOM:
- return TRUE;
- default:
- continue;
- }
+ {
+ case EOBJ__C_ETIR:
+ PRIV (image_section) = cur_section;
+ PRIV (image_offset) = cur_offset;
+ res = _bfd_vms_slurp_etir (abfd, info);
+ cur_section = PRIV (image_section);
+ cur_offset = PRIV (image_offset);
+ break;
+ case EOBJ__C_EDBG:
+ case EOBJ__C_ETBT:
+ if (dst_section == NULL)
+ continue;
+ PRIV (image_section) = dst_section;
+ PRIV (image_offset) = dst_offset;
+ res = _bfd_vms_slurp_etir (abfd, info);
+ dst_offset = PRIV (image_offset);
+ break;
+ case EOBJ__C_EEOM:
+ return TRUE;
+ default:
+ continue;
+ }
if (!res)
- {
- vms_debug2 ((2, "slurp eobj type %d failed\n", type));
- return FALSE;
- }
+ {
+ vms_debug2 ((2, "slurp eobj type %d failed\n", type));
+ return FALSE;
+ }
}
}
static int
alpha_vms_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED,
- struct bfd_link_info *info ATTRIBUTE_UNUSED)
+ struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
return 0;
}
file_ptr offset = PRIV2 (src, image_offset);
sl = &VEC_EL (alpha_vms_link_hash (info)->shrlibs,
- struct alpha_vms_shlib_el, PRIV2 (shlib, shr_index));
+ struct alpha_vms_shlib_el, PRIV2 (shlib, shr_index));
sl->has_fixups = TRUE;
VEC_APPEND_EL (sl->lp, bfd_vma,
- sect->output_section->vma + sect->output_offset + offset);
+ sect->output_section->vma + sect->output_offset + offset);
sect->output_section->flags |= SEC_RELOC;
}
file_ptr offset = PRIV2 (src, image_offset);
sl = &VEC_EL (alpha_vms_link_hash (info)->shrlibs,
- struct alpha_vms_shlib_el, PRIV2 (shlib, shr_index));
+ struct alpha_vms_shlib_el, PRIV2 (shlib, shr_index));
sl->has_fixups = TRUE;
VEC_APPEND_EL (sl->ca, bfd_vma,
- sect->output_section->vma + sect->output_offset + offset);
+ sect->output_section->vma + sect->output_offset + offset);
sect->output_section->flags |= SEC_RELOC;
}
static void
alpha_vms_add_fixup_qr (struct bfd_link_info *info, bfd *src,
- bfd *shlib, bfd_vma vec)
+ bfd *shlib, bfd_vma vec)
{
struct alpha_vms_shlib_el *sl;
struct alpha_vms_vma_ref *r;
file_ptr offset = PRIV2 (src, image_offset);
sl = &VEC_EL (alpha_vms_link_hash (info)->shrlibs,
- struct alpha_vms_shlib_el, PRIV2 (shlib, shr_index));
+ struct alpha_vms_shlib_el, PRIV2 (shlib, shr_index));
sl->has_fixups = TRUE;
r = VEC_APPEND (sl->qr, struct alpha_vms_vma_ref);
r->vma = sect->output_section->vma + sect->output_offset + offset;
static void
alpha_vms_add_fixup_lr (struct bfd_link_info *info ATTRIBUTE_UNUSED,
- unsigned int shr ATTRIBUTE_UNUSED,
- bfd_vma vec ATTRIBUTE_UNUSED)
+ unsigned int shr ATTRIBUTE_UNUSED,
+ bfd_vma vec ATTRIBUTE_UNUSED)
{
/* Not yet supported. */
abort ();
static struct bfd_hash_entry *
alpha_vms_link_hash_newfunc (struct bfd_hash_entry *entry,
- struct bfd_hash_table *table,
- const char *string)
+ struct bfd_hash_table *table,
+ const char *string)
{
struct alpha_vms_link_hash_entry *ret =
(struct alpha_vms_link_hash_entry *) entry;
if (ret == NULL)
ret = ((struct alpha_vms_link_hash_entry *)
bfd_hash_allocate (table,
- sizeof (struct alpha_vms_link_hash_entry)));
+ sizeof (struct alpha_vms_link_hash_entry)));
if (ret == NULL)
return NULL;
asymbol sym;
if (!alpha_vms_convert_symbol (abfd, e, &sym))
- return FALSE;
+ return FALSE;
if ((e->flags & EGSY__V_DEF) && abfd->selective_search)
- {
- /* In selective_search mode, only add definition that are
- required. */
- h = (struct alpha_vms_link_hash_entry *)bfd_link_hash_lookup
- (info->hash, sym.name, FALSE, FALSE, FALSE);
- if (h == NULL || h->root.type != bfd_link_hash_undefined)
- continue;
- }
+ {
+ /* In selective_search mode, only add definition that are
+ required. */
+ h = (struct alpha_vms_link_hash_entry *)bfd_link_hash_lookup
+ (info->hash, sym.name, FALSE, FALSE, FALSE);
+ if (h == NULL || h->root.type != bfd_link_hash_undefined)
+ continue;
+ }
else
- h = NULL;
+ h = NULL;
h_root = (struct bfd_link_hash_entry *) h;
if (!_bfd_generic_link_add_one_symbol (info, abfd, sym.name, sym.flags,
sym.section, sym.value, NULL,
FALSE, FALSE, &h_root))
- return FALSE;
+ return FALSE;
h = (struct alpha_vms_link_hash_entry *) h_root;
if ((e->flags & EGSY__V_DEF)
- && h->sym == NULL
- && abfd->xvec == info->output_bfd->xvec)
- h->sym = e;
+ && h->sym == NULL
+ && abfd->xvec == info->output_bfd->xvec)
+ h->sym = e;
}
if (abfd->flags & DYNAMIC)
struct alpha_vms_shlib_el *shlib;
/* We do not want to include any of the sections in a dynamic
- object in the output file. See comment in elflink.c. */
+ object in the output file. See comment in elflink.c. */
bfd_section_list_clear (abfd);
shlib = VEC_APPEND (alpha_vms_link_hash (info)->shrlibs,
- struct alpha_vms_shlib_el);
+ struct alpha_vms_shlib_el);
shlib->abfd = abfd;
VEC_INIT (shlib->ca);
VEC_INIT (shlib->lp);
entry if it is the tail, because that would lose any
entries we add to the list later on. */
if (*pundef != info->hash->undefs_tail)
- {
- *pundef = *next_pundef;
- next_pundef = pundef;
- }
+ {
+ *pundef = *next_pundef;
+ next_pundef = pundef;
+ }
continue;
}
return FALSE;
if (element->archive_pass == -1 || element->archive_pass == pass)
- {
- /* Next symbol if this archive is wrong or already handled. */
- continue;
- }
+ {
+ /* Next symbol if this archive is wrong or already handled. */
+ continue;
+ }
if (! bfd_check_format (element, bfd_object))
- {
- element->archive_pass = -1;
- return FALSE;
- }
+ {
+ element->archive_pass = -1;
+ return FALSE;
+ }
orig_element = element;
if (bfd_is_thin_archive (abfd))
- {
- element = _bfd_vms_lib_get_imagelib_file (element);
- if (element == NULL || !bfd_check_format (element, bfd_object))
- {
- orig_element->archive_pass = -1;
- return FALSE;
- }
- }
+ {
+ element = _bfd_vms_lib_get_imagelib_file (element);
+ if (element == NULL || !bfd_check_format (element, bfd_object))
+ {
+ orig_element->archive_pass = -1;
+ return FALSE;
+ }
+ }
/* Unlike the generic linker, we know that this element provides
a definition for an undefined symbol and we know that we want
{
case bfd_object:
vms_debug2 ((2, "vms_link_add_symbols for object %s\n",
- abfd->filename));
+ abfd->filename));
return alpha_vms_link_add_object_symbols (abfd, info);
break;
case bfd_archive:
vms_debug2 ((2, "vms_link_add_symbols for archive %s\n",
- abfd->filename));
+ abfd->filename));
return alpha_vms_link_add_archive_symbols (abfd, info);
break;
default:
shlib = &VEC_EL (t->shrlibs, struct alpha_vms_shlib_el, i);
if (!shlib->has_fixups)
- continue;
+ continue;
shrimg_cnt++;
if (VEC_COUNT (shlib->ca) > 0)
- {
- /* Header + entries. */
- ca_sz += 8;
- ca_sz += VEC_COUNT (shlib->ca) * 4;
- }
+ {
+ /* Header + entries. */
+ ca_sz += 8;
+ ca_sz += VEC_COUNT (shlib->ca) * 4;
+ }
if (VEC_COUNT (shlib->lp) > 0)
- {
- /* Header + entries. */
- lp_sz += 8;
- lp_sz += VEC_COUNT (shlib->lp) * 4;
- }
+ {
+ /* Header + entries. */
+ lp_sz += 8;
+ lp_sz += VEC_COUNT (shlib->lp) * 4;
+ }
if (VEC_COUNT (shlib->qr) > 0)
- {
- /* Header + entries. */
- qr_sz += 8;
- qr_sz += VEC_COUNT (shlib->qr) * 8;
- }
+ {
+ /* Header + entries. */
+ qr_sz += 8;
+ qr_sz += VEC_COUNT (shlib->qr) * 8;
+ }
}
/* Add markers. */
if (ca_sz > 0)
{
/* This isect could be made RO or EXE after relocations are applied. */
if ((sec->flags & SEC_RELOC) != 0
- && (sec->flags & (SEC_CODE | SEC_READONLY)) != 0)
- chgprt_num++;
+ && (sec->flags & (SEC_CODE | SEC_READONLY)) != 0)
+ chgprt_num++;
}
chgprt_sz = 4 + chgprt_num * sizeof (struct vms_eicp);
/* Write shl. */
for (i = 0; i < VEC_COUNT (t->shrlibs); i++)
- {
- struct alpha_vms_shlib_el *shlib;
- struct vms_shl *shl;
-
- shlib = &VEC_EL (t->shrlibs, struct alpha_vms_shlib_el, i);
-
- if (!shlib->has_fixups)
- continue;
-
- /* Renumber shared images. */
- PRIV2 (shlib->abfd, shr_index) = shrimg_cnt++;
-
- shl = (struct vms_shl *)(content + off);
- bfd_putl32 (0, shl->baseva);
- bfd_putl32 (0, shl->shlptr);
- bfd_putl32 (0, shl->ident);
- bfd_putl32 (0, shl->permctx);
- shl->size = sizeof (struct vms_shl);
- bfd_putl16 (0, shl->fill_1);
- shl->flags = 0;
- bfd_putl32 (0, shl->icb);
- shl->imgnam[0] = strlen (PRIV2 (shlib->abfd, hdr_data.hdr_t_name));
- memcpy (shl->imgnam + 1, PRIV2 (shlib->abfd, hdr_data.hdr_t_name),
- shl->imgnam[0]);
-
- off += sizeof (struct vms_shl);
- }
+ {
+ struct alpha_vms_shlib_el *shlib;
+ struct vms_shl *shl;
+
+ shlib = &VEC_EL (t->shrlibs, struct alpha_vms_shlib_el, i);
+
+ if (!shlib->has_fixups)
+ continue;
+
+ /* Renumber shared images. */
+ PRIV2 (shlib->abfd, shr_index) = shrimg_cnt++;
+
+ shl = (struct vms_shl *)(content + off);
+ bfd_putl32 (0, shl->baseva);
+ bfd_putl32 (0, shl->shlptr);
+ bfd_putl32 (0, shl->ident);
+ bfd_putl32 (0, shl->permctx);
+ shl->size = sizeof (struct vms_shl);
+ bfd_putl16 (0, shl->fill_1);
+ shl->flags = 0;
+ bfd_putl32 (0, shl->icb);
+ shl->imgnam[0] = strlen (PRIV2 (shlib->abfd, hdr_data.hdr_t_name));
+ memcpy (shl->imgnam + 1, PRIV2 (shlib->abfd, hdr_data.hdr_t_name),
+ shl->imgnam[0]);
+
+ off += sizeof (struct vms_shl);
+ }
/* CA fixups. */
if (ca_sz != 0)
- {
- bfd_putl32 (off, eiaf->codeadroff);
+ {
+ bfd_putl32 (off, eiaf->codeadroff);
- for (i = 0; i < VEC_COUNT (t->shrlibs); i++)
- {
- struct alpha_vms_shlib_el *shlib;
- unsigned int j;
+ for (i = 0; i < VEC_COUNT (t->shrlibs); i++)
+ {
+ struct alpha_vms_shlib_el *shlib;
+ unsigned int j;
- shlib = &VEC_EL (t->shrlibs, struct alpha_vms_shlib_el, i);
+ shlib = &VEC_EL (t->shrlibs, struct alpha_vms_shlib_el, i);
- if (VEC_COUNT (shlib->ca) == 0)
- continue;
+ if (VEC_COUNT (shlib->ca) == 0)
+ continue;
- bfd_putl32 (VEC_COUNT (shlib->ca), content + off);
- bfd_putl32 (PRIV2 (shlib->abfd, shr_index), content + off + 4);
- off += 8;
+ bfd_putl32 (VEC_COUNT (shlib->ca), content + off);
+ bfd_putl32 (PRIV2 (shlib->abfd, shr_index), content + off + 4);
+ off += 8;
- for (j = 0; j < VEC_COUNT (shlib->ca); j++)
- {
- bfd_putl32 (VEC_EL (shlib->ca, bfd_vma, j) - t->base_addr,
- content + off);
- off += 4;
- }
- }
+ for (j = 0; j < VEC_COUNT (shlib->ca); j++)
+ {
+ bfd_putl32 (VEC_EL (shlib->ca, bfd_vma, j) - t->base_addr,
+ content + off);
+ off += 4;
+ }
+ }
- bfd_putl32 (0, content + off);
- bfd_putl32 (0, content + off + 4);
- off += 8;
- }
+ bfd_putl32 (0, content + off);
+ bfd_putl32 (0, content + off + 4);
+ off += 8;
+ }
/* LP fixups. */
if (lp_sz != 0)
- {
- bfd_putl32 (off, eiaf->lpfixoff);
+ {
+ bfd_putl32 (off, eiaf->lpfixoff);
- for (i = 0; i < VEC_COUNT (t->shrlibs); i++)
- {
- struct alpha_vms_shlib_el *shlib;
- unsigned int j;
+ for (i = 0; i < VEC_COUNT (t->shrlibs); i++)
+ {
+ struct alpha_vms_shlib_el *shlib;
+ unsigned int j;
- shlib = &VEC_EL (t->shrlibs, struct alpha_vms_shlib_el, i);
+ shlib = &VEC_EL (t->shrlibs, struct alpha_vms_shlib_el, i);
- if (VEC_COUNT (shlib->lp) == 0)
- continue;
+ if (VEC_COUNT (shlib->lp) == 0)
+ continue;
- bfd_putl32 (VEC_COUNT (shlib->lp), content + off);
- bfd_putl32 (PRIV2 (shlib->abfd, shr_index), content + off + 4);
- off += 8;
+ bfd_putl32 (VEC_COUNT (shlib->lp), content + off);
+ bfd_putl32 (PRIV2 (shlib->abfd, shr_index), content + off + 4);
+ off += 8;
- for (j = 0; j < VEC_COUNT (shlib->lp); j++)
- {
- bfd_putl32 (VEC_EL (shlib->lp, bfd_vma, j) - t->base_addr,
- content + off);
- off += 4;
- }
- }
+ for (j = 0; j < VEC_COUNT (shlib->lp); j++)
+ {
+ bfd_putl32 (VEC_EL (shlib->lp, bfd_vma, j) - t->base_addr,
+ content + off);
+ off += 4;
+ }
+ }
- bfd_putl32 (0, content + off);
- bfd_putl32 (0, content + off + 4);
- off += 8;
- }
+ bfd_putl32 (0, content + off);
+ bfd_putl32 (0, content + off + 4);
+ off += 8;
+ }
/* QR fixups. */
if (qr_sz != 0)
- {
- bfd_putl32 (off, eiaf->qdotadroff);
+ {
+ bfd_putl32 (off, eiaf->qdotadroff);
- for (i = 0; i < VEC_COUNT (t->shrlibs); i++)
- {
- struct alpha_vms_shlib_el *shlib;
- unsigned int j;
+ for (i = 0; i < VEC_COUNT (t->shrlibs); i++)
+ {
+ struct alpha_vms_shlib_el *shlib;
+ unsigned int j;
- shlib = &VEC_EL (t->shrlibs, struct alpha_vms_shlib_el, i);
+ shlib = &VEC_EL (t->shrlibs, struct alpha_vms_shlib_el, i);
- if (VEC_COUNT (shlib->qr) == 0)
- continue;
+ if (VEC_COUNT (shlib->qr) == 0)
+ continue;
- bfd_putl32 (VEC_COUNT (shlib->qr), content + off);
- bfd_putl32 (PRIV2 (shlib->abfd, shr_index), content + off + 4);
- off += 8;
+ bfd_putl32 (VEC_COUNT (shlib->qr), content + off);
+ bfd_putl32 (PRIV2 (shlib->abfd, shr_index), content + off + 4);
+ off += 8;
- for (j = 0; j < VEC_COUNT (shlib->qr); j++)
- {
- struct alpha_vms_vma_ref *r;
- r = &VEC_EL (shlib->qr, struct alpha_vms_vma_ref, j);
- bfd_putl32 (r->vma - t->base_addr, content + off);
- bfd_putl32 (r->ref, content + off + 4);
- off += 8;
- }
- }
+ for (j = 0; j < VEC_COUNT (shlib->qr); j++)
+ {
+ struct alpha_vms_vma_ref *r;
+ r = &VEC_EL (shlib->qr, struct alpha_vms_vma_ref, j);
+ bfd_putl32 (r->vma - t->base_addr, content + off);
+ bfd_putl32 (r->ref, content + off + 4);
+ off += 8;
+ }
+ }
- bfd_putl32 (0, content + off);
- bfd_putl32 (0, content + off + 4);
- off += 8;
- }
+ bfd_putl32 (0, content + off);
+ bfd_putl32 (0, content + off + 4);
+ off += 8;
+ }
}
/* Write the change protection table. */
unsigned int prot;
if ((sec->flags & SEC_LINKER_CREATED) != 0 &&
- strcmp (sec->name, "$FIXUP$") == 0)
- prot = PRT__C_UREW;
+ strcmp (sec->name, "$FIXUP$") == 0)
+ prot = PRT__C_UREW;
else if ((sec->flags & SEC_RELOC) != 0
- && (sec->flags & (SEC_CODE | SEC_READONLY)) != 0)
- prot = PRT__C_UR;
+ && (sec->flags & (SEC_CODE | SEC_READONLY)) != 0)
+ prot = PRT__C_UR;
else
- continue;
+ continue;
eicp = (struct vms_eicp *)(content + off);
bfd_putl64 (sec->vma - t->base_addr, eicp->baseva);
bfd_putl32 ((sec->size + VMS_BLOCK_SIZE - 1) & ~(VMS_BLOCK_SIZE - 1),
- eicp->size);
+ eicp->size);
bfd_putl32 (prot, eicp->newprt);
off += sizeof (struct vms_eicp);
}
case bfd_link_hash_defined:
case bfd_link_hash_defweak:
{
- asection *sec = h->root.u.def.section;
+ asection *sec = h->root.u.def.section;
- /* FIXME: this is certainly a symbol from a dynamic library. */
- if (bfd_is_abs_section (sec))
- return TRUE;
+ /* FIXME: this is certainly a symbol from a dynamic library. */
+ if (bfd_is_abs_section (sec))
+ return TRUE;
- if (sec->owner->flags & DYNAMIC)
- return TRUE;
+ if (sec->owner->flags & DYNAMIC)
+ return TRUE;
}
break;
case bfd_link_hash_common:
/* Do not write not kept symbols. */
if (info->strip == strip_some
&& bfd_hash_lookup (info->keep_hash, h->root.root.string,
- FALSE, FALSE) != NULL)
+ FALSE, FALSE) != NULL)
return TRUE;
if (h->sym == NULL)
{
/* This symbol doesn't come from a VMS object. So we suppose it is
- a data. */
+ a data. */
int len = strlen (h->root.root.string);
sym = (struct vms_symbol_entry *)bfd_zalloc (info->output_bfd,
- sizeof (*sym) + len);
+ sizeof (*sym) + len);
if (sym == NULL)
- abort ();
+ abort ();
sym->namelen = len;
memcpy (sym->name, h->root.root.string, len);
sym->name[len] = 0;
if (bfd_link_relocatable (info))
{
/* FIXME: we do not yet support relocatable link. It is not obvious
- how to do it for debug infos. */
+ how to do it for debug infos. */
(*info->callbacks->einfo)(_("%P: relocatable link is not supported\n"));
return FALSE;
}
for (o = abfd->sections; o != NULL; o = o->next)
{
printf ("For section %s (at 0x%08x, flags=0x%08x):\n",
- o->name, (unsigned)o->vma, (unsigned)o->flags);
+ o->name, (unsigned)o->vma, (unsigned)o->flags);
for (p = o->map_head.link_order; p != NULL; p = p->next)
{
- printf (" at 0x%08x - 0x%08x: ",
- (unsigned)p->offset, (unsigned)(p->offset + p->size - 1));
+ printf (" at 0x%08x - 0x%08x: ",
+ (unsigned)p->offset, (unsigned)(p->offset + p->size - 1));
switch (p->type)
{
case bfd_section_reloc_link_order:
case bfd_symbol_reloc_link_order:
- printf (" section/symbol reloc\n");
+ printf (" section/symbol reloc\n");
break;
case bfd_indirect_link_order:
- printf (" section %s of %s\n",
- p->u.indirect.section->name,
- p->u.indirect.section->owner->filename);
+ printf (" section %s of %s\n",
+ p->u.indirect.section->name,
+ p->u.indirect.section->owner->filename);
+ break;
+ case bfd_data_link_order:
+ printf (" explicit data\n");
break;
- case bfd_data_link_order:
- printf (" explicit data\n");
- break;
default:
- printf (" *unknown* type %u\n", p->type);
+ printf (" *unknown* type %u\n", p->type);
break;
}
}
bfd *startbfd = NULL;
for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
- {
- /* Consider only VMS object files. */
- if (sub->xvec != abfd->xvec)
- continue;
-
- if (!PRIV2 (sub, eom_data).eom_has_transfer)
- continue;
- if ((PRIV2 (sub, eom_data).eom_b_tfrflg & EEOM__M_WKTFR) && startbfd)
- continue;
- if (startbfd != NULL
- && !(PRIV2 (sub, eom_data).eom_b_tfrflg & EEOM__M_WKTFR))
- {
- (*info->callbacks->einfo)
+ {
+ /* Consider only VMS object files. */
+ if (sub->xvec != abfd->xvec)
+ continue;
+
+ if (!PRIV2 (sub, eom_data).eom_has_transfer)
+ continue;
+ if ((PRIV2 (sub, eom_data).eom_b_tfrflg & EEOM__M_WKTFR) && startbfd)
+ continue;
+ if (startbfd != NULL
+ && !(PRIV2 (sub, eom_data).eom_b_tfrflg & EEOM__M_WKTFR))
+ {
+ (*info->callbacks->einfo)
/* xgettext:c-format */
- (_("%P: multiple entry points: in modules %B and %B\n"),
- startbfd, sub);
- continue;
- }
- startbfd = sub;
- }
+ (_("%P: multiple entry points: in modules %B and %B\n"),
+ startbfd, sub);
+ continue;
+ }
+ startbfd = sub;
+ }
if (startbfd)
- {
- unsigned int ps_idx = PRIV2 (startbfd, eom_data).eom_l_psindx;
- bfd_vma tfradr = PRIV2 (startbfd, eom_data).eom_l_tfradr;
- asection *sec;
+ {
+ unsigned int ps_idx = PRIV2 (startbfd, eom_data).eom_l_psindx;
+ bfd_vma tfradr = PRIV2 (startbfd, eom_data).eom_l_tfradr;
+ asection *sec;
- sec = PRIV2 (startbfd, sections)[ps_idx];
+ sec = PRIV2 (startbfd, sections)[ps_idx];
- bfd_set_start_address
- (abfd, sec->output_section->vma + sec->output_offset + tfradr);
- }
+ bfd_set_start_address
+ (abfd, sec->output_section->vma + sec->output_offset + tfradr);
+ }
}
/* Set transfer addresses. */
h = bfd_link_hash_lookup (info->hash, "LIB$INITIALIZE", FALSE, FALSE, TRUE);
if (h != NULL && h->type == bfd_link_hash_defined)
PRIV (transfer_address[i++]) =
- alpha_vms_get_sym_value (h->u.def.section, h->u.def.value);
+ alpha_vms_get_sym_value (h->u.def.section, h->u.def.value);
PRIV (transfer_address[i++]) = bfd_get_start_address (abfd);
while (i < 4)
PRIV (transfer_address[i++]) = 0;
for (o = abfd->sections; o != NULL; o = o->next)
{
if (o->flags & SEC_HAS_CONTENTS)
- {
- o->contents = bfd_alloc (abfd, o->size);
- if (o->contents == NULL)
- return FALSE;
- }
+ {
+ o->contents = bfd_alloc (abfd, o->size);
+ if (o->contents == NULL)
+ return FALSE;
+ }
if (o->flags & SEC_LOAD)
- {
- if (o->vma < base_addr)
- base_addr = o->vma;
- if (o->vma + o->size > last_addr)
- last_addr = o->vma + o->size;
- }
+ {
+ if (o->vma < base_addr)
+ base_addr = o->vma;
+ if (o->vma + o->size > last_addr)
+ last_addr = o->vma + o->size;
+ }
/* Clear the RELOC flags. Currently we don't support incremental
- linking. We use the RELOC flag for computing the eicp entries. */
+ linking. We use the RELOC flag for computing the eicp entries. */
o->flags &= ~SEC_RELOC;
}
{
PRIV (dst_section) = dst;
dmt = bfd_make_section_anyway_with_flags
- (info->output_bfd, "$DMT$",
- SEC_DEBUGGING | SEC_HAS_CONTENTS | SEC_LINKER_CREATED);
+ (info->output_bfd, "$DMT$",
+ SEC_DEBUGGING | SEC_HAS_CONTENTS | SEC_LINKER_CREATED);
if (dmt == NULL)
- return FALSE;
+ return FALSE;
}
else
dmt = NULL;
for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
{
if (sub->flags & DYNAMIC)
- {
- alpha_vms_create_eisd_for_shared (abfd, sub);
- continue;
- }
+ {
+ alpha_vms_create_eisd_for_shared (abfd, sub);
+ continue;
+ }
if (!alpha_vms_read_sections_content (sub, info))
- return FALSE;
+ return FALSE;
}
/* Handle all the link order information for the sections.
{
case bfd_section_reloc_link_order:
case bfd_symbol_reloc_link_order:
- abort ();
- return FALSE;
+ abort ();
+ return FALSE;
case bfd_indirect_link_order:
- /* Already done. */
+ /* Already done. */
break;
default:
if (! _bfd_default_link_order (abfd, info, o, p))
/* In pass 1, compute the size. In pass 2, write the DMT contents. */
for (pass = 0; pass < 2; pass++)
- {
- unsigned int off = 0;
-
- /* For each object file (ie for each module). */
- for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
- {
- asection *sub_dst;
- struct vms_dmt_header *dmth = NULL;
- unsigned int psect_count;
-
- /* Skip this module if it has no DST. */
- sub_dst = PRIV2 (sub, dst_section);
- if (sub_dst == NULL || sub_dst->size == 0)
- continue;
-
- if (pass == 1)
- {
- /* Write the header. */
- dmth = (struct vms_dmt_header *)(contents + off);
- bfd_putl32 (sub_dst->output_offset, dmth->modbeg);
- bfd_putl32 (sub_dst->size, dmth->size);
- }
-
- off += sizeof (struct vms_dmt_header);
- psect_count = 0;
-
- /* For each section (ie for each psect). */
- for (o = sub->sections; o != NULL; o = o->next)
- {
- /* Only consider interesting sections. */
- if (!(o->flags & SEC_ALLOC))
- continue;
- if (o->flags & SEC_LINKER_CREATED)
- continue;
-
- if (pass == 1)
- {
- /* Write an entry. */
- struct vms_dmt_psect *dmtp;
-
- dmtp = (struct vms_dmt_psect *)(contents + off);
- bfd_putl32 (o->output_offset + o->output_section->vma,
- dmtp->start);
- bfd_putl32 (o->size, dmtp->length);
- psect_count++;
- }
- off += sizeof (struct vms_dmt_psect);
- }
- if (pass == 1)
- bfd_putl32 (psect_count, dmth->psect_count);
- }
-
- if (pass == 0)
- {
- contents = bfd_zalloc (info->output_bfd, off);
- if (contents == NULL)
- return FALSE;
- dmt->contents = contents;
- dmt->size = off;
- }
- else
- {
- BFD_ASSERT (off == dmt->size);
- }
- }
+ {
+ unsigned int off = 0;
+
+ /* For each object file (ie for each module). */
+ for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
+ {
+ asection *sub_dst;
+ struct vms_dmt_header *dmth = NULL;
+ unsigned int psect_count;
+
+ /* Skip this module if it has no DST. */
+ sub_dst = PRIV2 (sub, dst_section);
+ if (sub_dst == NULL || sub_dst->size == 0)
+ continue;
+
+ if (pass == 1)
+ {
+ /* Write the header. */
+ dmth = (struct vms_dmt_header *)(contents + off);
+ bfd_putl32 (sub_dst->output_offset, dmth->modbeg);
+ bfd_putl32 (sub_dst->size, dmth->size);
+ }
+
+ off += sizeof (struct vms_dmt_header);
+ psect_count = 0;
+
+ /* For each section (ie for each psect). */
+ for (o = sub->sections; o != NULL; o = o->next)
+ {
+ /* Only consider interesting sections. */
+ if (!(o->flags & SEC_ALLOC))
+ continue;
+ if (o->flags & SEC_LINKER_CREATED)
+ continue;
+
+ if (pass == 1)
+ {
+ /* Write an entry. */
+ struct vms_dmt_psect *dmtp;
+
+ dmtp = (struct vms_dmt_psect *)(contents + off);
+ bfd_putl32 (o->output_offset + o->output_section->vma,
+ dmtp->start);
+ bfd_putl32 (o->size, dmtp->length);
+ psect_count++;
+ }
+ off += sizeof (struct vms_dmt_psect);
+ }
+ if (pass == 1)
+ bfd_putl32 (psect_count, dmth->psect_count);
+ }
+
+ if (pass == 0)
+ {
+ contents = bfd_zalloc (info->output_bfd, off);
+ if (contents == NULL)
+ return FALSE;
+ dmt->contents = contents;
+ dmt->size = off;
+ }
+ else
+ {
+ BFD_ASSERT (off == dmt->size);
+ }
+ }
}
return TRUE;
static bfd_boolean
alpha_vms_get_section_contents (bfd *abfd, asection *section,
- void *buf, file_ptr offset,
- bfd_size_type count)
+ void *buf, file_ptr offset,
+ bfd_size_type count)
{
asection *sec;
/* Image are easy. */
if (bfd_get_file_flags (abfd) & (EXEC_P | DYNAMIC))
return _bfd_generic_get_section_contents (abfd, section,
- buf, offset, count);
+ buf, offset, count);
/* Safety check. */
if (offset + count < count
BFD_ASSERT (sec->contents == NULL);
if (sec->size != 0 && (sec->flags & SEC_HAS_CONTENTS))
- {
- sec->contents = bfd_alloc (abfd, sec->size);
- if (sec->contents == NULL)
- return FALSE;
- }
+ {
+ sec->contents = bfd_alloc (abfd, sec->size);
+ if (sec->contents == NULL)
+ return FALSE;
+ }
}
if (!alpha_vms_read_sections_content (abfd, NULL))
return FALSE;
bfd_size_type amt;
vms_debug2 ((1, "vms_new_section_hook (%p, [%u]%s)\n",
- abfd, section->index, section->name));
+ abfd, section->index, section->name));
if (! bfd_set_section_alignment (abfd, section, 0))
return FALSE;
bfd_print_symbol_type how)
{
vms_debug2 ((1, "vms_print_symbol (%p, %p, %p, %d)\n",
- abfd, file, symbol, how));
+ abfd, file, symbol, how));
switch (how)
{
bfd_print_symbol_vandf (abfd, file, symbol);
fprintf ((FILE *) file," %-8s %s", section_name, symbol->name);
- }
+ }
break;
}
}
else if (bfd_is_ind_section (sec))
ret->type = 'I';
else if ((symbol->flags & BSF_FUNCTION)
- || (bfd_get_section_flags (abfd, sec) & SEC_CODE))
+ || (bfd_get_section_flags (abfd, sec) & SEC_CODE))
ret->type = 'T';
else if (bfd_get_section_flags (abfd, sec) & SEC_DATA)
ret->type = 'D';
static bfd_boolean
_bfd_vms_set_section_contents (bfd * abfd,
- asection *section,
- const void * location,
- file_ptr offset,
- bfd_size_type count)
+ asection *section,
+ const void * location,
+ file_ptr offset,
+ bfd_size_type count)
{
if (section->contents == NULL)
{
section->contents = bfd_alloc (abfd, section->size);
if (section->contents == NULL)
- return FALSE;
+ return FALSE;
memcpy (section->contents + offset, location, (size_t) count);
}
static bfd_boolean
alpha_vms_set_arch_mach (bfd *abfd,
- enum bfd_architecture arch, unsigned long mach)
+ enum bfd_architecture arch, unsigned long mach)
{
if (arch != bfd_arch_alpha
&& arch != bfd_arch_unknown)
}
#define vms_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define vms_bfd_link_just_syms _bfd_generic_link_just_syms
+#define vms_bfd_link_just_syms _bfd_generic_link_just_syms
#define vms_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
-#define vms_bfd_is_group_section bfd_generic_is_group_section
-#define vms_bfd_discard_group bfd_generic_discard_group
-#define vms_section_already_linked _bfd_generic_section_already_linked
-#define vms_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define vms_bfd_is_group_section bfd_generic_is_group_section
+#define vms_bfd_discard_group bfd_generic_discard_group
+#define vms_section_already_linked _bfd_generic_section_already_linked
+#define vms_bfd_define_common_symbol bfd_generic_define_common_symbol
#define vms_bfd_define_start_stop bfd_generic_define_start_stop
#define vms_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
#define vms_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
#define vms_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data
#define vms_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
-#define vms_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
-#define vms_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
+#define vms_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
+#define vms_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
/* Symbols table. */
-#define alpha_vms_make_empty_symbol _bfd_generic_make_empty_symbol
+#define alpha_vms_make_empty_symbol _bfd_generic_make_empty_symbol
#define alpha_vms_bfd_is_target_special_symbol \
((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define alpha_vms_print_symbol vms_print_symbol
-#define alpha_vms_get_symbol_info vms_get_symbol_info
+#define alpha_vms_print_symbol vms_print_symbol
+#define alpha_vms_get_symbol_info vms_get_symbol_info
#define alpha_vms_get_symbol_version_string \
_bfd_nosymbols_get_symbol_version_string
-#define alpha_vms_read_minisymbols _bfd_generic_read_minisymbols
-#define alpha_vms_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-#define alpha_vms_get_lineno _bfd_nosymbols_get_lineno
-#define alpha_vms_find_inliner_info _bfd_nosymbols_find_inliner_info
-#define alpha_vms_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define alpha_vms_find_nearest_line _bfd_vms_find_nearest_line
-#define alpha_vms_find_line _bfd_nosymbols_find_line
+#define alpha_vms_read_minisymbols _bfd_generic_read_minisymbols
+#define alpha_vms_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define alpha_vms_get_lineno _bfd_nosymbols_get_lineno
+#define alpha_vms_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define alpha_vms_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define alpha_vms_find_nearest_line _bfd_vms_find_nearest_line
+#define alpha_vms_find_line _bfd_nosymbols_find_line
#define alpha_vms_bfd_is_local_label_name vms_bfd_is_local_label_name
/* Generic table. */
_bfd_nodynamic_get_dynamic_reloc_upper_bound
#define alpha_vms_canonicalize_dynamic_reloc \
_bfd_nodynamic_canonicalize_dynamic_reloc
-#define alpha_vms_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define alpha_vms_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target alpha_vms_vec =
{
static bfd_boolean
vms_add_index (struct carsym_mem *cs, char *name,
- unsigned int idx_vbn, unsigned int idx_off)
+ unsigned int idx_vbn, unsigned int idx_off)
{
if (cs->nbr == cs->max)
{
cs->max = 2 * cs->max + 32;
if (!cs->realloced)
- {
- n = bfd_malloc2 (cs->max, sizeof (struct carsym));
- if (n == NULL)
- return FALSE;
- memcpy (n, cs->idx, cs->nbr * sizeof (struct carsym));
- /* And unfortunately we can't free cs->idx. */
- }
+ {
+ n = bfd_malloc2 (cs->max, sizeof (struct carsym));
+ if (n == NULL)
+ return FALSE;
+ memcpy (n, cs->idx, cs->nbr * sizeof (struct carsym));
+ /* And unfortunately we can't free cs->idx. */
+ }
else
- {
- n = bfd_realloc_or_free (cs->idx, cs->nbr * sizeof (struct carsym));
- if (n == NULL)
- return FALSE;
- }
+ {
+ n = bfd_realloc_or_free (cs->idx, cs->nbr * sizeof (struct carsym));
+ if (n == NULL)
+ return FALSE;
+ }
cs->idx = n;
cs->realloced = TRUE;
}
static bfd_boolean
vms_add_indexes_from_list (bfd *abfd, struct carsym_mem *cs, char *name,
- struct vms_rfa *rfa)
+ struct vms_rfa *rfa)
{
struct vms_lns lns;
unsigned int vbn;
{
vbn = bfd_getl32 (rfa->vbn);
if (vbn == 0)
- return TRUE;
+ return TRUE;
/* Read the LHS. */
off = (vbn - 1) * VMS_BLOCK_SIZE + bfd_getl16 (rfa->offset);
if (bfd_seek (abfd, off, SEEK_SET) != 0
- || bfd_bread (&lns, sizeof (lns), abfd) != sizeof (lns))
- return FALSE;
+ || bfd_bread (&lns, sizeof (lns), abfd) != sizeof (lns))
+ return FALSE;
if (!vms_add_index (cs, name,
- bfd_getl32 (lns.modrfa.vbn),
- bfd_getl16 (lns.modrfa.offset)))
- return FALSE;
+ bfd_getl32 (lns.modrfa.vbn),
+ bfd_getl16 (lns.modrfa.offset)))
+ return FALSE;
rfa = &lns.nxtrfa;
}
/* Extract key length. */
if (bfd_libdata (abfd)->ver == LBR_MAJORID)
- {
- struct vms_idx *ridx = (struct vms_idx *)p;
+ {
+ struct vms_idx *ridx = (struct vms_idx *)p;
- idx_vbn = bfd_getl32 (ridx->rfa.vbn);
- idx_off = bfd_getl16 (ridx->rfa.offset);
+ idx_vbn = bfd_getl32 (ridx->rfa.vbn);
+ idx_off = bfd_getl16 (ridx->rfa.offset);
- keylen = ridx->keylen;
- flags = 0;
- keyname = ridx->keyname;
- }
+ keylen = ridx->keylen;
+ flags = 0;
+ keyname = ridx->keyname;
+ }
else if (bfd_libdata (abfd)->ver == LBR_ELFMAJORID)
- {
- struct vms_elfidx *ridx = (struct vms_elfidx *)p;
+ {
+ struct vms_elfidx *ridx = (struct vms_elfidx *)p;
- idx_vbn = bfd_getl32 (ridx->rfa.vbn);
- idx_off = bfd_getl16 (ridx->rfa.offset);
+ idx_vbn = bfd_getl32 (ridx->rfa.vbn);
+ idx_off = bfd_getl16 (ridx->rfa.offset);
- keylen = bfd_getl16 (ridx->keylen);
- flags = ridx->flags;
- keyname = ridx->keyname;
- }
+ keylen = bfd_getl16 (ridx->keylen);
+ flags = ridx->flags;
+ keyname = ridx->keyname;
+ }
else
- return FALSE;
+ return FALSE;
/* Illegal value. */
if (idx_vbn == 0)
- return FALSE;
+ return FALSE;
/* Point to the next index entry. */
p = keyname + keylen;
if (idx_off == RFADEF__C_INDEX)
- {
- /* Indirect entry. Recurse. */
- if (!vms_traverse_index (abfd, idx_vbn, cs))
- return FALSE;
- }
+ {
+ /* Indirect entry. Recurse. */
+ if (!vms_traverse_index (abfd, idx_vbn, cs))
+ return FALSE;
+ }
else
- {
- /* Add a new entry. */
- char *name;
-
- if (flags & ELFIDX__SYMESC)
- {
- /* Extended key name. */
- unsigned int noff = 0;
- unsigned int koff;
- unsigned int kvbn;
- struct vms_kbn *kbn;
- unsigned char kblk[VMS_BLOCK_SIZE];
-
- /* Sanity check. */
- if (keylen != sizeof (struct vms_kbn))
- return FALSE;
-
- kbn = (struct vms_kbn *)keyname;
- keylen = bfd_getl16 (kbn->keylen);
-
- name = bfd_alloc (abfd, keylen + 1);
- if (name == NULL)
- return FALSE;
- kvbn = bfd_getl32 (kbn->rfa.vbn);
- koff = bfd_getl16 (kbn->rfa.offset);
-
- /* Read the key, chunk by chunk. */
- do
- {
- unsigned int klen;
-
- if (!vms_read_block (abfd, kvbn, kblk))
- return FALSE;
- kbn = (struct vms_kbn *)(kblk + koff);
- klen = bfd_getl16 (kbn->keylen);
- kvbn = bfd_getl32 (kbn->rfa.vbn);
- koff = bfd_getl16 (kbn->rfa.offset);
-
- memcpy (name + noff, kbn + 1, klen);
- noff += klen;
- }
- while (kvbn != 0);
-
- /* Sanity check. */
- if (noff != keylen)
- return FALSE;
- }
- else
- {
- /* Usual key name. */
- name = bfd_alloc (abfd, keylen + 1);
- if (name == NULL)
- return FALSE;
-
- memcpy (name, keyname, keylen);
- }
- name[keylen] = 0;
-
- if (flags & ELFIDX__LISTRFA)
- {
- struct vms_lhs lhs;
-
- /* Read the LHS. */
- off = (idx_vbn - 1) * VMS_BLOCK_SIZE + idx_off;
- if (bfd_seek (abfd, off, SEEK_SET) != 0
- || bfd_bread (&lhs, sizeof (lhs), abfd) != sizeof (lhs))
- return FALSE;
-
- /* FIXME: this adds extra entries that were not accounted. */
- if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.ng_g_rfa))
- return FALSE;
- if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.ng_wk_rfa))
- return FALSE;
- if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.g_g_rfa))
- return FALSE;
- if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.g_wk_rfa))
- return FALSE;
- }
- else
- {
- if (!vms_add_index (cs, name, idx_vbn, idx_off))
- return FALSE;
- }
- }
+ {
+ /* Add a new entry. */
+ char *name;
+
+ if (flags & ELFIDX__SYMESC)
+ {
+ /* Extended key name. */
+ unsigned int noff = 0;
+ unsigned int koff;
+ unsigned int kvbn;
+ struct vms_kbn *kbn;
+ unsigned char kblk[VMS_BLOCK_SIZE];
+
+ /* Sanity check. */
+ if (keylen != sizeof (struct vms_kbn))
+ return FALSE;
+
+ kbn = (struct vms_kbn *)keyname;
+ keylen = bfd_getl16 (kbn->keylen);
+
+ name = bfd_alloc (abfd, keylen + 1);
+ if (name == NULL)
+ return FALSE;
+ kvbn = bfd_getl32 (kbn->rfa.vbn);
+ koff = bfd_getl16 (kbn->rfa.offset);
+
+ /* Read the key, chunk by chunk. */
+ do
+ {
+ unsigned int klen;
+
+ if (!vms_read_block (abfd, kvbn, kblk))
+ return FALSE;
+ kbn = (struct vms_kbn *)(kblk + koff);
+ klen = bfd_getl16 (kbn->keylen);
+ kvbn = bfd_getl32 (kbn->rfa.vbn);
+ koff = bfd_getl16 (kbn->rfa.offset);
+
+ memcpy (name + noff, kbn + 1, klen);
+ noff += klen;
+ }
+ while (kvbn != 0);
+
+ /* Sanity check. */
+ if (noff != keylen)
+ return FALSE;
+ }
+ else
+ {
+ /* Usual key name. */
+ name = bfd_alloc (abfd, keylen + 1);
+ if (name == NULL)
+ return FALSE;
+
+ memcpy (name, keyname, keylen);
+ }
+ name[keylen] = 0;
+
+ if (flags & ELFIDX__LISTRFA)
+ {
+ struct vms_lhs lhs;
+
+ /* Read the LHS. */
+ off = (idx_vbn - 1) * VMS_BLOCK_SIZE + idx_off;
+ if (bfd_seek (abfd, off, SEEK_SET) != 0
+ || bfd_bread (&lhs, sizeof (lhs), abfd) != sizeof (lhs))
+ return FALSE;
+
+ /* FIXME: this adds extra entries that were not accounted. */
+ if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.ng_g_rfa))
+ return FALSE;
+ if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.ng_wk_rfa))
+ return FALSE;
+ if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.g_g_rfa))
+ return FALSE;
+ if (!vms_add_indexes_from_list (abfd, cs, name, &lhs.g_wk_rfa))
+ return FALSE;
+ }
+ else
+ {
+ if (!vms_add_index (cs, name, idx_vbn, idx_off))
+ return FALSE;
+ }
+ }
}
return TRUE;
if (vbn != 0 && !vms_traverse_index (abfd, vbn, &csm))
{
if (csm.realloced && csm.idx != NULL)
- free (csm.idx);
+ free (csm.idx);
/* Note: in case of error, we can free what was allocated on the
- BFD's objalloc. */
+ BFD's objalloc. */
bfd_release (abfd, csbuf);
return NULL;
}
if (csm.realloced)
{
/* There are more entries than the first estimate. Allocate on
- the BFD's objalloc. */
+ the BFD's objalloc. */
csbuf = bfd_alloc (abfd, csm.nbr * sizeof (struct carsym));
if (csbuf == NULL)
- return NULL;
+ return NULL;
memcpy (csbuf, csm.idx, csm.nbr * sizeof (struct carsym));
free (csm.idx);
*nbrel = csm.nbr;
/* Check sanity (= magic) number. */
sanity = bfd_getl32 (lhd.sanity);
if (!(sanity == LHD_SANEID3
- || sanity == LHD_SANEID6
- || sanity == LHD_SANEID_DCX))
+ || sanity == LHD_SANEID6
+ || sanity == LHD_SANEID_DCX))
{
bfd_set_error (bfd_error_wrong_format);
return NULL;
{
case vms_lib_alpha:
if ((lhd.type != LBR__C_TYP_EOBJ && lhd.type != LBR__C_TYP_ESHSTB)
- || majorid != LBR_MAJORID
- || lhd.nindex != 2)
- {
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
+ || majorid != LBR_MAJORID
+ || lhd.nindex != 2)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
break;
case vms_lib_ia64:
if ((lhd.type != LBR__C_TYP_IOBJ && lhd.type != LBR__C_TYP_ISHSTB)
- || majorid != LBR_ELFMAJORID
- || lhd.nindex != 2)
- {
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
+ || majorid != LBR_ELFMAJORID
+ || lhd.nindex != 2)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
break;
case vms_lib_txt:
if ((lhd.type != LBR__C_TYP_TXT
- && lhd.type != LBR__C_TYP_MLB
- && lhd.type != LBR__C_TYP_HLP)
- || majorid != LBR_MAJORID
- || lhd.nindex != 1)
- {
- bfd_set_error (bfd_error_wrong_format);
- return NULL;
- }
+ && lhd.type != LBR__C_TYP_MLB
+ && lhd.type != LBR__C_TYP_HLP)
+ || majorid != LBR_MAJORID
+ || lhd.nindex != 1)
+ {
+ bfd_set_error (bfd_error_wrong_format);
+ return NULL;
+ }
break;
default:
abort ();
nbr_ent = tdata->artdata.symdef_count;
tdata->artdata.symdefs = vms_lib_read_index (abfd, 1, &nbr_ent);
if (tdata->artdata.symdefs == NULL)
- goto err;
+ goto err;
/* Only IA64 archives may have more entries in the index that what
- was declared. */
+ was declared. */
if (nbr_ent != tdata->artdata.symdef_count
- && kind != vms_lib_ia64)
- goto err;
+ && kind != vms_lib_ia64)
+ goto err;
tdata->artdata.symdef_count = nbr_ent;
}
tdata->cache = bfd_zalloc (abfd, sizeof (bfd *) * tdata->nbr_modules);
unsigned int i;
if (bfd_seek (abfd, (dcxvbn - 1) * VMS_BLOCK_SIZE, SEEK_SET) != 0
- || bfd_bread (buf_reclen, sizeof (buf_reclen), abfd)
- != sizeof (buf_reclen))
- goto err;
+ || bfd_bread (buf_reclen, sizeof (buf_reclen), abfd)
+ != sizeof (buf_reclen))
+ goto err;
reclen = bfd_getl32 (buf_reclen);
buf = bfd_malloc (reclen);
if (buf == NULL)
- goto err;
+ goto err;
if (bfd_bread (buf, reclen, abfd) != reclen)
- {
- free (buf);
- goto err;
- }
+ {
+ free (buf);
+ goto err;
+ }
map = (struct vms_dcxmap *)buf;
tdata->nbr_dcxsbm = bfd_getl16 (map->nsubs);
sbm_off = bfd_getl16 (map->sub0);
tdata->dcxsbm = (struct dcxsbm_desc *)bfd_alloc
- (abfd, tdata->nbr_dcxsbm * sizeof (struct dcxsbm_desc));
+ (abfd, tdata->nbr_dcxsbm * sizeof (struct dcxsbm_desc));
for (i = 0; i < tdata->nbr_dcxsbm; i++)
- {
- struct vms_dcxsbm *sbm = (struct vms_dcxsbm *) (buf + sbm_off);
- struct dcxsbm_desc *sbmdesc = &tdata->dcxsbm[i];
- unsigned int sbm_len;
- unsigned int sbm_sz;
- unsigned int off;
- unsigned char *data = (unsigned char *)sbm;
- unsigned char *buf1;
- unsigned int l, j;
-
- sbm_sz = bfd_getl16 (sbm->size);
- sbm_off += sbm_sz;
- BFD_ASSERT (sbm_off <= reclen);
-
- sbmdesc->min_char = sbm->min_char;
- BFD_ASSERT (sbmdesc->min_char == 0);
- sbmdesc->max_char = sbm->max_char;
- sbm_len = sbmdesc->max_char - sbmdesc->min_char + 1;
- l = (2 * sbm_len + 7) / 8;
- BFD_ASSERT
- (sbm_sz >= sizeof (struct vms_dcxsbm) + l + 3 * sbm_len
- || (tdata->nbr_dcxsbm == 1
- && sbm_sz >= sizeof (struct vms_dcxsbm) + l + sbm_len));
- sbmdesc->flags = (unsigned char *)bfd_alloc (abfd, l);
- memcpy (sbmdesc->flags, data + bfd_getl16 (sbm->flags), l);
- sbmdesc->nodes = (unsigned char *)bfd_alloc (abfd, 2 * sbm_len);
- memcpy (sbmdesc->nodes, data + bfd_getl16 (sbm->nodes), 2 * sbm_len);
- off = bfd_getl16 (sbm->next);
- if (off != 0)
- {
- /* Read the 'next' array. */
- sbmdesc->next = (unsigned short *)bfd_alloc
- (abfd, sbm_len * sizeof (unsigned short));
- buf1 = data + off;
- for (j = 0; j < sbm_len; j++)
- sbmdesc->next[j] = bfd_getl16 (buf1 + j * 2);
- }
- else
- {
- /* There is no next array if there is only one submap. */
- BFD_ASSERT (tdata->nbr_dcxsbm == 1);
- sbmdesc->next = NULL;
- }
- }
+ {
+ struct vms_dcxsbm *sbm = (struct vms_dcxsbm *) (buf + sbm_off);
+ struct dcxsbm_desc *sbmdesc = &tdata->dcxsbm[i];
+ unsigned int sbm_len;
+ unsigned int sbm_sz;
+ unsigned int off;
+ unsigned char *data = (unsigned char *)sbm;
+ unsigned char *buf1;
+ unsigned int l, j;
+
+ sbm_sz = bfd_getl16 (sbm->size);
+ sbm_off += sbm_sz;
+ BFD_ASSERT (sbm_off <= reclen);
+
+ sbmdesc->min_char = sbm->min_char;
+ BFD_ASSERT (sbmdesc->min_char == 0);
+ sbmdesc->max_char = sbm->max_char;
+ sbm_len = sbmdesc->max_char - sbmdesc->min_char + 1;
+ l = (2 * sbm_len + 7) / 8;
+ BFD_ASSERT
+ (sbm_sz >= sizeof (struct vms_dcxsbm) + l + 3 * sbm_len
+ || (tdata->nbr_dcxsbm == 1
+ && sbm_sz >= sizeof (struct vms_dcxsbm) + l + sbm_len));
+ sbmdesc->flags = (unsigned char *)bfd_alloc (abfd, l);
+ memcpy (sbmdesc->flags, data + bfd_getl16 (sbm->flags), l);
+ sbmdesc->nodes = (unsigned char *)bfd_alloc (abfd, 2 * sbm_len);
+ memcpy (sbmdesc->nodes, data + bfd_getl16 (sbm->nodes), 2 * sbm_len);
+ off = bfd_getl16 (sbm->next);
+ if (off != 0)
+ {
+ /* Read the 'next' array. */
+ sbmdesc->next = (unsigned short *)bfd_alloc
+ (abfd, sbm_len * sizeof (unsigned short));
+ buf1 = data + off;
+ for (j = 0; j < sbm_len; j++)
+ sbmdesc->next[j] = bfd_getl16 (buf1 + j * 2);
+ }
+ else
+ {
+ /* There is no next array if there is only one submap. */
+ BFD_ASSERT (tdata->nbr_dcxsbm == 1);
+ sbmdesc->next = NULL;
+ }
+ }
free (buf);
}
else
diff = (char)(name[0] - syms[mid].name[0]);
if (diff == 0)
- diff = strcmp (name, syms[mid].name);
+ diff = strcmp (name, syms[mid].name);
if (diff == 0)
- return mid;
+ return mid;
else if (diff < 0)
- hi = mid - 1;
+ hi = mid - 1;
else
- lo = mid + 1;
+ lo = mid + 1;
}
return BFD_NO_MORE_SYMBOLS;
}
/* Read next block. */
if (bfd_seek (abfd->my_archive, vec->next_block, SEEK_SET) != 0)
- return FALSE;
+ return FALSE;
if (bfd_bread (hdr, sizeof (hdr), abfd->my_archive) != sizeof (hdr))
- return FALSE;
+ return FALSE;
vec->next_block = (bfd_getl32 (hdr + 2) - 1) * VMS_BLOCK_SIZE;
vec->blk_off = sizeof (hdr);
}
/* Be sure the current data block is read. */
if (!vms_lib_read_block (abfd))
- return -1;
+ return -1;
/* Do not read past the data block, do not read more than requested. */
l = DATA__LENGTH - vec->blk_off;
if (l > nbytes)
- l = nbytes;
+ l = nbytes;
if (l == 0)
- return 0;
+ return 0;
if (buf != NULL)
- {
- /* Really read into BUF. */
- if (bfd_bread (buf, l, abfd->my_archive) != l)
- return -1;
- }
+ {
+ /* Really read into BUF. */
+ if (bfd_bread (buf, l, abfd->my_archive) != l)
+ return -1;
+ }
else
- {
- /* Make as if we are reading. */
- if (bfd_seek (abfd->my_archive, l, SEEK_CUR) != 0)
- return -1;
- }
+ {
+ /* Make as if we are reading. */
+ if (bfd_seek (abfd->my_archive, l, SEEK_CUR) != 0)
+ return -1;
+ }
if (buf != NULL)
- buf += l;
+ buf += l;
vec->blk_off += l;
nbytes -= l;
res += l;
unsigned char b = vec->dcx_buf[i];
for (; j < 8; j++)
- {
- if (b & (1 << j))
- offset++;
- if (!(sbm->flags[offset >> 3] & (1 << (offset & 7))))
- {
- unsigned int n_offset = sbm->nodes[offset];
- if (n_offset == 0)
- {
- /* End of buffer. Stay where we are. */
- vec->dcx_pos = (i << 3) + j;
- if (b & (1 << j))
- offset--;
- vec->dcx_offset = offset;
- vec->dcx_sbm = sbm;
- return res;
- }
- offset = 2 * n_offset;
- }
- else
- {
- unsigned char v = sbm->nodes[offset];
-
- if (sbm->next != NULL)
- sbm = vec->dcxsbms + sbm->next[v];
- offset = 0;
- res++;
-
- if (buf)
- {
- *buf++ = v;
- nbytes--;
-
- if (nbytes == 0)
- {
- vec->dcx_pos = (i << 3) + j + 1;
- vec->dcx_offset = offset;
- vec->dcx_sbm = sbm;
-
- return res;
- }
- }
- }
- }
+ {
+ if (b & (1 << j))
+ offset++;
+ if (!(sbm->flags[offset >> 3] & (1 << (offset & 7))))
+ {
+ unsigned int n_offset = sbm->nodes[offset];
+ if (n_offset == 0)
+ {
+ /* End of buffer. Stay where we are. */
+ vec->dcx_pos = (i << 3) + j;
+ if (b & (1 << j))
+ offset--;
+ vec->dcx_offset = offset;
+ vec->dcx_sbm = sbm;
+ return res;
+ }
+ offset = 2 * n_offset;
+ }
+ else
+ {
+ unsigned char v = sbm->nodes[offset];
+
+ if (sbm->next != NULL)
+ sbm = vec->dcxsbms + sbm->next[v];
+ offset = 0;
+ res++;
+
+ if (buf)
+ {
+ *buf++ = v;
+ nbytes--;
+
+ if (nbytes == 0)
+ {
+ vec->dcx_pos = (i << 3) + j + 1;
+ vec->dcx_offset = offset;
+ vec->dcx_sbm = sbm;
+
+ return res;
+ }
+ }
+ }
+ }
j = 0;
}
return -1;
while (nbytes > 0)
{
if (vec->rec_rem == 0)
- {
- unsigned char blen[2];
-
- /* Read record length. */
- if (vms_lib_bread_raw (abfd, blen, sizeof (blen)) != sizeof (blen))
- return -1;
- vec->rec_len = bfd_getl16 (blen);
- if (bfd_libdata (abfd->my_archive)->kind == vms_lib_txt)
- {
- /* Discard record size and align byte. */
- vec->rec_pos = 0;
- vec->rec_rem = vec->rec_len;
- }
- else
- {
- /* Prepend record size. */
- vec->rec_pos = REC_POS_LEN0;
- vec->rec_rem = (vec->rec_len + 1) & ~1; /* With align byte. */
- }
- if (vec->rec_len == 3)
- {
- /* Possibly end of file. Check the pattern. */
- if (vms_lib_bread_raw (abfd, vec->pattern, 4) != 4)
- return -1;
- if (!memcmp (vec->pattern, eotdesc + 2, 3))
- {
- /* This is really an EOF. */
- vec->where += res;
- vec->file_len = vec->where;
- return res;
- }
- }
-
- if (vec->dcxsbms != NULL)
- {
- /* This is a compressed member. */
- unsigned int len;
- file_ptr elen;
-
- /* Be sure there is enough room for the expansion. */
- len = (vec->rec_len + 1) & ~1;
- if (len > vec->dcx_max)
- {
- while (len > vec->dcx_max)
- vec->dcx_max *= 2;
- vec->dcx_buf = bfd_alloc (abfd, vec->dcx_max);
- if (vec->dcx_buf == NULL)
- return -1;
- }
-
- /* Read the compressed record. */
- vec->dcx_rlen = len;
- if (vec->rec_len == 3)
- {
- /* Already read. */
- memcpy (vec->dcx_buf, vec->pattern, 3);
- }
- else
- {
- elen = vms_lib_bread_raw (abfd, vec->dcx_buf, len);
- if (elen != len)
- return -1;
- }
-
- /* Dummy expansion to get the expanded length. */
- vec->dcx_offset = 0;
- vec->dcx_sbm = vec->dcxsbms;
- vec->dcx_pos = 0;
- elen = vms_lib_dcx (vec, NULL, 0x10000);
- if (elen < 0)
- return -1;
- vec->rec_len = elen;
- vec->rec_rem = elen;
-
- /* Reset the state. */
- vec->dcx_offset = 0;
- vec->dcx_sbm = vec->dcxsbms;
- vec->dcx_pos = 0;
- }
- }
+ {
+ unsigned char blen[2];
+
+ /* Read record length. */
+ if (vms_lib_bread_raw (abfd, blen, sizeof (blen)) != sizeof (blen))
+ return -1;
+ vec->rec_len = bfd_getl16 (blen);
+ if (bfd_libdata (abfd->my_archive)->kind == vms_lib_txt)
+ {
+ /* Discard record size and align byte. */
+ vec->rec_pos = 0;
+ vec->rec_rem = vec->rec_len;
+ }
+ else
+ {
+ /* Prepend record size. */
+ vec->rec_pos = REC_POS_LEN0;
+ vec->rec_rem = (vec->rec_len + 1) & ~1; /* With align byte. */
+ }
+ if (vec->rec_len == 3)
+ {
+ /* Possibly end of file. Check the pattern. */
+ if (vms_lib_bread_raw (abfd, vec->pattern, 4) != 4)
+ return -1;
+ if (!memcmp (vec->pattern, eotdesc + 2, 3))
+ {
+ /* This is really an EOF. */
+ vec->where += res;
+ vec->file_len = vec->where;
+ return res;
+ }
+ }
+
+ if (vec->dcxsbms != NULL)
+ {
+ /* This is a compressed member. */
+ unsigned int len;
+ file_ptr elen;
+
+ /* Be sure there is enough room for the expansion. */
+ len = (vec->rec_len + 1) & ~1;
+ if (len > vec->dcx_max)
+ {
+ while (len > vec->dcx_max)
+ vec->dcx_max *= 2;
+ vec->dcx_buf = bfd_alloc (abfd, vec->dcx_max);
+ if (vec->dcx_buf == NULL)
+ return -1;
+ }
+
+ /* Read the compressed record. */
+ vec->dcx_rlen = len;
+ if (vec->rec_len == 3)
+ {
+ /* Already read. */
+ memcpy (vec->dcx_buf, vec->pattern, 3);
+ }
+ else
+ {
+ elen = vms_lib_bread_raw (abfd, vec->dcx_buf, len);
+ if (elen != len)
+ return -1;
+ }
+
+ /* Dummy expansion to get the expanded length. */
+ vec->dcx_offset = 0;
+ vec->dcx_sbm = vec->dcxsbms;
+ vec->dcx_pos = 0;
+ elen = vms_lib_dcx (vec, NULL, 0x10000);
+ if (elen < 0)
+ return -1;
+ vec->rec_len = elen;
+ vec->rec_rem = elen;
+
+ /* Reset the state. */
+ vec->dcx_offset = 0;
+ vec->dcx_sbm = vec->dcxsbms;
+ vec->dcx_pos = 0;
+ }
+ }
if (vec->rec_pos < 0)
- {
- unsigned char c;
- switch (vec->rec_pos)
- {
- case REC_POS_LEN0:
- c = vec->rec_len & 0xff;
- vec->rec_pos = REC_POS_LEN1;
- break;
- case REC_POS_LEN1:
- c = (vec->rec_len >> 8) & 0xff;
- vec->rec_pos = 0;
- break;
- case REC_POS_PAD:
- c = 0;
- vec->rec_rem = 0;
- break;
- case REC_POS_NL:
- c = '\n';
- vec->rec_rem = 0;
- break;
- default:
- abort ();
- }
- if (buf != NULL)
- {
- *buf = c;
- buf++;
- }
- nbytes--;
- res++;
- continue;
- }
+ {
+ unsigned char c;
+ switch (vec->rec_pos)
+ {
+ case REC_POS_LEN0:
+ c = vec->rec_len & 0xff;
+ vec->rec_pos = REC_POS_LEN1;
+ break;
+ case REC_POS_LEN1:
+ c = (vec->rec_len >> 8) & 0xff;
+ vec->rec_pos = 0;
+ break;
+ case REC_POS_PAD:
+ c = 0;
+ vec->rec_rem = 0;
+ break;
+ case REC_POS_NL:
+ c = '\n';
+ vec->rec_rem = 0;
+ break;
+ default:
+ abort ();
+ }
+ if (buf != NULL)
+ {
+ *buf = c;
+ buf++;
+ }
+ nbytes--;
+ res++;
+ continue;
+ }
if (nbytes > vec->rec_rem)
- chunk = vec->rec_rem;
+ chunk = vec->rec_rem;
else
- chunk = nbytes;
+ chunk = nbytes;
if (vec->dcxsbms != NULL)
- {
- /* Optimize the stat() case: no need to decompress again as we
- know the length. */
- if (!(buf == NULL && chunk == vec->rec_rem))
- chunk = vms_lib_dcx (vec, buf, chunk);
- }
+ {
+ /* Optimize the stat() case: no need to decompress again as we
+ know the length. */
+ if (!(buf == NULL && chunk == vec->rec_rem))
+ chunk = vms_lib_dcx (vec, buf, chunk);
+ }
else
- {
- if (vec->rec_len == 3)
- {
- if (buf != NULL)
- memcpy (buf, vec->pattern + vec->rec_pos, chunk);
- }
- else
- chunk = vms_lib_bread_raw (abfd, buf, chunk);
- }
+ {
+ if (vec->rec_len == 3)
+ {
+ if (buf != NULL)
+ memcpy (buf, vec->pattern + vec->rec_pos, chunk);
+ }
+ else
+ chunk = vms_lib_bread_raw (abfd, buf, chunk);
+ }
if (chunk < 0)
- return -1;
+ return -1;
res += chunk;
if (buf != NULL)
- buf += chunk;
+ buf += chunk;
nbytes -= chunk;
vec->rec_pos += chunk;
vec->rec_rem -= chunk;
if (vec->rec_rem == 0)
- {
- /* End of record reached. */
- if (bfd_libdata (abfd->my_archive)->kind == vms_lib_txt)
- {
- if ((vec->rec_len & 1) == 1
- && vec->rec_len != 3
- && vec->dcxsbms == NULL)
- {
- /* Eat the pad byte. */
- unsigned char pad;
- if (vms_lib_bread_raw (abfd, &pad, 1) != 1)
- return -1;
- }
- vec->rec_pos = REC_POS_NL;
- vec->rec_rem = 1;
- }
- else
- {
- if ((vec->rec_len & 1) == 1 && vec->dcxsbms != NULL)
- {
- vec->rec_pos = REC_POS_PAD;
- vec->rec_rem = 1;
- }
- }
- }
+ {
+ /* End of record reached. */
+ if (bfd_libdata (abfd->my_archive)->kind == vms_lib_txt)
+ {
+ if ((vec->rec_len & 1) == 1
+ && vec->rec_len != 3
+ && vec->dcxsbms == NULL)
+ {
+ /* Eat the pad byte. */
+ unsigned char pad;
+ if (vms_lib_bread_raw (abfd, &pad, 1) != 1)
+ return -1;
+ }
+ vec->rec_pos = REC_POS_NL;
+ vec->rec_rem = 1;
+ }
+ else
+ {
+ if ((vec->rec_len & 1) == 1 && vec->dcxsbms != NULL)
+ {
+ vec->rec_pos = REC_POS_PAD;
+ vec->rec_rem = 1;
+ }
+ }
+ }
}
vec->where += res;
return res;
vec->next_block = vec->init_next_block;
if (bfd_seek (abfd->my_archive, vec->first_block, SEEK_SET) != 0)
- return -1;
+ return -1;
}
else
abort ();
static int
vms_lib_bstat (struct bfd *abfd ATTRIBUTE_UNUSED,
- struct stat *sb ATTRIBUTE_UNUSED)
+ struct stat *sb ATTRIBUTE_UNUSED)
{
/* Not supported. */
return 0;
static void *
vms_lib_bmmap (struct bfd *abfd ATTRIBUTE_UNUSED,
- void *addr ATTRIBUTE_UNUSED,
- bfd_size_type len ATTRIBUTE_UNUSED,
- int prot ATTRIBUTE_UNUSED,
- int flags ATTRIBUTE_UNUSED,
- file_ptr offset ATTRIBUTE_UNUSED,
- void **map_addr ATTRIBUTE_UNUSED,
- bfd_size_type *map_len ATTRIBUTE_UNUSED)
+ void *addr ATTRIBUTE_UNUSED,
+ bfd_size_type len ATTRIBUTE_UNUSED,
+ int prot ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ file_ptr offset ATTRIBUTE_UNUSED,
+ void **map_addr ATTRIBUTE_UNUSED,
+ bfd_size_type *map_len ATTRIBUTE_UNUSED)
{
return (void *) -1;
}
vec->dcx_buf = bfd_alloc (el, vec->dcx_max);
vec->dcx_pos = -1;
if (vec->dcx_buf == NULL)
- return -1;
+ return -1;
}
return TRUE;
}
{
res = _bfd_create_empty_archive_element_shell (abfd);
if (res == NULL)
- return NULL;
+ return NULL;
/* Special reader to deal with data blocks. */
if (!vms_lib_bopen (res, file_off))
- return NULL;
+ return NULL;
}
else
{
/* Sanity check. The MHD must be big enough to contain module size. */
if (tdata->mhd_size < offsetof (struct vms_mhd, modsize) + 4)
- return NULL;
+ return NULL;
/* Read the MHD now. */
if (bfd_seek (abfd, file_off, SEEK_SET) != 0)
- return NULL;
+ return NULL;
if (bfd_bread (buf, tdata->mhd_size, abfd) != tdata->mhd_size)
- return NULL;
+ return NULL;
res = _bfd_create_empty_archive_element_shell (abfd);
if (res == NULL)
- return NULL;
+ return NULL;
arelt = bfd_zmalloc (sizeof (*arelt));
if (arelt == NULL)
- return NULL;
+ return NULL;
res->arelt_data = arelt;
/* Get info from mhd. */
mhd = (struct vms_mhd *)buf;
if (mhd->id != MHD__C_MHDID)
- return NULL;
+ return NULL;
if (tdata->mhd_size >= offsetof (struct vms_mhd, objstat) + 1)
- res->selective_search = (mhd->objstat & MHD__M_SELSRC) ? 1 : 0;
+ res->selective_search = (mhd->objstat & MHD__M_SELSRC) ? 1 : 0;
res->mtime = vms_rawtime_to_time_t (mhd->datim);
res->mtime_set = TRUE;
arelt->parsed_size = bfd_getl32 (mhd->modsize);
/* No need for a special reader as members are stored linearly.
- Just skip the MHD. */
+ Just skip the MHD. */
res->origin = file_off + tdata->mhd_size;
}
for (modidx = 0; modidx < tdata->nbr_modules; modidx++)
{
if (tdata->modules[modidx].file_offset == file_off)
- break;
+ break;
}
if (modidx >= tdata->nbr_modules)
return NULL;
bfd *
_bfd_vms_lib_openr_next_archived_file (bfd *archive,
- bfd *last_file)
+ bfd *last_file)
{
unsigned int idx;
bfd *res;
struct vms_lib_iovec *vec = (struct vms_lib_iovec *) abfd->iostream;
if (vec->file_len == (ufile_ptr)-1)
- {
- if (vms_lib_bseek (abfd, 0, SEEK_SET) != 0)
- return -1;
-
- /* Compute length. */
- while (vms_lib_bread (abfd, NULL, 1 << 20) > 0)
- ;
- }
+ {
+ if (vms_lib_bseek (abfd, 0, SEEK_SET) != 0)
+ return -1;
+
+ /* Compute length. */
+ while (vms_lib_bread (abfd, NULL, 1 << 20) > 0)
+ ;
+ }
st->st_size = vec->file_len;
}
else
{
/* 9 is the size of struct vms_elfidx without keyname. */
if (idx->namlen > MAX_KEYLEN)
- return 9 + sizeof (struct vms_kbn);
+ return 9 + sizeof (struct vms_kbn);
else
- return 9 + idx->namlen;
+ return 9 + idx->namlen;
}
else
{
static bfd_boolean
vms_write_index (bfd *abfd,
- struct lib_index *idx, unsigned int nbr, unsigned int *vbn,
- unsigned int *topvbn, bfd_boolean is_elfidx)
+ struct lib_index *idx, unsigned int nbr, unsigned int *vbn,
+ unsigned int *topvbn, bfd_boolean is_elfidx)
{
/* The index is organized as a tree. This function implements a naive
algorithm to balance the tree: it fills the leaves, and create a new
{
/* No entries. Very easy to handle. */
if (topvbn != NULL)
- *topvbn = 0;
+ *topvbn = 0;
return TRUE;
}
idxlen = get_idxlen (idx, is_elfidx);
if (is_elfidx && idx->namlen > MAX_KEYLEN)
- {
- /* If the key (ie name) is too long, write it in the kbn block. */
- unsigned int kl = idx->namlen;
- unsigned int kl_chunk;
- const char *key = idx->name;
-
- /* Write the key in the kbn, chunk after chunk. */
- do
- {
- if (kbn_sz < sizeof (struct vms_kbn))
- {
- /* Not enough room in the kbn block. */
- if (abfd != NULL)
- {
- /* Write it to the disk (if there is one). */
- if (kbn_vbn != 0)
- {
- if (!vms_write_block (abfd, kbn_vbn, kbn_blk))
- return FALSE;
- }
- else
- {
- kbn_blk = bfd_malloc (VMS_BLOCK_SIZE);
- if (kbn_blk == NULL)
- return FALSE;
- }
- *(unsigned short *)kbn_blk = 0;
- }
- /* Allocate a new block for the keys. */
- kbn_vbn = (*vbn)++;
- kbn_sz = VMS_BLOCK_SIZE - 2;
- }
- /* Size of the chunk written to the current key block. */
- if (kl + sizeof (struct vms_kbn) > kbn_sz)
- kl_chunk = kbn_sz - sizeof (struct vms_kbn);
- else
- kl_chunk = kl;
-
- if (kbn_blk != NULL)
- {
- struct vms_kbn *kbn;
-
- kbn = (struct vms_kbn *)(kbn_blk + VMS_BLOCK_SIZE - kbn_sz);
-
- if (key_vbn == 0)
- {
- /* Save the rfa of the first chunk. */
- key_vbn = kbn_vbn;
- key_off = VMS_BLOCK_SIZE - kbn_sz;
- }
-
- bfd_putl16 (kl_chunk, kbn->keylen);
- if (kl_chunk == kl)
- {
- /* No next chunk. */
- bfd_putl32 (0, kbn->rfa.vbn);
- bfd_putl16 (0, kbn->rfa.offset);
- }
- else
- {
- /* Next chunk will be at the start of the next block. */
- bfd_putl32 (*vbn, kbn->rfa.vbn);
- bfd_putl16 (2, kbn->rfa.offset);
- }
- memcpy ((char *)(kbn + 1), key, kl_chunk);
- key += kl_chunk;
- }
- kl -= kl_chunk;
- kl_chunk = (kl_chunk + 1) & ~1; /* Always align. */
- kbn_sz -= kl_chunk + sizeof (struct vms_kbn);
- }
- while (kl > 0);
- }
+ {
+ /* If the key (ie name) is too long, write it in the kbn block. */
+ unsigned int kl = idx->namlen;
+ unsigned int kl_chunk;
+ const char *key = idx->name;
+
+ /* Write the key in the kbn, chunk after chunk. */
+ do
+ {
+ if (kbn_sz < sizeof (struct vms_kbn))
+ {
+ /* Not enough room in the kbn block. */
+ if (abfd != NULL)
+ {
+ /* Write it to the disk (if there is one). */
+ if (kbn_vbn != 0)
+ {
+ if (!vms_write_block (abfd, kbn_vbn, kbn_blk))
+ return FALSE;
+ }
+ else
+ {
+ kbn_blk = bfd_malloc (VMS_BLOCK_SIZE);
+ if (kbn_blk == NULL)
+ return FALSE;
+ }
+ *(unsigned short *)kbn_blk = 0;
+ }
+ /* Allocate a new block for the keys. */
+ kbn_vbn = (*vbn)++;
+ kbn_sz = VMS_BLOCK_SIZE - 2;
+ }
+ /* Size of the chunk written to the current key block. */
+ if (kl + sizeof (struct vms_kbn) > kbn_sz)
+ kl_chunk = kbn_sz - sizeof (struct vms_kbn);
+ else
+ kl_chunk = kl;
+
+ if (kbn_blk != NULL)
+ {
+ struct vms_kbn *kbn;
+
+ kbn = (struct vms_kbn *)(kbn_blk + VMS_BLOCK_SIZE - kbn_sz);
+
+ if (key_vbn == 0)
+ {
+ /* Save the rfa of the first chunk. */
+ key_vbn = kbn_vbn;
+ key_off = VMS_BLOCK_SIZE - kbn_sz;
+ }
+
+ bfd_putl16 (kl_chunk, kbn->keylen);
+ if (kl_chunk == kl)
+ {
+ /* No next chunk. */
+ bfd_putl32 (0, kbn->rfa.vbn);
+ bfd_putl16 (0, kbn->rfa.offset);
+ }
+ else
+ {
+ /* Next chunk will be at the start of the next block. */
+ bfd_putl32 (*vbn, kbn->rfa.vbn);
+ bfd_putl16 (2, kbn->rfa.offset);
+ }
+ memcpy ((char *)(kbn + 1), key, kl_chunk);
+ key += kl_chunk;
+ }
+ kl -= kl_chunk;
+ kl_chunk = (kl_chunk + 1) & ~1; /* Always align. */
+ kbn_sz -= kl_chunk + sizeof (struct vms_kbn);
+ }
+ while (kl > 0);
+ }
/* Check if a block might overflow. In this case we will flush this
- block and all the blocks below it. */
+ block and all the blocks below it. */
for (j = 0; j < level; j++)
- if (blk[j].len + blk[j].lastlen + idxlen > INDEXDEF__BLKSIZ)
+ if (blk[j].len + blk[j].lastlen + idxlen > INDEXDEF__BLKSIZ)
flush = j + 1;
for (j = 0; j < level; j++)
- {
- if (j < flush)
- {
- /* There is not enough room to write the new entry in this
- block or in a parent block. */
-
- if (j + 1 == level)
- {
- BFD_ASSERT (level < MAX_LEVEL);
-
- /* Need to create a parent. */
- if (abfd != NULL)
- {
- rblk[level] = bfd_zmalloc (sizeof (struct vms_indexdef));
- bfd_putl32 (*vbn, rblk[j]->parent);
- }
- blk[level].vbn = (*vbn)++;
- blk[level].len = 0;
- blk[level].lastlen = blk[j].lastlen;
-
- level++;
- }
-
- /* Update parent block: write the last entry from the current
+ {
+ if (j < flush)
+ {
+ /* There is not enough room to write the new entry in this
+ block or in a parent block. */
+
+ if (j + 1 == level)
+ {
+ BFD_ASSERT (level < MAX_LEVEL);
+
+ /* Need to create a parent. */
+ if (abfd != NULL)
+ {
+ rblk[level] = bfd_zmalloc (sizeof (struct vms_indexdef));
+ bfd_putl32 (*vbn, rblk[j]->parent);
+ }
+ blk[level].vbn = (*vbn)++;
+ blk[level].len = 0;
+ blk[level].lastlen = blk[j].lastlen;
+
+ level++;
+ }
+
+ /* Update parent block: write the last entry from the current
block. */
- if (abfd != NULL)
- {
- struct vms_rfa *rfa;
+ if (abfd != NULL)
+ {
+ struct vms_rfa *rfa;
/* Pointer to the last entry in parent block. */
rfa = (struct vms_rfa *)(rblk[j + 1]->keys + blk[j + 1].len);
- /* Copy the whole entry. */
+ /* Copy the whole entry. */
BFD_ASSERT (blk[j + 1].lastlen == blk[j].lastlen);
- memcpy (rfa, rblk[j]->keys + blk[j].len, blk[j].lastlen);
- /* Fix the entry (which in always the first field of an
+ memcpy (rfa, rblk[j]->keys + blk[j].len, blk[j].lastlen);
+ /* Fix the entry (which in always the first field of an
entry. */
- bfd_putl32 (blk[j].vbn, rfa->vbn);
- bfd_putl16 (RFADEF__C_INDEX, rfa->offset);
- }
-
- if (j + 1 == flush)
- {
- /* And allocate it. Do it only on the block that won't be
- flushed (so that the parent of the parent can be
- updated too). */
- blk[j + 1].len += blk[j + 1].lastlen;
- blk[j + 1].lastlen = 0;
- }
-
- /* Write this block on the disk. */
- if (abfd != NULL)
- {
- bfd_putl16 (blk[j].len + blk[j].lastlen, rblk[j]->used);
- if (!vms_write_block (abfd, blk[j].vbn, rblk[j]))
- return FALSE;
- }
-
- /* Reset this block. */
- blk[j].len = 0;
- blk[j].lastlen = 0;
- blk[j].vbn = (*vbn)++;
- }
-
- /* Append it to the block. */
- if (j == 0)
- {
+ bfd_putl32 (blk[j].vbn, rfa->vbn);
+ bfd_putl16 (RFADEF__C_INDEX, rfa->offset);
+ }
+
+ if (j + 1 == flush)
+ {
+ /* And allocate it. Do it only on the block that won't be
+ flushed (so that the parent of the parent can be
+ updated too). */
+ blk[j + 1].len += blk[j + 1].lastlen;
+ blk[j + 1].lastlen = 0;
+ }
+
+ /* Write this block on the disk. */
+ if (abfd != NULL)
+ {
+ bfd_putl16 (blk[j].len + blk[j].lastlen, rblk[j]->used);
+ if (!vms_write_block (abfd, blk[j].vbn, rblk[j]))
+ return FALSE;
+ }
+
+ /* Reset this block. */
+ blk[j].len = 0;
+ blk[j].lastlen = 0;
+ blk[j].vbn = (*vbn)++;
+ }
+
+ /* Append it to the block. */
+ if (j == 0)
+ {
/* Keep the previous last entry. */
- blk[j].len += blk[j].lastlen;
-
- if (abfd != NULL)
- {
- struct vms_rfa *rfa;
-
- rfa = (struct vms_rfa *)(rblk[j]->keys + blk[j].len);
- bfd_putl32 ((idx->abfd->proxy_origin / VMS_BLOCK_SIZE) + 1,
- rfa->vbn);
- bfd_putl16
- ((idx->abfd->proxy_origin % VMS_BLOCK_SIZE)
- + (is_elfidx ? 0 : DATA__DATA),
- rfa->offset);
-
- if (is_elfidx)
- {
- /* Use elfidx format. */
- struct vms_elfidx *en = (struct vms_elfidx *)rfa;
-
- en->flags = 0;
- if (key_vbn != 0)
- {
- /* Long symbol name. */
- struct vms_kbn *k = (struct vms_kbn *)(en->keyname);
- bfd_putl16 (sizeof (struct vms_kbn), en->keylen);
- bfd_putl16 (idx->namlen, k->keylen);
- bfd_putl32 (key_vbn, k->rfa.vbn);
- bfd_putl16 (key_off, k->rfa.offset);
- en->flags |= ELFIDX__SYMESC;
- }
- else
- {
- bfd_putl16 (idx->namlen, en->keylen);
- memcpy (en->keyname, idx->name, idx->namlen);
- }
- }
- else
- {
- /* Use idx format. */
- struct vms_idx *en = (struct vms_idx *)rfa;
- en->keylen = idx->namlen;
- memcpy (en->keyname, idx->name, idx->namlen);
- }
- }
+ blk[j].len += blk[j].lastlen;
+
+ if (abfd != NULL)
+ {
+ struct vms_rfa *rfa;
+
+ rfa = (struct vms_rfa *)(rblk[j]->keys + blk[j].len);
+ bfd_putl32 ((idx->abfd->proxy_origin / VMS_BLOCK_SIZE) + 1,
+ rfa->vbn);
+ bfd_putl16
+ ((idx->abfd->proxy_origin % VMS_BLOCK_SIZE)
+ + (is_elfidx ? 0 : DATA__DATA),
+ rfa->offset);
+
+ if (is_elfidx)
+ {
+ /* Use elfidx format. */
+ struct vms_elfidx *en = (struct vms_elfidx *)rfa;
+
+ en->flags = 0;
+ if (key_vbn != 0)
+ {
+ /* Long symbol name. */
+ struct vms_kbn *k = (struct vms_kbn *)(en->keyname);
+ bfd_putl16 (sizeof (struct vms_kbn), en->keylen);
+ bfd_putl16 (idx->namlen, k->keylen);
+ bfd_putl32 (key_vbn, k->rfa.vbn);
+ bfd_putl16 (key_off, k->rfa.offset);
+ en->flags |= ELFIDX__SYMESC;
+ }
+ else
+ {
+ bfd_putl16 (idx->namlen, en->keylen);
+ memcpy (en->keyname, idx->name, idx->namlen);
+ }
+ }
+ else
+ {
+ /* Use idx format. */
+ struct vms_idx *en = (struct vms_idx *)rfa;
+ en->keylen = idx->namlen;
+ memcpy (en->keyname, idx->name, idx->namlen);
+ }
+ }
}
/* The last added key can now be the last one all blocks in the
path. */
blk[j].lastlen = idxlen;
- }
+ }
}
/* Save VBN of the root. */
/* Write this block on the disk. */
bfd_putl16 (blk[j].len + blk[j].lastlen, rblk[j]->used);
if (!vms_write_block (abfd, blk[j].vbn, rblk[j]))
- return FALSE;
+ return FALSE;
free (rblk[j]);
}
if (kbn_vbn != 0)
{
if (!vms_write_block (abfd, kbn_vbn, kbn_blk))
- return FALSE;
+ return FALSE;
free (kbn_blk);
}
static bfd_boolean
vms_write_data_block (bfd *arch, struct vms_datadef *data, file_ptr *off,
- const unsigned char *buf, unsigned int len, int pad)
+ const unsigned char *buf, unsigned int len, int pad)
{
while (len > 0 || pad)
{
*off += l;
if (doff == (DATA__LENGTH - DATA__DATA) || (len == 0 && pad))
- {
- data->recs = 0;
- data->fill_1 = 0;
- bfd_putl32 ((*off / VMS_BLOCK_SIZE) + 2, data->link);
+ {
+ data->recs = 0;
+ data->fill_1 = 0;
+ bfd_putl32 ((*off / VMS_BLOCK_SIZE) + 2, data->link);
- if (bfd_bwrite (data, sizeof (*data), arch) != sizeof (*data))
- return FALSE;
+ if (bfd_bwrite (data, sizeof (*data), arch) != sizeof (*data))
+ return FALSE;
- *off += DATA__LENGTH - doff;
+ *off += DATA__LENGTH - doff;
- if (len == 0)
- break;
- }
+ if (len == 0)
+ break;
+ }
}
return TRUE;
}
static bfd_boolean
_bfd_vms_lib_build_map (unsigned int nbr_modules,
- struct lib_index *modules,
- unsigned int *res_cnt,
- struct lib_index **res)
+ struct lib_index *modules,
+ unsigned int *res_cnt,
+ struct lib_index **res)
{
unsigned int i;
asymbol **syms = NULL;
bfd *current = modules[i].abfd;
if ((bfd_get_file_flags (current) & HAS_SYMS) == 0)
- continue;
+ continue;
storage = bfd_get_symtab_upper_bound (current);
if (storage < 0)
- goto error_return;
+ goto error_return;
if (storage != 0)
- {
- if (storage > syms_max)
- {
- if (syms_max > 0)
- free (syms);
- syms_max = storage;
- syms = (asymbol **) bfd_malloc (syms_max);
- if (syms == NULL)
- goto error_return;
- }
- symcount = bfd_canonicalize_symtab (current, syms);
- if (symcount < 0)
- goto error_return;
-
- /* Now map over all the symbols, picking out the ones we
- want. */
- for (src_count = 0; src_count < symcount; src_count++)
- {
- flagword flags = (syms[src_count])->flags;
- asection *sec = syms[src_count]->section;
-
- if ((flags & BSF_GLOBAL
- || flags & BSF_WEAK
- || flags & BSF_INDIRECT
- || bfd_is_com_section (sec))
- && ! bfd_is_und_section (sec))
- {
- struct lib_index *new_map;
-
- /* This symbol will go into the archive header. */
- if (map_count == map_max)
- {
- map_max *= 2;
- new_map = (struct lib_index *)
- bfd_realloc (map, map_max * sizeof (struct lib_index));
- if (new_map == NULL)
- goto error_return;
- map = new_map;
- }
-
- map[map_count].abfd = current;
- map[map_count].namlen = strlen (syms[src_count]->name);
- map[map_count].name = syms[src_count]->name;
- map_count++;
- modules[i].ref++;
- }
- }
+ {
+ if (storage > syms_max)
+ {
+ if (syms_max > 0)
+ free (syms);
+ syms_max = storage;
+ syms = (asymbol **) bfd_malloc (syms_max);
+ if (syms == NULL)
+ goto error_return;
+ }
+ symcount = bfd_canonicalize_symtab (current, syms);
+ if (symcount < 0)
+ goto error_return;
+
+ /* Now map over all the symbols, picking out the ones we
+ want. */
+ for (src_count = 0; src_count < symcount; src_count++)
+ {
+ flagword flags = (syms[src_count])->flags;
+ asection *sec = syms[src_count]->section;
+
+ if ((flags & BSF_GLOBAL
+ || flags & BSF_WEAK
+ || flags & BSF_INDIRECT
+ || bfd_is_com_section (sec))
+ && ! bfd_is_und_section (sec))
+ {
+ struct lib_index *new_map;
+
+ /* This symbol will go into the archive header. */
+ if (map_count == map_max)
+ {
+ map_max *= 2;
+ new_map = (struct lib_index *)
+ bfd_realloc (map, map_max * sizeof (struct lib_index));
+ if (new_map == NULL)
+ goto error_return;
+ map = new_map;
+ }
+
+ map[map_count].abfd = current;
+ map[map_count].namlen = strlen (syms[src_count]->name);
+ map[map_count].name = syms[src_count]->name;
+ map_count++;
+ modules[i].ref++;
+ }
+ }
}
}
current->proxy_origin = off;
if (is_elfidx)
- sz = 0;
+ sz = 0;
else
- {
- /* Write the MHD as a record (ie, size first). */
- sz = 2;
- bfd_putl16 (tdata->mhd_size, blk);
- }
+ {
+ /* Write the MHD as a record (ie, size first). */
+ sz = 2;
+ bfd_putl16 (tdata->mhd_size, blk);
+ }
mhd = (struct vms_mhd *)(blk + sz);
memset (mhd, 0, sizeof (struct vms_mhd));
mhd->lbrflag = 0;
/* Rewind the member to be put into the archive. */
if (bfd_seek (current, 0, SEEK_SET) != 0)
- goto input_err;
+ goto input_err;
/* Copy the member into the archive. */
if (is_elfidx)
- {
- unsigned int modsize = 0;
- bfd_size_type amt;
- file_ptr off_hdr = off;
-
- /* Read to complete the first block. */
- amt = bfd_bread (blk + sz, VMS_BLOCK_SIZE - sz, current);
- if (amt == (bfd_size_type)-1)
- goto input_err;
- modsize = amt;
- if (amt < VMS_BLOCK_SIZE - sz)
- {
- /* The member size is less than a block. Pad the block. */
- memset (blk + sz + amt, 0, VMS_BLOCK_SIZE - sz - amt);
- }
- bfd_putl32 (modsize, mhd->modsize);
-
- /* Write the first block (which contains an mhd). */
- if (bfd_bwrite (blk, VMS_BLOCK_SIZE, arch) != VMS_BLOCK_SIZE)
- goto input_err;
- off += VMS_BLOCK_SIZE;
-
- if (amt == VMS_BLOCK_SIZE - sz)
- {
- /* Copy the remaining. */
- char buffer[DEFAULT_BUFFERSIZE];
-
- while (1)
- {
- amt = bfd_bread (buffer, sizeof (buffer), current);
- if (amt == (bfd_size_type)-1)
- goto input_err;
- if (amt == 0)
- break;
- modsize += amt;
- if (amt != sizeof (buffer))
- {
- /* Clear the padding. */
- memset (buffer + amt, 0, sizeof (buffer) - amt);
- amt = (amt + VMS_BLOCK_SIZE) & ~(VMS_BLOCK_SIZE - 1);
- }
- if (bfd_bwrite (buffer, amt, arch) != amt)
- goto input_err;
- off += amt;
- }
-
- /* Now that the size is known, write the first block (again). */
- bfd_putl32 (modsize, mhd->modsize);
- if (bfd_seek (arch, off_hdr, SEEK_SET) != 0
- || bfd_bwrite (blk, VMS_BLOCK_SIZE, arch) != VMS_BLOCK_SIZE)
- goto input_err;
- if (bfd_seek (arch, off, SEEK_SET) != 0)
- goto input_err;
- }
- }
+ {
+ unsigned int modsize = 0;
+ bfd_size_type amt;
+ file_ptr off_hdr = off;
+
+ /* Read to complete the first block. */
+ amt = bfd_bread (blk + sz, VMS_BLOCK_SIZE - sz, current);
+ if (amt == (bfd_size_type)-1)
+ goto input_err;
+ modsize = amt;
+ if (amt < VMS_BLOCK_SIZE - sz)
+ {
+ /* The member size is less than a block. Pad the block. */
+ memset (blk + sz + amt, 0, VMS_BLOCK_SIZE - sz - amt);
+ }
+ bfd_putl32 (modsize, mhd->modsize);
+
+ /* Write the first block (which contains an mhd). */
+ if (bfd_bwrite (blk, VMS_BLOCK_SIZE, arch) != VMS_BLOCK_SIZE)
+ goto input_err;
+ off += VMS_BLOCK_SIZE;
+
+ if (amt == VMS_BLOCK_SIZE - sz)
+ {
+ /* Copy the remaining. */
+ char buffer[DEFAULT_BUFFERSIZE];
+
+ while (1)
+ {
+ amt = bfd_bread (buffer, sizeof (buffer), current);
+ if (amt == (bfd_size_type)-1)
+ goto input_err;
+ if (amt == 0)
+ break;
+ modsize += amt;
+ if (amt != sizeof (buffer))
+ {
+ /* Clear the padding. */
+ memset (buffer + amt, 0, sizeof (buffer) - amt);
+ amt = (amt + VMS_BLOCK_SIZE) & ~(VMS_BLOCK_SIZE - 1);
+ }
+ if (bfd_bwrite (buffer, amt, arch) != amt)
+ goto input_err;
+ off += amt;
+ }
+
+ /* Now that the size is known, write the first block (again). */
+ bfd_putl32 (modsize, mhd->modsize);
+ if (bfd_seek (arch, off_hdr, SEEK_SET) != 0
+ || bfd_bwrite (blk, VMS_BLOCK_SIZE, arch) != VMS_BLOCK_SIZE)
+ goto input_err;
+ if (bfd_seek (arch, off, SEEK_SET) != 0)
+ goto input_err;
+ }
+ }
else
- {
- /* Write the MHD. */
- if (vms_write_data_block (arch, &data, &off, blk, sz, 0) < 0)
- goto input_err;
-
- /* Write the member. */
- while (1)
- {
- sz = bfd_bread (blk, sizeof (blk), current);
- if (sz == 0)
- break;
- if (vms_write_data_block (arch, &data, &off, blk, sz, 0) < 0)
- goto input_err;
- }
-
- /* Write the end of module marker. */
- if (vms_write_data_block (arch, &data, &off,
- eotdesc, sizeof (eotdesc), 1) < 0)
- goto input_err;
- }
+ {
+ /* Write the MHD. */
+ if (vms_write_data_block (arch, &data, &off, blk, sz, 0) < 0)
+ goto input_err;
+
+ /* Write the member. */
+ while (1)
+ {
+ sz = bfd_bread (blk, sizeof (blk), current);
+ if (sz == 0)
+ break;
+ if (vms_write_data_block (arch, &data, &off, blk, sz, 0) < 0)
+ goto input_err;
+ }
+
+ /* Write the end of module marker. */
+ if (vms_write_data_block (arch, &data, &off,
+ eotdesc, sizeof (eotdesc), 1) < 0)
+ goto input_err;
+ }
}
/* Write the indexes. */
switch (tdata->kind)
{
case vms_lib_alpha:
- saneid = LHD_SANEID3;
- break;
+ saneid = LHD_SANEID3;
+ break;
case vms_lib_ia64:
- saneid = LHD_SANEID6;
- break;
+ saneid = LHD_SANEID6;
+ break;
default:
- abort ();
+ abort ();
}
bfd_putl32 (saneid, lhd->sanity);
bfd_putl16 (tdata->ver, lhd->majorid);
bfd_putl16 (0, lhd->minorid);
snprintf ((char *)lhd->lbrver + 1, sizeof (lhd->lbrver) - 1,
- "GNU ar %u.%u.%u",
- (unsigned)(BFD_VERSION / 100000000UL),
- (unsigned)(BFD_VERSION / 1000000UL) % 100,
- (unsigned)(BFD_VERSION / 10000UL) % 100);
+ "GNU ar %u.%u.%u",
+ (unsigned)(BFD_VERSION / 100000000UL),
+ (unsigned)(BFD_VERSION / 1000000UL) % 100,
+ (unsigned)(BFD_VERSION / 10000UL) % 100);
lhd->lbrver[sizeof (lhd->lbrver) - 1] = 0;
lhd->lbrver[0] = strlen ((char *)lhd->lbrver + 1);
/* Put length to buffer. */
bfd_putl16 ((bfd_vma) (recwr->size - recwr->subrec_offset),
- recwr->buf + recwr->subrec_offset + 2);
+ recwr->buf + recwr->subrec_offset + 2);
/* Close the subrecord. */
recwr->subrec_offset = 0;
for (fptr = fname; *fptr != 0; fptr++)
{
if (*fptr == ';' || (fptr - fname) >= 31)
- {
- *fptr = 0;
- break;
- }
+ {
+ *fptr = 0;
+ break;
+ }
if (upcase)
- *fptr = TOUPPER (*fptr);
+ *fptr = TOUPPER (*fptr);
}
return fname;
}
incomplete numbers). SIGN means interpret the number as SLEB128. */
static bfd_vma
-wasm_read_leb128 (bfd * abfd,
- bfd_boolean * error_return,
- unsigned int * length_return,
- bfd_boolean sign)
+wasm_read_leb128 (bfd * abfd,
+ bfd_boolean * error_return,
+ unsigned int * length_return,
+ bfd_boolean sign)
{
bfd_vma result = 0;
unsigned int num_read = 0;
shift += 7;
if ((byte & 0x80) == 0)
- {
- success = TRUE;
- break;
- }
+ {
+ success = TRUE;
+ break;
+ }
}
if (length_return != NULL)
v >>= 7;
if (v)
- c |= 0x80;
+ c |= 0x80;
if (bfd_bwrite (&c, 1, abfd) != 1)
- return FALSE;
+ return FALSE;
}
while (v);
/* Read the LEB128 integer at P, saving it to X; at end of buffer,
jump to error_return. */
-#define READ_LEB128(x, p, end) \
- do \
- { \
- unsigned int length_read; \
- (x) = _bfd_safe_read_leb128 (abfd, (p), &length_read, \
- FALSE, (end)); \
- (p) += length_read; \
- if (length_read == 0) \
- goto error_return; \
- } \
+#define READ_LEB128(x, p, end) \
+ do \
+ { \
+ unsigned int length_read; \
+ (x) = _bfd_safe_read_leb128 (abfd, (p), &length_read, \
+ FALSE, (end)); \
+ (p) += length_read; \
+ if (length_read == 0) \
+ goto error_return; \
+ } \
while (0)
/* Verify the magic number at the beginning of a WebAssembly module
{
bfd_byte subsection_code = *p++;
if (subsection_code == WASM_FUNCTION_SUBSECTION)
- break;
+ break;
/* subsection_code is documented to be a varuint7, meaning that
- it has to be a single byte in the 0 - 127 range. If it isn't,
- the spec must have changed underneath us, so give up. */
+ it has to be a single byte in the 0 - 127 range. If it isn't,
+ the spec must have changed underneath us, so give up. */
if (subsection_code & 0x80)
- return FALSE;
+ return FALSE;
READ_LEB128 (payload_size, p, end);
if (p > p + payload_size)
- return FALSE;
+ return FALSE;
p += payload_size;
}
READ_LEB128 (len, p, end);
if (p + len < p || p + len > end)
- goto error_return;
+ goto error_return;
name = bfd_zalloc (abfd, len + 1);
if (! name)
- goto error_return;
+ goto error_return;
memcpy (name, p, len);
p += len;
if (bfd_bread (&byte, (bfd_size_type) 1, abfd) != 1)
{
if (bfd_get_error () != bfd_error_file_truncated)
- *errorptr = TRUE;
+ *errorptr = TRUE;
return EOF;
}
while ((section_code = wasm_read_byte (abfd, &error)) != EOF)
{
if (section_code != 0)
- {
- const char *sname = wasm_section_code_to_name (section_code);
-
- if (! sname)
- goto error_return;
-
- name = strdup (sname);
- bfdsec = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS);
- if (bfdsec == NULL)
- goto error_return;
- name = NULL;
-
- bfdsec->vma = vma;
- bfdsec->lma = vma;
- bfdsec->size = wasm_read_leb128 (abfd, &error, &bytes_read, FALSE);
- if (error)
- goto error_return;
- bfdsec->filepos = bfd_tell (abfd);
- bfdsec->alignment_power = 0;
- }
+ {
+ const char *sname = wasm_section_code_to_name (section_code);
+
+ if (! sname)
+ goto error_return;
+
+ name = strdup (sname);
+ bfdsec = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS);
+ if (bfdsec == NULL)
+ goto error_return;
+ name = NULL;
+
+ bfdsec->vma = vma;
+ bfdsec->lma = vma;
+ bfdsec->size = wasm_read_leb128 (abfd, &error, &bytes_read, FALSE);
+ if (error)
+ goto error_return;
+ bfdsec->filepos = bfd_tell (abfd);
+ bfdsec->alignment_power = 0;
+ }
else
- {
- bfd_vma payload_len;
- file_ptr section_start;
- bfd_vma namelen;
- char *prefix = WASM_SECTION_PREFIX;
- char *p;
- int ret;
-
- payload_len = wasm_read_leb128 (abfd, &error, &bytes_read, FALSE);
- if (error)
- goto error_return;
- section_start = bfd_tell (abfd);
- namelen = wasm_read_leb128 (abfd, &error, &bytes_read, FALSE);
- if (error || namelen > payload_len)
- goto error_return;
- name = bfd_zmalloc (namelen + strlen (prefix) + 1);
- if (! name)
- goto error_return;
- p = name;
- ret = sprintf (p, "%s", prefix);
- if (ret < 0 || (bfd_vma) ret != strlen (prefix))
- goto error_return;
- p += ret;
- if (bfd_bread (p, namelen, abfd) != namelen)
+ {
+ bfd_vma payload_len;
+ file_ptr section_start;
+ bfd_vma namelen;
+ char *prefix = WASM_SECTION_PREFIX;
+ char *p;
+ int ret;
+
+ payload_len = wasm_read_leb128 (abfd, &error, &bytes_read, FALSE);
+ if (error)
+ goto error_return;
+ section_start = bfd_tell (abfd);
+ namelen = wasm_read_leb128 (abfd, &error, &bytes_read, FALSE);
+ if (error || namelen > payload_len)
+ goto error_return;
+ name = bfd_zmalloc (namelen + strlen (prefix) + 1);
+ if (! name)
+ goto error_return;
+ p = name;
+ ret = sprintf (p, "%s", prefix);
+ if (ret < 0 || (bfd_vma) ret != strlen (prefix))
+ goto error_return;
+ p += ret;
+ if (bfd_bread (p, namelen, abfd) != namelen)
goto error_return;
- bfdsec = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS);
- if (bfdsec == NULL)
- goto error_return;
- name = NULL;
+ bfdsec = bfd_make_section_anyway_with_flags (abfd, name, SEC_HAS_CONTENTS);
+ if (bfdsec == NULL)
+ goto error_return;
+ name = NULL;
- bfdsec->vma = vma;
- bfdsec->lma = vma;
- bfdsec->filepos = bfd_tell (abfd);
- bfdsec->size = section_start + payload_len - bfdsec->filepos;
- bfdsec->alignment_power = 0;
- }
+ bfdsec->vma = vma;
+ bfdsec->lma = vma;
+ bfdsec->filepos = bfd_tell (abfd);
+ bfdsec->size = section_start + payload_len - bfdsec->filepos;
+ bfdsec->alignment_power = 0;
+ }
if (bfdsec->size != 0)
- {
- bfdsec->contents = bfd_zalloc (abfd, bfdsec->size);
- if (! bfdsec->contents)
- goto error_return;
+ {
+ bfdsec->contents = bfd_zalloc (abfd, bfdsec->size);
+ if (! bfdsec->contents)
+ goto error_return;
- if (bfd_bread (bfdsec->contents, bfdsec->size, abfd) != bfdsec->size)
+ if (bfd_bread (bfdsec->contents, bfdsec->size, abfd) != bfdsec->size)
goto error_return;
- }
+ }
vma += bfdsec->size;
}
static void
wasm_register_section (bfd *abfd ATTRIBUTE_UNUSED,
- asection *asect,
+ asection *asect,
void *fsarg)
{
sec_ptr *numbered_sections = fsarg;
static void
wasm_compute_custom_section_file_position (bfd *abfd,
sec_ptr asect,
- void *fsarg)
+ void *fsarg)
{
struct compute_section_arg *fs = fsarg;
int index;
payload_len += name_len;
do
- {
- payload_len++;
- nl >>= 7;
- }
+ {
+ payload_len++;
+ nl >>= 7;
+ }
while (nl);
bfd_seek (abfd, fs->pos, SEEK_SET);
if (! wasm_write_uleb128 (abfd, 0)
- || ! wasm_write_uleb128 (abfd, payload_len)
- || ! wasm_write_uleb128 (abfd, name_len)
- || bfd_bwrite (name, name_len, abfd) != name_len)
- goto error_return;
+ || ! wasm_write_uleb128 (abfd, payload_len)
+ || ! wasm_write_uleb128 (abfd, name_len)
+ || bfd_bwrite (name, name_len, abfd) != name_len)
+ goto error_return;
fs->pos = asect->filepos = bfd_tell (abfd);
}
else
bfd_size_type size;
if (! sec)
- continue;
+ continue;
size = sec->size;
if (bfd_seek (abfd, fs.pos, SEEK_SET) != 0)
- return FALSE;
+ return FALSE;
if (! wasm_write_uleb128 (abfd, i)
- || ! wasm_write_uleb128 (abfd, size))
- return FALSE;
+ || ! wasm_write_uleb128 (abfd, size))
+ return FALSE;
fs.pos = sec->filepos = bfd_tell (abfd);
fs.pos += size;
}
static bfd_boolean
wasm_set_section_contents (bfd *abfd,
- sec_ptr section,
- const void *location,
- file_ptr offset,
- bfd_size_type count)
+ sec_ptr section,
+ const void *location,
+ file_ptr offset,
+ bfd_size_type count)
{
if (count == 0)
return TRUE;
static void
wasm_print_symbol (bfd *abfd,
- void * filep,
- asymbol *symbol,
- bfd_print_symbol_type how)
+ void * filep,
+ asymbol *symbol,
+ bfd_print_symbol_type how)
{
FILE *file = (FILE *) filep;
static void
wasm_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED,
- asymbol *symbol,
- symbol_info *ret)
+ asymbol *symbol,
+ symbol_info *ret)
{
bfd_symbol_info (symbol, ret);
}
}
/* BFD_JUMP_TABLE_WRITE */
-#define wasm_set_arch_mach _bfd_generic_set_arch_mach
+#define wasm_set_arch_mach _bfd_generic_set_arch_mach
/* BFD_JUMP_TABLE_SYMBOLS */
-#define wasm_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define wasm_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define wasm_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
+#define wasm_bfd_is_local_label_name bfd_generic_is_local_label_name
#define wasm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define wasm_get_lineno _bfd_nosymbols_get_lineno
-#define wasm_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define wasm_find_line _bfd_nosymbols_find_line
-#define wasm_find_inliner_info _bfd_nosymbols_find_inliner_info
-#define wasm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define wasm_read_minisymbols _bfd_generic_read_minisymbols
-#define wasm_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define wasm_get_lineno _bfd_nosymbols_get_lineno
+#define wasm_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define wasm_find_line _bfd_nosymbols_find_line
+#define wasm_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define wasm_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define wasm_read_minisymbols _bfd_generic_read_minisymbols
+#define wasm_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
const bfd_target wasm_vec =
{
- "wasm", /* Name. */
+ "wasm", /* Name. */
bfd_target_unknown_flavour,
BFD_ENDIAN_LITTLE,
BFD_ENDIAN_LITTLE,
(HAS_SYMS | WP_TEXT), /* Object flags. */
(SEC_CODE | SEC_DATA | SEC_HAS_CONTENTS), /* Section flags. */
- 0, /* Leading underscore. */
- ' ', /* AR_pad_char. */
- 255, /* AR_max_namelen. */
+ 0, /* Leading underscore. */
+ ' ', /* AR_pad_char. */
+ 255, /* AR_max_namelen. */
0, /* Match priority. */
/* Routines to byte-swap various sized integers from the data sections. */
bfd_getl64, bfd_getl_signed_64, bfd_putl64,
/* WebAssembly module file header. Note that WASM_VERSION is a 32-bit
little-endian integer, not an LEB128-encoded integer. */
#define SIZEOF_WASM_MAGIC 4
-#define WASM_MAGIC { 0x00, 'a', 's', 'm' }
+#define WASM_MAGIC { 0x00, 'a', 's', 'm' }
#define SIZEOF_WASM_VERSION 4
-#define WASM_VERSION { 0x01, 0x00, 0x00, 0x00 }
+#define WASM_VERSION { 0x01, 0x00, 0x00, 0x00 }
/* Prefix to use to form section names. */
#define WASM_SECTION_PREFIX ".wasm."
/* Section names. WASM_NAME_SECTION is the name of the named section
named "name". */
-#define WASM_NAME_SECTION WASM_SECTION (0, "name")
+#define WASM_NAME_SECTION WASM_SECTION (0, "name")
#define WASM_RELOC_SECTION_PREFIX WASM_SECTION (0, "reloc.")
-#define WASM_LINKING_SECTION WASM_SECTION (0, "linking")
-#define WASM_DYLINK_SECTION WASM_SECTION (0, "dylink")
+#define WASM_LINKING_SECTION WASM_SECTION (0, "linking")
+#define WASM_DYLINK_SECTION WASM_SECTION (0, "dylink")
/* Subsection indices. Right now, that's subsections of the "name"
section only. */
if (csect != NULL)
*csect_cache = csect;
else if (first_csect == NULL
- || sym.n_sclass == C_FILE || sym.n_sclass == C_DWARF)
+ || sym.n_sclass == C_FILE || sym.n_sclass == C_DWARF)
*csect_cache = coff_section_from_bfd_index (abfd, sym.n_scnum);
else
*csect_cache = NULL;
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
- csect = section;
+ csect = section;
value = sym.n_value - csect->vma;
}
break;
We also have to handle the case of statically linking a
shared object, which will cause symbol redefinitions,
although this is an easier case to detect. */
- else if (info->output_bfd->xvec == abfd->xvec)
+ else if (info->output_bfd->xvec == abfd->xvec)
{
if (! bfd_is_und_section (section))
*sym_hash = xcoff_link_hash_lookup (xcoff_hash_table (info),
= csect->alignment_power;
}
- if (info->output_bfd->xvec == abfd->xvec)
+ if (info->output_bfd->xvec == abfd->xvec)
{
int flag;
{
/* Debugging sections have no csects. */
if (bfd_get_section_flags (abfd, o) & SEC_DEBUGGING)
- continue;
+ continue;
/* Reset the section size and the line number count, since the
data is now attached to the csects. Don't reset the size of
/* We identify all function symbols that are the target
of a relocation, so that we can create glue code for
functions imported from dynamic objects. */
- if (info->output_bfd->xvec == abfd->xvec
+ if (info->output_bfd->xvec == abfd->xvec
&& *rel_csect != bfd_und_section_ptr
&& obj_xcoff_sym_hashes (abfd)[rel->r_symndx] != NULL)
{
undefined references in shared objects. */
if (h != NULL
&& h->type == bfd_link_hash_undefined
- && (info->output_bfd->xvec != abfd->xvec
+ && (info->output_bfd->xvec != abfd->xvec
|| (((struct xcoff_link_hash_entry *) h)->flags
& XCOFF_DEF_DYNAMIC) == 0))
{
|| o == xcoff_hash_table (info)->loader_section
|| o == xcoff_hash_table (info)->linkage_section
|| o == xcoff_hash_table (info)->descriptor_section
- || (bfd_get_section_flags (sub, o) & SEC_DEBUGGING)
+ || (bfd_get_section_flags (sub, o) & SEC_DEBUGGING)
|| strcmp (o->name, ".debug") == 0)
o->flags |= SEC_MARK;
else
flinfo->last_file.n_value = output_index;
bfd_coff_swap_sym_out (output_bfd, (void *) &flinfo->last_file,
(void *) (flinfo->outsyms
- + ((flinfo->last_file_index - syment_base)
- * osymesz)));
+ + ((flinfo->last_file_index - syment_base)
+ * osymesz)));
}
/* Write the modified symbols to the output file. */
this case, but I don't think it's worth it. */
is = flinfo->internal_syms + r_symndx;
- if (is->n_sclass != C_DWARF)
- {
- name = (_bfd_coff_internal_syment_name
- (input_bfd, is, buf));
+ if (is->n_sclass != C_DWARF)
+ {
+ name = (_bfd_coff_internal_syment_name
+ (input_bfd, is, buf));
- if (name == NULL)
- return FALSE;
+ if (name == NULL)
+ return FALSE;
(*flinfo->info->callbacks->unattached_reloc)
(flinfo->info, name,
input_bfd, o, irel->r_vaddr);
- }
+ }
}
}
}
if ((o->flags & SEC_DEBUGGING) == 0
- && xcoff_need_ldrel_p (flinfo->info, irel, h))
+ && xcoff_need_ldrel_p (flinfo->info, irel, h))
{
asection *sec;
#include "bfd.h"
#include "libbfd.h"
-#define bfd_sym_close_and_cleanup _bfd_generic_close_and_cleanup
-#define bfd_sym_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
-#define bfd_sym_new_section_hook _bfd_generic_new_section_hook
-#define bfd_sym_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define bfd_sym_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
-#define bfd_sym_get_lineno _bfd_nosymbols_get_lineno
-#define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line
-#define bfd_sym_find_line _bfd_nosymbols_find_line
-#define bfd_sym_find_inliner_info _bfd_nosymbols_find_inliner_info
+#define bfd_sym_close_and_cleanup _bfd_generic_close_and_cleanup
+#define bfd_sym_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
+#define bfd_sym_new_section_hook _bfd_generic_new_section_hook
+#define bfd_sym_bfd_is_local_label_name bfd_generic_is_local_label_name
+#define bfd_sym_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
+#define bfd_sym_get_lineno _bfd_nosymbols_get_lineno
+#define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define bfd_sym_find_line _bfd_nosymbols_find_line
+#define bfd_sym_find_inliner_info _bfd_nosymbols_find_inliner_info
#define bfd_sym_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
-#define bfd_sym_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
-#define bfd_sym_read_minisymbols _bfd_generic_read_minisymbols
-#define bfd_sym_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
-#define bfd_sym_set_arch_mach _bfd_generic_set_arch_mach
-#define bfd_sym_get_section_contents _bfd_generic_get_section_contents
-#define bfd_sym_set_section_contents _bfd_generic_set_section_contents
+#define bfd_sym_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
+#define bfd_sym_read_minisymbols _bfd_generic_read_minisymbols
+#define bfd_sym_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
+#define bfd_sym_set_arch_mach _bfd_generic_set_arch_mach
+#define bfd_sym_get_section_contents _bfd_generic_get_section_contents
+#define bfd_sym_set_section_contents _bfd_generic_set_section_contents
#define bfd_sym_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents
-#define bfd_sym_bfd_relax_section bfd_generic_relax_section
-#define bfd_sym_bfd_gc_sections bfd_generic_gc_sections
-#define bfd_sym_bfd_lookup_section_flags bfd_generic_lookup_section_flags
-#define bfd_sym_bfd_merge_sections bfd_generic_merge_sections
-#define bfd_sym_bfd_is_group_section bfd_generic_is_group_section
-#define bfd_sym_bfd_discard_group bfd_generic_discard_group
-#define bfd_sym_section_already_linked _bfd_generic_section_already_linked
-#define bfd_sym_bfd_define_common_symbol bfd_generic_define_common_symbol
-#define bfd_sym_bfd_define_start_stop bfd_generic_define_start_stop
-#define bfd_sym_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
-#define bfd_sym_bfd_link_add_symbols _bfd_generic_link_add_symbols
-#define bfd_sym_bfd_link_just_syms _bfd_generic_link_just_syms
+#define bfd_sym_bfd_relax_section bfd_generic_relax_section
+#define bfd_sym_bfd_gc_sections bfd_generic_gc_sections
+#define bfd_sym_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#define bfd_sym_bfd_merge_sections bfd_generic_merge_sections
+#define bfd_sym_bfd_is_group_section bfd_generic_is_group_section
+#define bfd_sym_bfd_discard_group bfd_generic_discard_group
+#define bfd_sym_section_already_linked _bfd_generic_section_already_linked
+#define bfd_sym_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define bfd_sym_bfd_define_start_stop bfd_generic_define_start_stop
+#define bfd_sym_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
+#define bfd_sym_bfd_link_add_symbols _bfd_generic_link_add_symbols
+#define bfd_sym_bfd_link_just_syms _bfd_generic_link_just_syms
#define bfd_sym_bfd_copy_link_hash_symbol_type \
_bfd_generic_copy_link_hash_symbol_type
-#define bfd_sym_bfd_final_link _bfd_generic_final_link
-#define bfd_sym_bfd_link_split_section _bfd_generic_link_split_section
-#define bfd_sym_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
-#define bfd_sym_bfd_link_check_relocs _bfd_generic_link_check_relocs
+#define bfd_sym_bfd_final_link _bfd_generic_final_link
+#define bfd_sym_bfd_link_split_section _bfd_generic_link_split_section
+#define bfd_sym_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
+#define bfd_sym_bfd_link_check_relocs _bfd_generic_link_check_relocs
extern const bfd_target sym_vec;
#ifndef __xSYM_H__
#define __xSYM_H__
-#define BFD_SYM_VERSION_STR_3_1 "\013Version 3.1"
-#define BFD_SYM_VERSION_STR_3_2 "\013Version 3.2"
-#define BFD_SYM_VERSION_STR_3_3 "\013Version 3.3"
-#define BFD_SYM_VERSION_STR_3_4 "\013Version 3.4"
-#define BFD_SYM_VERSION_STR_3_5 "\013Version 3.5"
+#define BFD_SYM_VERSION_STR_3_1 "\013Version 3.1"
+#define BFD_SYM_VERSION_STR_3_2 "\013Version 3.2"
+#define BFD_SYM_VERSION_STR_3_3 "\013Version 3.3"
+#define BFD_SYM_VERSION_STR_3_4 "\013Version 3.4"
+#define BFD_SYM_VERSION_STR_3_5 "\013Version 3.5"
#define BFD_SYM_END_OF_LIST_3_2 0xffff
#define BFD_SYM_END_OF_LIST_3_4 0xffffffff
-#define BFD_SYM_END_OF_LIST BFD_SYM_END_OF_LIST_3_4
+#define BFD_SYM_END_OF_LIST BFD_SYM_END_OF_LIST_3_4
#define BFD_SYM_FILE_NAME_INDEX_3_2 0xfffe
#define BFD_SYM_FILE_NAME_INDEX_3_4 0xfffffffe
#define BFD_SYM_FILE_NAME_INDEX BFD_SYM_FILE_NAME_INDEX_3_4
unsigned short rte_res_number; /* Resource Number. */
unsigned long rte_nte_index; /* Name of the resource. */
unsigned long rte_mte_first; /* Index of first module in the resource. */
- unsigned long rte_mte_last; /* Index of the last module in the resource. */
- unsigned long rte_res_size; /* Size of the resource. */
+ unsigned long rte_mte_last; /* Index of the last module in the resource. */
+ unsigned long rte_res_size; /* Size of the resource. */
};
typedef struct bfd_sym_resources_table_entry bfd_sym_resources_table_entry;
struct bfd_sym_modules_table_entry
{
- unsigned long mte_rte_index; /* Which resource it is in. */
- unsigned long mte_res_offset; /* Offset into the resource. */
- unsigned long mte_size; /* Size of module. */
- char mte_kind; /* What kind of module this is. */
- char mte_scope; /* How visible is it? */
- unsigned long mte_parent; /* Containing module. */
- bfd_sym_file_reference mte_imp_fref; /* Implementation source. */
- unsigned long mte_imp_end; /* End of implementation source. */
- unsigned long mte_nte_index; /* The name of the module. */
- unsigned long mte_cmte_index; /* Modules contained in this. */
- unsigned long mte_cvte_index; /* Variables contained in this. */
- unsigned long mte_clte_index; /* Local labels defined here. */
- unsigned long mte_ctte_index; /* Types contained in this. */
- unsigned long mte_csnte_idx_1; /* CSNTE index of mte_snbr_first. */
- unsigned long mte_csnte_idx_2; /* CSNTE index of mte_snbr_last. */
+ unsigned long mte_rte_index; /* Which resource it is in. */
+ unsigned long mte_res_offset; /* Offset into the resource. */
+ unsigned long mte_size; /* Size of module. */
+ char mte_kind; /* What kind of module this is. */
+ char mte_scope; /* How visible is it? */
+ unsigned long mte_parent; /* Containing module. */
+ bfd_sym_file_reference mte_imp_fref; /* Implementation source. */
+ unsigned long mte_imp_end; /* End of implementation source. */
+ unsigned long mte_nte_index; /* The name of the module. */
+ unsigned long mte_cmte_index; /* Modules contained in this. */
+ unsigned long mte_cvte_index; /* Variables contained in this. */
+ unsigned long mte_clte_index; /* Local labels defined here. */
+ unsigned long mte_ctte_index; /* Types contained in this. */
+ unsigned long mte_csnte_idx_1; /* CSNTE index of mte_snbr_first. */
+ unsigned long mte_csnte_idx_2; /* CSNTE index of mte_snbr_last. */
};
typedef struct bfd_sym_modules_table_entry bfd_sym_modules_table_entry;
The table is ordered by increasing file offset. Each new offset
references a module.
- FRT = FILE_SOURCE_START
- FILE_SOURCE_INCREMENT*
- END_OF_LIST.
+ FRT = FILE_SOURCE_START
+ FILE_SOURCE_INCREMENT*
+ END_OF_LIST.
*** THIS MECHANISM IS VERY SLOW FOR FILE+STATEMENT_NUMBER TO
- *** MODULE/CODE ADDRESS OPERATIONS. ANOTHER MECHANISM IS
- *** REQUIRED!! */
+ *** MODULE/CODE ADDRESS OPERATIONS. ANOTHER MECHANISM IS
+ *** REQUIRED!! */
union bfd_sym_file_references_table_entry
{
== BFD_SYM_CVTE_BIG_LA
Logical address bytes in constant pool, at offset 'big_la'. */
-#define BFD_SYM_CVTE_SCA 0 /* Indicate SCA variant of CVTE. */
+#define BFD_SYM_CVTE_SCA 0 /* Indicate SCA variant of CVTE. */
#define BFD_SYM_CVTE_LA_MAX_SIZE 13 /* Max# of logical address bytes in a CVTE. */
#define BFD_SYM_CVTE_BIG_LA 127 /* Indicates LA redirection to constant pool. */
/* < SOURCE_FILE_CHANGE. */
unsigned long tte_index;
unsigned long nte_index;
- unsigned long file_delta; /* Increment from previous source. */
+ unsigned long file_delta; /* Increment from previous source. */
unsigned char scope;
- unsigned char la_size; /* #bytes of LAs below. */
+ unsigned char la_size; /* #bytes of LAs below. */
union
{
/* la_size == BFD_SYM_CVTE_SCA. */
struct
{
- unsigned char sca_kind; /* Distinguish local from value/var formal. */
- unsigned char sca_class; /* The storage class itself. */
+ unsigned char sca_kind; /* Distinguish local from value/var formal. */
+ unsigned char sca_class; /* The storage class itself. */
unsigned long sca_offset;
}
scstruct;
/* la_size <= BFD_SYM_CVTE_LA_MAX_SIZE. */
struct {
unsigned char la[BFD_SYM_CVTE_LA_MAX_SIZE]; /* Logical address bytes. */
- unsigned char la_kind; /* Eqv. cvte_location.sca_kind. */
+ unsigned char la_kind; /* Eqv. cvte_location.sca_kind. */
}
lastruct;
/* la_size == BFD_SYM_CVTE_BIG_LA 127. */
struct
{
- unsigned long big_la; /* Logical address bytes in constant pool. */
- unsigned char big_la_kind; /* Eqv. cvte_location.sca_kind. */
+ unsigned long big_la; /* Logical address bytes in constant pool. */
+ unsigned char big_la_kind; /* Eqv. cvte_location.sca_kind. */
}
biglastruct;
}