In baremetal::Linker::ConstructJob, LinkerInput is handled prior to T_Group options,
but on the other side in RISCV::Linker::ConstructJob, it is opposite.
We want it to be consistent whether users are using RISCV::Linker or baremetal::Linker.
Differential D100615
[RISCV][Driver] Make the ordering of CmdArgs consistent between RISCV::Linker and baremetal::Linker arcbbb on Apr 15 2021, 8:00 PM. Authored by
Details In baremetal::Linker::ConstructJob, LinkerInput is handled prior to T_Group options, We want it to be consistent whether users are using RISCV::Linker or baremetal::Linker.
Diff Detail
Event TimelineComment Actions Few more word for this issue, the option order is matter for linker both for GNU ld and lld, in the test @arcbbb provided, ABC will treat as undefined in a.lds if the order is wrong. Comment Actions LG. A better test should have a few more stuff, see Xlinker-args.c
While GNU people may not like it, I think relying on the order between --defsym and -T is highly problematic: https://sourceware.org/pipermail/libc-alpha/2020-March/111920.html This comment was removed by kito-cheng. |