[llvm-bugs] [Bug 33239] New: SHN_ABS symbols cause --gc-sections to crash

via llvm-bugs llvm-bugs at lists.llvm.org
Tue May 30 19:33:50 PDT 2017


            Bug ID: 33239
           Summary: SHN_ABS symbols cause --gc-sections to crash
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: smeenai at fb.com
                CC: compnerd at compnerd.org, grimar at accesssoftek.com,
                    llvm-bugs at lists.llvm.org, rafael.espindola at gmail.com,
                    ruiu at google.com

% touch empty.bin
% ld.lld -m elf_x86_64 -b binary --relocatable -o empty.o empty.bin
% ld.lld -shared --gc-sections -o libempty.so empty.o
ld.lld: ../../../include/llvm/Support/Casting.h:104: static bool
llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
lld::elf::InputSectionBase; From = lld::elf::SectionBase]: Assertion `Val &&
"isa<> used on a null pointer"' failed.

The assertion is triggered via the cast in [1]. The symbol for which it fails
is _binary_empty_bin_size, which is absolute and has a null Section.

I'm using the first ld.lld command because it was how I came across the issue;
I believe it would generalize to any SHN_ABS symbol, however. I'm not sure if
there are scenarios in which a non-absolute symbol would trigger the assertion.


You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170531/6e10f6e2/attachment.html>

More information about the llvm-bugs mailing list