Index: lld/trunk/ELF/LinkerScript.cpp =================================================================== --- lld/trunk/ELF/LinkerScript.cpp +++ lld/trunk/ELF/LinkerScript.cpp @@ -135,8 +135,6 @@ // Update to location counter means update to section size. if (InSec) expandOutputSection(Val - Dot); - else if (Val > Dot) - expandMemoryRegions(Val - Dot); Dot = Val; } Index: lld/trunk/test/ELF/linkerscript/memory5.test =================================================================== --- lld/trunk/test/ELF/linkerscript/memory5.test +++ lld/trunk/test/ELF/linkerscript/memory5.test @@ -5,9 +5,9 @@ # RUN: llvm-objdump -section-headers %t.so | FileCheck %s # CHECK: 1 .text 00000001 0000000000042000 -# CHECK-NEXT: 2 .data 00000001 0000000000044001 +# CHECK-NEXT: 2 .data 00000001 0000000000042001 -## Test that assign to Dot changes the position in a memory region. +## Test that assigning to Dot does not change the position in a memory region. MEMORY { ram (wxa) : ORIGIN = 0x42000, LENGTH = 0x100000