diff options
author | Alan Modra <amodra@gmail.com> | 2013-03-20 03:44:56 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2013-03-20 03:44:56 +0000 |
commit | 8877b5e517baa355c68568e7c5e3ed01d277254a (patch) | |
tree | ce1ed473d31da5ef87d6d40da987380d52b8e389 /ld | |
parent | 8249a5a9e2a886aeb3b7142a5dc5a8b4f1b4665b (diff) | |
download | gdb-8877b5e517baa355c68568e7c5e3ed01d277254a.zip gdb-8877b5e517baa355c68568e7c5e3ed01d277254a.tar.gz gdb-8877b5e517baa355c68568e7c5e3ed01d277254a.tar.bz2 |
bfd/
* elflink.c (_bfd_elf_make_dynamic_reloc_section): Override
sh_type according to is_rela.
ld/testsuite/
* ld-elf/rel.c, ld-elf/relmain.c, ld-elf/relmain.out: New test.
* ld-elf/shared.exp: Build and run it.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/rel.c | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/relmain.c | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/relmain.out | 0 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/shared.exp | 6 |
5 files changed, 27 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 9d2fe1b..3dfdfa2 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,4 +1,9 @@ 2013-03-20 Alan Modra <amodra@gmail.com> + + * ld-elf/rel.c, ld-elf/relmain.c, ld-elf/relmain.out: New test. + * ld-elf/shared.exp: Build and run it. + +2013-03-20 Alan Modra <amodra@gmail.com> Will Newton <will.newton@linaro.org * ld-elfvers/vers.exp: Add -Wl,--no-as-needed to all tests diff --git a/ld/testsuite/ld-elf/rel.c b/ld/testsuite/ld-elf/rel.c new file mode 100644 index 0000000..fd94f71 --- /dev/null +++ b/ld/testsuite/ld-elf/rel.c @@ -0,0 +1,9 @@ +static int seven = 7; +static int *__attribute__((section("auto"))) auto_10 = &seven; + +int +eight (void) +{ + extern int *__start_auto[], *__stop_auto[]; + return *auto_10 + __stop_auto - __start_auto; +} diff --git a/ld/testsuite/ld-elf/relmain.c b/ld/testsuite/ld-elf/relmain.c new file mode 100644 index 0000000..f72dd54 --- /dev/null +++ b/ld/testsuite/ld-elf/relmain.c @@ -0,0 +1,7 @@ +extern int eight (void); + +int +main (void) +{ + return eight () - 8; +} diff --git a/ld/testsuite/ld-elf/relmain.out b/ld/testsuite/ld-elf/relmain.out new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ld/testsuite/ld-elf/relmain.out diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 2feb730..8a7590a 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -203,6 +203,9 @@ set build_tests { {"Build needed1b.so with --no-copy-dt-needed-entries" "-shared tmpdir/libneeded1pic.o -Wl,--no-copy-dt-needed-entries -Ltmpdir -lneeded1a" "" {dummy.c} {} "needed1d.so"} + {"Build librel.so" + "-shared" "-fPIC" + {rel.c} {} "librel.so"} } run_cc_link_tests $build_tests @@ -347,6 +350,9 @@ set run_tests { {"Link with --copy-dt-needed-entries" "tmpdir/libneeded1c.o --copy-dt-needed-entries -rpath=tmpdir -Ltmpdir -lneeded1a" "" {dummy.c} "needed1b" "needed1.out"} + {"Run relmain" + "--no-as-needed -rpath=tmpdir -Ltmpdir -lrel" "" + {relmain.c} "relmain" "relmain.out"} } # NetBSD ELF systems do not currently support the .*_array sections. |