<div dir="ltr">Let me roll this back for now, so that we can commit other changes. Feel free to resubmit once you figure out the issue and fix that.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 14, 2019 at 10:49 PM George Rimar <<a href="mailto:grimar@accesssoftek.com">grimar@accesssoftek.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif">
<p>I'll take a look. Had no notification from BB :(<br>
</p>
<p><br>
</p>
<div id="gmail-m_-7043050899912066254Signature">
<div name="divtagdefaultwrapper">
<div class="gmail-m_-7043050899912066254BodyFragment"><font size="2">
<div class="gmail-m_-7043050899912066254PlainText">Best regards,<br>
George | Developer | <span style="background-color:rgb(255,255,255);color:rgb(33,33,33);font-family:Calibri,sans-serif;font-size:13.3333px">Access Softek, Inc</span></div>
</font></div>
</div>
</div>
<div style="color:rgb(33,33,33)">
<hr style="display:inline-block;width:98%">
<div id="gmail-m_-7043050899912066254divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>От:</b> Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>><br>
<b>Отправлено:</b> 14 июня 2019 г. 16:47<br>
<b>Кому:</b> George Rimar<br>
<b>Копия:</b> llvm-commits<br>
<b>Тема:</b> Re: [llvm] r363377 - [yaml2obj] - Allow setting custom section types for implicit sections.</font>
<div> </div>
</div>
<div>
<div style="font-size:9pt;font-family:Calibri,sans-serif">
<h3 style="background-color:rgb(255,255,255);font-size:10pt;border:1px dotted rgb(0,51,51);padding:0.8em">
<span style="color:rgb(255,102,0)">CAUTION:<strong> </strong></span>This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. If you suspect potential phishing or spam
email, report it to <a href="mailto:ReportSpam@accesssoftek.com" target="_blank">ReportSpam@accesssoftek.com</a></h3>
</div>
<div>
<div dir="ltr">It looks like after this patch lld's test starts failing:
<div><br>
</div>
<div>FAIL: lld :: ELF/invalid/undefined-local-symbol-in-dso.test (889 of 2123)<br>
******************** TEST 'lld :: ELF/invalid/undefined-local-symbol-in-dso.test' FAILED ********************<br>
Script:<br>
--<br>
: 'RUN: at line 11'; /home/ruiu/llvm/b/bin/yaml2obj /home/ruiu/llvm/lld/test/ELF/invalid/undefined-local-symbol-in-dso.test -o /home/ruiu/llvm/b/tools/lld/test/ELF/invalid/Output/<a href="http://undefined-local-symbol-in-dso.test.tmp.so" target="_blank">undefined-local-symbol-in-dso.test.tmp.so</a><br>
: 'RUN: at line 12'; /home/ruiu/llvm/b/bin/ld.lld /home/ruiu/llvm/b/tools/lld/test/ELF/invalid/Output/<a href="http://undefined-local-symbol-in-dso.test.tmp.so" target="_blank">undefined-local-symbol-in-dso.test.tmp.so</a> -o /home/ruiu/llvm/b/tools/lld/test/ELF/invalid/Output/undefined-local-symbol-in-dso.test.tmp
2>&1 | /home/ruiu/llvm/b/bin/FileCheck -check-prefix=WARN /home/ruiu/llvm/lld/test/ELF/invalid/undefined-local-symbol-in-dso.test<br>
--<br>
Exit Code: 1<br>
<br>
Command Output (stderr):<br>
--<br>
/home/ruiu/llvm/lld/test/ELF/invalid/undefined-local-symbol-in-dso.test:13:9: error: WARN: expected string not found in input<br>
# WARN: found local symbol 'foo' in global part of symbol table in file {{.*}}.so<br>
^<br>
<stdin>:1:1: note: scanning from here<br>
ld.lld: warning: cannot find entry symbol _start; not setting start address<br>
^<br>
<stdin>:1:25: note: possible intended match here<br>
ld.lld: warning: cannot find entry symbol _start; not setting start address<br>
^<br>
</div>
<div><br>
</div>
<div>Can you take a look?</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, Jun 14, 2019 at 9:13 PM George Rimar via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Author: grimar<br>
Date: Fri Jun 14 05:16:59 2019<br>
New Revision: 363377<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=363377&view=rev" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=363377&view=rev</a><br>
Log:<br>
[yaml2obj] - Allow setting custom section types for implicit sections.<br>
<br>
We were hardcoding the final section type for sections that<br>
are usually implicit. The patch fixes that.<br>
<br>
This also fixes a few issues in existent test cases and removes<br>
one precompiled object.<br>
<br>
Differential revision: <a href="https://reviews.llvm.org/D63267" rel="noreferrer" target="_blank">
https://reviews.llvm.org/D63267</a><br>
<br>
Added:<br>
llvm/trunk/test/tools/yaml2obj/implicit-sections-types.test<br>
Removed:<br>
llvm/trunk/test/tools/llvm-readobj/Inputs/wrong-shstrtab-type.elf-x86-64<br>
Modified:<br>
llvm/trunk/test/tools/llvm-readobj/elf-wrong-shstrtab-type.test<br>
llvm/trunk/test/tools/yaml2obj/elf-symtab-shinfo.yaml<br>
llvm/trunk/test/tools/yaml2obj/elf-symtab-shtype.yaml<br>
llvm/trunk/test/tools/yaml2obj/explicit-dynsym-no-dynstr.yaml<br>
llvm/trunk/tools/yaml2obj/yaml2elf.cpp<br>
<br>
Removed: llvm/trunk/test/tools/llvm-readobj/Inputs/wrong-shstrtab-type.elf-x86-64<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/wrong-shstrtab-type.elf-x86-64?rev=363376&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/wrong-shstrtab-type.elf-x86-64?rev=363376&view=auto</a><br>
==============================================================================<br>
Binary file - no diff available.<br>
<br>
Modified: llvm/trunk/test/tools/llvm-readobj/elf-wrong-shstrtab-type.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-wrong-shstrtab-type.test?rev=363377&r1=363376&r2=363377&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/elf-wrong-shstrtab-type.test?rev=363377&r1=363376&r2=363377&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/tools/llvm-readobj/elf-wrong-shstrtab-type.test (original)<br>
+++ llvm/trunk/test/tools/llvm-readobj/elf-wrong-shstrtab-type.test Fri Jun 14 05:16:59 2019<br>
@@ -1,11 +1,22 @@<br>
-## wrong-shstrtab-type.elf-x86-64 contains .shstrtab section which has SHT_PROGBITS type.<br>
-## Check we do not fail to dump the section headers in this case.<br>
+## Check we do not fail to dump the section headers when<br>
+## a .shstrtab section does not have a SHT_STRTAB type.<br>
<br>
-# RUN: llvm-readobj -S %p/Inputs/wrong-shstrtab-type.elf-x86-64 | FileCheck %s --check-prefix LLVM<br>
-# RUN: llvm-readelf -S %p/Inputs/wrong-shstrtab-type.elf-x86-64 | FileCheck %s --check-prefix GNU<br>
+# RUN: yaml2obj %s -o %t1<br>
+# RUN: llvm-readobj -S %t1 | FileCheck %s --check-prefix LLVM<br>
+# RUN: llvm-readelf -S %t1 | FileCheck %s --check-prefix GNU<br>
<br>
# LLVM: Name: .shstrtab<br>
# LLVM-NEXT: Type: SHT_PROGBITS<br>
<br>
# GNU: [Nr] Name Type<br>
-# GNU: [ 3] .shstrtab PROGBITS<br>
+# GNU: [ 1] .shstrtab PROGBITS<br>
+<br>
+--- !ELF<br>
+FileHeader:<br>
+ Class: ELFCLASS64<br>
+ Data: ELFDATA2LSB<br>
+ Type: ET_DYN<br>
+ Machine: EM_X86_64<br>
+Sections:<br>
+ - Name: .shstrtab<br>
+ Type: SHT_PROGBITS<br>
<br>
Modified: llvm/trunk/test/tools/yaml2obj/elf-symtab-shinfo.yaml<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-symtab-shinfo.yaml?rev=363377&r1=363376&r2=363377&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-symtab-shinfo.yaml?rev=363377&r1=363376&r2=363377&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/tools/yaml2obj/elf-symtab-shinfo.yaml (original)<br>
+++ llvm/trunk/test/tools/yaml2obj/elf-symtab-shinfo.yaml Fri Jun 14 05:16:59 2019<br>
@@ -24,17 +24,17 @@<br>
<br>
--- !ELF<br>
FileHeader:<br>
- Class: ELFCLASS64<br>
- Data: ELFDATA2LSB<br>
- Type: ET_REL<br>
- Machine: EM_X86_64<br>
+ Class: ELFCLASS64<br>
+ Data: ELFDATA2LSB<br>
+ Type: ET_REL<br>
+ Machine: EM_X86_64<br>
Sections:<br>
- - Name: .symtab<br>
- Info: 42<br>
- Type: SHT_SYMTAB<br>
- - Name: .dynsym<br>
- Info: 26<br>
- Type: SHT_SYMTAB<br>
+ - Name: .symtab<br>
+ Info: 42<br>
+ Type: SHT_SYMTAB<br>
+ - Name: .dynsym<br>
+ Info: 26<br>
+ Type: SHT_DYNSYM<br>
Symbols:<br>
- Name: foo<br>
Binding: STB_GLOBAL<br>
<br>
Modified: llvm/trunk/test/tools/yaml2obj/elf-symtab-shtype.yaml<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-symtab-shtype.yaml?rev=363377&r1=363376&r2=363377&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/elf-symtab-shtype.yaml?rev=363377&r1=363376&r2=363377&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/tools/yaml2obj/elf-symtab-shtype.yaml (original)<br>
+++ llvm/trunk/test/tools/yaml2obj/elf-symtab-shtype.yaml Fri Jun 14 05:16:59 2019<br>
@@ -2,20 +2,18 @@<br>
# RUN: yaml2obj %s -o %t<br>
# RUN: llvm-readobj --sections %t | FileCheck %s<br>
<br>
-## TODO: the output is still SHT_SYMTAB because we do not yet<br>
-## support changing it.<br>
# CHECK: Name: .symtab<br>
-# CHECK-NEXT: Type: SHT_SYMTAB<br>
+# CHECK-NEXT: Type: SHT_DYNAMIC<br>
<br>
--- !ELF<br>
-FileHeader: <br>
- Class: ELFCLASS64<br>
- Data: ELFDATA2LSB<br>
- Type: ET_REL<br>
- Machine: EM_X86_64<br>
-Sections: <br>
- - Name: .symtab<br>
- Type: SHT_DYNAMIC<br>
+FileHeader:<br>
+ Class: ELFCLASS64<br>
+ Data: ELFDATA2LSB<br>
+ Type: ET_REL<br>
+ Machine: EM_X86_64<br>
+Sections:<br>
+ - Name: .symtab<br>
+ Type: SHT_DYNAMIC<br>
Symbols:<br>
- Name: foo<br>
Binding: STB_GLOBAL<br>
<br>
Modified: llvm/trunk/test/tools/yaml2obj/explicit-dynsym-no-dynstr.yaml<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/explicit-dynsym-no-dynstr.yaml?rev=363377&r1=363376&r2=363377&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/explicit-dynsym-no-dynstr.yaml?rev=363377&r1=363376&r2=363377&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/tools/yaml2obj/explicit-dynsym-no-dynstr.yaml (original)<br>
+++ llvm/trunk/test/tools/yaml2obj/explicit-dynsym-no-dynstr.yaml Fri Jun 14 05:16:59 2019<br>
@@ -19,4 +19,4 @@ FileHeader:<br>
Machine: EM_X86_64<br>
Sections:<br>
- Name: .dynsym<br>
- Type: SHT_SYMTAB<br>
+ Type: SHT_DYNSYM<br>
<br>
Added: llvm/trunk/test/tools/yaml2obj/implicit-sections-types.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/implicit-sections-types.test?rev=363377&view=auto" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/yaml2obj/implicit-sections-types.test?rev=363377&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/tools/yaml2obj/implicit-sections-types.test (added)<br>
+++ llvm/trunk/test/tools/yaml2obj/implicit-sections-types.test Fri Jun 14 05:16:59 2019<br>
@@ -0,0 +1,69 @@<br>
+## Here we check the types set for implicit sections<br>
+## in different cases.<br>
+<br>
+## Check the types set by default in case sections were implicitly<br>
+## added and not described in the YAML.<br>
+<br>
+# RUN: yaml2obj --docnum=1 %s -o %t1<br>
+# RUN: llvm-readobj -S %t1 | FileCheck %s --check-prefix=CASE1<br>
+<br>
+# CASE1: Name: .symtab<br>
+# CASE1-NEXT: Type: SHT_SYMTAB<br>
+# CASE1: Name: .strtab<br>
+# CASE1-NEXT: Type: SHT_STRTAB<br>
+# CASE1: Name: .shstrtab<br>
+# CASE1-NEXT: Type: SHT_STRTAB<br>
+# CASE1: Name: .dynsym<br>
+# CASE1-NEXT: Type: SHT_DYNSYM<br>
+# CASE1: Name: .dynstr<br>
+# CASE1-NEXT: Type: SHT_STRTAB<br>
+<br>
+--- !ELF<br>
+FileHeader:<br>
+ Class: ELFCLASS64<br>
+ Data: ELFDATA2LSB<br>
+ Type: ET_DYN<br>
+ Machine: EM_X86_64<br>
+## Needed to force the creation of the .dynsym and .dynstr.<br>
+DynamicSymbols:<br>
+ - Name: foo<br>
+ - Binding: STB_GLOBAL<br>
+<br>
+## Check we can set any arbitrary types when describing sections<br>
+## that are usually implicit.<br>
+<br>
+# RUN: yaml2obj --docnum=2 %s -o %t2<br>
+# RUN: llvm-readobj -S %t2 | FileCheck %s --check-prefix=CASE2<br>
+<br>
+# CASE2: Name: .symtab<br>
+# CASE2-NEXT: Type: SHT_DYNAMIC<br>
+# CASE2: Name: .strtab<br>
+# CASE2-NEXT: Type: SHT_RELA<br>
+# CASE2: Name: .shstrtab<br>
+# CASE2-NEXT: Type: SHT_PROGBITS<br>
+# CASE2: Name: .dynsym<br>
+# CASE2-NEXT: Type: SHT_NOTE<br>
+# CASE2: Name: .dynstr<br>
+# CASE2-NEXT: Type: SHT_NOBITS<br>
+<br>
+--- !ELF<br>
+FileHeader:<br>
+ Class: ELFCLASS64<br>
+ Data: ELFDATA2LSB<br>
+ Type: ET_DYN<br>
+ Machine: EM_X86_64<br>
+Sections:<br>
+ - Name: .symtab<br>
+ Type: SHT_DYNAMIC<br>
+ - Name: .strtab<br>
+ Type: SHT_RELA<br>
+ - Name: .shstrtab<br>
+ Type: SHT_PROGBITS<br>
+ - Name: .dynsym<br>
+ Type: SHT_NOTE<br>
+ - Name: .dynstr<br>
+ Type: SHT_NOBITS<br>
+## Needed to set the proper content size for .symtab, so<br>
+## that llvm-readobj can dump this section.<br>
+Symbols:<br>
+ - Name: foo<br>
<br>
Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=363377&r1=363376&r2=363377&view=diff" rel="noreferrer" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=363377&r1=363376&r2=363377&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)<br>
+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Fri Jun 14 05:16:59 2019<br>
@@ -403,7 +403,11 @@ void ELFState<ELFT>::initSymtabSectionHe<br>
<br>
zero(SHeader);<br>
SHeader.sh_name = DotShStrtab.getOffset(IsStatic ? ".symtab" : ".dynsym");<br>
- SHeader.sh_type = IsStatic ? ELF::SHT_SYMTAB : ELF::SHT_DYNSYM;<br>
+<br>
+ if (YAMLSec)<br>
+ SHeader.sh_type = YAMLSec->Type;<br>
+ else<br>
+ SHeader.sh_type = IsStatic ? ELF::SHT_SYMTAB : ELF::SHT_DYNSYM;<br>
<br>
if (RawSec && !RawSec->Link.empty()) {<br>
// If the Link field is explicitly defined in the document,<br>
@@ -467,7 +471,7 @@ void ELFState<ELFT>::initStrtabSectionHe<br>
ELFYAML::Section *YAMLSec) {<br>
zero(SHeader);<br>
SHeader.sh_name = DotShStrtab.getOffset(Name);<br>
- SHeader.sh_type = ELF::SHT_STRTAB;<br>
+ SHeader.sh_type = YAMLSec ? YAMLSec->Type : ELF::SHT_STRTAB;<br>
SHeader.sh_addralign = YAMLSec ? (uint64_t)YAMLSec->AddressAlign : 1;<br>
<br>
ELFYAML::RawContentSection *RawSec =<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote></div>