Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2018 17:38:21 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 225128] [exp-run] with LLD_BOOTSTRAP on i386
Message-ID:  <bug-225128-7788-sV2RVKde1G@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-225128-7788@https.bugs.freebsd.org/bugzilla/>
References:  <bug-225128-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D225128

Mark Johnston <markj@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markj@FreeBSD.org

--- Comment #25 from Mark Johnston <markj@FreeBSD.org> ---
(In reply to Antoine Brodin from comment #23)
I partially diagnosed the issue with nntpcache (which also seems to occur on
amd64). The issue is around the _end symbol, which marks the end of the .bss
section. When libc.so is linked with GNU ld, the _end symbol's section inde=
x is
SHN_ABS (i.e., the symbol value is not affected by relocations). When it's
linked with lld, _end's section index is that of .bss. When linking an
executable against an lld-linked libc.so, GNU ld does not include _end in t=
he
executable's dynamic symbol table. The crash then occurs because the execut=
able
uses sbrk(3), curbrk is initialized to &_end, and because the executable do=
es
not export _end, libc initializes curbrk to the address of its own internal
_end symbol, which is wrong. The problem occurs when linking an executable =
with
ld from binutils 2.30 as well.

I hacked lld to emit _end with a shndx of SHN_ABS, and when using a libc
compiled with that hack I can compile news/nntpcache. I have not been able =
to
reproduce the other build failures so far.

I'm having trouble figuring out why GNU ld refuses to emit _end in this
scenario. _end is synthesized using the system linker scripts, and I haven't
been able to figure out exactly what logic is causing it to be excluded. It
seems incorrect that GNU ld using SHN_ABS this way in the first place:
obviously the value of _end is going to be modified by a relocation when
libc.so is loaded.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-225128-7788-sV2RVKde1G>