diff options
Diffstat (limited to 'ld/testsuite/ld-i386')
25 files changed, 38 insertions, 28 deletions
diff --git a/ld/testsuite/ld-i386/branch1.d b/ld/testsuite/ld-i386/branch1.d index a078f1d4a2a..81b069e4281 100644 --- a/ld/testsuite/ld-i386/branch1.d +++ b/ld/testsuite/ld-i386/branch1.d @@ -1,4 +1,4 @@ -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 #objdump: -dw diff --git a/ld/testsuite/ld-i386/call1.d b/ld/testsuite/ld-i386/call1.d index 69383b23cba..e3ebedcc6bc 100644 --- a/ld/testsuite/ld-i386/call1.d +++ b/ld/testsuite/ld-i386/call1.d @@ -1,3 +1,3 @@ -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -shared -melf_i386 #error: direct GOT relocation R_386_GOT32X against `foo' without base register can not be used when making a shared object diff --git a/ld/testsuite/ld-i386/call2.d b/ld/testsuite/ld-i386/call2.d index 69383b23cba..e3ebedcc6bc 100644 --- a/ld/testsuite/ld-i386/call2.d +++ b/ld/testsuite/ld-i386/call2.d @@ -1,3 +1,3 @@ -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -shared -melf_i386 #error: direct GOT relocation R_386_GOT32X against `foo' without base register can not be used when making a shared object diff --git a/ld/testsuite/ld-i386/call3a.d b/ld/testsuite/ld-i386/call3a.d index a8ff27f12f5..5a1e1df1b35 100644 --- a/ld/testsuite/ld-i386/call3a.d +++ b/ld/testsuite/ld-i386/call3a.d @@ -1,5 +1,5 @@ #source: call3.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 #objdump: -dw diff --git a/ld/testsuite/ld-i386/call3b.d b/ld/testsuite/ld-i386/call3b.d index 06af6f5876e..de98ce41b01 100644 --- a/ld/testsuite/ld-i386/call3b.d +++ b/ld/testsuite/ld-i386/call3b.d @@ -1,5 +1,5 @@ #source: call3.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 -z call-nop=prefix-addr #objdump: -dw diff --git a/ld/testsuite/ld-i386/call3c.d b/ld/testsuite/ld-i386/call3c.d index 64e83728e6f..0fdbee454a3 100644 --- a/ld/testsuite/ld-i386/call3c.d +++ b/ld/testsuite/ld-i386/call3c.d @@ -1,5 +1,5 @@ #source: call3.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 -z call-nop=prefix-nop #objdump: -dw diff --git a/ld/testsuite/ld-i386/call3d.d b/ld/testsuite/ld-i386/call3d.d index a9274c8dbf0..4d965b30829 100644 --- a/ld/testsuite/ld-i386/call3d.d +++ b/ld/testsuite/ld-i386/call3d.d @@ -1,5 +1,5 @@ #source: call3.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 -z call-nop=suffix-nop #objdump: -dw diff --git a/ld/testsuite/ld-i386/call3e.d b/ld/testsuite/ld-i386/call3e.d index 2876b49ce2d..608682c00f3 100644 --- a/ld/testsuite/ld-i386/call3e.d +++ b/ld/testsuite/ld-i386/call3e.d @@ -1,5 +1,5 @@ #source: call3.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 -z call-nop=prefix-0x67 #objdump: -dw diff --git a/ld/testsuite/ld-i386/call3f.d b/ld/testsuite/ld-i386/call3f.d index 5ab0cf170ac..f3a48696e91 100644 --- a/ld/testsuite/ld-i386/call3f.d +++ b/ld/testsuite/ld-i386/call3f.d @@ -1,5 +1,5 @@ #source: call3.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 -z call-nop=prefix-0x90 #objdump: -dw diff --git a/ld/testsuite/ld-i386/call3g.d b/ld/testsuite/ld-i386/call3g.d index 828777024f8..f3e3f364ba1 100644 --- a/ld/testsuite/ld-i386/call3g.d +++ b/ld/testsuite/ld-i386/call3g.d @@ -1,5 +1,5 @@ #source: call3.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 -z call-nop=suffix-0x90 #objdump: -dw diff --git a/ld/testsuite/ld-i386/call3h.d b/ld/testsuite/ld-i386/call3h.d index 83f371a1bfb..afd1ce822a7 100644 --- a/ld/testsuite/ld-i386/call3h.d +++ b/ld/testsuite/ld-i386/call3h.d @@ -1,5 +1,5 @@ #source: call3.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 -z call-nop=suffix-144 #objdump: -dw diff --git a/ld/testsuite/ld-i386/got1.dd b/ld/testsuite/ld-i386/got1.dd index e46153db262..e6e82dee910 100644 --- a/ld/testsuite/ld-i386/got1.dd +++ b/ld/testsuite/ld-i386/got1.dd @@ -10,6 +10,8 @@ [ ]*[a-f0-9]+: ff d0 call \*%eax [ ]*[a-f0-9]+: [ a-f0-9]+ mov *0x[a-f0-9]+,%eax [ ]*[a-f0-9]+: ff d0 call \*%eax +[ ]*[a-f0-9]+: [ a-f0-9]+ call [a-f0-9]+ <__x86.get_pc_thunk.cx> +[ ]*[a-f0-9]+: [ a-f0-9]+ add \$0x[a-f0-9]+,%ecx [ ]*[a-f0-9]+: [ a-f0-9]+ lea *0x[a-f0-9]+,%ecx [ ]*[a-f0-9]+: ff d1 call \*%ecx [ ]*[a-f0-9]+: 83 ec 0c sub \$0xc,%esp diff --git a/ld/testsuite/ld-i386/got1a.S b/ld/testsuite/ld-i386/got1a.S index f3d5330b057..7a3f7b5b47d 100644 --- a/ld/testsuite/ld-i386/got1a.S +++ b/ld/testsuite/ld-i386/got1a.S @@ -12,10 +12,19 @@ main: call *%eax movl plt@GOT, %eax call *%eax - movl foo@GOT(%ebx), %ecx + call __x86.get_pc_thunk.cx + addl $_GLOBAL_OFFSET_TABLE_, %ecx + movl foo@GOT(%ecx), %ecx call *%ecx subl $12, %esp pushl $0 pushl $0 # Push a dummy return address onto stack. jmp *myexit@GOT .size main, .-main + .section .text.__x86.get_pc_thunk.cx,"axG",@progbits,__x86.get_pc_thunk.cx,comdat + .globl __x86.get_pc_thunk.cx + .hidden __x86.get_pc_thunk.cx + .type __x86.get_pc_thunk.cx, @function +__x86.get_pc_thunk.cx: + movl (%esp), %ecx + ret diff --git a/ld/testsuite/ld-i386/got1d.S b/ld/testsuite/ld-i386/got1d.S index a6d51c66eed..7e4c9b167d1 100644 --- a/ld/testsuite/ld-i386/got1d.S +++ b/ld/testsuite/ld-i386/got1d.S @@ -19,7 +19,6 @@ plt: pushl %esi pushl %ebx call __x86.get_pc_thunk.bx -1: addl $_GLOBAL_OFFSET_TABLE_, %ebx subl $20, %esp leal __FUNCTION__.1866@GOTOFF(%ebx), %esi diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index 04eb7b13e39..9d392c2a0bd 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -357,7 +357,7 @@ if { [isnative] [list \ "Build libplt-main1.a" \ "" \ - "-fPIC" \ + "-fPIC -Wa,-mrelax-relocations=yes" \ { plt-main1.c } \ {{readelf {-Wr} plt-main1.rd}} \ "libplt-main1.a" \ @@ -365,7 +365,7 @@ if { [isnative] [list \ "Build libplt-main2.a" \ "" \ - "-fPIC" \ + "-fPIC -Wa,-mrelax-relocations=yes" \ { plt-main2.c } \ {{readelf {-Wr} plt-main2.rd}} \ "libplt-main2.a" \ @@ -373,7 +373,7 @@ if { [isnative] [list \ "Build libplt-main3.a" \ "" \ - "-fPIC $PLT_CFLAGS" \ + "-fPIC -Wa,-mrelax-relocations=yes $PLT_CFLAGS" \ { plt-main3.c } \ {{readelf {-Wr} plt-main3.rd}} \ "libplt-main3.a" \ @@ -381,7 +381,7 @@ if { [isnative] [list \ "Build libplt-main4.a" \ "" \ - "-fPIC $PLT_CFLAGS" \ + "-fPIC -Wa,-mrelax-relocations=yes $PLT_CFLAGS" \ { plt-main4.c } \ {{readelf {-Wr} plt-main4.rd}} \ "libplt-main4.a" \ @@ -535,7 +535,7 @@ if { [isnative] [list \ "Build gotpc1" \ "tmpdir/got1d.so" \ - "" \ + "-Wa,-mrelax-relocations=yes" \ { got1a.S got1b.c got1c.c } \ {{objdump {-dw} got1.dd}} \ "got1" \ diff --git a/ld/testsuite/ld-i386/jmp1.d b/ld/testsuite/ld-i386/jmp1.d index 69383b23cba..e3ebedcc6bc 100644 --- a/ld/testsuite/ld-i386/jmp1.d +++ b/ld/testsuite/ld-i386/jmp1.d @@ -1,3 +1,3 @@ -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -shared -melf_i386 #error: direct GOT relocation R_386_GOT32X against `foo' without base register can not be used when making a shared object diff --git a/ld/testsuite/ld-i386/jmp2.d b/ld/testsuite/ld-i386/jmp2.d index 69383b23cba..e3ebedcc6bc 100644 --- a/ld/testsuite/ld-i386/jmp2.d +++ b/ld/testsuite/ld-i386/jmp2.d @@ -1,3 +1,3 @@ -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -shared -melf_i386 #error: direct GOT relocation R_386_GOT32X against `foo' without base register can not be used when making a shared object diff --git a/ld/testsuite/ld-i386/lea1c.d b/ld/testsuite/ld-i386/lea1c.d index dd76258be34..0c3580d21ae 100644 --- a/ld/testsuite/ld-i386/lea1c.d +++ b/ld/testsuite/ld-i386/lea1c.d @@ -1,5 +1,5 @@ #source: lea1.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 #objdump: -dw diff --git a/ld/testsuite/ld-i386/load1.d b/ld/testsuite/ld-i386/load1.d index 062ea183bf9..a252a15efa2 100644 --- a/ld/testsuite/ld-i386/load1.d +++ b/ld/testsuite/ld-i386/load1.d @@ -1,4 +1,4 @@ -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 #objdump: -dw --sym #notarget: i?86-*-nacl* x86_64-*-nacl* diff --git a/ld/testsuite/ld-i386/load2.d b/ld/testsuite/ld-i386/load2.d index 87c2509dca3..467fee03e8d 100644 --- a/ld/testsuite/ld-i386/load2.d +++ b/ld/testsuite/ld-i386/load2.d @@ -1,3 +1,3 @@ -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 -shared #error: direct GOT relocation R_386_GOT32X against `foo' without base register can not be used when making a shared object diff --git a/ld/testsuite/ld-i386/load3.d b/ld/testsuite/ld-i386/load3.d index 87c2509dca3..467fee03e8d 100644 --- a/ld/testsuite/ld-i386/load3.d +++ b/ld/testsuite/ld-i386/load3.d @@ -1,3 +1,3 @@ -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 -shared #error: direct GOT relocation R_386_GOT32X against `foo' without base register can not be used when making a shared object diff --git a/ld/testsuite/ld-i386/load4a.d b/ld/testsuite/ld-i386/load4a.d index 3aa56bd4923..f3f02eae7bc 100644 --- a/ld/testsuite/ld-i386/load4a.d +++ b/ld/testsuite/ld-i386/load4a.d @@ -1,4 +1,4 @@ #source: load4.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -Bsymbolic -shared -melf_i386 #error: direct GOT relocation R_386_GOT32X against `foo' without base register can not be used when making a shared object diff --git a/ld/testsuite/ld-i386/load5a.d b/ld/testsuite/ld-i386/load5a.d index 88c225a1b34..97443163de1 100644 --- a/ld/testsuite/ld-i386/load5a.d +++ b/ld/testsuite/ld-i386/load5a.d @@ -1,4 +1,4 @@ #source: load5.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -Bsymbolic -shared -melf_i386 #error: direct GOT relocation R_386_GOT32X against `foo' without base register can not be used when making a shared object diff --git a/ld/testsuite/ld-i386/mov2b.d b/ld/testsuite/ld-i386/mov2b.d index ea5dd9ba39b..295a7c5c5b1 100644 --- a/ld/testsuite/ld-i386/mov2b.d +++ b/ld/testsuite/ld-i386/mov2b.d @@ -1,5 +1,5 @@ #source: mov2.s -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -pie -melf_i386 #objdump: -dw diff --git a/ld/testsuite/ld-i386/mov3.d b/ld/testsuite/ld-i386/mov3.d index 17da244ba1c..4ce5cd8f53d 100644 --- a/ld/testsuite/ld-i386/mov3.d +++ b/ld/testsuite/ld-i386/mov3.d @@ -1,4 +1,4 @@ -#as: --32 +#as: --32 -mrelax-relocations=yes #ld: -melf_i386 #objdump: -dw |