Description
When passing mutually exclusive options, the last occurrence does not override the previous one, leading to inconsistent behavior.
For example:
$ ld.eld --no-warn-mismatch --warn-mismatch ...
# Warning is shown (expected)
$ ld.eld --warn-mismatch --no-warn-mismatch ...
# Warning is still shown (unexpected)
Expected Behavior
Command-line option parsing should follow the standard convention where:
The last occurrence of a conflicting option takes precedence.
So the second invocation should disable the warning:
$ ld.eld --warn-mismatch --no-warn-mismatch ...
# Warning should NOT be shown
Actual Behavior
The --no-warn-mismatch option does not override a prior --warn-mismatch, even when it appears later in the argument list.
Impact
- Breaks expected CLI semantics
- Can lead to confusing or misleading behavior for users
- Makes it difficult to reliably control linker behavior via scripts or build systems
Notes
This issue may affect other pairs of mutually exclusive options that follow a similar pattern (--foo / --no-foo).
Description
When passing mutually exclusive options, the last occurrence does not override the previous one, leading to inconsistent behavior.
For example:
Expected Behavior
Command-line option parsing should follow the standard convention where:
So the second invocation should disable the warning:
$ ld.eld --warn-mismatch --no-warn-mismatch ... # Warning should NOT be shownActual Behavior
The
--no-warn-mismatchoption does not override a prior--warn-mismatch, even when it appears later in the argument list.Impact
Notes
This issue may affect other pairs of mutually exclusive options that follow a similar pattern (
--foo/--no-foo).