This is an archive of the discontinued LLVM Phabricator instance.

[Linker/Mover] Implement merging of PIC flags
AbandonedPublic

Authored by davide on Jun 7 2016, 1:38 PM.

Details

Reviewers
rafael
Summary

We always pick the smallest. I think the ordering is Small < Default < Large, but I might have gotten that wrong, so .. comments welcome.
This fixes an LTO issue found while linking the FreeBSD base system.

Diff Detail

Event Timeline

davide updated this revision to Diff 59944.Jun 7 2016, 1:38 PM
davide retitled this revision from to [Linker/Mover] Implement merging of PIC flags.
davide updated this object.
davide added a reviewer: rafael.
davide added a subscriber: llvm-commits.
davide updated this revision to Diff 59946.Jun 7 2016, 1:41 PM

clang-format.

rafael edited edge metadata.Jun 11 2016, 10:47 AM

Sorry, but I think you hit an area that needs quite a bit of redesign :-(

We have Reloc::Model, PICLevel and PIELevel.

Medium term I would like to have have the "assumeDsoLocalBit" in each GV. With that we would need only one pic level of NotPic, SmallPic or BigPIc.

For a shorter term I think what we can do is:

  • Change Reloc::Model to Static, PIC_, DynamicNoPIC, PIE.
  • Delete PIELevel.
  • Change PICLevel to just NotPIC, SmallPIC, BigPic

Right now we cannot really merge because "Default" means different things to different things to different targets.

I would suggest starting by changing PicLevel. After that we can change Reloc::Model and drop PIELevel.

lib/IR/Module.cpp
497

Not sure if Warning is correct.

Maybe we need a "custom" or "minimum"?

davide abandoned this revision.Dec 13 2016, 6:54 PM