[PATCH] D37333: [ELF, draft] - Combine GOTPLT and GOT slots.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 07:57:44 PDT 2017


>2) BFD of version GNU ld (GNU Binutils) 2.28.51.20170605 and freshest GNU ld (GNU Binutils) 2.29.51.20171006
>Does not use small non-lazy plt entry for 'bar' (not sure why, looks like a bug for me):
>
>Disassembly of section .plt:
>0000000000000250 <bar at plt-0x10>:
> 250:   ff 35 8a 0d 20 00       pushq  0x200d8a(%rip)        # 200fe0 <_GLOBAL_OFFSET_TABLE_+0x8>
> 256:   ff 25 8c 0d 20 00       jmpq   *0x200d8c(%rip)        # 200fe8 <_GLOBAL_OFFSET_TABLE_+0x10>
> 25c:   0f 1f 40 00             nopl   0x0(%rax)
>0000000000000260 <bar at plt>:
> 260:   ff 25 8a 0d 20 00       jmpq   *0x200d8a(%rip)        # 200ff0 <_GLOBAL_OFFSET_TABLE_+0x18>
> 266:   68 00 00 00 00          pushq  $0x0
> 26b:   e9 e0 ff ff ff          jmpq   250 <bar at plt-0x10>
>Disassembly of section .plt.got:
>0000000000000270 <.plt.got>:
> 270:   ff 25 82 0d 20 00       jmpq   *0x200d82(%rip)        # 200ff8 <_GLOBAL_OFFSET_TABLE_+0x20>
> 276:   66 90                   xchg   %ax,%ax
>00000000000002b8 <_start>:
> 2b8:   48 8b 05 39 0d 20 00    mov    0x200d39(%rip),%rax        # 200ff8 <_DYNAMIC+0x130>
> 2bf:   e8 ec ff ff ff          callq  2b0 <bar at plt+0x10>
> 2c4:   e8 d7 ff ff ff          callq  2a0 <bar at plt>
>
>George.

Sorry, looks above I mixed output from 2.28 and from 2.29.51.
Output was following (difference in _start):

0000000000000250 <bar at plt-0x10>:
 250:	ff 35 8a 0d 20 00    	pushq  0x200d8a(%rip)        # 200fe0 <_GLOBAL_OFFSET_TABLE_+0x8>
 256:	ff 25 8c 0d 20 00    	jmpq   *0x200d8c(%rip)        # 200fe8 <_GLOBAL_OFFSET_TABLE_+0x10>
 25c:	0f 1f 40 00          	nopl   0x0(%rax)

0000000000000260 <bar at plt>:
 260:	ff 25 8a 0d 20 00    	jmpq   *0x200d8a(%rip)        # 200ff0 <_GLOBAL_OFFSET_TABLE_+0x18>
 266:	68 00 00 00 00       	pushq  $0x0
 26b:	e9 e0 ff ff ff       	jmpq   250 <bar at plt-0x10>
Disassembly of section .plt.got:

0000000000000270 <.plt.got>:
 270:	ff 25 82 0d 20 00    	jmpq   *0x200d82(%rip)        # 200ff8 <_GLOBAL_OFFSET_TABLE_+0x20>
 276:	66 90                	xchg   %ax,%ax
Disassembly of section .text:

0000000000000278 <_start>:
 278:	48 8b 05 79 0d 20 00 	mov    0x200d79(%rip),%rax        # 200ff8 <_GLOBAL_OFFSET_TABLE_+0x20>
 27f:	e8 ec ff ff ff       	callq  270 <bar at plt+0x10>
 284:	e8 d7 ff ff ff       	callq  260 <bar at plt>


George.


More information about the llvm-commits mailing list