Index: ELF/LinkerScript.cpp =================================================================== --- ELF/LinkerScript.cpp +++ 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: test/ELF/linkerscript/memory5.test =================================================================== --- test/ELF/linkerscript/memory5.test +++ 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 assign to Dot does not change the position in a memory region. MEMORY { ram (wxa) : ORIGIN = 0x42000, LENGTH = 0x100000