From 54ac0771d70dc2db461671bb5e1cd00852278de9 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 2 Jan 2009 19:29:38 +0000 Subject: bfd/ 2009-01-02 H.J. Lu PR ld/9679 * elflink.c (elf_merge_st_other): New. (_bfd_elf_merge_symbol): Use it on skipped weak definitions and hide them if needed. (elf_link_add_object_symbols): Updated. ld/testsuite/ 2009-01-02 H.J. Lu PR ld/9679 * ld-elf/pr9679-1.c: New. * ld-elf/pr9679-2.c: Likewise. * ld-elf/pr9679.rd: Likewise. * ld-elf/shared.exp (build_tests): Add test for libpr9679.so. --- ld/testsuite/ld-elf/pr9679-1.c | 5 +++++ ld/testsuite/ld-elf/pr9679-2.c | 13 +++++++++++++ ld/testsuite/ld-elf/pr9679.rd | 5 +++++ ld/testsuite/ld-elf/shared.exp | 3 +++ 4 files changed, 26 insertions(+) create mode 100644 ld/testsuite/ld-elf/pr9679-1.c create mode 100644 ld/testsuite/ld-elf/pr9679-2.c create mode 100644 ld/testsuite/ld-elf/pr9679.rd (limited to 'ld/testsuite/ld-elf') diff --git a/ld/testsuite/ld-elf/pr9679-1.c b/ld/testsuite/ld-elf/pr9679-1.c new file mode 100644 index 0000000..cf7abbb --- /dev/null +++ b/ld/testsuite/ld-elf/pr9679-1.c @@ -0,0 +1,5 @@ +int +foo (void) +{ + return 1; +} diff --git a/ld/testsuite/ld-elf/pr9679-2.c b/ld/testsuite/ld-elf/pr9679-2.c new file mode 100644 index 0000000..e125a6b --- /dev/null +++ b/ld/testsuite/ld-elf/pr9679-2.c @@ -0,0 +1,13 @@ +extern int foo (void) __attribute__((weak,__visibility__ ("hidden"))); + +int +foo (void) +{ + return 1; +} + +int +bar (void) +{ + return foo (); +} diff --git a/ld/testsuite/ld-elf/pr9679.rd b/ld/testsuite/ld-elf/pr9679.rd new file mode 100644 index 0000000..0585b1c --- /dev/null +++ b/ld/testsuite/ld-elf/pr9679.rd @@ -0,0 +1,5 @@ +Symbol table '\.dynsym' contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name +#... + +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +LOCAL +HIDDEN +[0-9]+ +foo +#... diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index ff8bc8f..4f45bdd 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -145,6 +145,9 @@ set build_tests { "-shared tmpdir/pr9676-4.o -Ltmpdir -lpr9676-3 -Wl,--start-group -lpr9676-1 -lpr9676-2 -Wl,--end-group" "-fPIC" {dummy.c} {{readelf {-s} pr9676.rd}} "libpr9676-4a.so"} + {"Build libpr9679.so" + "-shared" "-fPIC -O0" + {pr9679-1.c pr9679-2.c} {{readelf {-s} pr9679.rd}} "libpr9679.so"} } set run_tests { -- cgit v1.1