From: nobody <> Date: Sun, 16 Dec 2012 20:31:09 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create branch 'binutils- X-Git-Tag: binutils-2_23_2~136 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02085db75d4c12baefda91bc3074d253c70e05e8;p=thirdparty%2Fbinutils-gdb.git This commit was manufactured by cvs2svn to create branch 'binutils- 2_23-branch'. Cherrypick from master 2012-12-16 20:31:08 UTC H.J. Lu 'Also check local IFUNC references': ld/testsuite/ld-ifunc/ifunc-14a-i386.d ld/testsuite/ld-ifunc/ifunc-14a-x86-64.d ld/testsuite/ld-ifunc/ifunc-14b-i386.d ld/testsuite/ld-ifunc/ifunc-14b-x86-64.d ld/testsuite/ld-ifunc/ifunc-14c-i386.d ld/testsuite/ld-ifunc/ifunc-14c-x86-64.d ld/testsuite/ld-ifunc/ifunc-14d-i386.d ld/testsuite/ld-ifunc/ifunc-14d-x86-64.d ld/testsuite/ld-ifunc/ifunc-18a-i386.d ld/testsuite/ld-ifunc/ifunc-18a-x86-64.d ld/testsuite/ld-ifunc/ifunc-18a.s ld/testsuite/ld-ifunc/ifunc-18b-i386.d ld/testsuite/ld-ifunc/ifunc-18b-x86-64.d ld/testsuite/ld-ifunc/ifunc-18b.s ld/testsuite/ld-ifunc/ifunc-19a-i386.d ld/testsuite/ld-ifunc/ifunc-19a-x86-64.d ld/testsuite/ld-ifunc/ifunc-19a.s ld/testsuite/ld-ifunc/ifunc-19b-i386.d ld/testsuite/ld-ifunc/ifunc-19b-x86-64.d ld/testsuite/ld-ifunc/ifunc-19b.s --- diff --git a/ld/testsuite/ld-ifunc/ifunc-14a-i386.d b/ld/testsuite/ld-ifunc/ifunc-14a-i386.d new file mode 100644 index 00000000000..0edc9fbbd5e --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-14a-i386.d @@ -0,0 +1,11 @@ +#source: ifunc-14a.s +#source: ifunc-14b.s +#ld: -shared -m elf_i386 -z nocombreloc +#as: --32 +#readelf: -d --wide +#target: x86_64-*-* i?86-*-* + +#failif +#... +.*\(TEXTREL\).* +#... diff --git a/ld/testsuite/ld-ifunc/ifunc-14a-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-14a-x86-64.d new file mode 100644 index 00000000000..2c4ebbb03b9 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-14a-x86-64.d @@ -0,0 +1,11 @@ +#source: ifunc-14a.s +#source: ifunc-14b.s +#ld: -shared -m elf_x86_64 -z nocombreloc +#as: --64 +#readelf: -d +#target: x86_64-*-* + +#failif +#... +.*\(TEXTREL\).* +#... diff --git a/ld/testsuite/ld-ifunc/ifunc-14b-i386.d b/ld/testsuite/ld-ifunc/ifunc-14b-i386.d new file mode 100644 index 00000000000..948237d1caa --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-14b-i386.d @@ -0,0 +1,11 @@ +#source: ifunc-14b.s +#source: ifunc-14a.s +#ld: -shared -m elf_i386 -z nocombreloc +#as: --32 +#readelf: -d --wide +#target: x86_64-*-* i?86-*-* + +#failif +#... +.*\(TEXTREL\).* +#... diff --git a/ld/testsuite/ld-ifunc/ifunc-14b-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-14b-x86-64.d new file mode 100644 index 00000000000..cc1f5ae6b2a --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-14b-x86-64.d @@ -0,0 +1,11 @@ +#source: ifunc-14b.s +#source: ifunc-14a.s +#ld: -shared -m elf_x86_64 -z nocombreloc +#as: --64 +#readelf: -d +#target: x86_64-*-* + +#failif +#... +.*\(TEXTREL\).* +#... diff --git a/ld/testsuite/ld-ifunc/ifunc-14c-i386.d b/ld/testsuite/ld-ifunc/ifunc-14c-i386.d new file mode 100644 index 00000000000..ca360a396d0 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-14c-i386.d @@ -0,0 +1,11 @@ +#source: ifunc-14a.s +#source: ifunc-14b.s +#ld: -shared -m elf_i386 -z nocombreloc +#as: --32 +#readelf: -r --wide +#target: x86_64-*-* i?86-*-* + +#failif +#... +.* +R_386_NONE +.* +#... diff --git a/ld/testsuite/ld-ifunc/ifunc-14c-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-14c-x86-64.d new file mode 100644 index 00000000000..76bfa84a2f0 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-14c-x86-64.d @@ -0,0 +1,11 @@ +#source: ifunc-14a.s +#source: ifunc-14b.s +#ld: -shared -m elf_x86_64 -z nocombreloc +#as: --64 +#readelf: -r --wide +#target: x86_64-*-* + +#failif +#... +.* +R_X86_64_NONE +.* +#... diff --git a/ld/testsuite/ld-ifunc/ifunc-14d-i386.d b/ld/testsuite/ld-ifunc/ifunc-14d-i386.d new file mode 100644 index 00000000000..2327278f3bf --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-14d-i386.d @@ -0,0 +1,11 @@ +#source: ifunc-14b.s +#source: ifunc-14a.s +#ld: -shared -m elf_i386 -z nocombreloc +#as: --32 +#readelf: -r --wide +#target: x86_64-*-* i?86-*-* + +#failif +#... +.* +R_386_NONE +.* +#... diff --git a/ld/testsuite/ld-ifunc/ifunc-14d-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-14d-x86-64.d new file mode 100644 index 00000000000..789584bc309 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-14d-x86-64.d @@ -0,0 +1,11 @@ +#source: ifunc-14b.s +#source: ifunc-14a.s +#ld: -shared -m elf_x86_64 -z nocombreloc +#as: --64 +#readelf: -r --wide +#target: x86_64-*-* + +#failif +#... +.* +R_X86_64_NONE +.* +#... diff --git a/ld/testsuite/ld-ifunc/ifunc-18a-i386.d b/ld/testsuite/ld-ifunc/ifunc-18a-i386.d new file mode 100644 index 00000000000..10490b112b7 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-18a-i386.d @@ -0,0 +1,15 @@ +#source: ifunc-18a.s +#source: ifunc-18b.s +#ld: -shared -m elf_i386 -z nocombreloc +#as: --32 +#readelf: -r --wide +#target: x86_64-*-* i?86-*-* + +Relocation section '.rel.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]* + +Relocation section '.rel.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]* diff --git a/ld/testsuite/ld-ifunc/ifunc-18a-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-18a-x86-64.d new file mode 100644 index 00000000000..0d600eb3821 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-18a-x86-64.d @@ -0,0 +1,15 @@ +#source: ifunc-18a.s +#source: ifunc-18b.s +#as: --64 +#ld: -shared -melf_x86_64 -z nocombreloc +#readelf: -r --wide +#target: x86_64-*-* + +Relocation section '.rela.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]* diff --git a/ld/testsuite/ld-ifunc/ifunc-18a.s b/ld/testsuite/ld-ifunc/ifunc-18a.s new file mode 100644 index 00000000000..c29c121c235 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-18a.s @@ -0,0 +1,5 @@ + .section .data.rel,"aw",@progbits + .globl foo_ptrt + .type foo_ptr, @object +foo_ptr: + .dc.a foo diff --git a/ld/testsuite/ld-ifunc/ifunc-18b-i386.d b/ld/testsuite/ld-ifunc/ifunc-18b-i386.d new file mode 100644 index 00000000000..a5eda9495a4 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-18b-i386.d @@ -0,0 +1,15 @@ +#source: ifunc-18b.s +#source: ifunc-18a.s +#ld: -shared -m elf_i386 -z nocombreloc +#as: --32 +#readelf: -r --wide +#target: x86_64-*-* i?86-*-* + +Relocation section '.rel.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]* + +Relocation section '.rel.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]* diff --git a/ld/testsuite/ld-ifunc/ifunc-18b-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-18b-x86-64.d new file mode 100644 index 00000000000..8dfebfb8e9d --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-18b-x86-64.d @@ -0,0 +1,15 @@ +#source: ifunc-18b.s +#source: ifunc-18a.s +#as: --64 +#ld: -shared -melf_x86_64 -z nocombreloc +#readelf: -r --wide +#target: x86_64-*-* + +Relocation section '.rela.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]* diff --git a/ld/testsuite/ld-ifunc/ifunc-18b.s b/ld/testsuite/ld-ifunc/ifunc-18b.s new file mode 100644 index 00000000000..fece4131892 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-18b.s @@ -0,0 +1,15 @@ + .text + .type foo, %gnu_indirect_function + .hidden foo + .globl foo +foo: + ret + .size foo, .-foo + .globl bar +bar: + jmp foo1@PLT + ret + .size bar, .-bar + .hidden foo1 + .globl foo1 + foo1 = foo diff --git a/ld/testsuite/ld-ifunc/ifunc-19a-i386.d b/ld/testsuite/ld-ifunc/ifunc-19a-i386.d new file mode 100644 index 00000000000..8319bfc74c2 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-19a-i386.d @@ -0,0 +1,14 @@ +#source: ifunc-19a.s +#source: ifunc-19b.s +#ld: -shared -m elf_i386 -z nocombreloc +#as: --32 +#readelf: -r --wide +#target: x86_64-*-* i?86-*-* + +Relocation section '.rel.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]* + +Relocation section '.rel.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]* diff --git a/ld/testsuite/ld-ifunc/ifunc-19a-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-19a-x86-64.d new file mode 100644 index 00000000000..fe576d2d333 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-19a-x86-64.d @@ -0,0 +1,14 @@ +#source: ifunc-19a.s +#source: ifunc-19b.s +#as: --64 +#ld: -shared -melf_x86_64 -z nocombreloc +#readelf: -r --wide +#target: x86_64-*-* + +Relocation section '.rela.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]* diff --git a/ld/testsuite/ld-ifunc/ifunc-19a.s b/ld/testsuite/ld-ifunc/ifunc-19a.s new file mode 100644 index 00000000000..3a3d0cd6689 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-19a.s @@ -0,0 +1,5 @@ + .section .data.rel,"aw",@progbits + .globl foo_ptrt + .type foo_ptr, @object +foo_ptr: + .dc.a foo1 diff --git a/ld/testsuite/ld-ifunc/ifunc-19b-i386.d b/ld/testsuite/ld-ifunc/ifunc-19b-i386.d new file mode 100644 index 00000000000..5bb81706aaf --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-19b-i386.d @@ -0,0 +1,14 @@ +#source: ifunc-19b.s +#source: ifunc-19a.s +#ld: -shared -m elf_i386 -z nocombreloc +#as: --32 +#readelf: -r --wide +#target: x86_64-*-* i?86-*-* + +Relocation section '.rel.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]* + +Relocation section '.rel.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_IRELATIVE[ ]* diff --git a/ld/testsuite/ld-ifunc/ifunc-19b-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-19b-x86-64.d new file mode 100644 index 00000000000..35fa3285fd5 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-19b-x86-64.d @@ -0,0 +1,14 @@ +#source: ifunc-19b.s +#source: ifunc-19a.s +#as: --64 +#ld: -shared -melf_x86_64 -z nocombreloc +#readelf: -r --wide +#target: x86_64-*-* + +Relocation section '.rela.ifunc' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]* + +Relocation section '.rela.plt' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_IRELATIVE[ ]+[0-9a-f]* diff --git a/ld/testsuite/ld-ifunc/ifunc-19b.s b/ld/testsuite/ld-ifunc/ifunc-19b.s new file mode 100644 index 00000000000..fece4131892 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-19b.s @@ -0,0 +1,15 @@ + .text + .type foo, %gnu_indirect_function + .hidden foo + .globl foo +foo: + ret + .size foo, .-foo + .globl bar +bar: + jmp foo1@PLT + ret + .size bar, .-bar + .hidden foo1 + .globl foo1 + foo1 = foo