<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">This test is failing on Darwin.<div class=""><br class=""></div><div class=""><span title="Compile Error" style="box-sizing: border-box; font-family: monospace; font-size: 14px; white-space: pre-wrap; color: white; background-color: red;" class="">/Users/buildslave/jenkins/workspace/clang-stage1-RA/llvm-project/llvm/test/tools/yaml2obj/elf-custom-null-section.yaml:79:9: error: SIZE: expected string not found in input
</span><span style="caret-color: rgb(51, 51, 51); color: rgb(51, 51, 51); font-family: monospace; font-size: 14px; white-space: pre-wrap;" class=""># SIZE: Size: [[FILESIZE:.*]]
^
/Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/test/tools/yaml2obj/Output/elf-custom-null-section.yaml.tmp.txt:1:1: note: scanning from here
16777220 5978701391 -rw-r--r-- 1 buildslave staff 0 377 "Jul 24 07:06:53 2019" "Jul 24 07:06:53 2019" "Jul 24 07:06:53 2019" "Jul 24 07:06:53 2019" 4096 8 0 /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/test/tools/yaml2obj/Output/elf-custom-null-section.yaml.tmp3
^
/Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/test/tools/yaml2obj/Output/elf-custom-null-section.yaml.tmp.txt:1:4: note: possible intended match here
16777220 5978701391 -rw-r--r-- 1 buildslave staff 0 377 "Jul 24 07:06:53 2019" "Jul 24 07:06:53 2019" "Jul 24 07:06:53 2019" "Jul 24 07:06:53 2019" 4096 8 0 /Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/test/tools/yaml2obj/Output/elf-custom-null-section.yaml.tmp3
^</span><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 24, 2019, at 5:16 AM, George Rimar via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Author: grimar<br class="">Date: Wed Jul 24 05:16:22 2019<br class="">New Revision: 366894<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=366894&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=366894&view=rev</a><br class="">Log:<br class="">[yaml2obj] - Allow custom fields for the SHT_UNDEF sections.<br class=""><br class="">This is a follow-up refactoring patch for recently<br class="">introduced functionality which which reduces the code duplication<br class="">and also makes possible to redefine all possible fields of<br class="">the first SHT_NULL section (previously it was only possible to set<br class="">sh_link and sh_size).<br class=""><br class="">Differential revision: <a href="https://reviews.llvm.org/D65140" class="">https://reviews.llvm.org/D65140</a><br class=""><br class="">Modified:<br class=""> llvm/trunk/test/tools/yaml2obj/elf-custom-null-section.yaml<br class=""> llvm/trunk/tools/yaml2obj/yaml2elf.cpp<br class=""><br class="">Modified: llvm/trunk/test/tools/yaml2obj/elf-custom-null-section.yaml<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-custom-null-section.yaml?rev=366894&r1=366893&r2=366894&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-custom-null-section.yaml?rev=366894&r1=366893&r2=366894&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/tools/yaml2obj/elf-custom-null-section.yaml (original)<br class="">+++ llvm/trunk/test/tools/yaml2obj/elf-custom-null-section.yaml Wed Jul 24 05:16:22 2019<br class="">@@ -42,18 +42,14 @@ Sections:<br class=""> Info: 0<br class=""> Address: 0x0<br class=""><br class="">-## Check we are still able to describe other sections too.<br class="">+## Check we can redefine fields of the first SHT_NULL section.<br class=""><br class=""> # RUN: yaml2obj --docnum=3 %s -o %t3<br class="">-# RUN: llvm-readelf --sections %t3 | FileCheck %s --check-prefix=OTHER-SECTION<br class="">+# RUN: llvm-readelf --sections %t3 | FileCheck %s --check-prefix=REDEFINE<br class=""><br class="">-# OTHER-SECTION: Section Headers:<br class="">-# OTHER-SECTION-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al<br class="">-# OTHER-SECTION-NEXT: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0<br class="">-# OTHER-SECTION-NEXT: [ 1] foo PROGBITS 0000000000000000 000180 000000 00 0 0 0<br class="">-# OTHER-SECTION-NEXT: [ 2] .symtab SYMTAB 0000000000000000 000180 000018 18 3 1 8<br class="">-# OTHER-SECTION-NEXT: [ 3] .strtab STRTAB 0000000000000000 000198 000001 00 0 0 1<br class="">-# OTHER-SECTION-NEXT: [ 4] .shstrtab STRTAB 0000000000000000 000199 00001f 00 0 0 1<br class="">+# REDEFINE: Section Headers:<br class="">+# REDEFINE-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al<br class="">+# REDEFINE-NEXT: [ 0] .foo NULL 0000000000000006 000000 000002 03 A 4 5 1<br class=""><br class=""> --- !ELF<br class=""> FileHeader:<br class="">@@ -63,23 +59,25 @@ FileHeader:<br class=""> Machine: EM_X86_64<br class=""> Sections:<br class=""> - Type: SHT_NULL<br class="">- Name: ''<br class="">- Flags: [ ]<br class="">- AddressAlign: 0x0<br class="">- Size: 0x0<br class="">- EntSize: 0x0<br class="">- Link: 0<br class="">- - Type: SHT_PROGBITS<br class="">- Name: 'foo'<br class="">+ Name: .foo<br class="">+ Flags: [ SHF_ALLOC ]<br class="">+ AddressAlign: 0x1<br class="">+ Size: 0x2<br class="">+ EntSize: 0x3<br class="">+ Link: 4<br class="">+ Info: 5<br class="">+ Address: 0x6<br class=""><br class="">-## Check we can redefine sh_size and sh_link fields of the SHT_NULL section.<br class="">+## Check that file size does not change if we redefine the Size<br class="">+## of the first SHT_NULL section.<br class=""><br class=""> # RUN: yaml2obj --docnum=4 %s -o %t4<br class="">-# RUN: llvm-readelf --sections %t4 | FileCheck %s --check-prefix=REDEFINE<br class="">+# RUN: stat %t3 > %t.txt<br class="">+# RUN: stat %t4 >> %t.txt<br class="">+# RUN: FileCheck %s --input-file=%t.txt --check-prefix=SIZE<br class=""><br class="">-# REDEFINE: Section Headers:<br class="">-# REDEFINE-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al<br class="">-# REDEFINE-NEXT: [ 0] NULL 0000000000000000 000000 000123 00 1 0 0<br class="">+# SIZE: Size: [[FILESIZE:.*]]<br class="">+# SIZE: Size: [[FILESIZE]]<br class=""><br class=""> --- !ELF<br class=""> FileHeader:<br class="">@@ -88,16 +86,28 @@ FileHeader:<br class=""> Type: ET_REL<br class=""> Machine: EM_X86_64<br class=""> Sections:<br class="">- - Type: SHT_NULL<br class="">- Link: .foo<br class="">- Size: 0x123<br class="">- - Type: SHT_PROGBITS<br class="">- Name: .foo<br class="">+ - Type: SHT_NULL<br class="">+ Name: .foo<br class="">+ Flags: [ SHF_ALLOC ]<br class="">+ AddressAlign: 0x1<br class="">+ Size: 0xFFFF<br class="">+ EntSize: 0x3<br class="">+ Link: 4<br class="">+ Info: 5<br class="">+ Address: 0x6<br class=""><br class="">-## The same as above, but using a number as a Link value.<br class="">+## Check we are still able to describe other sections too.<br class=""><br class=""> # RUN: yaml2obj --docnum=5 %s -o %t5<br class="">-# RUN: llvm-readelf --sections %t5 | FileCheck %s --check-prefix=REDEFINE<br class="">+# RUN: llvm-readelf --sections %t5 | FileCheck %s --check-prefix=OTHER-SECTION<br class="">+<br class="">+# OTHER-SECTION: Section Headers:<br class="">+# OTHER-SECTION-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al<br class="">+# OTHER-SECTION-NEXT: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0<br class="">+# OTHER-SECTION-NEXT: [ 1] foo PROGBITS 0000000000000000 000180 000000 00 0 0 0<br class="">+# OTHER-SECTION-NEXT: [ 2] .symtab SYMTAB 0000000000000000 000180 000018 18 3 1 8<br class="">+# OTHER-SECTION-NEXT: [ 3] .strtab STRTAB 0000000000000000 000198 000001 00 0 0 1<br class="">+# OTHER-SECTION-NEXT: [ 4] .shstrtab STRTAB 0000000000000000 000199 00001f 00 0 0 1<br class=""><br class=""> --- !ELF<br class=""> FileHeader:<br class="">@@ -106,11 +116,15 @@ FileHeader:<br class=""> Type: ET_REL<br class=""> Machine: EM_X86_64<br class=""> Sections:<br class="">- - Type: SHT_NULL<br class="">- Link: 1<br class="">- Size: 0x123<br class="">+ - Type: SHT_NULL<br class="">+ Name: ''<br class="">+ Flags: [ ]<br class="">+ AddressAlign: 0x0<br class="">+ Size: 0x0<br class="">+ EntSize: 0x0<br class="">+ Link: 0<br class=""> - Type: SHT_PROGBITS<br class="">- Name: .foo<br class="">+ Name: 'foo'<br class=""><br class=""> ## Check we report an error if null section sh_link field refers to an unknown section.<br class=""><br class="">@@ -150,7 +164,7 @@ Sections:<br class=""> # MULTIPLE: Section Headers:<br class=""> # MULTIPLE-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al<br class=""> # MULTIPLE-NEXT: [ 0] NULL 0000000000000000 000000 000000 00 0 0 0<br class="">-# MULTIPLE-NEXT: [ 1] NULL 0000000000000123 000180 000020 10 A 1 2 0<br class="">+# MULTIPLE-NEXT: [ 1] .foo NULL 0000000000000123 000180 000020 10 A 1 2 0<br class=""><br class=""> --- !ELF<br class=""> FileHeader:<br class="">@@ -161,9 +175,31 @@ FileHeader:<br class=""> Sections:<br class=""> - Type: SHT_NULL<br class=""> - Type: SHT_NULL<br class="">+ Name: .foo<br class=""> Flags: [ SHF_ALLOC ]<br class=""> Size: 0x20<br class=""> EntSize: 0x10<br class=""> Link: 1<br class=""> Info: 2<br class=""> Address: 0x123<br class="">+<br class="">+## Check we can override the sh_offset/sh_size fields of the first SHT_NULL section if requested.<br class="">+<br class="">+# RUN: yaml2obj --docnum=9 %s -o %t9<br class="">+# RUN: llvm-readelf --sections %t9 | FileCheck %s --check-prefix=OVERRIDE<br class="">+<br class="">+# OVERRIDE: Section Headers:<br class="">+# OVERRIDE-NEXT: [Nr] Name Type Address Off Size ES Flg Lk Inf Al<br class="">+# OVERRIDE-NEXT: [ 0] NULL 0000000000000000 000007 000008 00 0 0 0<br class="">+<br class="">+--- !ELF<br class="">+FileHeader:<br class="">+ Class: ELFCLASS64<br class="">+ Data: ELFDATA2LSB<br class="">+ Type: ET_REL<br class="">+ Machine: EM_X86_64<br class="">+Sections:<br class="">+ - Type: SHT_NULL<br class="">+ Size: 0x2<br class="">+ ShOffset: 0x7<br class="">+ ShSize: 0x8<br class=""><br class="">Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=366894&r1=366893&r2=366894&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=366894&r1=366893&r2=366894&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)<br class="">+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Wed Jul 24 05:16:22 2019<br class="">@@ -247,7 +247,7 @@ void ELFState<ELFT>::initELFHeader(Elf_E<br class=""> ? (typename ELFT::uint)(*Doc.Header.SHOffset)<br class=""> : sizeof(Header) + sizeof(Elf_Phdr) * Doc.ProgramHeaders.size();<br class=""> Header.e_shnum =<br class="">- Doc.Header.SHNum ? (uint16_t)*Doc.Header.SHNum : SN2I.size() + 1;<br class="">+ Doc.Header.SHNum ? (uint16_t)*Doc.Header.SHNum : Doc.Sections.size();<br class=""> Header.e_shstrndx = Doc.Header.SHStrNdx ? (uint16_t)*Doc.Header.SHStrNdx<br class=""> : SN2I.get(".shstrtab");<br class=""> }<br class="">@@ -327,30 +327,15 @@ bool ELFState<ELFT>::initSectionHeaders(<br class=""> SHeaders.resize(Doc.Sections.size());<br class=""><br class=""> for (size_t I = 0; I < Doc.Sections.size(); ++I) {<br class="">- Elf_Shdr &SHeader = SHeaders[I];<br class=""> ELFYAML::Section *Sec = Doc.Sections[I].get();<br class="">-<br class="">- if (I == 0) {<br class="">- if (Sec->IsImplicit)<br class="">- continue;<br class="">-<br class="">- if (auto S = dyn_cast<ELFYAML::RawContentSection>(Sec))<br class="">- if (S->Size)<br class="">- SHeader.sh_size = *S->Size;<br class="">-<br class="">- if (!Sec->Link.empty()) {<br class="">- unsigned Index;<br class="">- if (!convertSectionIndex(SN2I, Sec->Name, Sec->Link, Index))<br class="">- return false;<br class="">- SHeader.sh_link = Index;<br class="">- }<br class="">+ if (I == 0 && Sec->IsImplicit)<br class=""> continue;<br class="">- }<br class=""><br class=""> // We have a few sections like string or symbol tables that are usually<br class=""> // added implicitly to the end. However, if they are explicitly specified<br class=""> // in the YAML, we need to write them here. This ensures the file offset<br class=""> // remains correct.<br class="">+ Elf_Shdr &SHeader = SHeaders[I];<br class=""> if (initImplicitHeader(State, CBA, SHeader, Sec->Name,<br class=""> Sec->IsImplicit ? nullptr : Sec))<br class=""> continue;<br class="">@@ -372,7 +357,17 @@ bool ELFState<ELFT>::initSectionHeaders(<br class=""> SHeader.sh_link = Index;<br class=""> }<br class=""><br class="">- if (auto S = dyn_cast<ELFYAML::RawContentSection>(Sec)) {<br class="">+ if (I == 0) {<br class="">+ if (auto RawSec = dyn_cast<ELFYAML::RawContentSection>(Sec)) {<br class="">+ // We do not write any content for special SHN_UNDEF section.<br class="">+ if (RawSec->Size)<br class="">+ SHeader.sh_size = *RawSec->Size;<br class="">+ if (RawSec->Info)<br class="">+ SHeader.sh_info = *RawSec->Info;<br class="">+ }<br class="">+ if (Sec->EntSize)<br class="">+ SHeader.sh_entsize = *Sec->EntSize;<br class="">+ } else if (auto S = dyn_cast<ELFYAML::RawContentSection>(Sec)) {<br class=""> if (!writeSectionContent(SHeader, *S, CBA))<br class=""> return false;<br class=""> } else if (auto S = dyn_cast<ELFYAML::RelocationSection>(Sec)) {<br class="">@@ -966,8 +961,11 @@ bool ELFState<ELFT>::writeSectionContent<br class=""> }<br class=""><br class=""> template <class ELFT> bool ELFState<ELFT>::buildSectionIndex() {<br class="">- for (unsigned I = 1, E = Doc.Sections.size(); I != E; ++I) {<br class="">+ for (unsigned I = 0, E = Doc.Sections.size(); I != E; ++I) {<br class=""> StringRef Name = Doc.Sections[I]->Name;<br class="">+ if (Name.empty())<br class="">+ continue;<br class="">+<br class=""> DotShStrtab.add(dropUniqueSuffix(Name));<br class=""> if (!SN2I.addName(Name, I)) {<br class=""> WithColor::error() << "Repeated section name: '" << Name<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></div></blockquote></div><br class=""></div></body></html>