This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: Compiling with -fdata-sections doesn't put the constant in the section expected


Hi Andrew,

Thanks for your reply,

I try with

gcc -c -o hello.o -ffunction-sections -fdata-sections hello.c -Os

But same result the data are put in section depending on their length
and not on the function where they are declared (due to the
fmerge-constants optimization).
I got a .rodata.str1.1 section.

gcc -c -o hello.o -ffunction-sections -fdata-sections hello.c -Os
-fno-merge-constants
And same result as without -Os argument

After the link my string used will stay in my ELF :S

Regards,
Clement

2014-10-01 11:42 GMT+02:00 Andrew Haley <aph@redhat.com>:
> On 01/10/14 10:30, ClÃment PÃron wrote:
>> I have different .text.__function__
>>
>> But i have only one .rodata instead of different .rodata.__function__
>>
>> Thanks for your help,
>
> Now turn on the optimizer.  :-)
>
> Andrew.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]