Index: lib/ObjectYAML/ELFYAML.cpp =================================================================== --- lib/ObjectYAML/ELFYAML.cpp +++ lib/ObjectYAML/ELFYAML.cpp @@ -52,6 +52,8 @@ ECase(PT_PHDR); ECase(PT_TLS); ECase(PT_GNU_EH_FRAME); + ECase(PT_GNU_STACK); + ECase(PT_GNU_RELRO); #undef ECase IO.enumFallback(Value); } Index: test/tools/llvm-objcopy/ELF/marker-segment.test =================================================================== --- test/tools/llvm-objcopy/ELF/marker-segment.test +++ test/tools/llvm-objcopy/ELF/marker-segment.test @@ -43,7 +43,7 @@ Align: 0x1000 Sections: - Section: .data - - Type: 0x6474e551 # GNU_STACK + - Type: PT_GNU_STACK Flags: [ PF_R, PF_W ] VAddr: 0x0000 PAddr: 0x0000 Index: test/tools/yaml2obj/program-header.yaml =================================================================== --- test/tools/yaml2obj/program-header.yaml +++ test/tools/yaml2obj/program-header.yaml @@ -37,6 +37,9 @@ PAddr: 0xFFFF2000 Sections: - Section: .data + - Type: PT_GNU_EH_FRAME + - Type: PT_GNU_STACK + - Type: PT_GNU_RELRO #CHECK: ProgramHeaders [ #CHECK-NEXT: ProgramHeader { @@ -64,6 +67,15 @@ #CHECK-NEXT: ] #CHECK-NEXT: Alignment: 4096 #CHECK-NEXT: } +#CHECK-NEXT: ProgramHeader { +#CHECK-NEXT: Type: PT_GNU_EH_FRAME (0x6474E550) +#CHECK: } +#CHECK-NEXT: ProgramHeader { +#CHECK-NEXT: Type: PT_GNU_STACK (0x6474E551) +#CHECK: } +#CHECK-NEXT: ProgramHeader { +#CHECK-NEXT: Type: PT_GNU_RELRO (0x6474E552) +#CHECK: } #CHECK-NEXT:] ## Check we do not allow referencing sections that do not exist.