Re: Use of .eh_frame_hdr, .eh_frame & .gcc_except_table in Linker Script.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PRASANTH RAJAGOPAL <prasanthris@xxxxxxxxx> writes:

> I am trying to explore GCC Linker Script as much as possible. I do not
> know anything about ELF , DWARF or STAB (newbie to all that). Now, I
> have a default Linker script for Bare Metal ELF toolchain, where I am
> trying to understand the usage of the below sections:
>
>
>   .eh_frame_hdr         : { *(.eh_frame_hdr) } >MEM_L1_DATA_A
>   .eh_frame               : ONLY_IF_RO { KEEP (*(.eh_frame)) } >MEM_L1_DATA_A
>   .gcc_except_table   : ONLY_IF_RO { *(.gcc_except_table
> .gcc_except_table.*) } >MEM_L1_DATA_A
>   /* Adjust the address for the data segment.  We want to adjust up to
>      the same address within the page on the next page up.  */
>   . = ALIGN(0x1000) + (. & (0x1000 - 1));
>   /* Exception handling  */
>   .eh_frame               : ONLY_IF_RW { KEEP (*(.eh_frame)) } >MEM_L1_DATA_A
>   .gcc_except_table   : ONLY_IF_RW { *(.gcc_except_table
> .gcc_except_table.*) } >MEM_L1_DATA_A
>
>
> What is the importance of eh_frame_hdr , eh_frame sections,
> .gcc_except_table and why are they written with different Read / Write
> properties. Again my toolchain is pure bare metal, so do I really need
> those?
> Where can I find a high level explanation of what they mean and their use?

Coincidentally, I just posted that.

http://www.airs.com/blog/archives/460
http://www.airs.com/blog/archives/462
http://www.airs.com/blog/archives/464

The different handling for read/write has to do with whether the
sections must be writable at runtime or not.  If they need not be
writable, they can go in the text segment or the relro area; if they
need to be writable (which is normally not the case) they must go in the
data segment.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux