<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - ObjectFileELF::GetModuleSpecifications overrides OS and Vendor name with those from host"
   href="http://llvm.org/bugs/show_bug.cgi?id=17209">17209</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ObjectFileELF::GetModuleSpecifications overrides OS and Vendor name with those from host
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>emaste@freebsd.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>spec.GetArchitecture().GetTriple().setOSName
(Host::GetOSString().GetCString());
spec.GetArchitecture().GetTriple().setVendorName(Host::GetVendorString().GetCString());

We would like to be able to open Linux and FreeBSD core files on any of Linux,
FreeBSD, and OS X.

Michael provided a reference for the GNU ABI tag already:
<a href="http://refspecs.linuxfoundation.org/LSB_1.2.0/gLSB/noteabitag.html">http://refspecs.linuxfoundation.org/LSB_1.2.0/gLSB/noteabitag.html</a>

Note that the build ID page reports that "the name is not normative, and the
section can be merged with other SHT_NOTE sections."
<a href="http://fedoraproject.org/wiki/Releases/FeatureBuildId">http://fedoraproject.org/wiki/Releases/FeatureBuildId</a>
We should apply the same logic for ABI tag parsing, using the note name and not
relying on the section name.

We can fall back to using the Host's OS/Vendor if the note is not found.

A handy reference:

** Linux **
Name: GNU
Type: NT_GNU_ABI_TAG (1)
Desc: Four 4-byte words, as follows
 OS (0=linux)
 major version (minimum compatible kernel version)
 minor version
 dot version

** FreeBSD **
Name: FreeBSD
Type: NT_FREEBSD_ABI_TAG (1)
Desc: One 4-byte word

** NetBSD **
Name: NetBSD
Type: NT_NETBSD_IDENT(?) (1)
Desc: One 4-byte word containing the version constant

<a href="http://www.netbsd.org/docs/kernel/elf-notes.html">http://www.netbsd.org/docs/kernel/elf-notes.html</a>

** OpenBSD **
Name: OpenBSD
Type: NT_OPENBSD_IDENT (1)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>