mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-18 14:53:32 +08:00
PR22374 testcase, function pointer references in .data
Function pointer references in .data ought to use a dynamic reloc. There shouldn't be any need for a PLT entry and definitely no copy reloc. This test fails on quite a few targets, but isn't something that anyone should worry about too much. It's really just a missed optimization. PR 22374 * testsuite/ld-elf/pr22374a.s, * testsuite/ld-elf/pr22374b.s, * testsuite/ld-elf/pr22374-1.r, * testsuite/ld-elf/pr22374-2.r: New test. * testsuite/ld-elf/elf.exp: Run it.
This commit is contained in:
parent
46b06a98d1
commit
e48f0c8f1b
@ -1,3 +1,12 @@
|
||||
2017-11-01 Alan Modra <amodra@gmail.com>
|
||||
|
||||
PR 22374
|
||||
* testsuite/ld-elf/pr22374a.s,
|
||||
* testsuite/ld-elf/pr22374b.s,
|
||||
* testsuite/ld-elf/pr22374-1.r,
|
||||
* testsuite/ld-elf/pr22374-2.r: New test.
|
||||
* testsuite/ld-elf/elf.exp: Run it.
|
||||
|
||||
2017-11-01 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* testsuite/ld-elf/elf.exp: Merge some conditionals, a better
|
||||
|
@ -192,6 +192,17 @@ if { [check_shared_lib_support] } then {
|
||||
"pr20995-2" \
|
||||
"" "tmpdir/pr20995-2.so" "$AFLAGS_NONPIC" \
|
||||
{pr20995a.s} {{readelf {-S --wide} pr20995.r}} "pr20995-2"]]
|
||||
|
||||
setup_xfail "tic6x-*-*"
|
||||
run_ld_link_tests {
|
||||
{"Build pr22374 shared library"
|
||||
"-shared" "" "" "pr22374b.s" {} "pr22374.so" }
|
||||
{"pr22374 function pointer initialization"
|
||||
"" "tmpdir/pr22374.so" "" "pr22374a.s"
|
||||
{ {readelf {--wide -r --dyn-syms} "pr22374-1.r"}
|
||||
{readelf {--wide -r} "pr22374-2.r"} }
|
||||
"pr22374" }
|
||||
}
|
||||
}
|
||||
|
||||
if [is_underscore_target] {
|
||||
|
8
ld/testsuite/ld-elf/pr22374-1.r
Normal file
8
ld/testsuite/ld-elf/pr22374-1.r
Normal file
@ -0,0 +1,8 @@
|
||||
Relocation section .* contains 1 entries:
|
||||
.*
|
||||
.* +0+ +foo.*
|
||||
|
||||
Symbol table '.dynsym' contains .* entries:
|
||||
#...
|
||||
.*: 0+ +0 FUNC +GLOBAL DEFAULT +UND foo
|
||||
#pass
|
4
ld/testsuite/ld-elf/pr22374-2.r
Normal file
4
ld/testsuite/ld-elf/pr22374-2.r
Normal file
@ -0,0 +1,4 @@
|
||||
#failif
|
||||
Relocation section .* contains 1 entries:
|
||||
.*
|
||||
.*COPY.*
|
2
ld/testsuite/ld-elf/pr22374a.s
Normal file
2
ld/testsuite/ld-elf/pr22374a.s
Normal file
@ -0,0 +1,2 @@
|
||||
.data
|
||||
.dc.a foo
|
5
ld/testsuite/ld-elf/pr22374b.s
Normal file
5
ld/testsuite/ld-elf/pr22374b.s
Normal file
@ -0,0 +1,5 @@
|
||||
.global foo
|
||||
.type foo, %function
|
||||
foo:
|
||||
.dc.a 0
|
||||
.size foo, .-foo
|
Loading…
Reference in New Issue
Block a user