This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH, needs GWP] Honour int_rels_per_ext_rel when creating @plt symbols
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: binutils at sourceware dot org
- Date: Sat, 28 Jun 2008 18:08:07 +0100
- Subject: [PATCH, needs GWP] Honour int_rels_per_ext_rel when creating @plt symbols
One of the quirks of the MIPS n64 ABI is that every relocation
is a compound of three r_types. BFD chooses to represent each
external compound relocation as three "normal" internal relocations.
Because MIPS n64 has hitherto not used PLTs, the foo@plt code in
_bfd_elf_get_synthetic_symtab was not aware of this. It assumed
that there was one internal relocation per jump slot.
Tested on mips64-linux-gnu and mips64el-linux-gnu. OK to install?
Richard
bfd/
* elf.c (_bfd_elf_get_synthetic_symtab): Increment p by
bed->s->int_rels_per_ext_rel.
Index: bfd/elf.c
===================================================================
--- bfd/elf.c 2008-06-28 17:14:56.000000000 +0100
+++ bfd/elf.c 2008-06-28 17:14:58.000000000 +0100
@@ -8762,7 +8762,7 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd
count = relplt->size / hdr->sh_entsize;
size = count * sizeof (asymbol);
p = relplt->relocation;
- for (i = 0; i < count; i++, p++)
+ for (i = 0; i < count; i++, p += bed->s->int_rels_per_ext_rel)
size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt");
s = *ret = bfd_malloc (size);
@@ -8772,7 +8772,7 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd
names = (char *) (s + count);
p = relplt->relocation;
n = 0;
- for (i = 0; i < count; i++, p++)
+ for (i = 0; i < count; i++, p += bed->s->int_rels_per_ext_rel)
{
size_t len;
bfd_vma addr;