This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] MIPS/LD/testsuite: Provide for correct PLT disassembly
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: Richard Sandiford <rdsandiford at googlemail dot com>
- Cc: <binutils at sourceware dot org>
- Date: Mon, 18 Feb 2013 15:20:08 +0000
- Subject: [PATCH] MIPS/LD/testsuite: Provide for correct PLT disassembly
Hi,
We have a test case in the LD test suite that disassembles PLT, but
discards .rel.plt upon link. As a result the PLT cannot be correctly
interpreted, the synthetic symbols cannot be made.
I propose this change in preparation to switch to microMIPS PLT support
where the presence of _PROCEDURE_LINKAGE_TABLE_ and the synthetic symbols
will actually be a requirement for meaningful interpretation/disassembly
of the PLT. The change adds all the dynamic and other usual sections to
the linker script as well, for clarity (they're output implicitly anyway).
No regressions across the usual 25 MIPS targets. OK to apply?
2013-02-18 Maciej W. Rozycki <macro@codesourcery.com>
ld/testsuite/
* ld-mips-elf/jalx-2.ld: Include .rel.plt in output. Place the
other sections in the expected order.
* ld-mips-elf/jalx-2.dd: Adjust disassembly accordingly.
Maciej
binutils-umips-ld-jalx-test-fix.diff
Index: binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/jalx-2.dd
===================================================================
--- binutils-fsf-trunk-quilt.orig/ld/testsuite/ld-mips-elf/jalx-2.dd 2011-10-24 22:15:55.155938046 +0100
+++ binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/jalx-2.dd 2011-10-24 23:03:24.945915225 +0100
@@ -29,7 +29,7 @@
4400038: f8be 0024 sw a1,36\(s8\)
440003c: 41a2 0440 lui v0,0x440
4400040: 3082 02a0 addiu a0,v0,672
- 4400044: f110 0028 jalx 44000a0 <_PROCEDURE_LINKAGE_TABLE_\+0x20>
+ 4400044: f110 0028 jalx 44000a0 <printf@plt>
4400048: 0000 0000 nop
440004c: f620 0010 jal 4400020 <internal_function>
4400050: 0000 0000 nop
@@ -52,6 +52,8 @@
4400094: 0018c082 srl t8,t8,0x2
4400098: 0320f809 jalr t9
440009c: 2718fffe addiu t8,t8,-2
+
+044000a0 <printf@plt>:
44000a0: 3c0f0440 lui t7,0x440
44000a4: 8df900e0 lw t9,224\(t7\)
44000a8: 03200008 jr t9
Index: binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/jalx-2.ld
===================================================================
--- binutils-fsf-trunk-quilt.orig/ld/testsuite/ld-mips-elf/jalx-2.ld 2011-10-24 22:15:55.145952461 +0100
+++ binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/jalx-2.ld 2011-10-24 23:03:24.945915225 +0100
@@ -5,4 +5,16 @@ _start_text = _start_text_phys;
SECTIONS
{
.text _start_text : AT (ADDR (.text)) { *(.text) }
+ .plt : { *(.plt) }
+ .interp : { *(.interp) }
+ .got : { *(.got) }
+ .got.plt : { *(.got.plt) }
+ .rld_map : { *(.rld_map) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .dynamic : { *(.dynamic) }
+ .hash : { *(.hash) }
+ .reginfo : { *(.reginfo) }
+ .rodata : { *(.rodata) }
+ .rel.plt : { *(.rel.plt) }
}