llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Missing dynamic init array tags when a linker script explicitly includes the init array sections

Open nga888 opened this issue 7 years ago • 4 comments

Bugzilla Link 43461
Resolution FIXED
Resolved on Sep 27, 2019 02:14
Version unspecified
OS All
Attachments Test case to reproduce issue
CC @MaskRay,@smithp35

Extended Description

The change submitted in r372734, "Make MergeInputSection merging aware of output sections" breaks the attached "dynamic2.s" test. This test is based on "ELF/linkerscript/dynamic.s", except that the linker script explicitly includes the init array sections and is actually used in the link itself.

This issue was noticed as it caused a regression in some local tests.

It looks though the issue is related to the value of "partition" in the OutputSection, the behavior of which has changed as a result of r372734.

nga888 avatar Sep 26 '19 12:09 nga888

No problem and thanks for the quick fix!

nga888 avatar Sep 27 '19 09:09 nga888

Sorry for the trouble. Fixed by D68087/r372996.

I changed the existing linkerscript/dynamic.s instead of adding a new one.

MaskRay avatar Sep 26 '19 17:09 MaskRay

Yes, it is related to SectionBase::partition.

A fix is to assign to sec->partition at LinkerScript.cpp:516.

I'll take a closer look after about 1hr.

MaskRay avatar Sep 26 '19 13:09 MaskRay

assigned to @MaskRay

nga888 avatar Sep 26 '19 12:09 nga888