[RFC] Refactor elf_prpsinfo{32,64} structures
H.J. Lu
hjl.tools@gmail.com
Fri Nov 16 05:13:00 GMT 2012
On Thu, Nov 15, 2012 at 8:18 PM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
> Hi,
>
> This patch is related to
> <http://sourceware.org/ml/binutils/2012-10/msg00286.html>.
>
> Please take it with a ton of salt, since it's still an RFC and is not
> complete. I have also not written a ChangeLog entry because I'd like to
> know others first.
>
> My first task was to extend the information being generated/recorded on
> prpsinfo structures on GNU/Linux. When I started working on this, I
> noticed that the code is a bit confuse and perhaps does not do what it
> should. For example, elf_x86_64_write_core_note on bfd/elf64-x86-64.c
> handles two cases for NT_PRPSINFO: elfclass is 32-bit or 64-bit.
> However, it never gets called (or at least I couldn't make it be called)
> for the 32-bit case, basically because elfcore_write_prpsinfo (at
> bfd/elf.c) will only call it when the class is 64-bit.
The 32-bit case does get called for x32 core. That is how
gcore works on x32 process. You can find more about x32
at
https://sites.google.com/site/x32abi/
> That, and some other discrepancies made me rewrite some parts of the
> prpsinfo code to better handle the generation of such note on corefiles.
>
> The most important things that my patch adds are:
>
> 1) The creation of bfd/elf-psinfo.h, which now holds the declaration for
> elf_prpsinfo32 and elf_prpsinfo64. This file is to be included on every
> architecture file (e.g. bfd/elf64-x86-64.c) that deals with prpsinfo
> things.
>
Whatever you do, please make sure that it works for x32.
BTW, I think we should ELF core dump host-independent:
http://sourceware.org/ml/binutils/2012-10/msg00488.html
hosts/x86-64linux.h and hosts/i386linux.h should be target
files, not hosts.
--
H.J.
More information about the Binutils
mailing list