svn commit: r339350 - head/contrib/elftoolchain/elfcopy

Antoine Brodin antoine at freebsd.org
Mon Oct 15 09:43:49 UTC 2018


On Sat, Oct 13, 2018 at 11:26 PM Ed Maste <emaste at freebsd.org> wrote:
>
> Author: emaste
> Date: Sat Oct 13 21:26:07 2018
> New Revision: 339350
> URL: https://svnweb.freebsd.org/changeset/base/339350
>
> Log:
>   elfcopy: delete filter_reloc, it is broken and unnecessary
>
>   elfcopy contained logic to filter individual relocations in STRIP_ALL
>   mode.  However, this is not valid; relocations emitted by the linker are
>   required, unless they apply to an entire section being removed (which is
>   handled by other logic in elfcopy).
>
>   Note that filter_reloc was also buggy: for RELA relocation sections it
>   operated on uninitialized rel.r_info resulting in invalid operation.
>
>   The logic most likely needs to be inverted: instead of removing
>   relocations because their associated symbols are being removed, we must
>   keep symbols referenced by relocations.  That said, in practice we do
>   not encounter this code path today: objects being stripped are either
>   dynamically linked binaries which retain .dynsym, or static binaries
>   with no relocations.
>
>   Just remove filter_reloc.  This fixes certain cases including statically
>   linked binaries containing ifuncs.  Stripping binaries with relocations
>   referencing removed symbols was already broken, and after this change
>   may still be broken in a different way.
>
>   PR:           232176
>   Reviewed by:  kaiw, kib, markj
>   Approved by:  re (rgrimes)
>   MFC after:    1 month
>   Sponsored by: The FreeBSD Foundation
>   Differential Revision:        https://reviews.freebsd.org/D17519
>
> Modified:
>   head/contrib/elftoolchain/elfcopy/sections.c

Hi,

This commit broke lang/gcc* :
http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc48-4.8.5_9.log
http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc49-4.9.4_8.log
http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc5-5.5.0_5.log
http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc7-7.3.0_5.log
http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p482125_s339356/logs/errors/gcc8-8.2.0_1.log
etc.

Antoine


More information about the svn-src-head mailing list