Hi,
I have recently been working on getting SEH into the x64 port. This
covers several parts. One of them is compiler support.
On x64 SEH is table based rather than code based, that means it needs
tables of unwind data. These can be generated from DWARF unwind info -
which gcc generates - and that's what I'm working on.
The x64 version of rsym shall parse the DWARF unwind data and convert it
into Windows compatible unwind data.
Now there is a problem. While older versions of mingw64 used the
".debug_frame" section, the newer versions use the ".eh_frame"
section.
That is good and bad at the same time. What does that mean? What's the
difference?
The .eh_frame section isn't part of the DWARF 2 or 3 specification, it's
a GNU extension / part of the LSB-Core specification. Documentation was
hard to find, but google is your friend and it seems there's only one
major difference to the debug_frame section and that is relative
addressing rather than absolute. This is actually very good and saves
the day for all modules that live in kernel space, because the addresses
are only 32 bits.
There is still a problem left. While the .debug_frame section is by
default put into the output executable as a seperate section, the
.eh_frame section isn't. The default linker script puts it into the
".rdata" section. But there it's kinda lost and I don't want to keep it
anyway.
With ntoskrnl there's no problem as it uses it's own linker script
anyway. I can change it, so the .eh_frame section is put at the end of
the executable. But how do I do this for the other modules? Do i need to
provide a new default linkerscript for all other modules? Can I "fix"
this behavior in RosBE64 (the files in lib/ldscripts seem to be unused)?
Or does anyone know a command line option to change this default behavior?
Regards,
Timo