This matches bfd.ld's behavior
Diff Detail
Event Timeline
lld/ELF/Driver.cpp | ||
---|---|---|
717 ↗ | (On Diff #503587) | Seems like the semantics of Default should change, otherwise it's not the default?.. |
lld/ELF/Driver.cpp | ||
---|---|---|
717 ↗ | (On Diff #503587) | Agreed. The only meaning of Default really is what the final case in shouldKeepInSymtab does, and I think it makes more sense to just change that one if to add an || config->emachine == EM_RISCV there. |
lld/ELF/Writer.cpp | ||
---|---|---|
655 | Comment is now wrong... |
lld/ELF/Writer.cpp | ||
---|---|---|
655 | Indeed. This merits a nontrivial comment anyway, something like " * RISC-V, where the assembler doesn't discard them by default as other targets do, so as to facilitate relaxation that can move things around and would break if labels were reduced to section offsets". |
lld/ELF/Writer.cpp | ||
---|---|---|
653 |
when it's already implicitly or'ed is weird, be consistent and do
|
Anyway, this definitely still merits a review from @MaskRay given his commit to tackle the problem differently
Yeah; I wish that we don't do this. The target difference doesn't seem useful.
IIRC even a RISC-V binutils maintainers said the behavior is strange but perhaps people don't have enough motivation to fix that.
We don't really need to copy the behavior as Clang Driver has passed -X.
when it's already implicitly or'ed is weird, be consistent and do