Skip to content
Commit 3deff866 authored by Fangrui Song's avatar Fangrui Song
Browse files

[ELF] Respect NonAlloc when copying flags from the previous sections

Summary:
If the output section contains only symbol assignments, we copy flags
from the previous sections. Don't set SHF_ALLOC if NonAlloc is true.

We also have to change the type from SHT_NOBITS to SHT_PROGBITS.
In ld.bfd, bfd_elf_get_default_section_type maps non-alloctable sections to SHT_PROGBITS.
Non-alloctable SHT_NOBITS sections do not make sense.

Fixes PR38626

Differential Revision: https://reviews.llvm.org/D59986

llvm-svn: 358650
parent 66a9d0f8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment