[PATCH] D29327: [LLD][ELF] Use Synthetic Sections for Thunks (try 2)

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 12:57:34 PST 2017


Peter Smith <peter.smith at linaro.org> writes:

> It is possible, although somewhat contrived, to mix executable and
> non-executable input sections within the same output section with
> linker scripts. From what I can tell it isn't possible for linker
> generated Output Sections.
>
> For example:
> SECTIONS {
>     .text : { *(.text) *(.rodata) }
> }
> I've checked that with a simple assembler file:
> .syntax unified
>  .text
>  nop
>  .rodata
>  .word 10
>
> We get one .text OutputSection (--Map)
> 00000000 00000008     4 .text
> 00000000 00000004     4         .text
> 00000000 00000004     4                 t.o
> 00000000 00000000     0                         $a.0
> 00000004 00000004     1         .rodata
> 00000004 00000004     1                 t.o
> 00000004 00000000     0                         $d.1

But the output section is executable. So why is it important to consider
the flags of the individual input sections when placing the thunks?

Cheers,
Rafael


More information about the llvm-commits mailing list