[PATCH] Pretty-printing plt entries on ARM (second try)
Yury Gribov
y.gribov@samsung.com
Wed Mar 12 09:10:00 GMT 2014
This is simplified version of patch originally proposed in
https://sourceware.org/ml/binutils/2014-03/msg00046.html
This code will add pretty-printing of PLT entries on ARM, so e.g. instead of
Disassembly of section .plt:
00001000 <.plt>:
1000: e52de004 push {lr} ; (str lr, [sp, #-4]!)
1004: e59fe004 ldr lr, [pc, #4] ; 1010 <_start-0x14>
1008: e08fe00e add lr, pc, lr
100c: e5bef008 ldr pc, [lr, #8]!
1010: f00000f0 .word 0xf00000f0
1014: e28fc20f add ip, pc, #-268435456 ; 0xf0000000
1018: e28cc600 add ip, ip, #0, 12
101c: e28cca00 add ip, ip, #0, 20
1020: e5bcf0f0 ldr pc, [ip, #240]! ; 0xf0
objdump will now output a much more convenient message:
Disassembly of section .plt:
00001000 <foo@plt-0x14>:
1000: e52de004 push {lr} ; (str lr, [sp, #-4]!)
1004: e59fe004 ldr lr, [pc, #4] ; 1010 <foo@plt-0x4>
1008: e08fe00e add lr, pc, lr
100c: e5bef008 ldr pc, [lr, #8]!
1010: f00000f0 .word 0xf00000f0
00001014 <foo@plt>:
1014: e28fc20f add ip, pc, #-268435456 ; 0xf0000000
1018: e28cc600 add ip, ip, #0, 12
101c: e28cca00 add ip, ip, #0, 20
1020: e5bcf0f0 ldr pc, [ip, #240]! ; 0xf0
Instead of abusing elf_backend_plt_sym_val I overloaded
bfd_elf32_get_synthetic_symtab (per Pavel's advice). This has
significantly shortened the patch.
I got no regressions for host-only tests on
arm-{gnueabi,eabi,nacl,symbian}. I haven't tried runtime gdb tests (they
require complete toolchains for all platforms and I don't have them atm).
Ok to commit?
-Y
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm_pretty_plt_dumps.diff
Type: text/x-diff
Size: 155095 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20140312/996af307/attachment.bin>
More information about the Binutils
mailing list