[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/22677] ld -r --gc-collect does not KEEP .init_array/.fini_array

From: address@hidden
Subject: [Bug ld/22677] ld -r --gc-collect does not KEEP .init_array/.fini_array
Date: Fri, 05 Jan 2018 09:52:33 +0000


--- Comment #1 from David Leonard <address@hidden> ---
Submitted too early, sorry. I mean --gc-section not --gc-collect.


$ cat L.c
int L4var = 4;
int L5var;
int L5init() {
        L5var = 5;
static void Lconstructor() {

$ gcc -ffunction-sections -fdata-sections -c -o L.o L.c
$ ld -r --gc-section L.o -u L4var -o libL.o
$ nm libL.o
0000000000000000 D L4var

With workaround:

$ ld -r --gc-section L.o -u L4var -o libL.o fixup.ldscript 
ld: warning: fixup.ldscript contains output sections; did you forget -T?
$ nm libL.o
0000000000000000 D L4var
0000000000000000 T L5init
0000000000000004 C L5var
0000000000000000 t Lconstructor

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]