[PATCH 1/2] ld: Define _edata, __bss_start, and _end only for executables

Alan Modra amodra@gmail.com
Thu May 31 00:49:00 GMT 2018


On Thu, May 31, 2018 at 10:14:08AM +0930, Alan Modra wrote:
> On Wed, May 30, 2018 at 02:59:39PM -0700, H.J. Lu wrote:
> > _edata, __bss_start, and _end are defined for executables.  FreeBSD's
> > libc.so uses executable's _end to initialize curbrk.  But there is no
> > good reason to access values of _edata, __bss_start, and _end defined
> > in shared libraries.  We should define _edata, __bss_start, and _end
> > only for executables.
> 
> I agree with the idea, but the patch isn't complete.  You'll need to
> look at all the target OTHER_END_SYMBOLS, OTHER_BSS_SYMBOLS, and
> OTHER_BSS_END_SYMBOLS.

To be clear, I'm only talking about targets that use elf.sc.  Targets
that use their own scripts should be left alone, I think.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list