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 27bf827..c2e281b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,9 @@ 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 and ref_regular_nonweak comment. * elflink.c (elf_link_output_extsym): Special case ifunc syms diff --git a/bfd/elf.c b/bfd/elf.c index 7f74236..0a46a84 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.7.4