From 8c7fe0e9d04bd602356c2371d37c4ed5fad3cd35 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 9 Sep 2010 16:23:33 +0000 Subject: [PATCH] MC: Give a (lame) hard error if a .org directive would create an unreasonably large object file (> 1GB). llvm-svn: 113494 --- lib/MC/MCAssembler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index f0e1d7fbc21..8db1536d2d5 100644 --- a/lib/MC/MCAssembler.cpp +++ b/lib/MC/MCAssembler.cpp @@ -447,7 +447,7 @@ uint64_t MCAssembler::ComputeFragmentSize(MCAsmLayout &Layout, // FIXME: We need a way to communicate this error. int64_t Offset = TargetLocation - FragmentOffset; - if (Offset < 0) + if (Offset < 0 || Offset >= 0x40000000) report_fatal_error("invalid .org offset '" + Twine(TargetLocation) + "' (at offset '" + Twine(FragmentOffset) + "'");