[lld] r282118 - Once more unto the strict weak ordering, once more.

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 06:40:50 PDT 2016


> Do you have an example?

PHDRS { kernel  PT_LOAD; }

SECTIONS {
  .rwx : { *(.rwx) } : kernel
  .ro : { *(.ro) } : kernel
}

If you place any ro orphan section to the beginning of the list,
you'll create extra PT_LOAD. In my case you'll get unbootable kernel
:-)


I'm pretty sure (although I can't prove that) that putting orphan
section after the last scripted section with compatible attributes
will do a better job.

2016-09-22 16:34 GMT+03:00 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:
> On 22 September 2016 at 04:44, Eugene Leviant <evgeny.leviant at gmail.com> wrote:
>> This breaks things for me (I'm getting extra PT_LOAD, because RO
>> orphans are placed in the beginning of the section list), so I wonder
>> why don't you simply put RO orphans after RO sections, RW after RW and
>> so on?
>>
>
> Do you have an example? Normally RO sections are the start, so moving
> other RO sections there should not be a problem.
>
> We could put orphans further down the file, but one case to be careful about is
>
> foo : { *(foo) }
> . = align...
> bar : { *(bar) }
>
> with foo RO and bar RW. If a ro section zed is pushed after the
> alignment it will cause the PT_LOAD that starts at bar to be
> unaligned.
>
>
> Cheers,
> Rafael


More information about the llvm-commits mailing list