On Tue, Jul 04, 2023 at 12:31:33PM +0000, RVP wrote: > On Tue, 4 Jul 2023, RVP wrote: > > > I think lld(1) does things differently. I'll check this later... > > > > And I was right! On Linux (what I have at hand now): > > ``` > $ clang -fuse-ld=lld -Wl,-Map=map.txt -static -s -o foo foo.c -L. -lmm > > $ fgrep -A3 ./libmm.a map.txt > [...] > -- > 224c30 224c30 13 1 > ./libmm.a(calloc.o):(.text) > 224c30 224c30 13 1 calloc > 224c50 224c50 ac3 16 > /lib/x86_64-linux-gnu/libc.a(libc-start.o):(.text) > 224c50 224c50 398 1 > get_common_indices.constprop.1 > -- > 225f71 225f71 2d 1 > ./libmm.a(malloc.o):(.text) > 225f71 225f71 f 1 malloc > 225f80 225f80 13 1 realloc > 225f93 225f93 b 1 free > -- > [...] > ``` > > This is what I had expected from GNU ld(1) also...
lld and gold behave like an implicit group around all libraries. Joerg