[LLVMbugs] [Bug 23598] New: MachObjectWriter::WriteNlist() might be grabbing the wrong symbol offset, or may otherwise be wrong

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 20 13:35:09 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23598

            Bug ID: 23598
           Summary: MachObjectWriter::WriteNlist() might be grabbing the
                    wrong symbol offset, or may otherwise be wrong
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: dexonsmith at apple.com
                CC: enderby at apple.com, kledzik at apple.com,
                    lhames at gmail.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I added a FIXME in r237750 when I noticed strange mixing of an `MCSymbol
*Symbol` and an `MCSymbolData &Data`, which aren't necessarily talking about
the same "symbol".

@@ -377,7 +373,9 @@ void MachObjectWriter::WriteNlist(MachSymbolData &MSD,
   if (IsAlias && Symbol->isUndefined())
     Address = AliaseeInfo->StringIndex;
   else if (Symbol->isDefined())
-    Address = getSymbolAddress(&Data, Layout);
+    // FIXME: Should Data.getSymbol() always be *Symbol?  It doesn't look like
+    // that's true.
+    Address = getSymbolAddress(Data.getSymbol(), Layout);
   else if (Data.isCommon()) {
     // Common symbols are encoded with the size in the address
     // field, and their alignment in the flags.

I'll circle back to this eventually -- the whole function looks kind of hairy
-- but anyone else feel free to look into it in the meantime.

I'm about to move the FIXME around, since I'm removing the MCSymbolData
backpointer to MCSymbol, but the code won't really change.  I'll reference the
PR in the commit.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150520/83032bed/attachment.html>


More information about the llvm-bugs mailing list