From 1c08e9f5cee04c0164a5f8408e6854ce64fe3d29 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Fri, 16 Feb 2018 10:42:58 +0000 Subject: [ELF] - Support COPY, INFO, OVERLAY output sections attributes. This is PR36298. (COPY), (INFO), (OVERLAY) all have the same effect: section should be marked as non-allocatable. (https://www.eecs.umich.edu/courses/eecs373/readings/Linker.pdf, 3.6.8.1 Output Section Type) Differential revision: https://reviews.llvm.org/D43071 llvm-svn: 325331 --- lld/ELF/LinkerScript.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lld/ELF/LinkerScript.cpp') diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 309755e6197..d7fbd62c983 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -436,6 +436,8 @@ void LinkerScript::processSectionCommands() { Sec->SectionIndex = I++; if (Sec->Noload) Sec->Type = SHT_NOBITS; + if (Sec->NonAlloc) + Sec->Flags &= ~(uint64_t)SHF_ALLOC; } } Ctx = nullptr; -- cgit v1.2.3