Browse Source
"-z dynamic-undefined-weak" makes undefined weak symbols dynamic, but undefined weak symbols are still resolved to 0 at link-time if there is no dynamic linker in executable. * testsuite/ld-i386/i386.exp: Run pr19636-1j, pr19636-1k, pr19636-1l, pr19636-3h and pr19636-3i. * testsuite/ld-i386/pr19636-1j.d: New file. * testsuite/ld-i386/pr19636-1k.d: Likewise. * testsuite/ld-i386/pr19636-1l.d: Likewise. * testsuite/ld-i386/pr19636-3h.d: Likewise. * testsuite/ld-i386/pr19636-3i.d: Likewise. * testsuite/ld-x86-64/pr19636-1h.d: Likewise. * testsuite/ld-x86-64/pr19636-1i.d: Likewise. * testsuite/ld-x86-64/pr19636-1j.d: Likewise. * testsuite/ld-x86-64/pr19636-2j.d: Likewise. * testsuite/ld-x86-64/pr19636-2k.d: Likewise. * testsuite/ld-x86-64/pr19636-2l.d: Likewise. * testsuite/ld-x86-64/pr19636-2m.d: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr19636-1h, pr19636-1i, pr19636-1j, pr19636-2j, pr19636-2k, pr19636-2l and pr19636-2m.gdb-8.1-branch
15 changed files with 190 additions and 0 deletions
@ -0,0 +1,12 @@ |
|||
#source: pr19636-1.s |
|||
#as: --32 -mrelax-relocations=no |
|||
#ld: -pie -m elf_i386 --no-dynamic-linker -z dynamic-undefined-weak |
|||
#readelf : -r --wide -x .got -x .got.plt |
|||
|
|||
There are no relocations in this file. |
|||
|
|||
Hex dump of section '.got': |
|||
0x[0-9a-f]+ [0 ]+\.+ |
|||
|
|||
Hex dump of section '.got.plt': |
|||
0x[0-9a-f]+ +[0-9a-f]+ +[0 ]+ .\.+ |
|||
@ -0,0 +1,19 @@ |
|||
#source: pr19636-1.s |
|||
#as: --32 -mrelax-relocations=no |
|||
#ld: -pie -E -m elf_i386 --no-dynamic-linker -z dynamic-undefined-weak |
|||
#readelf : -r --wide -x .got -x .got.plt --dyn-syms |
|||
|
|||
There are no relocations in this file. |
|||
|
|||
Symbol table '\.dynsym' contains [0-9]+ entries: |
|||
+Num: +Value +Size Type +Bind +Vis +Ndx Name |
|||
+0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND + |
|||
#... |
|||
+[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +_start |
|||
#... |
|||
|
|||
Hex dump of section '.got': |
|||
0x[0-9a-f]+ [0 ]+\.+ |
|||
|
|||
Hex dump of section '.got.plt': |
|||
0x[0-9a-f]+ +[0-9a-f]+ +[0 ]+ .\.+ |
|||
@ -0,0 +1,26 @@ |
|||
#source: pr19636-1.s |
|||
#as: --32 -mrelax-relocations=no |
|||
#ld: -pie -m elf_i386 --no-dynamic-linker -z dynamic-undefined-weak |
|||
#objdump: -dw |
|||
#notarget: i?86-*-nacl* x86_64-*-nacl* |
|||
|
|||
.*: +file format .* |
|||
|
|||
|
|||
Disassembly of section .plt: |
|||
|
|||
.* <.plt>: |
|||
[ ]*[a-f0-9]+: ff b3 04 00 00 00 pushl 0x4\(%ebx\) |
|||
[ ]*[a-f0-9]+: ff a3 08 00 00 00 jmp \*0x8\(%ebx\) |
|||
[ ]*[a-f0-9]+: 00 00 add %al,\(%eax\) |
|||
[ ]*[a-f0-9]+: 00 00 add %al,\(%eax\) |
|||
[ ]*[a-f0-9]+: ff a3 0c 00 00 00 jmp \*0xc\(%ebx\) |
|||
[ ]*[a-f0-9]+: 68 00 00 00 00 push \$0x0 |
|||
[ ]*[a-f0-9]+: e9 00 00 00 00 jmp [a-f0-9]+ <.*> |
|||
|
|||
Disassembly of section .text: |
|||
|
|||
.* <_start>: |
|||
[ ]*[a-f0-9]+: 3b 80 f8 ff ff ff cmp -0x8\(%eax\),%eax |
|||
[ ]*[a-f0-9]+: ff a0 fc ff ff ff jmp \*-0x4\(%eax\) |
|||
[ ]*[a-f0-9]+: e8 df ff ff ff call .* <\.plt\+0x10> |
|||
@ -0,0 +1,6 @@ |
|||
#source: pr19636-3.s |
|||
#as: --32 |
|||
#ld: -pie -m elf_i386 -z dynamic-undefined-weak |
|||
#readelf: -r --wide |
|||
|
|||
There are no relocations in this file. |
|||
@ -0,0 +1,6 @@ |
|||
#source: pr19636-3.s |
|||
#as: --32 |
|||
#ld: -pie -E -m elf_i386 -z dynamic-undefined-weak |
|||
#readelf : -r --wide |
|||
|
|||
There are no relocations in this file. |
|||
@ -0,0 +1,6 @@ |
|||
#source: pr19636-1.s |
|||
#as: --64 |
|||
#ld: -pie -m elf_x86_64 -z dynamic-undefined-weak |
|||
#readelf : -r |
|||
|
|||
There are no relocations in this file. |
|||
@ -0,0 +1,6 @@ |
|||
#source: pr19636-1.s |
|||
#as: --64 |
|||
#ld: -pie -E -m elf_x86_64 -z dynamic-undefined-weak |
|||
#readelf : -r --wide |
|||
|
|||
There are no relocations in this file. |
|||
@ -0,0 +1,6 @@ |
|||
#source: pr19636-1.s |
|||
#as: --64 |
|||
#ld: -E -m elf_x86_64 -z dynamic-undefined-weak |
|||
#readelf : -r --wide |
|||
|
|||
There are no relocations in this file. |
|||
@ -0,0 +1,13 @@ |
|||
#source: pr19636-2.s |
|||
#as: --64 -mrelax-relocations=no |
|||
#ld: -pie -m elf_x86_64 --no-dynamic-linker -z dynamic-undefined-weak |
|||
#readelf : -r --wide -x .got -x .got.plt |
|||
|
|||
There are no relocations in this file. |
|||
|
|||
Hex dump of section '.got': |
|||
0x[0-9a-f]+ [0 ]+\.+ |
|||
|
|||
Hex dump of section '.got.plt': |
|||
0x[0-9a-f]+ +[0-9a-f]+ +[0 ]+ .+ |
|||
0x[0-9a-f]+ [0 ]+\.+ |
|||
@ -0,0 +1,20 @@ |
|||
#source: pr19636-2.s |
|||
#as: --64 -mrelax-relocations=no |
|||
#ld: -pie -E -m elf_x86_64 --no-dynamic-linker -z dynamic-undefined-weak |
|||
#readelf : -r --wide -x .got -x .got.plt --dyn-syms |
|||
|
|||
There are no relocations in this file. |
|||
|
|||
Symbol table '\.dynsym' contains [0-9]+ entries: |
|||
+Num: +Value +Size Type +Bind +Vis +Ndx Name |
|||
+0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND + |
|||
#... |
|||
+[0-9]+: +[a-f0-9]+ +0 +NOTYPE +GLOBAL +DEFAULT +[0-9]+ +_start |
|||
#... |
|||
|
|||
Hex dump of section '.got': |
|||
0x[0-9a-f]+ [0 ]+\.+ |
|||
|
|||
Hex dump of section '.got.plt': |
|||
0x[0-9a-f]+ +[0-9a-f]+ +[0 ]+ .+ |
|||
0x[0-9a-f]+ [0 ]+\.+ |
|||
@ -0,0 +1,26 @@ |
|||
#source: pr19636-2.s |
|||
#as: --64 -mrelax-relocations=no |
|||
#ld: -pie -m elf_x86_64 --no-dynamic-linker --hash-style=sysv -z dynamic-undefined-weak |
|||
#objdump: -dw |
|||
#notarget: x86_64-*-nacl* |
|||
|
|||
.*: +file format .* |
|||
|
|||
|
|||
Disassembly of section .plt: |
|||
|
|||
0+190 <.plt>: |
|||
+[a-f0-9]+: ff 35 2a 01 20 00 pushq 0x20012a\(%rip\) # 2002c0 <_GLOBAL_OFFSET_TABLE_\+0x8> |
|||
+[a-f0-9]+: ff 25 2c 01 20 00 jmpq \*0x20012c\(%rip\) # 2002c8 <_GLOBAL_OFFSET_TABLE_\+0x10> |
|||
+[a-f0-9]+: 0f 1f 40 00 nopl 0x0\(%rax\) |
|||
+[a-f0-9]+: ff 25 2a 01 20 00 jmpq \*0x20012a\(%rip\) # 2002d0 <_GLOBAL_OFFSET_TABLE_\+0x18> |
|||
+[a-f0-9]+: 68 00 00 00 00 pushq \$0x0 |
|||
+[a-f0-9]+: e9 00 00 00 00 jmpq 1b0 <_start> |
|||
|
|||
Disassembly of section .text: |
|||
|
|||
0+1b0 <_start>: |
|||
+[a-f0-9]+: 48 3b 05 f1 00 20 00 cmp 0x2000f1\(%rip\),%rax # 2002a8 <.got> |
|||
+[a-f0-9]+: ff 25 f3 00 20 00 jmpq \*0x2000f3\(%rip\) # 2002b0 <.got\+0x8> |
|||
+[a-f0-9]+: e8 de ff ff ff callq 1a0 <.plt\+0x10> |
|||
#pass |
|||
@ -0,0 +1,13 @@ |
|||
#source: pr19636-2.s |
|||
#as: --64 -mrelax-relocations=no |
|||
#ld: -m elf_x86_64 --no-dynamic-linker -z dynamic-undefined-weak |
|||
#readelf : -r --wide -x .got -x .got.plt --dyn-syms |
|||
|
|||
There are no relocations in this file. |
|||
|
|||
Hex dump of section '.got': |
|||
0x[0-9a-f]+ [0 ]+\.+ |
|||
|
|||
Hex dump of section '.got.plt': |
|||
0x[0-9a-f]+ [0 ]+\.+ |
|||
0x[0-9a-f]+ [0 ]+\.+ |
|||
Loading…
Reference in new issue