[PATCH] D70468: [ELF] Error if -Ttext-segment is specified

Troy Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 12:03:18 PST 2020


troyj added a comment.

> For this -Ttext-segment we faced a decision whether we should silently interpret an option incorrectly or leave it as an hard error.

Understood, but since the incorrect interpretation was silently "working," it is necessary for us to remove this change until the option is no longer used anywhere.

> I know the documentation says lld aims to be a drop-in placement of GNU linkers, but in my opinion in some cases we really need downstream users to do some necessary refactorings to adopt lld. This is like adopting clang.

It's not quite the same.  We have adopted Clang, but Clang (and GNU) provide a -fuse-ld option, which means that the choice of linker is actually exposed to the user.  We prefer to use lld as our default because we can more easily modify its source as necessary (such as in this case), but in practice the reason that our users sometimes need to select a specific linker is to workaround bugs in bfd/gold/lld.  Normally the bugs present themselves as relocation errors that appear with only one of the three linkers.  Therefore, the users need to be able to swap between the different linkers and any option that is not supported by all linkers requires additional effort -- either educating the user to be aware and change their options, or having scripts that automatically detect the active linker and hide the differences.  Either takes time to implement and needs to be implemented before we leave the hard error in place.

> I remember that Peter Smith once said we probably need to consider a deprecation mechanism

Yes, that would have been appreciated here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70468/new/

https://reviews.llvm.org/D70468





More information about the llvm-commits mailing list