[PATCH] D32289: [ELF] - Linkerscript: support combination of linkerscript and --compress-debug-sections.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon May 1 14:08:19 PDT 2017


George Rimar via Phabricator <reviews at reviews.llvm.org> writes:
> Index: ELF/OutputSections.cpp
> ===================================================================
> --- ELF/OutputSections.cpp
> +++ ELF/OutputSections.cpp
> @@ -93,6 +93,10 @@
>        !Name.startswith(".debug_"))
>      return;
>  
> +  // We call maybeCompress() early and for linkerscript case need to assign offsets,
> +  // because that was not done yet. That finalizes mergeable synthetic sections.
> +  assignOffsets();
> +

It seems wrong to this in here.

In the most general case (like for thunks), we will have to run
assignAddresses multiple times.

For debug info it should be trivial to change processCommands to compute
the offsets.

BTW, should we avoid compressing or error out if the linker script has a
symbol assignment? For example:

SECTIONS {
.debug_str : { *(foo) sym=.; *(bar) }
}

Cheers,
Rafael


More information about the llvm-commits mailing list