From 7c445aa3c80222dfc679ab112c864d674b805ec3 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 1 Oct 2002 10:43:37 +0000 Subject: bfd/ * elf32-i386.c (elf_i386_relocate_section): Fix movl foo@indntpoff, %eax IE->LE transition. ld/testsuite/ * ld-i386/i386.exp: Add tlsindntpoff test. * ld-i386/tlsindntpoff.s: New test. * ld-i386/tlsindntpoff.dd: New test. --- ld/testsuite/ChangeLog | 6 ++++++ ld/testsuite/ld-i386/i386.exp | 2 ++ ld/testsuite/ld-i386/tlsindntpoff.dd | 16 ++++++++++++++++ ld/testsuite/ld-i386/tlsindntpoff.s | 19 +++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 ld/testsuite/ld-i386/tlsindntpoff.dd create mode 100644 ld/testsuite/ld-i386/tlsindntpoff.s (limited to 'ld') diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 1e91d598dd..d9b35f6eed 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2002-10-01 Jakub Jelinek + + * ld-i386/i386.exp: Add tlsindntpoff test. + * ld-i386/tlsindntpoff.s: New test. + * ld-i386/tlsindntpoff.dd: New test. + 2002-10-01 Jakub Jelinek * ld-x86-64/tlspic1.s: Change TLSGD sequences. diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index 795efc218d..846847e2b4 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -55,6 +55,8 @@ set i386tests { {"TLS in debug sections" "-melf_i386" "--32" {tlsg.s} {{objdump -sj.debug_foobar tlsg.sd}} "tlsg"} + {"TLS @indntpoff with %eax" "-melf_i386" "--32" {tlsindntpoff.s} + {{objdump -drj.text tlsindntpoff.dd}} "tlsindntpoff"} {"Reloc section order" "-shared -melf_i386" "--32" {reloc.s} {{objdump -hw reloc.d}} "reloc.so"} } diff --git a/ld/testsuite/ld-i386/tlsindntpoff.dd b/ld/testsuite/ld-i386/tlsindntpoff.dd new file mode 100644 index 0000000000..db20de1d93 --- /dev/null +++ b/ld/testsuite/ld-i386/tlsindntpoff.dd @@ -0,0 +1,16 @@ +#source: tlsindntpoff.s +#as: --32 +#ld: -melf_i386 +#objdump: -drj.text +#target: i?86-*-* + +.*: +file format elf32-i386 + +Disassembly of section .text: + +[0-9a-f]+000 <_start>: + [0-9a-f]+000: 39 d8[ ]+cmp %ebx,%eax + [0-9a-f]+002: 73 08[ ]+jae [0-9a-f]+00c <_start\+0xc> + [0-9a-f]+004: b8 fc ff ff ff[ ]+mov \$0xfffffffc,%eax + [0-9a-f]+009: 65 8b 00[ ]+mov %gs:\(%eax\),%eax + [0-9a-f]+00c: c3[ ]+ret * diff --git a/ld/testsuite/ld-i386/tlsindntpoff.s b/ld/testsuite/ld-i386/tlsindntpoff.s new file mode 100644 index 0000000000..4bc93f6327 --- /dev/null +++ b/ld/testsuite/ld-i386/tlsindntpoff.s @@ -0,0 +1,19 @@ + /* Force .got aligned to 4K, so it very likely gets at 0x804a100 + (0x60 bytes .tdata and 0xa0 bytes .dynamic) */ + .data + .balign 4096 + .section ".tdata", "awT", @progbits + .globl foo +foo: .long 27 + + /* Force .text aligned to 4K, so it very likely gets at 0x8049000. */ + .text + .balign 4096 + .globl _start + .type _start,@function +_start: + cmp %ebx, %eax + jae 1f + movl foo@indntpoff, %eax + movl %gs:(%eax), %eax +1: ret -- cgit v1.2.1