diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-08-26 07:43:23 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-08-27 19:44:57 -0700 |
commit | 7de7786bb7db5159fc8a7bfa3df72381ff16a38c (patch) | |
tree | beb6bd50c6bfa1019914afdc61f49baab9ed3e11 /ld/testsuite/ld-plugin | |
parent | b05929a20efa7caa40415d2f069e44f7e76615e4 (diff) | |
download | gdb-7de7786bb7db5159fc8a7bfa3df72381ff16a38c.zip gdb-7de7786bb7db5159fc8a7bfa3df72381ff16a38c.tar.gz gdb-7de7786bb7db5159fc8a7bfa3df72381ff16a38c.tar.bz2 |
ld: Change indirect symbol from IR to undefined
bfd/
PR ld/28264
* elflink.c (_bfd_elf_merge_symbol): Change indirect symbol from
IR to undefined.
ld/
PR ld/28264
* testsuite/ld-plugin/lto.exp: Run PR ld/28264 test.
* testsuite/ld-plugin/pr28264-1.d: New file.
* testsuite/ld-plugin/pr28264-2.d: Likewise.
* testsuite/ld-plugin/pr28264-3.d: Likewise.
* testsuite/ld-plugin/pr28264-4.d: Likewise.
* testsuite/ld-plugin/pr28264.c: Likewise.
* testsuite/ld-plugin/pr28264.ver: Likewise.
Diffstat (limited to 'ld/testsuite/ld-plugin')
-rw-r--r-- | ld/testsuite/ld-plugin/lto.exp | 9 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr28264-1.d | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr28264-2.d | 5 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr28264-3.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr28264-4.d | 4 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr28264.c | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr28264.ver | 8 |
7 files changed, 46 insertions, 0 deletions
diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 68d2db1..c343132 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -238,6 +238,15 @@ if { [at_least_gcc_version 10 0] } { "-flto -fno-common $lto_no_fat" \ {pr25355.c} \ [list [list "nm" "$plug_opt" "pr25355.d"]]] \ + [list "pr28264.so" \ + "-shared -Wl,--version-script=pr28264.ver" \ + "-flto $lto_no_fat -fPIC" \ + {pr28264.c} \ + {{readelf {--dyn-syms --wide} pr28264-1.d} \ + {readelf {--dyn-syms --wide} pr28264-2.d} \ + {readelf {--dyn-syms --wide} pr28264-3.d} \ + {readelf {--dyn-syms --wide} pr28264-4.d}} \ + {pr28264.so}] \ ]] } diff --git a/ld/testsuite/ld-plugin/pr28264-1.d b/ld/testsuite/ld-plugin/pr28264-1.d new file mode 100644 index 0000000..5ff8969 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr28264-1.d @@ -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 +GLOBAL +DEFAULT .*[0-9]+ _?foo@VERSION.1 +#pass diff --git a/ld/testsuite/ld-plugin/pr28264-2.d b/ld/testsuite/ld-plugin/pr28264-2.d new file mode 100644 index 0000000..f2f629d --- /dev/null +++ b/ld/testsuite/ld-plugin/pr28264-2.d @@ -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 +GLOBAL +DEFAULT .*[0-9]+ _?bar@@VERSION.1 +#pass diff --git a/ld/testsuite/ld-plugin/pr28264-3.d b/ld/testsuite/ld-plugin/pr28264-3.d new file mode 100644 index 0000000..b6a8f1f --- /dev/null +++ b/ld/testsuite/ld-plugin/pr28264-3.d @@ -0,0 +1,4 @@ +#failif +#... + +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT .*[0-9]+ _?foo +#... diff --git a/ld/testsuite/ld-plugin/pr28264-4.d b/ld/testsuite/ld-plugin/pr28264-4.d new file mode 100644 index 0000000..408b853 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr28264-4.d @@ -0,0 +1,4 @@ +#failif +#... + +[0-9]+: +[0-9a-f]+ +[0-9a-f]+ +FUNC +GLOBAL +DEFAULT .*[0-9]+ _?bar +#... diff --git a/ld/testsuite/ld-plugin/pr28264.c b/ld/testsuite/ld-plugin/pr28264.c new file mode 100644 index 0000000..4efa934 --- /dev/null +++ b/ld/testsuite/ld-plugin/pr28264.c @@ -0,0 +1,11 @@ +void +__attribute__ ((symver ("foo@VERSION.1"))) +foo (void) +{ +} + +void +__attribute__ ((symver ("bar@@VERSION.1"))) +bar1 (void) +{ +} diff --git a/ld/testsuite/ld-plugin/pr28264.ver b/ld/testsuite/ld-plugin/pr28264.ver new file mode 100644 index 0000000..1608fca --- /dev/null +++ b/ld/testsuite/ld-plugin/pr28264.ver @@ -0,0 +1,8 @@ +VERSION.1 +{ + global: + foo; + bar; + local: + *; +}; |