[llvm-bugs] [Bug 31064] New: assertion failure in llvm::MCSymbol::getSection for arm assembly input using EABI unwind and __aeabi_unwind_cpp_pr0 symbol with absolute value

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 18 13:59:34 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=31064

            Bug ID: 31064
           Summary: assertion failure in llvm::MCSymbol::getSection for
                    arm assembly input using EABI unwind and
                    __aeabi_unwind_cpp_pr0 symbol with absolute value
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: roland at hack.frob.com
                CC: llvm-bugs at lists.llvm.org, phosek at chromium.org
    Classification: Unclassified

EABI unwind directives cause an implicit reference to the magic symbol
__aeabi_unwind_cpp_pr0.  If that symbol is defined locally to an absolute
value, the assembler gets an assertion failure.

$ cat foo.s
.text

__aeabi_unwind_cpp_pr0 = 0xdeadbeef

foo:    .fnstart
    bx lr
    .fnend
$ ../llvm/build/bin/clang -O2 --target=arm-linux -c foo.s 
clang-4.0: warning: unknown platform, assuming -mfloat-abi=soft
clang-4.0: ../include/llvm/MC/MCSymbol.h:265: llvm::MCSection
&llvm::MCSymbol::getSection(bool) const: Assertion `isInSection(SetUsed) &&
"Invalid accessor!"' failed.
#0 0x00000000022cc93c llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/Support/Unix/Signals.inc:402:11
#1 0x00000000022cce29 PrintStackTraceSignalHandler(void*)
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/Support/Unix/Signals.inc:466:1
#2 0x00000000022cb1b3 llvm::sys::RunSignalHandlers()
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/Support/Signals.cpp:45:5
#3 0x00000000022cd184 SignalHandler(int)
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/Support/Unix/Signals.inc:256:1
#4 0x00007f9d8411e330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#5 0x00007f9d82d11c37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#6 0x00007f9d82d15028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#7 0x00007f9d82d0abf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#8 0x00007f9d82d0aca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#9 0x0000000000f5dd6a llvm::MCSymbol::getSection(bool) const
/usr/local/google/home/mcgrathr/tq/llvm/build/../include/llvm/MC/MCSymbol.h:266:27
#10 0x0000000001ecf5ad (anonymous
namespace)::ELFObjectWriter::shouldRelocateWithSymbol(llvm::MCAssembler const&,
llvm::MCSymbolRefExpr const*, llvm::MCSymbol const*, unsigned long, unsigned
int) const
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/MC/ELFObjectWriter.cpp:571:15
#11 0x0000000001ece37d (anonymous
namespace)::ELFObjectWriter::recordRelocation(llvm::MCAssembler&,
llvm::MCAsmLayout const&, llvm::MCFragment const*, llvm::MCFixup const&,
llvm::MCValue, bool&, unsigned long&)
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/MC/ELFObjectWriter.cpp:690:8
#12 0x0000000001ef1786 llvm::MCAssembler::handleFixup(llvm::MCAsmLayout const&,
llvm::MCFragment&, llvm::MCFixup const&)
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/MC/MCAssembler.cpp:629:17
#13 0x0000000001ef1fcd llvm::MCAssembler::layout(llvm::MCAsmLayout&)
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/MC/MCAssembler.cpp:708:41
#14 0x0000000001ef2373 llvm::MCAssembler::Finish()
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/MC/MCAssembler.cpp:721:21
#15 0x0000000001f45b3f llvm::MCObjectStreamer::FinishImpl()
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/MC/MCObjectStreamer.cpp:584:1
#16 0x0000000001f21ce7 llvm::MCELFStreamer::FinishImpl()
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/MC/MCELFStreamer.cpp:631:1
#17 0x0000000000f5caef (anonymous namespace)::ARMELFStreamer::FinishImpl()
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:1063:1
#18 0x0000000001f4e1ec llvm::MCStreamer::Finish()
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/MC/MCStreamer.cpp:728:1
#19 0x0000000001f7e752 (anonymous namespace)::AsmParser::Run(bool, bool)
/usr/local/google/home/mcgrathr/tq/llvm/build/../lib/MC/MCParser/AsmParser.cpp:828:9
#20 0x0000000000cbbecd ExecuteAssembler((anonymous
namespace)::AssemblerInvocation&, clang::DiagnosticsEngine&)
/usr/local/google/home/mcgrathr/tq/llvm/build/../tools/clang/tools/driver/cc1as_main.cpp:425:12
#21 0x0000000000cb8c1e cc1as_main(llvm::ArrayRef<char const*>, char const*,
void*)
/usr/local/google/home/mcgrathr/tq/llvm/build/../tools/clang/tools/driver/cc1as_main.cpp:505:45
#22 0x0000000000ca576b ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/usr/local/google/home/mcgrathr/tq/llvm/build/../tools/clang/tools/driver/driver.cpp:301:5
#23 0x0000000000ca422c main
/usr/local/google/home/mcgrathr/tq/llvm/build/../tools/clang/tools/driver/driver.cpp:380:5
#24 0x00007f9d82cfcf45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#25 0x0000000000ca33ba _start
(/usr/local/google/home/mcgrathr/tq/llvm/build/bin/clang-4.0+0xca33ba)
Stack dump:
0.    Program arguments:
/usr/local/google/home/mcgrathr/tq/llvm/build/bin/clang-4.0 -cc1as -triple
armv4t--linux -filetype obj -main-file-name foo.s -target-cpu arm7tdmi
-target-feature -neon -target-feature -crypto -target-feature +strict-align
-fdebug-compilation-dir /usr/local/google/home/mcgrathr/tq/magenta
-dwarf-debug-producer clang version 4.0.0 (trunk 287358) (llvm/trunk 287360)
-dwarf-version=4 -mrelocation-model static -o foo.o foo.s 
clang-4.0: error: unable to execute command: Aborted (core dumped)
clang-4.0: error: clang integrated assembler command failed due to signal (use
-v to see invocation)
clang version 4.0.0 (trunk 287358) (llvm/trunk 287360)
Target: arm--linux
Thread model: posix
InstalledDir: /usr/local/google/home/mcgrathr/tq/magenta/../llvm/build/bin
clang-4.0: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-4.0: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.
$

-- 
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/20161118/b0cce9a9/attachment-0001.html>


More information about the llvm-bugs mailing list