mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-26 22:34:39 +00:00
[MC] Don't crash when trying to emit a relocation against .bss.
Turn that into an error instead. llvm-svn: 276783
This commit is contained in:
parent
e4279b249c
commit
ea4f924624
@ -575,8 +575,8 @@ void MCAssembler::writeSectionData(const MCSection *Sec,
|
||||
// into a virtual section. This is to support clients which use standard
|
||||
// directives to fill the contents of virtual sections.
|
||||
const MCDataFragment &DF = cast<MCDataFragment>(F);
|
||||
assert(DF.fixup_begin() == DF.fixup_end() &&
|
||||
"Cannot have fixups in virtual section!");
|
||||
if (DF.fixup_begin() != DF.fixup_end())
|
||||
report_fatal_error("cannot have fixups in virtual section!");
|
||||
for (unsigned i = 0, e = DF.getContents().size(); i != e; ++i)
|
||||
if (DF.getContents()[i]) {
|
||||
if (auto *ELFSec = dyn_cast<const MCSectionELF>(Sec))
|
||||
|
9
test/MC/X86/reloc-bss.s
Normal file
9
test/MC/X86/reloc-bss.s
Normal file
@ -0,0 +1,9 @@
|
||||
# RUN: not llvm-mc -filetype=obj -triple=x86_64-linux-gnu %s 2>&1 | FileCheck %s
|
||||
# CHECK: LLVM ERROR: cannot have fixups in virtual section!
|
||||
|
||||
.section .init_array,"awT",@nobits
|
||||
|
||||
.hidden patatino
|
||||
.globl patatino
|
||||
patatino:
|
||||
movl __init_array_start, %eax
|
Loading…
x
Reference in New Issue
Block a user