<div dir="ltr">On Thu, Jan 4, 2018 at 9:14 AM, John Reagan via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>
    </p>
    <div class="m_-7138785077021501552moz-text-html" lang="x-unicode">
      <p><font face="Courier New, Courier, monospace">We use .note
          descriptors with ELF on OpenVMS.  We have self-describing
          entries with tags and lengths.  The compiler encodes stuff for
          the linker such as compiler version, compilation date-time,
          module name, final severity of the compilation, etc.  The
          linker itself then adds/modifies the .note entries to insert
          linker version, link date/time, etc.  We also use .notes to
          record floating point settings used on the compilation (ie,
          VAX float vs IEEE float with denorms vs IEEE float without
          denorms, etc.)  We currently don't have options that impact
          the linker's behavior but that is reasonable.</font></p></div></div></blockquote><div>The note that I am describing would be part of the LLVM namespace.  It would be named ".note.linker-options".  These notes should *not* be preserved across the actual link.  The notes that you are describing sound very much like the ones in the ARM ELF specification (although they call them attributes).<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><div class="m_-7138785077021501552moz-text-html" lang="x-unicode">
      <p><font face="Courier New, Courier, monospace">I would like to
          see something with tags so that our linker can identify .notes
          that it cares about vs .notes that it should ignore.<br></font></p></div></div></blockquote><div>Since they are in the vendor namespace, you should already be able to determine that.   You are using a different vendor namespace, and the two would not collide and you would be able to easily identify the notes that you can ignore.  Unless your frontend emits the metadata, no such note would even be created in the first place.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><div class="m_-7138785077021501552moz-text-html" lang="x-unicode"><p><font face="Courier New, Courier, monospace">
        </font></p>
      <p><font face="Courier New, Courier, monospace">For our x86 work,
          we're starting to generate them at the MC boundary so they
          show up both in the ELF and in an .s file.</font></p></div></div></blockquote><div>Yes, this is the same as what happens here. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><div class="m_-7138785077021501552moz-text-html" lang="x-unicode">
      <p><font face="Courier New, Courier, monospace">What we plan to do
          is to generate module metadata which would then get turned
          into MC calls.<br>
        </font></p>
      <p><font face="Courier New, Courier, monospace">Here's what we
          generate on OpenVMS Itanium (we don't do .s files there)</font></p>
      <p><font face="Courier New, Courier, monospace">Analyze Object
          File                           4-JAN-2018
          11:44:44.78                   <wbr>                              <wbr> 
          Page 1<br>
          WORK20:[JREAGAN]HW.OBJ;73<br>
          ANALYZ I01-55<br>
          <br>
          This is an OpenVMS IA64 (Elf format) object file<br>
          <br>
          Module Identification Information, in note section 2.<br>
          <br>
              Module name:                         <wbr>       "HW"<br>
              Module version:                      <wbr>       "V1.0"<br>
              Creation date/time:                    <wbr>     " 9-JUN-2017
          10:30"<br>
              Language name:                         <wbr>     "VSI C
          V7.4-001"<br>
          <br>
          Elf Header Information, at file address 0.<br>
          <br>
              Class:                        <wbr>              ELF-64<br>
              Data:                         <wbr>              Little-endian
          byte order<br>
              Elf Header Version:                      <wbr>   1.<br>
              OS ABI:                          <wbr>           OpenVMS<br>
              OS ABI Version:                      <wbr>       2.<br>
              Type:                         <wbr>              Object<br>
              Machine Architecture:                 <wbr>      IA_64<br>
              Elf File Version:                      <wbr>     1.<br>
              VMS Completion Code:                        SUCCESS<br>
        </font></p>
      <p><font face="Courier New, Courier, monospace">...</font></p>
      <p><font face="Courier New, Courier, monospace">SECTION DATA 2.
          (0002)                       SHDR$K_SHT_NOTE 00000000000000A8
          (168.) bytes<br>
          ".note"<br>
          FileAddr Offset in Section 2. (0002)<br>
          -------- ---------------------------<br>
          000000C0 00000000  Note Entry 0.<br>
          000000C0 00000000    Note Name Size:            
          0000000000000008       8.                            <wbr> 
          nhdr$q_nh_namesz<br>
          000000C8 00000008    Note Descriptor size:      
          000000000000002A      42.                           <wbr>  
          nhdr$q_nh_descsz<br>
          000000D0 00000010    Note Type:                 
          0000000000000001       1. NT_VMS_MHD                  
          nhdr$q_nh_type<br>
          000000D8 00000018    Note Name:                  "IPF/VMS"<br>
          000000E0 00000020    Descriptor:<br>
          000000E0 00000020      Creation Date/Time:       " 9-JUN-2017
          10:30"<br>
          000000F1 00000031      Last Patch Date/Time:     " 9-JUN-2017
          10:30"<br>
          00000102 00000042      Module Name:              "HW"<br>
          00000105 00000045      Module Version:           "V1.0"<br>
          <br>
          00000110 00000050  Note Entry 1.<br>
          00000110 00000050    Note Name Size:            
          0000000000000008       8.                            <wbr> 
          nhdr$q_nh_namesz<br>
          00000118 00000058    Note Descriptor size:      
          000000000000000F      15.                           <wbr>  
          nhdr$q_nh_descsz<br>
          00000120 00000060    Note Type:                 
          0000000000000002       2. NT_VMS_LNM                  
          nhdr$q_nh_type<br>
          00000128 00000068    Note Name:                  "IPF/VMS"<br>
          00000130 00000070    Descriptor:<br>
          00000130 00000070      Language Name:            "VSI C
          V7.4-001"<br>
          <br>
          00000140 00000080  Note Entry 2.<br>
          00000140 00000080    Note Name Size:            
          0000000000000008       8.                            <wbr> 
          nhdr$q_nh_namesz<br>
          00000148 00000088    Note Descriptor size:      
          0000000000000008       8.                            <wbr> 
          nhdr$q_nh_descsz<br>
          00000150 00000090    Note Type:                 
          0000000000000006       6. NT_VMS_FPMODE               
          nhdr$q_nh_type<br>
          00000158 00000098    Note Name:                  "IPF/VMS"<br>
          00000160 000000A0    Descriptor:<br>
          00000160 000000A0      Floating-Point Mode:     
          0000000009800000          IEEE DENORM_RESULTS<br>
        </font></p>
      <p><font face="Courier New, Courier, monospace">On OpenVMS x86,
          here's what we have in our .s files at the moment (subject to
          change)</font></p>
      <p><font face="Courier New, Courier, monospace">       
          .section        .note,"",@note<br>
                  .quad   8<br>
                  .quad   44<br>
                  .quad   1<br>
                  .ascii  "IPF/VMS"<br>
                  .byte   0<br>
                  .ascii  " 4-JAN-2018 11:49"<br>
                  .ascii  " 4-JAN-2018 11:49"<br>
                  .ascii  ".MAIN."<br>
                  .byte   0<br>
                  .ascii  "V1"<br>
                  .byte   0<br>
                  .align  8<br>
                  .quad   8<br>
                  .quad   14<br>
                  .quad   2<br>
                  .ascii  "IPF/VMS"<br>
                  .byte   0<br>
                  .ascii  "XMAC X6.0-004"<br>
                  .byte   0<br>
                  .align  8<br>
        </font><br>
      </p>
    </div>
  </div>

<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>
</div></div>