aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-01-31 06:28:48 +0000
committerAlan Modra <amodra@gmail.com>2013-01-31 06:28:48 +0000
commitbcaa2f8235869541dfefd7edf8494890e06f5871 (patch)
tree93ac31adbaf5ec959840d50d7329f089cbe304ee
parent9de83df8198ac23fbb1a43b41121815b8bb90df6 (diff)
downloadgdb-bcaa2f8235869541dfefd7edf8494890e06f5871.zip
gdb-bcaa2f8235869541dfefd7edf8494890e06f5871.tar.gz
gdb-bcaa2f8235869541dfefd7edf8494890e06f5871.tar.bz2
bfd/
* elf64-ppc.c (ppc_stub_name): Trim off trailing "+0". ld/testsuite/ * ld-powerpc/tlsexe.d: Update for changed stub names. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsexetoc.d: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlsso.d: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlstocso.d: Likewise. * ld-powerpc/tlstocso.r: Likewise.
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elf64-ppc.c22
-rw-r--r--ld/testsuite/ChangeLog11
-rw-r--r--ld/testsuite/ld-powerpc/tlsexe.d2
-rw-r--r--ld/testsuite/ld-powerpc/tlsexe.r2
-rw-r--r--ld/testsuite/ld-powerpc/tlsexetoc.d2
-rw-r--r--ld/testsuite/ld-powerpc/tlsexetoc.r2
-rw-r--r--ld/testsuite/ld-powerpc/tlsso.d2
-rw-r--r--ld/testsuite/ld-powerpc/tlsso.r2
-rw-r--r--ld/testsuite/ld-powerpc/tlstocso.d2
-rw-r--r--ld/testsuite/ld-powerpc/tlstocso.r2
11 files changed, 34 insertions, 19 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8011d9a..9598b6a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,9 @@
2013-01-31 Alan Modra <amodra@gmail.com>
+ * elf64-ppc.c (ppc_stub_name): Trim off trailing "+0".
+
+2013-01-31 Alan Modra <amodra@gmail.com>
+
* elf64-ppc.c (build_plt_stub): Correct plt stub branch to glink.
2013-01-28 Alan Modra <amodra@gmail.com>
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index eca7bb3..6ac3bc6 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -4074,7 +4074,7 @@ ppc_stub_name (const asection *input_section,
const Elf_Internal_Rela *rel)
{
char *stub_name;
- bfd_size_type len;
+ ssize_t len;
/* rel->r_addend is actually 64 bit, but who uses more than +/- 2^31
offsets from a sym as a branch target? In fact, we could
@@ -4088,10 +4088,10 @@ ppc_stub_name (const asection *input_section,
if (stub_name == NULL)
return stub_name;
- sprintf (stub_name, "%08x.%s+%x",
- input_section->id & 0xffffffff,
- h->elf.root.root.string,
- (int) rel->r_addend & 0xffffffff);
+ len = sprintf (stub_name, "%08x.%s+%x",
+ input_section->id & 0xffffffff,
+ h->elf.root.root.string,
+ (int) rel->r_addend & 0xffffffff);
}
else
{
@@ -4100,13 +4100,13 @@ ppc_stub_name (const asection *input_section,
if (stub_name == NULL)
return stub_name;
- sprintf (stub_name, "%08x.%x:%x+%x",
- input_section->id & 0xffffffff,
- sym_sec->id & 0xffffffff,
- (int) ELF64_R_SYM (rel->r_info) & 0xffffffff,
- (int) rel->r_addend & 0xffffffff);
+ len = sprintf (stub_name, "%08x.%x:%x+%x",
+ input_section->id & 0xffffffff,
+ sym_sec->id & 0xffffffff,
+ (int) ELF64_R_SYM (rel->r_info) & 0xffffffff,
+ (int) rel->r_addend & 0xffffffff);
}
- if (stub_name[len - 2] == '+' && stub_name[len - 1] == '0')
+ if (len > 2 && stub_name[len - 2] == '+' && stub_name[len - 1] == '0')
stub_name[len - 2] = 0;
return stub_name;
}
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 7c0eed0..522f4de 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,14 @@
+2013-01-31 Alan Modra <amodra@gmail.com>
+
+ * ld-powerpc/tlsexe.d: Update for changed stub names.
+ * ld-powerpc/tlsexe.r: Likewise.
+ * ld-powerpc/tlsexetoc.d: Likewise.
+ * ld-powerpc/tlsexetoc.r: Likewise.
+ * ld-powerpc/tlsso.d: Likewise.
+ * ld-powerpc/tlsso.r: Likewise.
+ * ld-powerpc/tlstocso.d: Likewise.
+ * ld-powerpc/tlstocso.r: Likewise.
+
2013-01-31 Hans-Peter Nilsson <hp@axis.com>
* ld-cris/libdso-13.d: Adjust for --enable-new-dtags now
diff --git a/ld/testsuite/ld-powerpc/tlsexe.d b/ld/testsuite/ld-powerpc/tlsexe.d
index 01796df..8390551 100644
--- a/ld/testsuite/ld-powerpc/tlsexe.d
+++ b/ld/testsuite/ld-powerpc/tlsexe.d
@@ -8,7 +8,7 @@
Disassembly of section \.text:
-.* <00000010\.plt_call\.__tls_get_addr(|_opt)\+0>:
+.* <00000010\.plt_call\.__tls_get_addr(|_opt)>:
.* (e9 63 00 00|00 00 63 e9) ld r11,0\(r3\)
.* (e9 83 00 08|08 00 83 e9) ld r12,8\(r3\)
.* (7c 60 1b 78|78 1b 60 7c) mr r0,r3
diff --git a/ld/testsuite/ld-powerpc/tlsexe.r b/ld/testsuite/ld-powerpc/tlsexe.r
index b0783f1..8d6ff30 100644
--- a/ld/testsuite/ld-powerpc/tlsexe.r
+++ b/ld/testsuite/ld-powerpc/tlsexe.r
@@ -96,8 +96,8 @@ Symbol table '\.symtab' contains [0-9]+ entries:
.* TLS +LOCAL +DEFAULT +8 le5
.* (FUNC|NOTYPE) +LOCAL +DEFAULT +UND \.__tls_get_addr(|_opt)
.* FILE +LOCAL +DEFAULT +ABS .*
+.* NOTYPE +LOCAL +DEFAULT +7 00000010\.plt_call\.__tls_get_addr(|_opt)
.* OBJECT +LOCAL +DEFAULT +10 _DYNAMIC
-.* NOTYPE +LOCAL +DEFAULT +7 00000010\.plt_call\.__tls_get_addr(|_opt)\+0
.* NOTYPE +LOCAL +DEFAULT +7 __glink_PLTresolve
.* GLOBAL +DEFAULT +UND gd
.* GLOBAL +DEFAULT +9 le0
diff --git a/ld/testsuite/ld-powerpc/tlsexetoc.d b/ld/testsuite/ld-powerpc/tlsexetoc.d
index 48bde59..fc20992 100644
--- a/ld/testsuite/ld-powerpc/tlsexetoc.d
+++ b/ld/testsuite/ld-powerpc/tlsexetoc.d
@@ -8,7 +8,7 @@
Disassembly of section \.text:
-.* <00000010\.plt_call\.__tls_get_addr(|_opt)\+0>:
+.* <00000010\.plt_call\.__tls_get_addr(|_opt)>:
.* (e9 63 00 00|00 00 63 e9) ld r11,0\(r3\)
.* (e9 83 00 08|08 00 83 e9) ld r12,8\(r3\)
.* (7c 60 1b 78|78 1b 60 7c) mr r0,r3
diff --git a/ld/testsuite/ld-powerpc/tlsexetoc.r b/ld/testsuite/ld-powerpc/tlsexetoc.r
index d404752..71d6c9e 100644
--- a/ld/testsuite/ld-powerpc/tlsexetoc.r
+++ b/ld/testsuite/ld-powerpc/tlsexetoc.r
@@ -96,8 +96,8 @@ Symbol table '\.symtab' contains [0-9]+ entries:
.* NOTYPE +LOCAL +DEFAULT +11 \.Lie0
.* (FUNC|NOTYPE) +LOCAL +DEFAULT +UND \.__tls_get_addr(|_opt)
.* FILE +LOCAL +DEFAULT +ABS .*
+.* NOTYPE +LOCAL +DEFAULT +7 00000010\.plt_call\.__tls_get_addr(|_opt)
.* OBJECT +LOCAL +DEFAULT +10 _DYNAMIC
-.* NOTYPE +LOCAL +DEFAULT +7 00000010\.plt_call\.__tls_get_addr(|_opt)\+0
.* NOTYPE +LOCAL +DEFAULT +7 __glink_PLTresolve
.* TLS +GLOBAL +DEFAULT +UND gd
.* TLS +GLOBAL +DEFAULT +9 le0
diff --git a/ld/testsuite/ld-powerpc/tlsso.d b/ld/testsuite/ld-powerpc/tlsso.d
index e0bc9a0..00b00a0 100644
--- a/ld/testsuite/ld-powerpc/tlsso.d
+++ b/ld/testsuite/ld-powerpc/tlsso.d
@@ -8,7 +8,7 @@
Disassembly of section \.text:
-.* <00000010\.plt_call\.__tls_get_addr(|_opt)\+0>:
+.* <00000010\.plt_call\.__tls_get_addr(|_opt)>:
.* (f8 41 00 28|28 00 41 f8) std r2,40\(r1\)
.* (e9 62 80 78|78 80 62 e9) ld r11,-32648\(r2\)
.* (7d 69 03 a6|a6 03 69 7d) mtctr r11
diff --git a/ld/testsuite/ld-powerpc/tlsso.r b/ld/testsuite/ld-powerpc/tlsso.r
index 2475fb4..fab50e0 100644
--- a/ld/testsuite/ld-powerpc/tlsso.r
+++ b/ld/testsuite/ld-powerpc/tlsso.r
@@ -111,7 +111,7 @@ Symbol table '\.symtab' contains [0-9]+ entries:
.* NOTYPE +LOCAL +DEFAULT +UND \.__tls_get_addr
.* FILE +LOCAL +DEFAULT +ABS .*
.* OBJECT +LOCAL +DEFAULT +9 _DYNAMIC
-.* NOTYPE +LOCAL +DEFAULT +6 00000010\.plt_call\.__tls_get_addr\+0
+.* NOTYPE +LOCAL +DEFAULT +6 00000010\.plt_call\.__tls_get_addr
.* NOTYPE +LOCAL +DEFAULT +6 __glink_PLTresolve
.* TLS +GLOBAL +DEFAULT +UND gd
.* TLS +GLOBAL +DEFAULT +8 le0
diff --git a/ld/testsuite/ld-powerpc/tlstocso.d b/ld/testsuite/ld-powerpc/tlstocso.d
index c91c30b..a0cd08f 100644
--- a/ld/testsuite/ld-powerpc/tlstocso.d
+++ b/ld/testsuite/ld-powerpc/tlstocso.d
@@ -8,7 +8,7 @@
Disassembly of section \.text:
-.* <00000010\.plt_call\.__tls_get_addr(|_opt)\+0>:
+.* <00000010\.plt_call\.__tls_get_addr(|_opt)>:
.* (f8 41 00 28|28 00 41 f8) std r2,40\(r1\)
.* (e9 62 80 70|70 80 62 e9) ld r11,-32656\(r2\)
.* (7d 69 03 a6|a6 03 69 7d) mtctr r11
diff --git a/ld/testsuite/ld-powerpc/tlstocso.r b/ld/testsuite/ld-powerpc/tlstocso.r
index a0bc863..1ec8b63 100644
--- a/ld/testsuite/ld-powerpc/tlstocso.r
+++ b/ld/testsuite/ld-powerpc/tlstocso.r
@@ -107,7 +107,7 @@ Symbol table '\.symtab' contains [0-9]+ entries:
.* NOTYPE +LOCAL +DEFAULT +UND \.__tls_get_addr
.* FILE +LOCAL +DEFAULT +ABS .*
.* OBJECT +LOCAL +DEFAULT +9 _DYNAMIC
-.* NOTYPE +LOCAL +DEFAULT +6 00000010\.plt_call\.__tls_get_addr\+0
+.* NOTYPE +LOCAL +DEFAULT +6 00000010\.plt_call\.__tls_get_addr
.* NOTYPE +LOCAL +DEFAULT +6 __glink_PLTresolve
.* TLS +GLOBAL +DEFAULT +UND gd
.* TLS +GLOBAL +DEFAULT +8 le0