[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/25473] [gold] Gold doesn't handle GDesc -> LE/IE transition co
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug gold/25473] [gold] Gold doesn't handle GDesc -> LE/IE transition correctly |
Date: |
Tue, 28 Jan 2020 13:51:35 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=25473
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[gold] Gold doesn't handle |[gold] Gold doesn't handle
|GDesc -> LE transition |GDesc -> LE/IE transition
|correctly |correctly
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
GDesc -> IE transition is also wrong:
[hjl@gnu-cfl-2 tmp]$ cat x.s
.text
.p2align 4
.globl _start
.type _start, @function
_start:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
leaq foo@TLSDESC(%rip), %rax
call *foo@TLSCALL(%rax)
addq %fs:0, %rax
addq foo@gottpoff(%rip), %rax
addq $8, %rsp
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.size _start, .-_start
.section .tdata,"awT",@progbits
.align 4
.type foo, @object
.size foo, 4
foo:
.long 30
.section .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-2 tmp]$ gcc -c x.s
[hjl@gnu-cfl-2 tmp]$ ld -shared x.o
[hjl@gnu-cfl-2 tmp]$ objdump -dw --disassemble=_start a.out
a.out: file format elf64-x86-64
Disassembly of section .text:
0000000000001000 <_start>:
1000: 48 83 ec 08 sub $0x8,%rsp
1004: 48 8b 05 ed 2f 00 00 mov 0x2fed(%rip),%rax # 3ff8
<.got>
100b: 66 90 xchg %ax,%ax
100d: 64 48 03 04 25 00 00 00 00 add %fs:0x0,%rax
1016: 48 03 05 db 2f 00 00 add 0x2fdb(%rip),%rax # 3ff8
<.got>
101d: 48 83 c4 08 add $0x8,%rsp
1021: c3 retq
[hjl@gnu-cfl-2 tmp]$ ld.gold -shared x.o
[hjl@gnu-cfl-2 tmp]$ objdump -dw --disassemble=_start a.out
a.out: file format elf64-x86-64
Disassembly of section .plt:
Disassembly of section .text:
0000000000000390 <_start>:
390: 48 83 ec 08 sub $0x8,%rsp
394: 48 8d 05 65 1c 00 00 lea 0x1c65(%rip),%rax # 2000
<_GLOBAL_OFFSET_TABLE_+0x18>
39b: ff 10 callq *(%rax)
39d: 64 48 03 04 25 00 00 00 00 add %fs:0x0,%rax
3a6: 48 03 05 33 1c 00 00 add 0x1c33(%rip),%rax # 1fe0
<foo+0x1fe0>
3ad: 48 83 c4 08 add $0x8,%rsp
3b1: c3 retq
[hjl@gnu-cfl-2 tmp]$
--
You are receiving this mail because:
You are on the CC list for the bug.