Skip to content

Commit fc0007d

Browse files
committed
Add undefined symbol test
1 parent fba75e6 commit fc0007d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lld/ELF/MarkLive.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ template <class ELFT> void MarkLive<ELFT>::printWhyLive(Symbol *s) const {
248248
// If the symbol isn't live, return.
249249
if (!whyLive.contains(s)) {
250250
auto *d = dyn_cast<Defined>(s);
251-
// TODO: Test
252251
if (!d)
253252
return;
254253
// TODO: Test both cases

lld/test/ELF/why-live.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ jmp test_from_unsized
4242
.section .test_dead,"ax",@progbits
4343
test_dead:
4444
jmp test_dead
45+
46+
## Undefined symbols are not considered live.
47+
# RUN: ld.lld %t.o -o /dev/null --gc-sections --why-live=test_undef -u test_undef | count 0
48+

0 commit comments

Comments
 (0)