aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl/ppc64elf.em
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2007-05-14 08:53:23 +0000
committerAndreas Schwab <schwab@linux-m68k.org>2007-05-14 08:53:23 +0000
commitb7b7fe3f8fd2580eb6f437d9324f807177b65a61 (patch)
treeaf5a873d0b4cc81e513ee0e3eb61d6400412c37a /ld/emultempl/ppc64elf.em
parent2e74ed18043f3cc9d8edc3fe4beb82cca6bbc30e (diff)
downloadgdb-b7b7fe3f8fd2580eb6f437d9324f807177b65a61.zip
gdb-b7b7fe3f8fd2580eb6f437d9324f807177b65a61.tar.gz
gdb-b7b7fe3f8fd2580eb6f437d9324f807177b65a61.tar.bz2
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_new_vers_pattern):
Handle null pattern. testsuite/: * ld-elf/dl2a.list: New file. * ld-elf/shared.exp: Add test using --dynamic-list=dl2a.list.
Diffstat (limited to 'ld/emultempl/ppc64elf.em')
-rw-r--r--ld/emultempl/ppc64elf.em17
1 files changed, 11 insertions, 6 deletions
diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em
index 1fcf3ab..9372f88 100644
--- a/ld/emultempl/ppc64elf.em
+++ b/ld/emultempl/ppc64elf.em
@@ -414,17 +414,22 @@ gld${EMULATION_NAME}_new_vers_pattern (struct bfd_elf_version_expr *entry)
unsigned int len;
char *dot_pat;
- if (!dotsyms || entry->pattern[0] == '*' || entry->pattern[0] == '.')
+ if (!dotsyms
+ || (entry->pattern != NULL
+ && (entry->pattern[0] == '*' || entry->pattern[0] == '.')))
return entry;
dot_entry = xmalloc (sizeof *dot_entry);
*dot_entry = *entry;
dot_entry->next = entry;
- len = strlen (entry->pattern) + 2;
- dot_pat = xmalloc (len);
- dot_pat[0] = '.';
- memcpy (dot_pat + 1, entry->pattern, len - 1);
- dot_entry->pattern = dot_pat;
+ if (entry->pattern != NULL)
+ {
+ len = strlen (entry->pattern) + 2;
+ dot_pat = xmalloc (len);
+ dot_pat[0] = '.';
+ memcpy (dot_pat + 1, entry->pattern, len - 1);
+ dot_entry->pattern = dot_pat;
+ }
if (entry->symbol != NULL)
{
len = strlen (entry->symbol) + 2;