This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/2] Define _edata, __bss_start, and _end only for executables


On Tue, Jun 05, 2018 at 07:21:21PM -0700, H.J. Lu wrote:
> On Tue, Jun 5, 2018 at 5:48 AM, H.J. Lu <hjl.tools@gmail.com> 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.  To exclude _edata, __bss_start, _end and end
> > from shared libraries, EXCLUDE_SHLIB_SYMBOLS should be set.
> >
> > This series of patches sets EXCLUDE_SHLIB_SYMBOLS for x86 ELF targets.
> > There are no regressions on
> >
> > aarch64-linux
> 
> I withdrew this series of patches since in glibc, ld.so has
> 
> /* These defined magically in the linker script.  */
> extern char _begin[] attribute_hidden;
> extern char _etext[] attribute_hidden;
> extern char _end[] attribute_hidden;
> 
> it can't reference _end defined in executables.

Yes, I was just about to make a comment in the bugzilla that the
patchset isn't quite right yet.  I've taken what you posted previously
and extended the patches to do what I think is correct.  I'll post
when regression tests finish.

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]