<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 29, 2016 at 10:28 AM, Rui Ueyama via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Can you just set 16 and 32 instead of sizeof(ElfHalf) and sizeof(ElfWord)? I don't really memorize these types.</div></div></blockquote><div><br></div><div>The spec is defined in terms of them, hopefully they are familiar?</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 29, 2016 at 10:19 AM, Rafael Espindola via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Fri Apr 29 12:19:45 2016<br>
New Revision: 268070<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=268070&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=268070&view=rev</a><br>
Log:<br>
Fix the alignment of the version info.<br>
<br>
Modified:<br>
lld/trunk/ELF/OutputSections.cpp<br>
lld/trunk/test/ELF/verneed.s<br>
<br>
Modified: lld/trunk/ELF/OutputSections.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=268070&r1=268069&r2=268070&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=268070&r1=268069&r2=268070&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/OutputSections.cpp (original)<br>
+++ lld/trunk/ELF/OutputSections.cpp Fri Apr 29 12:19:45 2016<br>
@@ -1521,7 +1521,9 @@ SymbolTableSection<ELFT>::getOutputSecti<br>
<br>
template <class ELFT><br>
VersionTableSection<ELFT>::VersionTableSection()<br>
- : OutputSectionBase<ELFT>(".gnu.version", SHT_GNU_versym, SHF_ALLOC) {}<br>
+ : OutputSectionBase<ELFT>(".gnu.version", SHT_GNU_versym, SHF_ALLOC) {<br>
+ this->Header.sh_addralign = sizeof(typename ELFT::Half);<br>
+}<br>
<br>
template <class ELFT> void VersionTableSection<ELFT>::finalize() {<br>
this->Header.sh_size =<br>
@@ -1544,7 +1546,9 @@ template <class ELFT> void VersionTableS<br>
<br>
template <class ELFT><br>
VersionNeedSection<ELFT>::VersionNeedSection()<br>
- : OutputSectionBase<ELFT>(".gnu.version_r", SHT_GNU_verneed, SHF_ALLOC) {}<br>
+ : OutputSectionBase<ELFT>(".gnu.version_r", SHT_GNU_verneed, SHF_ALLOC) {<br>
+ this->Header.sh_addralign = sizeof(typename ELFT::Word);<br>
+}<br>
<br>
template <class ELFT><br>
void VersionNeedSection<ELFT>::addSymbol(SharedSymbol<ELFT> *SS) {<br>
<br>
Modified: lld/trunk/test/ELF/verneed.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/verneed.s?rev=268070&r1=268069&r2=268070&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/verneed.s?rev=268070&r1=268069&r2=268070&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/ELF/verneed.s (original)<br>
+++ lld/trunk/test/ELF/verneed.s Fri Apr 29 12:19:45 2016<br>
@@ -15,7 +15,7 @@<br>
# CHECK-NEXT: Size: 8<br>
# CHECK-NEXT: Link: 0<br>
# CHECK-NEXT: Info: 0<br>
-# CHECK-NEXT: AddressAlignment: 0<br>
+# CHECK-NEXT: AddressAlignment: 2<br>
# CHECK-NEXT: EntrySize: 2<br>
# CHECK-NEXT: }<br>
# CHECK-NEXT: Section {<br>
@@ -30,7 +30,7 @@<br>
# CHECK-NEXT: Size: 80<br>
# CHECK-NEXT: Link: 5<br>
# CHECK-NEXT: Info: 2<br>
-# CHECK-NEXT: AddressAlignment: 0<br>
+# CHECK-NEXT: AddressAlignment: 4<br>
# CHECK-NEXT: EntrySize: 0<br>
# CHECK-NEXT: }<br>
<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div></div>