Page MenuHomePhabricator

[ELF] Bypass section type check.
ClosedPublic

Authored by evgeny777 on Jan 16 2017, 1:42 AM.

Details

Summary

r291107 has broken things for me, because I have following in my linker script:

.data : {
  *(.data*)
  /* .. other "aw" sections go here  ... */
  PROVIDE_HIDDEN(__init_array_start = .);
  *(.init_array*)
  PROVIDE_HIDDEN(__init_array_end = .);
}

This patch bypasses type check when section comes from linker script (it might make sense to eliminate it completely, though).

Diff Detail

Repository
rL LLVM

Event Timeline

evgeny777 updated this revision to Diff 84524.Jan 16 2017, 1:42 AM
evgeny777 retitled this revision from to [ELF] Bypass section type check..
evgeny777 updated this object.
evgeny777 added reviewers: ruiu, rafael.
evgeny777 set the repository for this revision to rL LLVM.
evgeny777 added a project: lld.
evgeny777 added subscribers: grimar, ikudrin, llvm-commits.
ruiu edited edge metadata.Jan 16 2017, 10:31 PM

I think I want to avoid adding an "if linker script" condition and instead want to solve a problem in a generic way.

So what are we trying to check there? If the check is too picky, we should just remove it. If it is needed for some critical errors (such as turning non-executable sections to executable sections), we should check for that.

I don't know why this type check was added, but it prevents from joining .init_array with any other section by linker script.
If Rafael doesn't mind removing it I'm ok with that as well.

Rafael, can you please look at this? Thanks.

This revision was automatically updated to reflect the committed changes.