This patch moves the checking for too large offsets into merge sections earlier. Without this change the large offset generated in the added test-case will cause an assert (as it happens to be a value reserved as a "tombstone" in the DenseMap implementation) when OffsetMap is queried in getSectionPiece(). To simplify the code and avoid future mistakes I have refactored so that there is only one function that looks up offsets in the OffsetMap. Differential Revision: https://reviews.llvm.org/D51180 llvm-svn: 341206
12 lines
346 B
ArmAsm
12 lines
346 B
ArmAsm
// REQUIRES: x86
|
|
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
|
// RUN: not ld.lld %t.o -o /dev/null -shared 2>&1 | FileCheck %s
|
|
|
|
.section .rodata.str1.1,"aMS",@progbits,1
|
|
.asciz "abc"
|
|
|
|
.data
|
|
.long .rodata.str1.1 + 4
|
|
|
|
// CHECK: merge-string-error.s.tmp.o:(.rodata.str1.1): offset is outside the section
|