[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Patch] Objdump disassembly with dynamic relocation info
From: |
Dirk Thierbach |
Subject: |
[Patch] Objdump disassembly with dynamic relocation info |
Date: |
Fri, 2 Aug 2002 08:43:25 +0200 (CEST) |
Hello all,
this is a patch against binutils 2.12.90.0.1 (from the woody debian
source package) to make objdump disassembly work better with dynamic
relocation information. It does three things:
1) With -dR, in prints dynamic reloction info interspersed with
disassembly, like in -dr with normal relocation info.
The problem here was that dynamic relocations use absolute addresses,
while normal relocations use addresses relative to the section.
A possible solution is to modify one of them "in place", so they
can be treated together. But this is a hack, and would possibly
interfere with the DISASSEMBLER_NEEDS_RELOCS #ifdef.
So instead, both information is processed seperately and in
parallel, with common code moved into subroutines. This has the
side effect of making the dissassembly routines somewhat shorter
and IMHO more readable.
2) When there is initialization code at the beginning of a section
without symbols, this code is labelled by the following symbol with
negative offset. To improve this, objdump now makes an attempt
to re-use debugging symbols that point at the beginning of the
section as section labels. To achieve this, the symbols are
modified "in place".
3) For elf-i386, the .got section contains information which can be
used to label the .plt section. To make this work, we need
symbols that refer to the .plt section. Here, they are created
by modifying the address of the symbols that point to the .got
section, which are not interesting for disassembly anyway.
The last two items are also only activated with the -dR option.
They are a bit questionable, because they modify data "in place",
which may interfere somewhat with later outputs (here: only the
debugging information). Also, (3) is architecture dependent,
though this is marked clearly in the source and the architecture
is checked before using it.
But it works for me, and it makes the disassembly of dynamic code
a lot more readable.
Change (1) should be acceptable in any case, IMHO.
- Dirk
P.S: If you answer this mail, please send a copy to my address, since
I am not on any binutils mailing lists.
diff-20020801
Description: Text document
- [Patch] Objdump disassembly with dynamic relocation info,
Dirk Thierbach <=