[PATCH] -z relro + .dynsym STT_SECTION
Jakub Jelinek
jakub@redhat.com
Tue Jun 15 14:22:00 GMT 2004
On Tue, Jun 15, 2004 at 04:23:52PM +0200, Eric Botcazou wrote:
> > * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set.
> > Create separate .got.plt section if SEPARATE_GOTPLT.
> > Move sections which are only written during relocation handling
> > to the beginning of RW segment. If NO_SMALL_DATA, move .got
> > before .data. Add DATA_SEGMENT_RELRO_END directive.
> > Include OTHER_RELRO_SECTIONS.
>
> These bits
>
> + /* Exception handling */
> + .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) }
> + .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) }
>
> - .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) }
> - .gcc_except_table ${RELOCATING-0} : { KEEP (*(.gcc_except_table))
> *(.gcc_except_table.*) }
>
> broke the gc mechanism used for Ada in presence of DWARF-2 EH.
This is not what current ld uses.
The current layout is:
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr : { *(.eh_frame_hdr) }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table) }
END OF RO SEGMENT
START OF RW SEGMENT
/* Exception handling */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame)) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table) }
/* Thread Local Storage sections */
.tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
.tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
...
Can you reproduce it even with current linker?
> Would you mind fixing the problem? Thanks.
Do you have a particular testcase in mind?
Jakub
More information about the Binutils
mailing list