* 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.
+2005-05-07 Alan Modra <amodra@bigpond.net.au>
+
+ * 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.
+
2005-05-05 Steve Ellcey <sje@cup.hp.com>
* configure.in (ACX_HEADER_STRING): New.
/* An array of target specific special section map. */
const struct bfd_elf_special_section *special_sections;
- /* offset of the _GLOBAL_OFFSET_TABLE_ symbol from the start of the
- .got section */
- bfd_vma got_symbol_offset;
-
/* The size in bytes of the header for the GOT. This includes the
so-called reserved entries on some systems. */
bfd_vma got_header_size;
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;
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;
}
else
{
/* This is a global offset table entry for a local
- symbol. */
+ symbol. */
if (local_got_offsets == NULL)
{
size_t size;
bfd_put_32 (input_bfd, value, hit_data);
return bfd_reloc_ok;
-
+
case R_MN10300_GOTPC16:
/* Use global offset table as symbol value. */
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;
value -= bfd_get_section_by_name (dynobj,
".got")->output_section->vma;
value += addend;
-
+
if ((long) value > 0x7fffff || (long) value < -0x800000)
return bfd_reloc_overflow;
value -= bfd_get_section_by_name (dynobj,
".got")->output_section->vma;
value += addend;
-
+
if ((long) value > 0xffff || (long) value < -0x10000)
return bfd_reloc_overflow;
asection * splt;
splt = bfd_get_section_by_name (dynobj, ".plt");
-
+
value = (splt->output_section->vma
+ splt->output_offset
+ h->plt.offset) - value;
asection * splt;
splt = bfd_get_section_by_name (dynobj, ".plt");
-
+
value = (splt->output_section->vma
+ splt->output_offset
+ h->plt.offset) - value;
asection * sgot;
sgot = bfd_get_section_by_name (dynobj, ".got");
-
+
if (h != NULL)
{
bfd_vma off;
return bfd_reloc_ok;
}
/* Fall through. */
-
+
default:
return bfd_reloc_notsupported;
}
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)
/* 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,
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
|| (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,
&& 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;
/* 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 \
FALSE), /* pcrel_offset */
/* A 16 bit pc-relative relocation. */
- HOWTO (R_FRV_LABEL16, /* type */
+ HOWTO (R_FRV_LABEL16, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* A 24-bit pc-relative relocation. */
- HOWTO (R_FRV_LABEL24, /* type */
+ HOWTO (R_FRV_LABEL24, /* type */
2, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
26, /* bitsize */
FALSE, /* partial_inplace */
0x7e03ffff, /* src_mask */
0x7e03ffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
- HOWTO (R_FRV_LO16, /* type */
+ HOWTO (R_FRV_LO16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_FRV_HI16, /* type */
+ HOWTO (R_FRV_HI16, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_FRV_GPREL12, /* type */
+ HOWTO (R_FRV_GPREL12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_FRV_GPREL12", /* name */
+ "R_FRV_GPREL12", /* name */
FALSE, /* partial_inplace */
- 0xfff, /* src_mask */
- 0xfff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xfff, /* src_mask */
+ 0xfff, /* dst_mask */
+ FALSE), /* pcrel_offset */
- HOWTO (R_FRV_GPRELU12, /* type */
+ HOWTO (R_FRV_GPRELU12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
0, /* bitpos */
complain_overflow_dont, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_FRV_GPRELU12", /* name */
+ "R_FRV_GPRELU12", /* name */
FALSE, /* partial_inplace */
- 0xfff, /* src_mask */
- 0x3f03f, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xfff, /* src_mask */
+ 0x3f03f, /* dst_mask */
+ FALSE), /* pcrel_offset */
- HOWTO (R_FRV_GPREL32, /* type */
+ HOWTO (R_FRV_GPREL32, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_GPREL32", /* name */
FALSE, /* partial_inplace */
- 0xffffffff, /* src_mask */
+ 0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_FRV_GPRELHI, /* type */
+ HOWTO (R_FRV_GPRELHI, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_GPRELHI", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
- HOWTO (R_FRV_GPRELLO, /* type */
+ HOWTO (R_FRV_GPRELLO, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_GPRELLO", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* A 12-bit signed operand with the GOT offset for the address of
the symbol. */
- HOWTO (R_FRV_GOT12, /* type */
+ HOWTO (R_FRV_GOT12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_GOT12", /* name */
FALSE, /* partial_inplace */
- 0xfff, /* src_mask */
- 0xfff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xfff, /* src_mask */
+ 0xfff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* The upper 16 bits of the GOT offset for the address of the
symbol. */
- HOWTO (R_FRV_GOTHI, /* type */
+ HOWTO (R_FRV_GOTHI, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_GOTHI", /* name */
FALSE, /* partial_inplace */
- 0xffff, /* src_mask */
+ 0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The lower 16 bits of the GOT offset for the address of the
symbol. */
- HOWTO (R_FRV_GOTLO, /* type */
+ HOWTO (R_FRV_GOTLO, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The 32-bit address of the canonical descriptor of a function. */
HOWTO (R_FRV_FUNCDESC, /* type */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_FUNCDESC_GOT12", /* name */
FALSE, /* partial_inplace */
- 0xfff, /* src_mask */
- 0xfff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xfff, /* src_mask */
+ 0xfff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* The upper 16 bits of the GOT offset for the address of the
canonical descriptor of a function. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The lower 16 bits of the GOT offset for the address of the
canonical descriptor of a function. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The 64-bit descriptor of a function. */
HOWTO (R_FRV_FUNCDESC_VALUE, /* type */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_FUNCDESC_GOTOFF12", /* name */
FALSE, /* partial_inplace */
- 0xfff, /* src_mask */
- 0xfff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xfff, /* src_mask */
+ 0xfff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* The upper 16 bits of the GOT offset for the address of the
canonical descriptor of a function. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The lower 16 bits of the GOT offset for the address of the
canonical descriptor of a function. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* A 12-bit signed operand with the GOT offset for the address of
the symbol. */
- HOWTO (R_FRV_GOTOFF12, /* type */
+ HOWTO (R_FRV_GOTOFF12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_GOTOFF12", /* name */
FALSE, /* partial_inplace */
- 0xfff, /* src_mask */
- 0xfff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xfff, /* src_mask */
+ 0xfff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* The upper 16 bits of the GOT offset for the address of the
symbol. */
- HOWTO (R_FRV_GOTOFFHI, /* type */
+ HOWTO (R_FRV_GOTOFFHI, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The lower 16 bits of the GOT offset for the address of the
symbol. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* A 24-bit pc-relative relocation referencing the TLS PLT entry for
a thread-local symbol. If the symbol number is 0, it refers to
FALSE, /* partial_inplace */
0x7e03ffff, /* src_mask */
0x7e03ffff, /* dst_mask */
- TRUE), /* pcrel_offset */
+ TRUE), /* pcrel_offset */
/* A 64-bit TLS descriptor for a symbol. This relocation is only
valid as a REL, dynamic relocation. */
/* A 12-bit signed operand with the GOT offset for the TLS
descriptor of the symbol. */
- HOWTO (R_FRV_GOTTLSDESC12, /* type */
+ HOWTO (R_FRV_GOTTLSDESC12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_GOTTLSDESC12", /* name */
FALSE, /* partial_inplace */
- 0xfff, /* src_mask */
- 0xfff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xfff, /* src_mask */
+ 0xfff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* The upper 16 bits of the GOT offset for the TLS descriptor of the
symbol. */
- HOWTO (R_FRV_GOTTLSDESCHI, /* type */
+ HOWTO (R_FRV_GOTTLSDESCHI, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The lower 16 bits of the GOT offset for the TLS descriptor of the
symbol. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* A 12-bit signed operand with the offset from the module base
address to the thread-local symbol address. */
- HOWTO (R_FRV_TLSMOFF12, /* type */
+ HOWTO (R_FRV_TLSMOFF12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_TLSMOFF12", /* name */
FALSE, /* partial_inplace */
- 0xfff, /* src_mask */
- 0xfff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xfff, /* src_mask */
+ 0xfff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* The upper 16 bits of the offset from the module base address to
the thread-local symbol address. */
- HOWTO (R_FRV_TLSMOFFHI, /* type */
+ HOWTO (R_FRV_TLSMOFFHI, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The lower 16 bits of the offset from the module base address to
the thread-local symbol address. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* A 12-bit signed operand with the GOT offset for the TLSOFF entry
for a symbol. */
- HOWTO (R_FRV_GOTTLSOFF12, /* type */
+ HOWTO (R_FRV_GOTTLSOFF12, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
12, /* bitsize */
bfd_elf_generic_reloc, /* special_function */
"R_FRV_GOTTLSOFF12", /* name */
FALSE, /* partial_inplace */
- 0xfff, /* src_mask */
- 0xfff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ 0xfff, /* src_mask */
+ 0xfff, /* dst_mask */
+ FALSE), /* pcrel_offset */
/* The upper 16 bits of the GOT offset for the TLSOFF entry for a
symbol. */
- HOWTO (R_FRV_GOTTLSOFFHI, /* type */
+ HOWTO (R_FRV_GOTTLSOFFHI, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
16, /* bitsize */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The lower 16 bits of the GOT offset for the TLSOFF entry for a
symbol. */
FALSE, /* partial_inplace */
0xffff, /* src_mask */
0xffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
/* The 32-bit offset from the thread pointer (not the module base
address) to a thread-local symbol. */
/* A 32-bit offset from the module base address to
the thread-local symbol address. */
- HOWTO (R_FRV_TLSMOFF, /* type */
+ HOWTO (R_FRV_TLSMOFF, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
- FALSE), /* pcrel_offset */
+ FALSE), /* pcrel_offset */
};
/* GNU extension to record C++ vtable hierarchy. */
static reloc_howto_type elf32_frv_vtinherit_howto =
- HOWTO (R_FRV_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_FRV_GNU_VTINHERIT", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE); /* pcrel_offset */
+ HOWTO (R_FRV_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_FRV_GNU_VTINHERIT", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE); /* pcrel_offset */
/* GNU extension to record C++ vtable member usage. */
static reloc_howto_type elf32_frv_vtentry_howto =
- HOWTO (R_FRV_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_FRV_GNU_VTENTRY", /* name */
- FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
- FALSE); /* pcrel_offset */
+ HOWTO (R_FRV_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_FRV_GNU_VTENTRY", /* name */
+ FALSE, /* partial_inplace */
+ 0, /* src_mask */
+ 0, /* dst_mask */
+ FALSE); /* pcrel_offset */
/* The following 3 relocations are REL. The only difference to the
entries in the table above are that partial_inplace is TRUE. */
->output_offset,
R_FRV_TLSOFF, idx, ad, entry);
}
-
+
bfd_put_32 (output_bfd, ad,
frvfdpic_got_section (info)->contents
+ frvfdpic_got_initial_offset (info)
{
bfd_byte *plt_code = frvfdpic_plt_section (info)->contents
+ entry->tlsplt_entry;
-
+
if (info->executable
&& (entry->symndx != -1
|| FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
else
idx = 0;
}
-
+
/* *ABS*+addend is special for TLS relocations, use only the
addend for the TLS offset, and take the module id as
0. */
TLS offset to the addend. */
else if (sec)
ad += sec->output_section->vma - tls_biased_base (info);
-
+
if ((bfd_signed_vma)ad >= -(1 << (16 - 1))
&& (bfd_signed_vma)ad < (1 << (16 - 1)))
{
(LOCAL_EXEC_P ((info), (picrel)))
#define RELAX_TLSDESC_INITIAL_EXEC_P(info, picrel) \
(INITIAL_EXEC_P ((info), (picrel)))
-
+
#define RELAX_GOTTLSOFF_LOCAL_EXEC_P(info, picrel, value) \
(LOCAL_EXEC_P ((info), (picrel)) \
&& TLSMOFF_IN_RANGE_FOR_SETLOS_P((value), (info)))
name, input_bfd, input_section, rel->r_offset);
return FALSE;
}
-
+
if (RELAX_GETTLSOFF_LOCAL_EXEC_P (info, picrel,
relocation + rel->r_addend))
{
}
break;
-
+
case R_FRV_GOTTLSDESCLO:
insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
}
break;
-
+
case R_FRV_TLSDESC_RELAX:
insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
/*
There's nothing to relax in these:
- R_FRV_TLSDESC_VALUE
- R_FRV_TLSOFF
- R_FRV_TLSMOFF12
- R_FRV_TLSMOFFHI
- R_FRV_TLSMOFFLO
- R_FRV_TLSMOFF
+ R_FRV_TLSDESC_VALUE
+ R_FRV_TLSOFF
+ R_FRV_TLSMOFF12
+ R_FRV_TLSMOFFHI
+ R_FRV_TLSMOFFLO
+ R_FRV_TLSMOFF
*/
default:
? _frvfdpic_osec_to_segment (output_bfd, sec->output_section)
: tls_segment;
break;
-
+
case R_FRV_TLSDESC_VALUE:
case R_FRV_TLSOFF:
/* These shouldn't be present in input object files. */
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;
}
/* 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;
/* This is the machine-specific part. Create and initialize section
data for the got. */
bfd_boolean subtract)
{
const int l = subtract ? -1 : 1;
-
+
/* Allocate space for a GOT entry with the TLS offset of the
symbol. */
if (entry->tlsoff12)
_frvfdpic_count_tls_entries (entry, dinfo, TRUE);
changed = TRUE;
}
-
+
entry->tlsplt =
entry->tlsoff12 = entry->tlsofflos = entry->tlsoffhilo = 0;
}
else
size = 16;
}
-
+
frvfdpic_plt_section (dinfo->g.info)->size += size;
}
&& (hend->type == bfd_link_hash_defined
|| hend->type == bfd_link_hash_defweak))
{
- bfd_vma value =
+ bfd_vma value =
frvfdpic_gotfixup_section (info)->output_section->vma
+ frvfdpic_gotfixup_section (info)->output_offset
+ frvfdpic_gotfixup_section (info)->size
case R_FRV_TLSDESC_VALUE:
picrel->relocstlsd++;
goto bad_reloc;
-
+
case R_FRV_GOTTLSDESC12:
picrel->tlsdesc12 = 1;
break;
picrel->tlsoff12 = 1;
info->flags |= DF_STATIC_TLS;
break;
-
+
case R_FRV_GOTTLSOFFHI:
case R_FRV_GOTTLSOFFLO:
picrel->tlsoffhilo = 1;
info->flags |= DF_STATIC_TLS;
break;
-
+
case R_FRV_TLSOFF:
picrel->relocstlsoff++;
info->flags |= DF_STATIC_TLS;
if (s->size == 0)
{
/* Strip this section if we don't need it; see the
- comment below. */
+ comment below. */
strip = TRUE;
}
else
}
}
- /* Add a blrl instruction at _GLOBAL_OFFSET_TABLE_-4 so that a function can
- easily find the address of the _GLOBAL_OFFSET_TABLE_. */
-/* XXX this is clearly very wrong for the 370 arch */
if (sgot)
{
unsigned char *contents = sgot->contents;
- bfd_put_32 (output_bfd, (bfd_vma) 0x4e800021 /* blrl */, contents);
if (sdyn == NULL)
- bfd_put_32 (output_bfd, (bfd_vma) 0, contents+4);
+ bfd_put_32 (output_bfd, (bfd_vma) 0, contents);
else
bfd_put_32 (output_bfd,
sdyn->output_section->vma + sdyn->output_offset,
- contents+4);
+ contents);
elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4;
}
}
/* Set the sh_info field of the output .dynsym section to the
- index of the first global symbol. */
+ index of the first global symbol. */
elf_section_data (sdynsym->output_section)->this_hdr.sh_info =
maxdindx + 1;
}
|| r_type == R_I370_RELATIVE))
{
/* In these cases, we don't need the relocation
- value. We check specially because in some
- obscure cases sec->output_section will be NULL. */
+ value. We check specially because in some
+ obscure cases sec->output_section will be NULL. */
relocation = 0;
}
else
continue;
/* Relocations that may need to be propagated if this is a shared
- object. */
+ object. */
case (int)R_I370_REL31:
/* If these relocations are not to a named symbol, they can be
handled right here, no need to bother the dynamic linker. */
/* fall through */
/* Relocations that always need to be propagated if this is a shared
- object. */
+ object. */
case (int)R_I370_ADDR31:
case (int)R_I370_ADDR16:
if (info->shared
#endif
/* When generating a shared object, these relocations
- are copied into the output file to be resolved at run
- time. */
+ are copied into the output file to be resolved at run
+ time. */
if (sreloc == NULL)
{
if (skip)
memset (&outrel, 0, sizeof outrel);
/* h->dynindx may be -1 if this symbol was marked to
- become local. */
+ become local. */
else if (h != NULL
&& ((! info->symbolic && h->dynindx != -1)
|| !h->def_regular))
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
/* This reloc will be computed at runtime, so there's no
- need to do anything now, unless this is a RELATIVE
- reloc in an unallocated section. */
+ need to do anything now, unless this is a RELATIVE
+ reloc in an unallocated section. */
if (skip == -1
|| (input_section->flags & SEC_ALLOC) != 0
|| ELF32_R_TYPE (outrel.r_info) != R_I370_RELATIVE)
#define elf_info_to_howto i370_elf_info_to_howto
#define elf_backend_plt_not_loaded 1
-#define elf_backend_got_symbol_offset 4
#define elf_backend_rela_normal 1
#define bfd_elf32_bfd_reloc_type_lookup i370_elf_reloc_type_lookup
bfd_vma offset;
} tlsld_got;
+ /* Size of reserved GOT entries. */
+ unsigned int got_header_size;
+ /* Non-zero if allocating the header left a gap. */
+ unsigned int got_gap;
+
/* Small local sym to section mapping cache. */
struct sym_sec_cache sym_sec;
};
if (!bfd_set_section_flags (abfd, s, flags))
return FALSE;
- htab->relgot = bfd_make_section_with_flags (abfd, ".rela.got",
- SEC_ALLOC | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY
- | SEC_LINKER_CREATED
- | SEC_READONLY);
+ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED | SEC_READONLY);
+ htab->relgot = bfd_make_section_with_flags (abfd, ".rela.got", flags);
if (!htab->relgot
|| ! bfd_set_section_alignment (abfd, htab->relgot, 2))
return FALSE;
| SEC_LINKER_CREATED);
htab->dynbss = bfd_get_section_by_name (abfd, ".dynbss");
- htab->dynsbss = s = bfd_make_section_with_flags (abfd, ".dynsbss",
- SEC_ALLOC
- | SEC_LINKER_CREATED);
+ s = bfd_make_section_with_flags (abfd, ".dynsbss",
+ SEC_ALLOC | SEC_LINKER_CREATED);
+ htab->dynsbss = s;
if (s == NULL)
return FALSE;
if (! info->shared)
{
htab->relbss = bfd_get_section_by_name (abfd, ".rela.bss");
- htab->relsbss = s = bfd_make_section_with_flags (abfd,
- ".rela.sbss",
- flags | SEC_READONLY);
+ s = bfd_make_section_with_flags (abfd, ".rela.sbss",
+ flags | SEC_READONLY);
+ htab->relsbss = s;
if (s == NULL
|| ! bfd_set_section_alignment (abfd, s, 2))
return FALSE;
if (s == NULL)
abort ();
- flags = SEC_ALLOC | SEC_CODE | SEC_IN_MEMORY | SEC_LINKER_CREATED;
+ flags = SEC_ALLOC | SEC_CODE | SEC_LINKER_CREATED;
return bfd_set_section_flags (abfd, s, flags);
}
/* If a relocation refers to _GLOBAL_OFFSET_TABLE_, create the .got.
This shows up in particular in an R_PPC_ADDR32 in the eabi
startup code. */
- if (h && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+ if (h != NULL
+ && htab->got == NULL
+ && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
{
- if (htab->got == NULL)
- {
- if (htab->elf.dynobj == NULL)
- htab->elf.dynobj = abfd;
- if (!ppc_elf_create_got (htab->elf.dynobj, info))
- return FALSE;
- }
+ if (htab->elf.dynobj == NULL)
+ htab->elf.dynobj = abfd;
+ if (!ppc_elf_create_got (htab->elf.dynobj, info))
+ return FALSE;
+ BFD_ASSERT (h == htab->elf.hgot);
}
r_type = ELF32_R_TYPE (rel->r_info);
case R_PPC_REL14_BRTAKEN:
case R_PPC_REL14_BRNTAKEN:
case R_PPC_REL32:
- if (h == NULL
- || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+ if (h == NULL || h == htab->elf.hgot)
break;
/* fall through */
case R_PPC_REL14_BRTAKEN:
case R_PPC_REL14_BRNTAKEN:
case R_PPC_REL32:
- if (h == NULL
- || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+ if (h == NULL || h == htab->elf.hgot)
break;
/* Fall thru */
return TRUE;
}
\f
+/* Allocate NEED contiguous space in .got, and return the offset.
+ Handles allocation of the got header when crossing 32k. */
+
+static bfd_vma
+allocate_got (struct ppc_elf_link_hash_table *htab, unsigned int need)
+{
+ bfd_vma where;
+ unsigned int max_before_header = 32764;
+
+ if (need <= htab->got_gap)
+ {
+ where = max_before_header - htab->got_gap;
+ htab->got_gap -= need;
+ }
+ else
+ {
+ if (htab->got->size + need > max_before_header
+ && htab->got->size <= max_before_header)
+ {
+ htab->got_gap = max_before_header - htab->got->size;
+ htab->got->size = max_before_header + htab->got_header_size;
+ }
+ where = htab->got->size;
+ htab->got->size += need;
+ }
+ return where;
+}
+
/* Allocate space in associated reloc sections for dynamic relocs. */
static bfd_boolean
else
{
bfd_boolean dyn;
- eh->elf.got.offset = htab->got->size;
+ unsigned int need = 0;
if ((eh->tls_mask & TLS_TLS) != 0)
{
if ((eh->tls_mask & TLS_LD) != 0)
- htab->got->size += 8;
+ need += 8;
if ((eh->tls_mask & TLS_GD) != 0)
- htab->got->size += 8;
+ need += 8;
if ((eh->tls_mask & (TLS_TPREL | TLS_TPRELGD)) != 0)
- htab->got->size += 4;
+ need += 4;
if ((eh->tls_mask & TLS_DTPREL) != 0)
- htab->got->size += 4;
+ need += 4;
}
else
- htab->got->size += 4;
+ need += 4;
+ eh->elf.got.offset = allocate_got (htab, need);
dyn = htab->elf.dynamic_sections_created;
if ((info->shared
|| WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, &eh->elf))
&& (ELF_ST_VISIBILITY (eh->elf.other) == STV_DEFAULT
|| eh->elf.root.type != bfd_link_hash_undefweak))
{
- /* All the entries we allocated need relocs. */
- htab->relgot->size
- += ((htab->got->size - eh->elf.got.offset) / 4
- * sizeof (Elf32_External_Rela));
- /* Except LD only needs one. */
+ /* All the entries we allocated need relocs.
+ Except LD only needs one. */
if ((eh->tls_mask & TLS_LD) != 0)
- htab->relgot->size -= sizeof (Elf32_External_Rela);
+ need -= 4;
+ htab->relgot->size += need * (sizeof (Elf32_External_Rela) / 4);
}
}
}
}
}
- if (htab->tlsld_got.refcount > 0)
- {
- htab->tlsld_got.offset = htab->got->size;
- htab->got->size += 8;
- if (info->shared)
- htab->relgot->size += sizeof (Elf32_External_Rela);
- }
- else
- htab->tlsld_got.offset = (bfd_vma) -1;
+ htab->got_header_size = 16;
/* Set up .got offsets for local syms, and space for local dynamic
relocs. */
char *lgot_masks;
bfd_size_type locsymcount;
Elf_Internal_Shdr *symtab_hdr;
- asection *srel;
if (!is_ppc_elf_target (ibfd->xvec))
continue;
locsymcount = symtab_hdr->sh_info;
end_local_got = local_got + locsymcount;
lgot_masks = (char *) end_local_got;
- s = htab->got;
- srel = htab->relgot;
for (; local_got < end_local_got; ++local_got, ++lgot_masks)
if (*local_got > 0)
{
{
/* If just an LD reloc, we'll just use
htab->tlsld_got.offset. */
- if (htab->tlsld_got.offset == (bfd_vma) -1)
- {
- htab->tlsld_got.offset = s->size;
- s->size += 8;
- if (info->shared)
- srel->size += sizeof (Elf32_External_Rela);
- }
+ htab->tlsld_got.refcount += 1;
*local_got = (bfd_vma) -1;
}
else
{
- *local_got = s->size;
+ unsigned int need = 0;
if ((*lgot_masks & TLS_TLS) != 0)
{
if ((*lgot_masks & TLS_GD) != 0)
- s->size += 8;
+ need += 8;
if ((*lgot_masks & (TLS_TPREL | TLS_TPRELGD)) != 0)
- s->size += 4;
+ need += 4;
if ((*lgot_masks & TLS_DTPREL) != 0)
- s->size += 4;
+ need += 4;
}
else
- s->size += 4;
+ need += 4;
+ *local_got = allocate_got (htab, need);
if (info->shared)
- srel->size += ((s->size - *local_got) / 4
- * sizeof (Elf32_External_Rela));
+ htab->relgot->size += (need
+ * (sizeof (Elf32_External_Rela) / 4));
}
}
else
*local_got = (bfd_vma) -1;
}
+ if (htab->tlsld_got.refcount > 0)
+ {
+ htab->tlsld_got.offset = allocate_got (htab, 8);
+ if (info->shared)
+ htab->relgot->size += sizeof (Elf32_External_Rela);
+ }
+ else
+ htab->tlsld_got.offset = (bfd_vma) -1;
+
/* Allocate space for global sym dynamic relocs. */
elf_link_hash_traverse (elf_hash_table (info), allocate_dynrelocs, info);
+ if (htab->got != NULL)
+ {
+ unsigned int g_o_t = 32768;
+
+ /* If we haven't allocated the header, do so now. */
+ if (htab->got->size <= 32768)
+ {
+ g_o_t = htab->got->size;
+ htab->got->size += htab->got_header_size;
+ }
+ g_o_t += 4;
+
+ htab->elf.hgot->root.u.def.value = g_o_t;
+ }
+
/* We've now determined the sizes of the various dynamic sections.
Allocate memory for them. */
relocs = FALSE;
}
}
- relocation = htab->got->output_offset + off - 4;
+ relocation = htab->got->output_offset + off;
+ relocation -= htab->elf.hgot->root.u.def.value;
/* Addends on got relocations don't make much sense.
x+off@got is actually x@got+off, and since the got is
/* If these relocations are not to a named symbol, they can be
handled right here, no need to bother the dynamic linker. */
if (SYMBOL_REFERENCES_LOCAL (info, h)
- || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+ || h == htab->elf.hgot)
break;
/* fall through */
#endif
/* Mark some specially defined symbols as absolute. */
- if (strcmp (h->root.root.string, "_DYNAMIC") == 0
- || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0
+ if (h == htab->elf.hgot
+ || strcmp (h->root.root.string, "_DYNAMIC") == 0
|| strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0)
sym->st_shndx = SHN_ABS;
/* Add a blrl instruction at _GLOBAL_OFFSET_TABLE_-4 so that a function can
easily find the address of the _GLOBAL_OFFSET_TABLE_. */
- if (htab->got)
+ if (htab->got != NULL)
{
- unsigned char *contents = htab->got->contents;
- bfd_put_32 (output_bfd, 0x4e800021 /* blrl */, contents);
+ unsigned char *p = htab->got->contents;
+ bfd_vma val;
- if (sdyn == NULL)
- bfd_put_32 (output_bfd, 0, contents + 4);
- else
- bfd_put_32 (output_bfd,
- sdyn->output_section->vma + sdyn->output_offset,
- contents + 4);
+ p += elf_hash_table (info)->hgot->root.u.def.value;
+ bfd_put_32 (output_bfd, 0x4e800021 /* blrl */, p - 4);
+
+ val = 0;
+ if (sdyn != NULL)
+ val = sdyn->output_section->vma + sdyn->output_offset;
+ bfd_put_32 (output_bfd, val, p);
elf_section_data (htab->got->output_section)->this_hdr.sh_entsize = 4;
}
#endif
#define elf_backend_plt_not_loaded 1
-#define elf_backend_got_symbol_offset 4
#define elf_backend_can_gc_sections 1
#define elf_backend_can_refcount 1
-#define elf_backend_got_header_size 12
#define elf_backend_rela_normal 1
#define bfd_elf32_mkobject ppc_elf_mkobject
#define elf_backend_want_plt_sym 0
#define elf_backend_plt_alignment 3
#define elf_backend_plt_not_loaded 1
-#define elf_backend_got_symbol_offset 0
#define elf_backend_got_header_size 8
#define elf_backend_can_gc_sections 1
#define elf_backend_can_refcount 1
long j;
/* Trim duplicate syms, since we may have merged the normal and
dynamic symbols. Actually, we only care about syms that have
- different values, so trim any with the same value. */
+ different values, so trim any with the same value. */
for (i = 1, j = 1; i < symcount; ++i)
if (syms[i - 1]->value + syms[i - 1]->section->vma
!= syms[i]->value + syms[i]->section->vma)
if (!bfd_get_section_contents (opd_bfd, opd_sec, &val, offset, 8))
return (bfd_vma) -1;
-
+
if (code_sec != NULL)
{
asection *sec, *likely = NULL;
bh = NULL;
if (!(_bfd_generic_link_add_one_symbol
(info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
- bed->got_symbol_offset, NULL, FALSE, bed->collect, &bh)))
+ 0, NULL, FALSE, bed->collect, &bh)))
return FALSE;
h = (struct elf_link_hash_entry *) bh;
h->def_regular = 1;
}
/* 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;
}
if (h->type == STT_TLS)
{
- ntbfd = abfd;
+ ntbfd = abfd;
ntsec = sec;
ntdef = newdef;
tbfd = oldbfd;
else if (sec->kept_section)
{
/* Symbols from discarded section are undefined, and have
- default visibility. */
+ default visibility. */
sec = bfd_und_section_ptr;
isym->st_shndx = SHN_UNDEF;
isym->st_other = STV_DEFAULT
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
-
+
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
struct bfd_link_order **sections;
asection *s;
bfd_vma offset;
-
+
seen_other = 0;
seen_linkorder = 0;
for (p = o->map_head.link_order; p != NULL; p = p->next)
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
-
+
sections = (struct bfd_link_order **)
xmalloc (seen_linkorder * sizeof (struct bfd_link_order *));
seen_linkorder = 0;
-
+
for (p = o->map_head.link_order; p != NULL; p = p->next)
{
sections[seen_linkorder++] = p;
return TRUE;
}
-
+
/* Mark sections containing global symbols. This is called through
elf_link_hash_traverse. */
return TRUE;
}
-
+
/* Do mark and sweep of unused sections. */
bfd_boolean
{
/* _bfd_elf_discard_section_eh_frame knows how to discard
orphaned FDEs so don't mark sections referenced by the
- EH frame section. */
+ EH frame section. */
if (strcmp (o->name, ".eh_frame") == 0)
o->gc_mark = 1;
else if (!_bfd_elf_gc_mark (info, o, gc_mark_hook))
which we are really going to use. */
sec->output_section = bfd_abs_section_ptr;
sec->kept_section = l->sec;
-
+
if (flags & SEC_GROUP)
{
asection *first = elf_next_in_group (sec);
h = elf_link_hash_lookup (elf_hash_table (info), name, FALSE, FALSE,
FALSE);
if (h != NULL && (h->root.type == bfd_link_hash_undefined
- || h->root.type == bfd_link_hash_undefweak))
+ || h->root.type == bfd_link_hash_undefweak))
bfd_elf_set_symbol (h, val);
}
#define bfd_elfNN_get_section_contents_in_window \
_bfd_generic_get_section_contents_in_window
-#ifndef elf_backend_got_symbol_offset
-#define elf_backend_got_symbol_offset (bfd_vma) 0
-#endif
#ifndef elf_backend_can_refcount
#define elf_backend_can_refcount 0
#endif
ELF_MACHINE_CODE, /* elf_machine_code */
ELF_MAXPAGESIZE, /* maxpagesize */
ELF_MINPAGESIZE, /* minpagesize */
- ELF_DYNAMIC_SEC_FLAGS, /* dynamic_sec_flags */
+ ELF_DYNAMIC_SEC_FLAGS, /* dynamic_sec_flags */
elf_info_to_howto,
elf_info_to_howto_rel,
elf_backend_sym_is_global,
ELF_MACHINE_ALT2,
&elf_backend_size_info,
elf_backend_special_sections,
- elf_backend_got_symbol_offset,
elf_backend_got_header_size,
elf_backend_collect,
elf_backend_type_change_ok,
+2005-05-07 Alan Modra <amodra@bigpond.net.au>
+
+ * 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.
+
2005-05-06 Nick Clifton <nickc@redhat.com>
- * Update the address and phone number of the FSF organization in
+ Update the address and phone number of the FSF organization in
the GPL notices in the following files:
- config/default.exp, ld-alpha/alpha.exp, ld-arm/arm-elf.exp,
+ * config/default.exp, ld-alpha/alpha.exp, ld-arm/arm-elf.exp,
ld-auto-import/auto-import.exp, ld-bootstrap/bootstrap.exp,
ld-cdtest/cdtest.exp, ld-checks/checks.exp, ld-cris/cris.exp,
ld-crx/crx.exp, ld-cygwin/exe-export.exp, ld-d10v/d10v.exp,
- ld-discard/discard.exp, ld-elf/elf.exp, ld-elf/exclude.exp,
+ ld-discard/discard.exp, ld-elf/elf.exp, ld-elf/exclude.exp,
ld-elf/frame.exp, ld-elf/sec64k.exp, ld-elfcomm/elfcomm.exp,
ld-elfvers/vers.exp, ld-elfvsb/elfvsb.exp, ld-elfweak/elfweak.exp,
ld-fastcall/fastcall.exp, ld-frv/fdpic.exp, ld-frv/tls.exp,
Disassembly of section \.text:
.* <_start>:
-.*: 80 7f 00 0c lwz r3,12\(r31\)
+.*: 80 7f ff f0 lwz r3,-16\(r31\)
.*: 7c 63 12 14 add r3,r3,r2
-.*: 38 7f 00 10 addi r3,r31,16
+.*: 38 7f ff f4 addi r3,r31,-12
.*: 48 01 01 85 bl .*<__tls_get_addr@plt>
.*: 3c 62 00 00 addis r3,r2,0
.*: 38 63 90 1c addi r3,r3,-28644
.*: a9 49 90 18 lha r10,-28648\(r9\)
Disassembly of section \.got:
-.* <_GLOBAL_OFFSET_TABLE_-0x4>:
+.* <_GLOBAL_OFFSET_TABLE_-0x10>:
+ \.\.\.
.*: 4e 80 00 21 blrl
+
.* <_GLOBAL_OFFSET_TABLE_>:
-.*: 01 81 02 d0 00 00 00 00 00 00 00 00 00 00 00 00 .*
- \.\.\.
+.*: 01 81 02 d0 00 00 00 00 00 00 00 00 .*
.*: +file format elf32-powerpc
Contents of section \.got:
-.* 4e800021 018102d0 00000000 00000000 .*
-.* 00000000 00000000 00000000 .*
+.* 00000000 00000000 00000000 4e800021 .*
+.* 018102d0 00000000 00000000 .*
Relocation section '\.rela\.dyn' at offset 0x220 contains 2 entries:
Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
-01810380 +00000249 R_PPC_TPREL32 +00000000 +gd \+ 0
-01810384 +00000444 R_PPC_DTPMOD32 +00000000 +ld \+ 0
+01810370 +00000249 R_PPC_TPREL32 +00000000 +gd \+ 0
+01810374 +00000444 R_PPC_DTPMOD32 +00000000 +ld \+ 0
Relocation section '\.rela\.plt' at offset 0x238 contains 1 entries:
Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
.*: 00000024 +0 TLS +GLOBAL DEFAULT +9 ld1
.*: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS __bss_start
.*: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _edata
-.*: 01810374 +0 OBJECT +GLOBAL +HIDDEN +11 _GLOBAL_OFFSET_TABLE_
+.*: 01810380 +0 OBJECT +GLOBAL +HIDDEN +11 _GLOBAL_OFFSET_TABLE_
.*: [0-9a-f]+ +0 NOTYPE +GLOBAL DEFAULT +ABS _end
.*: 0000001c +0 TLS +GLOBAL DEFAULT +9 gd0
.*: 0000002c +0 TLS +GLOBAL DEFAULT +9 ie0
Disassembly of section \.text:
.* <_start>:
-.*: 38 7f 00 1c addi r3,r31,28
+.*: 38 7f ff e8 addi r3,r31,-24
.*: 48 00 00 01 bl .*
-.*: 38 7f 00 0c addi r3,r31,12
+.*: 38 7f ff e0 addi r3,r31,-32
.*: 48 00 00 01 bl .*
-.*: 38 7f 00 24 addi r3,r31,36
+.*: 38 7f ff f0 addi r3,r31,-16
.*: 48 01 01 95 bl .*<__tls_get_addr@plt>
-.*: 38 7f 00 0c addi r3,r31,12
+.*: 38 7f ff e0 addi r3,r31,-32
.*: 48 01 01 8d bl .*<__tls_get_addr@plt>
.*: 39 23 80 20 addi r9,r3,-32736
.*: 3d 23 00 00 addis r9,r3,0
.*: 81 49 80 24 lwz r10,-32732\(r9\)
-.*: 81 3f 00 2c lwz r9,44\(r31\)
+.*: 81 3f ff f8 lwz r9,-8\(r31\)
.*: 7d 49 12 2e lhzx r10,r9,r2
.*: 89 42 00 00 lbz r10,0\(r2\)
.*: 3d 22 00 00 addis r9,r2,0
.*: 99 49 00 00 stb r10,0\(r9\)
-.*: 38 7e 00 14 addi r3,r30,20
+.*: 38 7e ff d8 addi r3,r30,-40
.*: 48 00 00 01 bl .*
-.*: 38 7e 00 0c addi r3,r30,12
+.*: 38 7e ff e0 addi r3,r30,-32
.*: 48 00 00 01 bl .*
.*: 91 43 80 04 stw r10,-32764\(r3\)
.*: 3d 23 00 00 addis r9,r3,0
.*: 91 49 80 08 stw r10,-32760\(r9\)
-.*: 81 3e 00 2c lwz r9,44\(r30\)
+.*: 81 3e ff f8 lwz r9,-8\(r30\)
.*: 7d 49 13 2e sthx r10,r9,r2
.*: a1 42 00 00 lhz r10,0\(r2\)
.*: 3d 22 00 00 addis r9,r2,0
Disassembly of section \.got:
.* <\.got>:
+ \.\.\.
.*: 4e 80 00 21 blrl
.*: 00 01 04 90 .*
\.\.\.
.*: +file format elf32-powerpc
Contents of section \.got:
-.* 4e800021 00010490 00000000 00000000 .*
.* 00000000 00000000 00000000 00000000 .*
.* 00000000 00000000 00000000 00000000 .*
+.* 00000000 4e800021 00010490 00000000 .*
.* 00000000 .*
0+46a +0+245 R_PPC_TPREL16 +0+10474 +\.tdata \+ 10488
0+46e +0+248 R_PPC_TPREL16_HA +0+10474 +\.tdata \+ 1048c
0+472 +0+246 R_PPC_TPREL16_LO +0+10474 +\.tdata \+ 1048c
-0+10540 +0+44 R_PPC_DTPMOD32 +0+
-0+10548 +0+44 R_PPC_DTPMOD32 +0+
-0+1054c +0+4e R_PPC_DTPREL32 +0+
-0+10550 +0+844 R_PPC_DTPMOD32 +0+ +gd \+ 0
-0+10554 +0+84e R_PPC_DTPREL32 +0+ +gd \+ 0
-0+10558 +0+1544 R_PPC_DTPMOD32 +0+1c +gd0 \+ 0
-0+1055c +0+154e R_PPC_DTPREL32 +0+1c +gd0 \+ 0
-0+10560 +0+1649 R_PPC_TPREL32 +0+2c +ie0 \+ 0
+0+10530 +0+44 R_PPC_DTPMOD32 +0+
+0+10534 +0+4e R_PPC_DTPREL32 +0+
+0+10538 +0+44 R_PPC_DTPMOD32 +0+
+0+10540 +0+844 R_PPC_DTPMOD32 +0+ +gd \+ 0
+0+10544 +0+84e R_PPC_DTPREL32 +0+ +gd \+ 0
+0+10548 +0+1544 R_PPC_DTPMOD32 +0+1c +gd0 \+ 0
+0+1054c +0+154e R_PPC_DTPREL32 +0+1c +gd0 \+ 0
+0+10550 +0+1649 R_PPC_TPREL32 +0+2c +ie0 \+ 0
Relocation section '\.rela\.plt' at offset 0x[0-9a-f]+ contains 1 entries:
Offset +Info +Type +Sym\. Value +Symbol's Name \+ Addend
+[0-9]+: 0+10 +0 TLS +LOCAL +DEFAULT +7 ie4
+[0-9]+: 0+14 +0 TLS +LOCAL +DEFAULT +7 le4
+[0-9]+: 0+18 +0 TLS +LOCAL +DEFAULT +7 le5
- +[0-9]+: 0+10534 +0 OBJECT +LOCAL +HIDDEN +ABS _GLOBAL_OFFSET_TABLE_
+ +[0-9]+: 0+10558 +0 OBJECT +LOCAL +HIDDEN +ABS _GLOBAL_OFFSET_TABLE_
+[0-9]+: 0+10490 +0 OBJECT +GLOBAL DEFAULT +ABS _DYNAMIC
+[0-9]+: 0+ +0 TLS +GLOBAL DEFAULT +UND gd
+[0-9]+: 0+30 +0 TLS +GLOBAL DEFAULT +8 le0