This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] -z relro + .dynsym STT_SECTION
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Eric Botcazou <ebotcazou at act-europe dot fr>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 15 Jun 2004 10:21:44 -0400
- Subject: Re: [PATCH] -z relro + .dynsym STT_SECTION
- References: <20040505133326.GS2565@bubble.modra.org> <20040506110502.GA3507@bubble.modra.org> <20040506103549.GQ5191@sunsite.ms.mff.cuni.cz> <200406151622.37233.ebotcazou@act-europe.fr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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