diff options
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 22 |
2 files changed, 21 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 311e211..fcfd913 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2018-04-26 Pedro Alves <palves@redhat.com> + + * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't consider + ifunc and non-ifunc symbols duplicates. + 2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 971adc4..9009768 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -3366,13 +3366,23 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd, if (!relocatable && symcount > 1) { - /* 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. */ + /* 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. Don't consider ifunc and ifunc resolver symbols + duplicates however, because GDB wants to know whether a + text symbol is an ifunc resolver. */ 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) - syms[j++] = syms[i]; + { + const asymbol *s0 = syms[i - 1]; + const asymbol *s1 = syms[i]; + + if ((s0->value + s0->section->vma + != s1->value + s1->section->vma) + || ((s0->flags & BSF_GNU_INDIRECT_FUNCTION) + != (s1->flags & BSF_GNU_INDIRECT_FUNCTION))) + syms[j++] = syms[i]; + } symcount = j; } |