[Bug ld/28398] binutils: ld: KEEP ignored

2021-10-12 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=28398

Alan Modra  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #4 from Alan Modra  ---
> The expected behavior is that unreferenced sections .sbilist* are retained 
> due to > the KEEP statement.
Your expectation is not correct.  KEEP is for controlling garbage collection of
sections part of objects loaded by ld.  The behaviour of unix archives is
orthogonal to this, as Jessica commented.

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


[Bug ld/28398] binutils: ld: KEEP ignored

2021-09-30 Thread jrtc27 at jrtc27 dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=28398

Jessica Clarke  changed:

   What|Removed |Added

 CC||jrtc27 at jrtc27 dot com

--- Comment #3 from Jessica Clarke  ---
1. That's because you need -Wl,--whole-archive to include all .o files in the
.a
2. Don't put a dot in the section names, make them valid C identifiers and use
the linker-generated __start_$section/__stop_$section names
3. You will need -Wl,-z,nostart-stop-gc for LLD 13+ because the maintainer
decided breaking coding patterns that have worked for decades is fine (binutils
also accepts the flag as of 2.37 but does not currently default to the broken
behaviour)

If you want a BSD-2-Clause-licensed linker set implementation you can grab
sys/sys/linker_set.h from FreeBSD and alter it however you like.

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


[Bug ld/28398] binutils: ld: KEEP ignored

2021-09-29 Thread xypron.glpk at gmx dot de
https://sourceware.org/bugzilla/show_bug.cgi?id=28398

Heinrich Schuchardt  changed:

   What|Removed |Added

Summary|binutils: KEEP ignored  |binutils: ld: KEEP ignored

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