diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-02-14 17:03:45 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-02-14 17:03:45 +0000 |
commit | 93252b1cf41a1638dc1c4a3d9688f2dbb5963504 (patch) | |
tree | 456755cee65d44c5321901f68825006bb4bdd876 /bfd | |
parent | 6bfc80c7385fe08f025e6e774655bc90441e2254 (diff) | |
download | gdb-93252b1cf41a1638dc1c4a3d9688f2dbb5963504.zip gdb-93252b1cf41a1638dc1c4a3d9688f2dbb5963504.tar.gz gdb-93252b1cf41a1638dc1c4a3d9688f2dbb5963504.tar.bz2 |
bfd/ld: handle ABI prefixes in version scripts
The default language in version scripts is supposed to be C, but no
symbol demangling is performed on the symbols by default. This makes
targets with a symbol prefix to fail with most version scripts out
there. So strip away this prefix by default.
This fixes many tests (real world and ld's testsuite) for Blackfin
targets and doesn't seem to cause regressions for x86_64.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elflink.c | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 72b3c32..2f54729 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2011-02-14 Mike Frysinger <vapier@gentoo.org> + + * elflink.c (bfd_elf_size_dynamic_sections): Add + bfd_get_symbol_leading_char to the start of newname. + 2011-02-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * configure: Regenerate. diff --git a/bfd/elflink.c b/bfd/elflink.c index 79256bf..dffe0ae 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -5710,11 +5710,12 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, { const char *verstr, *name; size_t namelen, verlen, newlen; - char *newname, *p; + char *newname, *p, leading_char; struct elf_link_hash_entry *newh; + leading_char = bfd_get_symbol_leading_char (output_bfd); name = d->pattern; - namelen = strlen (name); + namelen = strlen (name) + (leading_char != '\0'); verstr = t->name; verlen = strlen (verstr); newlen = namelen + verlen + 3; @@ -5722,7 +5723,8 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, newname = (char *) bfd_malloc (newlen); if (newname == NULL) return FALSE; - memcpy (newname, name, namelen); + newname[0] = leading_char; + memcpy (newname + (leading_char != '\0'), name, namelen); /* Check the hidden versioned definition. */ p = newname + namelen; |