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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 11:26:15 PST 2020


MaskRay added a comment.

In D70468#1857432 <https://reviews.llvm.org/D70468#1857432>, @troyj wrote:

> I appreciate your point of view, but it's not very pragmatic given how "baked in" an old option like this is across existing environments.  I have reverted downstream and we will continue to support the option ourselves until it can be phased out with less of an impact.


I appreciate your feedback. In some cases there are still subtle differences among linkers. For this -Ttext-segment we faced a decision whether we should silently interpret an option incorrectly or leave it as an hard error. We chose the latter. 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. If a project enables -Werror and clang happens to report more diagnostics. That project may have to do some adaptations. Clang developers will assuredly consider the positive rate when deciding whether an option should be enabled by default. This may be more so for closed source software.

I remember that Peter Smith once said we probably need to consider a deprecation mechanism. For some more common options, if we eventually want to make some semantic changes, we should to consider that. For this `-Ttext-segment`, however, I don't think making it warning first then upgrading it to an error in a later release is worth the effort.


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