<div dir="ltr">Seems that cannot describe the change you made to MIPS. This change makes it something special for MIPS if a section name is ".text". Is this really for debugging and reporting errors?<div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 5, 2015 at 1:12 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This code helps to debug and check for errors when there is something wrong with the final layout of the image.<br>
<br>
Hope this helps.<span><font color="#888888"><br>
<br>
Shankar Easwaran</font></span><div><div><br>
<br>
On 3/5/2015 2:56 PM, Rui Ueyama wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So, why did you have to fix that FIXME in the first place? This patch<br>
cannot fix anything if it didn't change any functionality.<br>
<br>
On Thu, Mar 5, 2015 at 12:54 PM, Shankar Easwaran <<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>><br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-  // FIXME: We really need the file path here in the SectionKey, when that<br>
-  // is available, replace the sectionKey that has outputSectionName to<br>
the<br>
-  // inputSectionName.<br>
<br>
Shankar Easwaran<br>
<br>
<br>
On 3/5/2015 2:51 PM, Rui Ueyama wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What did you address? The commit message says that there's no<br>
functionality<br>
change by this commit.<br>
<br>
On Thu, Mar 5, 2015 at 12:41 PM, Shankar Easwaran <<br>
<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>><br>
wrote:<br>
<br>
  Sorry, I missed your ping.<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There was a FIXME comment that I addressed as part of the commit.<br>
Previously I had to disable because of the RoundTripPasses.<br>
<br>
Shankar Easwaran<br>
<br>
<br>
On 3/5/2015 2:29 PM, Rui Ueyama wrote:<br>
<br>
  Ping. This added extra code but no additional functionality? I'll roll<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
this<br>
back if it is so.<br>
<br>
On Wed, Feb 25, 2015 at 3:30 PM, Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> wrote:<br>
<br>
   Ping?<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sun, Feb 22, 2015 at 7:36 PM, Rui Ueyama <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> wrote:<br>
<br>
   On Sat, Feb 21, 2015 at 7:49 AM, Shankar Easwaran <<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>> wrote:<br>
<br>
   Author: shankare<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Date: Sat Feb 21 09:49:34 2015<br>
New Revision: 230138<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=230138&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=230138&view=rev</a><br>
Log:<br>
[ELF][Writer] Use Path to create AtomSection.<br>
<br>
Now since the correct file path for atoms is available and not<br>
clobbered,<br>
commit r222309 which was reverted previously can be added back.<br>
<br>
No change in functionality.<br>
<br>
   Why do we need this new code if it doesn't change anything?<br>
<br>
</blockquote>
   Modified:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
       lld/trunk/lib/ReaderWriter/<u></u>ELF/DefaultLayout.h<br>
       lld/trunk/lib/ReaderWriter/<u></u>ELF/Mips/MipsTargetHandler.h<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/<u></u>ELF/DefaultLayout.h<br>
URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/<u></u>ReaderWriter/ELF/</a><br>
DefaultLayout.h?rev=230138&r1=<u></u>230137&r2=230138&view=diff<br>
<br>
==============================<u></u>==============================<br>
==================<br>
--- lld/trunk/lib/ReaderWriter/<u></u>ELF/DefaultLayout.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/<u></u>ELF/DefaultLayout.h Sat Feb 21<br>
09:49:34<br>
2015<br>
@@ -91,24 +91,26 @@ public:<br>
      // The sections are created using<br>
      // SectionName, contentPermissions<br>
      struct SectionKey {<br>
-    SectionKey(StringRef name, DefinedAtom::<u></u>ContentPermissions<br>
perm)<br>
-        : _name(name), _perm(perm) {<br>
-    }<br>
+    SectionKey(StringRef name, DefinedAtom::<u></u>ContentPermissions<br>
perm,<br>
+               StringRef path)<br>
+        : _name(name), _perm(perm), _path(path) {}<br>
<br>
        // Data members<br>
        StringRef _name;<br>
        DefinedAtom::<u></u>ContentPermissions _perm;<br>
+    StringRef _path;<br>
      };<br>
<br>
      struct SectionKeyHash {<br>
        int64_t operator()(const SectionKey &k) const {<br>
-      return llvm::hash_combine(k._name, k._perm);<br>
+      return llvm::hash_combine(k._name, k._perm, k._path);<br>
        }<br>
      };<br>
<br>
      struct SectionKeyEq {<br>
        bool operator()(const SectionKey &lhs, const SectionKey &rhs)<br>
const<br>
{<br>
-      return ((lhs._name == rhs._name) && (lhs._perm == rhs._perm));<br>
+      return ((lhs._name == rhs._name) && (lhs._perm == rhs._perm)<br>
&&<br>
+              (lhs._path == rhs._path));<br>
        }<br>
      };<br>
<br>
@@ -181,9 +183,10 @@ public:<br>
      virtual StringRef getOutputSectionName(StringRef<br>
inputSectionName)<br>
const;<br>
<br>
      /// \brief Gets or creates a section.<br>
-  AtomSection<ELFT> *getSection(<br>
-      StringRef name, int32_t contentType,<br>
-      DefinedAtom::<u></u>ContentPermissions contentPermissions);<br>
+  AtomSection<ELFT> *<br>
+  getSection(StringRef name, int32_t contentType,<br>
+             DefinedAtom::<u></u>ContentPermissions contentPermissions,<br>
+             StringRef path);<br>
<br>
      /// \brief Gets the segment for a output section<br>
      virtual Layout::SegmentType getSegmentType(Section<ELFT><br>
*section)<br>
const;<br>
@@ -530,22 +533,19 @@ AtomSection<ELFT> *DefaultLayout<ELFT>::<br>
    }<br>
<br>
    template <class ELFT><br>
-AtomSection<ELFT> *DefaultLayout<ELFT>::<u></u>getSection(<br>
-    StringRef sectionName, int32_t contentType,<br>
-    DefinedAtom::<u></u>ContentPermissions permissions) {<br>
-  // FIXME: We really need the file path here in the SectionKey,<br>
when<br>
that<br>
-  // is available, replace the sectionKey that has outputSectionName<br>
to<br>
the<br>
-  // inputSectionName.<br>
-  StringRef outputSectionName = getOutputSectionName(<u></u>sectionName);<br>
-  const SectionKey sectionKey(outputSectionName, permissions);<br>
+AtomSection<ELFT> *<br>
+DefaultLayout<ELFT>::<u></u>getSection(StringRef sectionName, int32_t<br>
contentType,<br>
+                                DefinedAtom::<u></u>ContentPermissions<br>
permissions,<br>
+                                StringRef path) {<br>
+  const SectionKey sectionKey(sectionName, permissions, path);<br>
+  SectionOrder sectionOrder =<br>
+      getSectionOrder(sectionName, contentType, permissions);<br>
      auto sec = _sectionMap.find(sectionKey);<br>
      if (sec != _sectionMap.end())<br>
        return sec->second;<br>
-  SectionOrder sectionOrder =<br>
-      getSectionOrder(sectionName, contentType, permissions);<br>
      AtomSection<ELFT> *newSec =<br>
          createSection(sectionName, contentType, permissions,<br>
sectionOrder);<br>
-  newSec->setOutputSectionName(<u></u>outputSectionName);<br>
+  newSec->setOutputSectionName(<u></u>getOutputSectionName(<u></u>sectionName));<br>
      newSec->setOrder(sectionOrder)<u></u>;<br>
      _sections.push_back(newSec);<br>
      _sectionMap.insert(std::make_<u></u>pair(sectionKey, newSec));<br>
@@ -565,8 +565,8 @@ ErrorOr<const lld::AtomLayout &> Default<br>
        const DefinedAtom::ContentType contentType =<br>
definedAtom->contentType();<br>
<br>
        StringRef sectionName = getInputSectionName(<u></u>definedAtom);<br>
-    AtomSection<ELFT> *section =<br>
-        getSection(sectionName, contentType, permissions);<br>
+    AtomSection<ELFT> *section = getSection(<br>
+        sectionName, contentType, permissions,<br>
definedAtom->file().path());<br>
<br>
        // Add runtime relocations to the .rela section.<br>
        for (const auto &reloc : *definedAtom) {<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/<u></u>ELF/Mips/MipsTargetHandler.h<br>
URL:<br>
<a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/lld/trunk/lib/</a><br>
ReaderWriter/ELF/Mips/<u></u>MipsTargetHandler.h?rev=<br>
230138&r1=230137&r2=230138&<u></u>view=diff<br>
<br>
==============================<u></u>==============================<br>
==================<br>
--- lld/trunk/lib/ReaderWriter/<u></u>ELF/Mips/MipsTargetHandler.h<br>
(original)<br>
+++ lld/trunk/lib/ReaderWriter/<u></u>ELF/Mips/MipsTargetHandler.h Sat Feb<br>
21<br>
09:49:34 2015<br>
@@ -67,6 +67,17 @@ public:<br>
        return *_gpDispAtom;<br>
      }<br>
<br>
+  /// \brief Return the section order for a input section<br>
+  virtual Layout::SectionOrder getSectionOrder(StringRef name,<br>
+                                               int32_t contentType,<br>
+                                               int32_t<br>
contentPermissions) {<br>
+    if ((contentType == DefinedAtom::typeStub) &&<br>
(name.startswith(".text")))<br>
+      return DefaultLayout<ELFType>::ORDER_<u></u>TEXT;<br>
+<br>
+    return DefaultLayout<ELFType>::<u></u>getSectionOrder(name,<br>
contentType,<br>
+<br>
   contentPermissions);<br>
+  }<br>
+<br>
    private:<br>
      llvm::BumpPtrAllocator _alloc;<br>
      MipsGOTSection<ELFType> *_gotSection;<br>
<br>
<br>
______________________________<u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
<br>
<br>
  --<br>
</blockquote></blockquote></blockquote></blockquote>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted<br>
by the Linux Foundation<br>
<br>
<br>
<br>
</blockquote></blockquote>
--<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted<br>
by the Linux Foundation<br>
<br>
<br>
</blockquote></blockquote>
<br>
<br>
-- <br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation<br>
<br>
</div></div></blockquote></div><br></div></div>