This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Auto-generated .rodata contents and __attribute__((section))
Hi,
On Wed, 16 May 2018, Richard Biener wrote:
> > Are constant pool entries merged at compile time or at link time? I
> > would presume it should be done at link time because otherwise you're
> > only merging entries within a single compilation unit (which doesn't
> > sound that useful in a big project with hundreds of source files),
> > right?
>
> constant pool entries are merged at compile time. There's no such thing
> as mergeable constant pool sections
Actually there is in ELF. Mergable sections can not only hold strings,
but also fixed-size entities (e.g. 4 or 8 byte constants). Those are
merged content-wise at link time and references properly rewritten. Of
course, those still aren't per-function.
Ciao,
Michael.