aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-score.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-12-06 09:26:00 +1030
committerAlan Modra <amodra@gmail.com>2017-12-06 17:51:43 +1030
commit07d6d2b8345ef3dc82eab49635acac9ee67dbb18 (patch)
tree380d1e08ae32b2a37d5f9610f1811bb98299ac09 /bfd/elf32-score.c
parent65281396861dfcfa993eb5af4769d6837104890d (diff)
downloadfsf-binutils-gdb-07d6d2b8345ef3dc82eab49635acac9ee67dbb18.zip
fsf-binutils-gdb-07d6d2b8345ef3dc82eab49635acac9ee67dbb18.tar.gz
fsf-binutils-gdb-07d6d2b8345ef3dc82eab49635acac9ee67dbb18.tar.bz2
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have whitespace = indent-with-non-tab,space-before-tab,trailing-space and I got annoyed enough seeing red in "git diff" output to fix the problems. * 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.
Diffstat (limited to 'bfd/elf32-score.c')
-rw-r--r--bfd/elf32-score.c3012
1 files changed, 1506 insertions, 1506 deletions
diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c
index 061b92a..77a5876 100644
--- a/bfd/elf32-score.c
+++ b/bfd/elf32-score.c
@@ -176,7 +176,7 @@ struct _score_elf_section_data
(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) \
@@ -304,12 +304,12 @@ score_bfd_put_48 (bfd *abfd, bfd_vma val, void *p)
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;
@@ -317,12 +317,12 @@ score_elf_hi16_reloc (bfd *abfd ATTRIBUTE_UNUSED,
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;
@@ -370,17 +370,17 @@ score_elf_assign_gp (bfd *output_bfd, bfd_vma *pgp)
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)
@@ -401,10 +401,10 @@ score_elf_assign_gp (bfd *output_bfd, bfd_vma *pgp)
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)
@@ -416,20 +416,20 @@ score_elf_final_gp (bfd *output_bfd,
*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;
@@ -437,12 +437,12 @@ score_elf_final_gp (bfd *output_bfd,
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;
@@ -472,8 +472,8 @@ score_elf_gprel15_with_gp (bfd *abfd,
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;
@@ -515,12 +515,12 @@ gprel32_with_gp (bfd *abfd, asymbol *symbol, arelent *reloc_entry,
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;
@@ -545,7 +545,7 @@ score_elf_gprel15_reloc (bfd *abfd,
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
@@ -553,8 +553,8 @@ score_elf_gprel15_reloc (bfd *abfd,
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;
@@ -566,7 +566,7 @@ score_elf_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
&& (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;
}
@@ -584,7 +584,7 @@ score_elf_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
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
@@ -592,29 +592,29 @@ score_elf_gprel32_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
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;
@@ -643,334 +643,334 @@ score_elf_got_lo16_reloc (bfd *abfd,
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
@@ -981,28 +981,28 @@ 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
@@ -1025,8 +1025,8 @@ score_elf_got_entry_eq (const void *entry1, const void *entry2)
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
@@ -1048,7 +1048,7 @@ score_elf_sort_hash_table_f (struct score_elf_link_hash_entry *h, void *data)
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)
@@ -1099,7 +1099,7 @@ score_elf_got_info (bfd *abfd, asection **sgotp)
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;
@@ -1129,7 +1129,7 @@ score_elf_sort_hash_table (struct bfd_link_info *info,
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. */
@@ -1142,8 +1142,8 @@ score_elf_sort_hash_table (struct bfd_link_info *info,
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;
@@ -1155,7 +1155,7 @@ score_elf_link_hash_newfunc (struct bfd_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)
{
@@ -1172,13 +1172,13 @@ score_elf_link_hash_newfunc (struct bfd_hash_entry *entry,
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;
}
@@ -1205,9 +1205,9 @@ score_elf_sort_dynamic_relocs (const void *arg1, const void *arg2)
/* 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;
@@ -1227,13 +1227,13 @@ score_elf_local_relocation_p (bfd *input_bfd,
{
/* 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;
@@ -1257,9 +1257,9 @@ score_elf_rel_dyn_section (bfd *dynobj, bfd_boolean create_p)
| 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;
}
@@ -1287,11 +1287,11 @@ score_elf_allocate_dynamic_relocations (bfd *abfd, unsigned int n)
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;
@@ -1321,8 +1321,8 @@ score_elf_create_dynamic_relocation (bfd *output_bfd,
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;
}
@@ -1332,14 +1332,14 @@ score_elf_create_dynamic_relocation (bfd *output_bfd,
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
@@ -1377,11 +1377,11 @@ score_elf_create_dynamic_relocation (bfd *output_bfd,
/* 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
@@ -1402,8 +1402,8 @@ score_elf_create_dynamic_relocation (bfd *output_bfd,
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;
@@ -1417,7 +1417,7 @@ score_elf_create_got_section (bfd *abfd,
if (s)
{
if (! maybe_exclude)
- s->flags &= ~SEC_EXCLUDE;
+ s->flags &= ~SEC_EXCLUDE;
return TRUE;
}
@@ -1439,8 +1439,8 @@ score_elf_create_got_section (bfd *abfd,
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;
@@ -1465,7 +1465,7 @@ score_elf_create_got_section (bfd *abfd,
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;
@@ -1485,12 +1485,12 @@ score_elf_high (bfd_vma value)
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;
@@ -1518,7 +1518,7 @@ score_elf_create_local_got_entry (bfd *abfd,
(*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;
}
@@ -1532,7 +1532,7 @@ score_elf_create_local_got_entry (bfd *abfd,
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;
@@ -1541,16 +1541,16 @@ score_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
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
@@ -1559,8 +1559,8 @@ score_elf_got16_entry (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
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;
@@ -1577,55 +1577,55 @@ s3_bfd_score_elf_hide_symbol (struct bfd_link_info *info,
{
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);
@@ -1636,9 +1636,9 @@ s3_bfd_score_elf_hide_symbol (struct bfd_link_info *info,
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;
@@ -1646,14 +1646,14 @@ score_elf_record_global_got_symbol (struct elf_link_hash_entry *h,
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;
@@ -1690,9 +1690,9 @@ score_elf_record_global_got_symbol (struct elf_link_hash_entry *h,
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;
@@ -1720,8 +1720,8 @@ score_elf_record_local_got_symbol (bfd *abfd,
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;
@@ -1730,7 +1730,7 @@ score_elf_local_got_index (bfd *abfd, bfd *ibfd, struct bfd_link_info *info,
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;
@@ -1768,7 +1768,7 @@ score_elf_global_got_index (bfd *abfd, struct elf_link_hash_entry *h)
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;
@@ -1797,30 +1797,30 @@ score_elf_resolve_final_got_entry (void **entryp, void *p)
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;
@@ -1837,8 +1837,8 @@ score_elf_resolve_final_got_entries (struct score_got_info *g)
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);
}
@@ -1846,9 +1846,9 @@ score_elf_resolve_final_got_entries (struct score_got_info *g)
/* 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;
@@ -1872,11 +1872,11 @@ score_elf_add_to_rel (bfd *abfd,
{
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:
@@ -1889,7 +1889,7 @@ score_elf_add_to_rel (bfd *abfd,
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);
@@ -1897,11 +1897,11 @@ score_elf_add_to_rel (bfd *abfd,
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;
@@ -1962,19 +1962,19 @@ score_elf_add_to_rel (bfd *abfd,
/* 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;
@@ -2002,26 +2002,26 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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. */
@@ -2039,11 +2039,11 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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. */
@@ -2063,39 +2063,39 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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:
@@ -2119,35 +2119,35 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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;
@@ -2155,7 +2155,7 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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;
@@ -2163,87 +2163,87 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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;
@@ -2251,12 +2251,12 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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);
@@ -2265,17 +2265,17 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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;
@@ -2290,13 +2290,13 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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);
@@ -2307,10 +2307,10 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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;
@@ -2318,27 +2318,27 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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);
@@ -2356,7 +2356,7 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
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;
@@ -2377,8 +2377,8 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
/* 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;
@@ -2392,13 +2392,13 @@ s3_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
/* 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;
@@ -2414,19 +2414,19 @@ s3_bfd_score_elf_relocate_section (bfd *output_bfd,
{
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;
@@ -2456,304 +2456,304 @@ s3_bfd_score_elf_relocate_section (bfd *output_bfd,
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;
@@ -2763,9 +2763,9 @@ s3_bfd_score_elf_relocate_section (bfd *output_bfd,
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;
@@ -2794,13 +2794,13 @@ s3_bfd_score_elf_check_relocs (bfd *abfd,
{
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;
@@ -2815,176 +2815,176 @@ s3_bfd_score_elf_check_relocs (bfd *abfd,
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;
@@ -2992,18 +2992,18 @@ s3_bfd_score_elf_check_relocs (bfd *abfd,
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");
@@ -3025,22 +3025,22 @@ s3_bfd_score_elf_symbol_processing (bfd *abfd, asymbol *asym)
{
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;
@@ -3049,10 +3049,10 @@ s3_bfd_score_elf_symbol_processing (bfd *abfd, asymbol *asym)
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
@@ -3065,8 +3065,8 @@ s3_bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_U
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)
{
@@ -3083,7 +3083,7 @@ s3_bfd_score_elf_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED,
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;
@@ -3093,9 +3093,9 @@ s3_bfd_score_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
/* 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
@@ -3107,45 +3107,45 @@ s3_bfd_score_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
{
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;
}
@@ -3171,7 +3171,7 @@ s3_bfd_score_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
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;
@@ -3197,14 +3197,14 @@ s3_bfd_score_elf_always_size_sections (bfd *output_bfd,
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
@@ -3260,12 +3260,12 @@ s3_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
{
/* 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
@@ -3277,131 +3277,131 @@ s3_bfd_score_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *i
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;
@@ -3416,14 +3416,14 @@ s3_bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
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. */
@@ -3439,9 +3439,9 @@ s3_bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
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))
@@ -3451,9 +3451,9 @@ s3_bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *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;
@@ -3461,7 +3461,7 @@ s3_bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
h->type = STT_SECTION;
if (!bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
+ return FALSE;
}
return TRUE;
@@ -3472,9 +3472,9 @@ s3_bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
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;
@@ -3496,7 +3496,7 @@ s3_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd,
/* 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);
@@ -3508,12 +3508,12 @@ s3_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd,
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);
}
@@ -3561,7 +3561,7 @@ s3_bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd,
/* 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;
@@ -3591,84 +3591,84 @@ s3_bfd_score_elf_finish_dynamic_sections (bfd *output_bfd,
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
@@ -3692,7 +3692,7 @@ s3_bfd_score_elf_finish_dynamic_sections (bfd *output_bfd,
{
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;
@@ -3702,8 +3702,8 @@ s3_bfd_score_elf_finish_dynamic_sections (bfd *output_bfd,
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;
@@ -3733,20 +3733,20 @@ s3_bfd_score_elf_section_processing (bfd *abfd ATTRIBUTE_UNUSED, Elf_Internal_Sh
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;
@@ -3769,15 +3769,15 @@ s3_bfd_score_elf_write_section (bfd *output_bfd, asection *sec, bfd_byte *conten
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;
}
@@ -3786,8 +3786,8 @@ s3_bfd_score_elf_write_section (bfd *output_bfd, asection *sec, bfd_byte *conten
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;
@@ -3810,7 +3810,7 @@ s3_bfd_score_elf_copy_indirect_symbol (struct bfd_link_info *info,
/* 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;
@@ -3839,10 +3839,10 @@ s3_bfd_score_elf_discard_info (bfd *abfd, struct elf_reloc_cookie *cookie,
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)
@@ -3873,17 +3873,17 @@ s3_bfd_score_elf_ignore_discarded_relocs (asection *sec)
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);
@@ -3902,7 +3902,7 @@ s3_bfd_score_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
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);
@@ -3931,7 +3931,7 @@ s3_bfd_score_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
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
@@ -3969,16 +3969,16 @@ s3_elf32_score_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_rea
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;
@@ -4035,10 +4035,10 @@ s3_elf32_score_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
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;
}
@@ -4071,8 +4071,8 @@ s3_elf32_score_new_section_hook (bfd *abfd, asection *sec)
/* 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);
@@ -4082,29 +4082,29 @@ _bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
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);
@@ -4114,19 +4114,19 @@ _bfd_score_elf_check_relocs (bfd *abfd,
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
@@ -4149,10 +4149,10 @@ _bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNU
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;
}
@@ -4164,8 +4164,8 @@ _bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNU
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);
@@ -4175,7 +4175,7 @@ _bfd_score_elf_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED,
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);
@@ -4185,7 +4185,7 @@ _bfd_score_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
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);
@@ -4213,9 +4213,9 @@ _bfd_score_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *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);
@@ -4225,7 +4225,7 @@ _bfd_score_elf_finish_dynamic_symbol (bfd *output_bfd,
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);
@@ -4235,8 +4235,8 @@ _bfd_score_elf_finish_dynamic_sections (bfd *output_bfd,
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);
@@ -4255,8 +4255,8 @@ _bfd_score_elf_section_processing (bfd *abfd ATTRIBUTE_UNUSED, Elf_Internal_Shdr
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);
@@ -4266,8 +4266,8 @@ _bfd_score_elf_write_section (bfd *output_bfd,
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);
@@ -4277,8 +4277,8 @@ _bfd_score_elf_copy_indirect_symbol (struct bfd_link_info *info,
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);
@@ -4288,7 +4288,7 @@ _bfd_score_elf_hide_symbol (struct bfd_link_info *info,
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);
@@ -4307,10 +4307,10 @@ _bfd_score_elf_ignore_discarded_relocs (asection *sec)
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);
@@ -4365,7 +4365,7 @@ elf32_score_link_hash_table_create (bfd *abfd)
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);
@@ -4415,17 +4415,17 @@ _bfd_score_elf_score_object_p (bfd * abfd)
{
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);
@@ -4440,22 +4440,22 @@ _bfd_score_elf_common_definition (Elf_Internal_Sym *sym)
/*****************************************************************************/
-#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 \
@@ -4474,31 +4474,31 @@ _bfd_score_elf_common_definition (Elf_Internal_Sym *sym)
_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"