Need help with gas directive .cfi_sections
Sharyathi Nagesh
sharyath@in.ibm.com
Fri Nov 20 18:32:00 GMT 2009
Hi Daniel
Thanks for the response
>
> What's wrong with using .eh_frame? You can mix this with
> .debug_frame, you don't need .cfi_sections unless you want to strip
> .eh_frame from the runtime image.
It is not we don't want to use eh_frame but it would have been lot simpler to implement
stack unwind if all the information was available in .debug_frame. Since our implementation
primarily uses .debug_section we need to create fall back routine to rely on .eh_frame when
ever unwind call fails.
This create some challenges that I can foresee, like
1. When to fall back to eh_frame
a. As there can be dwarf corruption
b. Indeed unwinding is completed (currently assumed when return address == 0)
c. Hit exception frame while unwinding
2. Completely relying on .eh_frame, with bp register, for unwinding is not suggested as
kernel code optimizes out bp register and following Intel ABI verbatim wont be possible.
We also need to explore the libraries available to access eh_frame. But libdw provided good
set of APIs to access dwarf information.
>> .global test1
>> test1:
>> .cfi_startproc
>> .cfi_signal_frame
>> .cfi_sections .debug_frame
>> .cfi_def_cfa_offset 8
>> .cfi_def_cfa r3, 4
>> .cfi_endproc
>> mr 10,9
>> blr
>
> CFI instructions apply to the current location. Put them at the
> points in the program where they belong, and gas will give you correct
> output.
>
Ok thank you, I think it is my limited knowledge in assembly code that is causing the issue,
will explore more
Thanks once again
Sharyathi N
More information about the Binutils
mailing list