49 lines · plain
1REQUIRES: x862 3RUN: split-file %s %ts4RUN: llvm-mc -filetype=obj -triple=x86_64 %ts/s -o %t.o5 6## Check that a non-allocatable section is not assigned to a memory region by7## matching the section/region properties. Previously, that could lead to an8## "error: section '.nonalloc' will not fit in region 'RAM'".9 10RUN: ld.lld %t.o -T %ts/t --fatal-warnings -o /dev/null11 12## Check that an explicit assignment is ignored for a non-allocatable section.13## Previously, that also could lead to the same error.14 15RUN: ld.lld %t.o -T %ts/t2 -o /dev/null 2>&1 | FileCheck %s --check-prefix=WARN16 17WARN: warning: ignoring memory region assignment for non-allocatable section '.nonalloc'18 19#--- s20 .global _start21_start:22 23 ## Note: a "writable" section is used because lld does not fully support24 ## memory region attribute "r" at the moment.25 .section .nonalloc,"w"26 .zero 0x100027 28#--- t29MEMORY30{31 RAM (rwx) : ORIGIN = 0x8000, LENGTH = 0x10032}33 34SECTIONS35{36 .nonalloc : { *(.nonalloc) }37}38 39#--- t240MEMORY41{42 RAM (rwx) : ORIGIN = 0x8000, LENGTH = 0x10043}44 45SECTIONS46{47 .nonalloc : { *(.nonalloc) } > RAM48}49