Add testcases for PR ld/14323
PR ld/14323 * ld-elf/pr14323-1.c: New. * ld-elf/pr14323-2.c: Likewise. * ld-elf/shared.exp (build_tests): Add libpr14323-2.so. (run_tests): Add pr14323.
This commit is contained in:
parent
b74db4368d
commit
bc9ad2e430
4 changed files with 45 additions and 0 deletions
|
@ -1,3 +1,12 @@
|
|||
2012-07-09 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/14323
|
||||
* ld-elf/pr14323-1.c: New.
|
||||
* ld-elf/pr14323-2.c: Likewise.
|
||||
|
||||
* ld-elf/shared.exp (build_tests): Add libpr14323-2.so.
|
||||
(run_tests): Add pr14323.
|
||||
|
||||
2012-07-03 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/3351
|
||||
|
|
17
ld/testsuite/ld-elf/pr14323-1.c
Normal file
17
ld/testsuite/ld-elf/pr14323-1.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern int foo_alias;
|
||||
extern char *bar ();
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (foo_alias != 0)
|
||||
abort ();
|
||||
bar ();
|
||||
if (foo_alias != -1)
|
||||
abort ();
|
||||
printf ("PASS\n");
|
||||
return 0;
|
||||
}
|
13
ld/testsuite/ld-elf/pr14323-2.c
Normal file
13
ld/testsuite/ld-elf/pr14323-2.c
Normal file
|
@ -0,0 +1,13 @@
|
|||
int foo __attribute__ ((section ("_data_foo"))) = 0;
|
||||
extern int foo_alias __attribute__ ((weak, alias ("foo")));
|
||||
extern char __start__data_foo;
|
||||
asm (".type __start__data_foo,%object");
|
||||
int x1 = 1;
|
||||
int x2 = 2;
|
||||
|
||||
char *
|
||||
bar ()
|
||||
{
|
||||
foo = -1;
|
||||
return &__start__data_foo;
|
||||
}
|
|
@ -170,6 +170,9 @@ set build_tests {
|
|||
{"Build libpr13250-3.o"
|
||||
"-r -nostdlib" ""
|
||||
{pr13250-3.c} {} "libpr13250-3.o"}
|
||||
{"Build libpr14323-2.so"
|
||||
"-shared" "-fPIC"
|
||||
{pr14323-2.c} {} "libpr14323-2.so"}
|
||||
}
|
||||
|
||||
run_cc_link_tests $build_tests
|
||||
|
@ -302,6 +305,9 @@ set run_tests {
|
|||
{"Run with pr13250-3.c, libpr13250-1.so and libpr13250-2.so"
|
||||
"--as-needed tmpdir/pr13250-3.o tmpdir/libpr13250-1.so tmpdir/libpr13250-2.so" ""
|
||||
{dummy.c} "pr13250" "pass.out"}
|
||||
{"Run with pr14323-1.c pr14323-2.so"
|
||||
"tmpdir/libpr14323-2.so" ""
|
||||
{pr14323-1.c} "pr14323" "pass.out"}
|
||||
}
|
||||
|
||||
# NetBSD ELF systems do not currently support the .*_array sections.
|
||||
|
|
Loading…
Reference in a new issue