<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/65146>65146</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            LLD --save-temps ELF object file output does not set e_flags the same as for the final link
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lld:ELF
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ilovepi
      </td>
    </tr>
</table>

<pre>
    While investigating #65090, using `--save-temps` I was surprised that the e_flags in the `lto.o` file were not the same as those in the final linked binary. This makes using tools like `llvm-objdump` hard to use without passing several other flags. I'm not sure if this is related to RISC-V target features or if this is an existing problem that goes beyond RISC-V.

CC: @MaskRay Is this a known issue? Is there a workaround?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcUs2O2zwMfBr5QsRQ5J9sDj7ky66BAPku26I9FvSatrWRLUOkkubtCzvbdtGLDUnkzHA4yGz7iahSxX-qeE4wyuBDZZ2_0myTxrf36vtgHYGdrsRiexQ79aBMVhZ6r5U5QuT1ptSbDeOVNkLjzKrUcIIbMnAMc7BMLciAAjIQ0I_OYc9gp_WoSu3Ep37p6RauGwWCyT-KGUcCZJDBM_1u6eyEDpydLtRCYycM9xS-DpZhxAvxhybx3jE4e3lwuOu48c17G8d5oRowtCAeIhPcrAw-CsyLIVMPTFcK6MDLQAFWtSmclNmNqy6OgcB2IAujZQjkUGhFez19OW6-gWDoSaAjlBiIwYfP9TgB_bS8WjkH3zgaH-70nhgauvup_UBKlX5W-vD4Ho8qO4DK9f_Il1e8w4kfmAiXyd8msMyRVFY_HhYbEW4-XDD4OLUqq5O2ytp9tseEqm25zwqdZ1meDFXXki73ORr9VGBT7jJqjNmWVOzKrSY0ia2MNpl-yrbbXWG2eVrkZbEvjGmL4qkw2Klc04jWpYvRqQ99sqqpymKbl4nDhhyvOTPGuVZlh5dzrYxZYheqdTlN7Fnl2lkW_osiVhxV5_MzfA4YvJxr8M07vckjND7KHAXaxcF1RyR_gvY5R50P_0QoicFVg8jMKjsoUytT91aG2KRvflSmXpR8_DZz8AulMvU6HCtTr_P9CgAA__9fIBc0">