This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Fwd: Compiling with -fdata-sections doesn't put the constant in the section expected
- From: Andrew Haley <aph at redhat dot com>
- To: ClÃment PÃron <peron dot clem at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 01 Oct 2014 11:02:28 +0100
- Subject: Re: Fwd: Compiling with -fdata-sections doesn't put the constant in the section expected
- Authentication-results: sourceware.org; auth=none
- References: <CAJiuCcfJHXCRAnj4v7fhoAcwWAyWLN2z_9+Seygqx05iJUQCtw at mail dot gmail dot com> <CAJiuCceKWtpiJdySnft_K_9FkxXvBKiXt9U2EYmSnWZHr26nyA at mail dot gmail dot com> <CAJiuCcd0PsOs3cw=Qfz5XJO1rY2dyAX8j-XqyZ6tYuN-OWgX1Q at mail dot gmail dot com> <542BCC98 dot 5030901 at redhat dot com> <CAJiuCcf6CrAA=t8Sb4bEvhMYkxY82tzNXc4p+czvn_Z67M=d7A at mail dot gmail dot com>
On 01/10/14 10:48, ClÃment PÃron wrote:
> After the link my string used will stay in my ELF :S
I am quite baffled. Maybe there is some reason this doesn't work, but
right now I can't think of what it might be. Unused strings are removed
from static functions, as you'd expect.
I can't think of any reason that each string should not be put into a
unique section. It's need a unique name for each string, but that isn't
hard.
Andrew.