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

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

 



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@xxxxxxxxxx>:
> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux