It is possible for a link to fail with an undefined reference, unless --gc-sections is specified, removing the reference in the process. This doesn't look to be tested anywhere explicitly, so I thought it useful to add a test for it to ensure the behaviour is maintained.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
LGTM
test/ELF/gc-sections-no-undef-error.s | ||
---|---|---|
7–8 ↗ | (On Diff #130613) | You can write this in one line. not ld.lld %t.o -o %t 2>&1 | FileCheck %s |
test/ELF/gc-sections-no-undef-error.s | ||
---|---|---|
7–8 ↗ | (On Diff #130613) | Thanks Rui. I thought I'd read somewhere on the mailing lists advising against doing that for some reason, but I can't find it now, so I may be misremembering it. |
Comment Actions
I thought I'd read somewhere on the mailing lists advising against doing that for some reason, but I can't find it now, so I may be misremembering it.
Not sure if it is actually discouraged, but at least in lld it's conventional.