From: Andreas Schwab Date: Mon, 14 May 2007 08:53:23 +0000 (+0000) Subject: * emultempl/ppc64elf.em (gld${EMULATION_NAME}_new_vers_pattern): X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b7b7fe3f8fd2580eb6f437d9324f807177b65a61;p=binutils-gdb.git * 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. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 6951481612f..3cc0c85141c 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2007-05-14 Andreas Schwab + + * emultempl/ppc64elf.em (gld${EMULATION_NAME}_new_vers_pattern): + Handle null pattern. + 2007-05-11 Alan Modra * emultempl/ppc32elf.em (plt_style): New variable. diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em index 1fcf3abdf4a..9372f88d3d3 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; diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 3a7818d4879..309b15aef69 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-05-14 Andreas Schwab + + * ld-elf/dl2a.list: New file. + * ld-elf/shared.exp: Add test using --dynamic-list=dl2a.list. + 2007-05-10 Richard Sandiford * ld-arm/vxworks1-lib.dd: Expect "push" instead of stmdb and diff --git a/ld/testsuite/ld-elf/dl2a.list b/ld/testsuite/ld-elf/dl2a.list new file mode 100644 index 00000000000..989646e63f1 --- /dev/null +++ b/ld/testsuite/ld-elf/dl2a.list @@ -0,0 +1,3 @@ +{ + "foo"; +}; diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index c38294cdd5d..0a9a4ff065c 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -75,6 +75,9 @@ set build_tests { {"Build libdl2a.so with --dynamic-list=dl2.list" "-shared -Wl,--dynamic-list=dl2.list" "-fPIC" {dl2.c dl2xxx.c} {} "libdl2a.so"} + {"Build libdl2a.so with --dynamic-list=dl2a.list" + "-shared -Wl,--dynamic-list=dl2a.list" "-fPIC" + {dl2.c dl2xxx.c} {} "libdl2a.so"} {"Build libdl2a.so with --dynamic-list-data" "-shared -Wl,--dynamic-list-data" "-fPIC" {dl2.c dl2xxx.c} {} "libdl2a.so"}