Make last conflicting option take precedence#1190
Conversation
There was a problem hiding this comment.
It should apply to these options too:
--gc-sections / --no-gc-sections
--export-dynamic / --no-export-dynamic
--relax / --no-relax (riscv)
Unrelated to this PR, these options are hard errors today when both forms are present; we might want to relax them in the future for consistency:
--enable-linker-version / --disable-linker-version
--thread-count / --no-threads
--enable-new-dtags / --disable-new-dtags
Another tangent, Hexagon has no --no-relax option like riscv does, and the --help text for hexagon's --relax says "Enable Hexagon Relaxation (default behavior)", but it is not actually the default.
7a3458c to
f066933
Compare
quic-areg
left a comment
There was a problem hiding this comment.
LGTM aside from the minor test comment
| DEMANGLE: Verbose: Adding symbol foo() | ||
| NODEMANGLE: Verbose: Adding symbol _Z3foov | ||
| CHECKSECT: section .comment file range overlaps with .text | ||
| NOCHECKSECT-NOT: section .comment file range overlaps with .text |
There was a problem hiding this comment.
This looks like a bug ?
There was a problem hiding this comment.
You mean a bug in my test or that the check itself found a bug?
If it is a bug in eld then awesome. Since you understand why it is a bug then raise an issue. Great catch.
Update option handling so that the last occurrence of conflicting flags (e.g. --demangle/--no-demangle) takes precedence, matching standard command-line semantics and user expectations. Fix: qualcomm#1179 Signed-off-by: Steven Ramirez Rosa <ramirezr@qti.qualcomm.com>
Update option handling so that the last occurrence of conflicting flags (e.g. --warn-mismatch/--no-warn-mismatch) takes precedence, matching standard command-line semantics and user expectations.
Fix: #1179