From 1d7708459220fa4c011f7e7bea9e58a808cb2289 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 10 Jul 2009 14:03:03 +0000 Subject: [PATCH] bfd/ 2009-07-10 H.J. Lu * elf.c (_bfd_elf_get_synthetic_symtab): Remove leading zeros when reporting addends. ld/testsuite/ 2009-07-10 H.J. Lu * ld-ifunc/ifunc-1-local-x86.d: Updated. * ld-ifunc/ifunc-1-x86.d: Likewise.Likewise. * ld-ifunc/ifunc-2-local-x86-64.d: Likewise.Likewise. * ld-ifunc/ifunc-2-x86-64.d: Likewise. * ld-ifunc/ifunc-3a-x86.d: Likewise.Likewise. --- bfd/ChangeLog | 5 +++++ bfd/elf.c | 10 ++++++++-- ld/testsuite/ChangeLog | 8 ++++++++ ld/testsuite/ld-ifunc/ifunc-1-local-x86.d | 2 +- ld/testsuite/ld-ifunc/ifunc-1-x86.d | 2 +- ld/testsuite/ld-ifunc/ifunc-2-local-x86-64.d | 4 ++-- ld/testsuite/ld-ifunc/ifunc-2-x86-64.d | 4 ++-- ld/testsuite/ld-ifunc/ifunc-3a-x86.d | 2 +- 8 files changed, 28 insertions(+), 9 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e53ff76dcef..34951613066 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2009-07-10 H.J. Lu + + * elf.c (_bfd_elf_get_synthetic_symtab): Remove leading zeros + when reporting addends. + 2009-07-10 Alan Modra * elf32-spu.c (spu_elf_size_stubs): Do set up soft-icache manager diff --git a/bfd/elf.c b/bfd/elf.c index 0a46a84036d..19f26842046 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -8965,10 +8965,16 @@ _bfd_elf_get_synthetic_symtab (bfd *abfd, names += len; if (p->addend != 0) { + char buf[30], *a; + int len; memcpy (names, "+0x", sizeof ("+0x") - 1); names += sizeof ("+0x") - 1; - bfd_sprintf_vma (abfd, names, p->addend); - names += strlen (names); + bfd_sprintf_vma (abfd, buf, p->addend); + for (a = buf; *a == '0'; ++a) + ; + len = strlen (a); + memcpy (names, a, len); + names += len; } memcpy (names, "@plt", sizeof ("@plt")); names += sizeof ("@plt"); diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index be6e2e5a7cd..0c560bdf0ec 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2009-07-10 H.J. Lu + + * ld-ifunc/ifunc-1-local-x86.d: Updated. + * ld-ifunc/ifunc-1-x86.d: Likewise.Likewise. + * ld-ifunc/ifunc-2-local-x86-64.d: Likewise.Likewise. + * ld-ifunc/ifunc-2-x86-64.d: Likewise. + * ld-ifunc/ifunc-3a-x86.d: Likewise.Likewise. + 2009-07-10 Alan Modra * ld-ifunc/ifunc.exp: Run for powerpc. Really generate static diff --git a/ld/testsuite/ld-ifunc/ifunc-1-local-x86.d b/ld/testsuite/ld-ifunc/ifunc-1-local-x86.d index ee043b1207b..244ef8c40bc 100644 --- a/ld/testsuite/ld-ifunc/ifunc-1-local-x86.d +++ b/ld/testsuite/ld-ifunc/ifunc-1-local-x86.d @@ -3,5 +3,5 @@ #target: x86_64-*-* i?86-*-* #... -[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*@plt> +[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*\+0x200@plt> #pass diff --git a/ld/testsuite/ld-ifunc/ifunc-1-x86.d b/ld/testsuite/ld-ifunc/ifunc-1-x86.d index ee043b1207b..b0f7ccb0bea 100644 --- a/ld/testsuite/ld-ifunc/ifunc-1-x86.d +++ b/ld/testsuite/ld-ifunc/ifunc-1-x86.d @@ -3,5 +3,5 @@ #target: x86_64-*-* i?86-*-* #... -[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*@plt> +[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*\+0x220@plt> #pass diff --git a/ld/testsuite/ld-ifunc/ifunc-2-local-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-2-local-x86-64.d index fa8710254d0..f72359d8dc8 100644 --- a/ld/testsuite/ld-ifunc/ifunc-2-local-x86-64.d +++ b/ld/testsuite/ld-ifunc/ifunc-2-local-x86-64.d @@ -4,6 +4,6 @@ #target: x86_64-*-* #... -[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*@plt> -[ \t0-9a-f]+:[ \t0-9a-f]+lea[ \t]+.*\(%rip\),%rax.*[ \t0-9a-fq]+<\*ABS\*@plt> +[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*\+0x220@plt> +[ \t0-9a-f]+:[ \t0-9a-f]+lea[ \t]+.*\(%rip\),%rax.*[ \t0-9a-fq]+<\*ABS\*\+0x220@plt> #pass diff --git a/ld/testsuite/ld-ifunc/ifunc-2-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-2-x86-64.d index fa8710254d0..f72359d8dc8 100644 --- a/ld/testsuite/ld-ifunc/ifunc-2-x86-64.d +++ b/ld/testsuite/ld-ifunc/ifunc-2-x86-64.d @@ -4,6 +4,6 @@ #target: x86_64-*-* #... -[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*@plt> -[ \t0-9a-f]+:[ \t0-9a-f]+lea[ \t]+.*\(%rip\),%rax.*[ \t0-9a-fq]+<\*ABS\*@plt> +[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*\+0x220@plt> +[ \t0-9a-f]+:[ \t0-9a-f]+lea[ \t]+.*\(%rip\),%rax.*[ \t0-9a-fq]+<\*ABS\*\+0x220@plt> #pass diff --git a/ld/testsuite/ld-ifunc/ifunc-3a-x86.d b/ld/testsuite/ld-ifunc/ifunc-3a-x86.d index 97225bad769..88897c2f5e8 100644 --- a/ld/testsuite/ld-ifunc/ifunc-3a-x86.d +++ b/ld/testsuite/ld-ifunc/ifunc-3a-x86.d @@ -4,5 +4,5 @@ #target: x86_64-*-* i?86-*-* #... -[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*@plt> +[ \t0-9a-f]+:[ \t0-9a-f]+call[ \t0-9a-fq]+<\*ABS\*\+0x258@plt> #pass -- 2.30.2