aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-m10300.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-05-07 02:55:55 +0000
committerAlan Modra <amodra@gmail.com>2005-05-07 02:55:55 +0000
commit3b36f7e6294151e194b7bf437379e9dcf5b857cb (patch)
tree8731fe456070e99d18865e8872e04ad119dd3fa0 /bfd/elf-m10300.c
parentc18bae34de482f2dc415694af45bd21f1a78715b (diff)
downloadgdb-3b36f7e6294151e194b7bf437379e9dcf5b857cb.zip
gdb-3b36f7e6294151e194b7bf437379e9dcf5b857cb.tar.gz
gdb-3b36f7e6294151e194b7bf437379e9dcf5b857cb.tar.bz2
bfd/
* elf-bfd.h (struct elf_backend_data): Remove got_symbol_offset. * elfxx-target.h (elf_backend_got_symbol_offset): Delete. * elflink.c (_bfd_elf_create_got_section): Use zero in place of got_symbol_offset. * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise. * elf32-frv.c (_frv_create_got_section): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Delete ppc code. (elf_backend_got_symbol_offset): Don't define. * elf64-ppc.c (elf_backend_got_symbol_offset): Don't define. * elf32-ppc.c (struct ppc_elf_link_hash_table): Add got_header_size and got_gap. (ppc_elf_create_got): Tidy. (ppc_elf_create_dynamic_sections): Don't set SEC_IN_MEMORY for .plt. (ppc_elf_check_relocs): Reduce string comparisons by using elf.hgot. (ppc_elf_gc_sweep_hook): Likewise. (ppc_elf_relocate_section): Likewise. (ppc_elf_finish_dynamic_symbol): Likewise. (allocate_got): New function. (allocate_dynrelocs): Use allocate_got. (ppc_elf_size_dynamic_sections): Likewise. Delay tlsld_got allocation so that local got can refcount it. Set got_header_size. (ppc_elf_relocate_section): Use value of elf.hgot rather than hard- coded 4. (ppc_elf_finish_dynamic_sections): Likewise. (elf_backend_got_symbol_offset): Don't define. (elf_backend_got_header_size): Ditto. ld/testsuite/ * ld-powerpc/tlsexe32.d: Update for changed got layout. * ld-powerpc/tlsexe32.g: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.r: Likewise.
Diffstat (limited to 'bfd/elf-m10300.c')
-rw-r--r--bfd/elf-m10300.c53
1 files changed, 26 insertions, 27 deletions
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index c9a9848..c78f040 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -620,8 +620,7 @@ _bfd_mn10300_elf_create_got_section (abfd, info)
bh = NULL;
if (!(_bfd_generic_link_add_one_symbol
(info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
- bed->got_symbol_offset, (const char *) NULL, FALSE,
- bed->collect, &bh)))
+ 0, (const char *) NULL, FALSE, bed->collect, &bh)))
return FALSE;
h = (struct elf_link_hash_entry *) bh;
h->def_regular = 1;
@@ -634,7 +633,7 @@ _bfd_mn10300_elf_create_got_section (abfd, info)
elf_hash_table (info)->hgot = h;
/* The first bit of the global offset table is the header. */
- s->size += bed->got_header_size + bed->got_symbol_offset;
+ s->size += bed->got_header_size;
return TRUE;
}
@@ -809,7 +808,7 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs)
else
{
/* This is a global offset table entry for a local
- symbol. */
+ symbol. */
if (local_got_offsets == NULL)
{
size_t size;
@@ -1186,7 +1185,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
-
+
case R_MN10300_GOTPC16:
/* Use global offset table as symbol value. */
@@ -1207,7 +1206,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
value -= bfd_get_section_by_name (dynobj,
".got")->output_section->vma;
value += addend;
-
+
bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
@@ -1215,7 +1214,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
value -= bfd_get_section_by_name (dynobj,
".got")->output_section->vma;
value += addend;
-
+
if ((long) value > 0x7fffff || (long) value < -0x800000)
return bfd_reloc_overflow;
@@ -1228,7 +1227,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
value -= bfd_get_section_by_name (dynobj,
".got")->output_section->vma;
value += addend;
-
+
if ((long) value > 0xffff || (long) value < -0x10000)
return bfd_reloc_overflow;
@@ -1244,7 +1243,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
asection * splt;
splt = bfd_get_section_by_name (dynobj, ".plt");
-
+
value = (splt->output_section->vma
+ splt->output_offset
+ h->plt.offset) - value;
@@ -1267,7 +1266,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
asection * splt;
splt = bfd_get_section_by_name (dynobj, ".plt");
-
+
value = (splt->output_section->vma
+ splt->output_offset
+ h->plt.offset) - value;
@@ -1291,7 +1290,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
asection * sgot;
sgot = bfd_get_section_by_name (dynobj, ".got");
-
+
if (h != NULL)
{
bfd_vma off;
@@ -1373,7 +1372,7 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
return bfd_reloc_ok;
}
/* Fall through. */
-
+
default:
return bfd_reloc_notsupported;
}
@@ -2383,7 +2382,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
splt = bfd_get_section_by_name (elf_hash_table (link_info)
->dynobj, ".plt");
-
+
value = ((splt->output_section->vma
+ splt->output_offset
+ h->root.plt.offset)
@@ -2760,16 +2759,16 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
/* We can not relax 0x6b, 0x7b, 0x8b, 0x9b as no 24bit
equivalent instructions exists. */
- if (code != 0x6b && code != 0x7b
+ if (code != 0x6b && code != 0x7b
&& code != 0x8b && code != 0x9b
&& ((code & 0x0f) == 0x09 || (code & 0x0f) == 0x08
|| (code & 0x0f) == 0x0a || (code & 0x0f) == 0x0b
|| (code & 0x0f) == 0x0e))
{
/* Not safe if the high bit is on as relaxing may
- move the value out of high mem and thus not fit
- in a signed 8bit value. This is currently over
- conservative. */
+ move the value out of high mem and thus not fit
+ in a signed 8bit value. This is currently over
+ conservative. */
if ((value & 0x80) == 0)
{
/* Note that we've changed the relocation contents,
@@ -2857,8 +2856,8 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
if (code == 0xfe)
{
- /* Get the second opcode. */
- code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
+ /* Get the second opcode. */
+ code = bfd_get_8 (abfd, contents + irel->r_offset - 2);
/* All the am33 32 -> 24 relaxing possibilities. */
/* We can not relax 0x6b, 0x7b, 0x8b, 0x9b as no 24bit
@@ -2872,9 +2871,9 @@ mn10300_elf_relax_section (abfd, sec, link_info, again)
|| (code & 0x0f) == 0x0e))
{
/* Not safe if the high bit is on as relaxing may
- move the value out of high mem and thus not fit
- in a signed 16bit value. This is currently over
- conservative. */
+ move the value out of high mem and thus not fit
+ in a signed 16bit value. This is currently over
+ conservative. */
if ((value & 0x8000) == 0)
{
/* Note that we've changed the relocation contents,
@@ -3823,8 +3822,8 @@ _bfd_mn10300_elf_merge_private_bfd_data (ibfd, obfd)
&& bfd_get_mach (obfd) < bfd_get_mach (ibfd))
{
if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd),
- bfd_get_mach (ibfd)))
- return FALSE;
+ bfd_get_mach (ibfd)))
+ return FALSE;
}
return TRUE;
@@ -4693,11 +4692,11 @@ _bfd_mn10300_elf_reloc_type_class (const Elf_Internal_Rela *rela)
/* So we can set bits in e_flags. */
#define elf_backend_final_write_processing \
- _bfd_mn10300_elf_final_write_processing
-#define elf_backend_object_p _bfd_mn10300_elf_object_p
+ _bfd_mn10300_elf_final_write_processing
+#define elf_backend_object_p _bfd_mn10300_elf_object_p
#define bfd_elf32_bfd_merge_private_bfd_data \
- _bfd_mn10300_elf_merge_private_bfd_data
+ _bfd_mn10300_elf_merge_private_bfd_data
#define elf_backend_can_gc_sections 1
#define elf_backend_create_dynamic_sections \