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/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 +#CHECK: } +#CHECK-NEXT: ProgramHeader { +#CHECK-NEXT: Type: PT_GNU_STACK +#CHECK: } +#CHECK-NEXT: ProgramHeader { +#CHECK-NEXT: Type: PT_GNU_RELRO +#CHECK: } #CHECK-NEXT:] ## Check we do not allow referencing sections that do not exist.