From 041de40dc8e221039d7a983d489c6dcacd446e36 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Fri, 10 Jul 2009 10:33:19 +0000 Subject: [PATCH] * elf.c (_bfd_elf_get_synthetic_symtab): Report addends. --- bfd/ChangeLog | 4 ++++ bfd/elf.c | 19 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 27bf82740cf..c2e281b5705 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2009-07-10 Alan Modra + + * elf.c (_bfd_elf_get_synthetic_symtab): Report addends. + 2009-07-10 Alan Modra * elf-bfd.h (struct elf_link_hash_entry): Clarify ref_regular diff --git a/bfd/elf.c b/bfd/elf.c index 7f74236302c..0a46a84036d 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -8922,7 +8922,17 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd, size = count * sizeof (asymbol); p = relplt->relocation; for (i = 0; i < count; i++, p += bed->s->int_rels_per_ext_rel) - size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt"); + { + size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt"); + if (p->addend != 0) + { +#ifdef BFD64 + size += sizeof ("+0x") - 1 + 8 + 8 * (bed->s->elfclass == ELFCLASS64); +#else + size += sizeof ("+0x") - 1 + 8; +#endif + } + } s = *ret = bfd_malloc (size); if (s == NULL) @@ -8953,6 +8963,13 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd, len = strlen ((*p->sym_ptr_ptr)->name); memcpy (names, (*p->sym_ptr_ptr)->name, len); names += len; + if (p->addend != 0) + { + memcpy (names, "+0x", sizeof ("+0x") - 1); + names += sizeof ("+0x") - 1; + bfd_sprintf_vma (abfd, names, p->addend); + names += strlen (names); + } memcpy (names, "@plt", sizeof ("@plt")); names += sizeof ("@plt"); ++s, ++n; -- 2.30.2