[PATCH] D27415: [ELF] - Replace MergeOutputSection with synthetic input section MergeSection.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 12:08:52 PST 2017


George Rimar via Phabricator <reviews at reviews.llvm.org> writes:

> grimar added a comment.
>
> I found next script in linux kernel:
>
>   .rodata : {
>    *(.rodata)
>    *(.rodata.*)
>    . = ALIGN(16);
>    video_cards = .;
>    *(.videocards)
>    video_cards_end = .;
>   }

arch/x86/realmode/rm/realmode.lds.S I assume?


> We generate video_cards == video_cards_end here, what is wrong and happens because we generate multiple .rodata*.
> That what this patch had to fix, seems it is very good now justification about that we need this logic.
> And I worked on a new patch basing on this one today (to have a cleaner version and to refresh it in mind).

I am confused. The videocards section is not SHF_MERGE, is it? So, even
if we only map input merge sections to synthetic sections in a common
place before linker scripts, this should work:

>    *(.rodata)
>    *(.rodata.*)

will find the various synthetic sections named .rodata.

>    . = ALIGN(16);
>    video_cards = .;

should be trivial.

>    *(.videocards)

will find the plain videocards sections.

>    video_cards_end = .;

should be trivial.

I don't doubt that we will at some point need to support the linker
script driving the input to synthetic mapping, but I don't see why this
is the example that requires it.


Cheers,
Rafael


More information about the llvm-commits mailing list