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

    <tr>
        <th>Summary</th>
        <td>
            llvm-objcopy: Emit warnings when handling sparse ELF files
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    The `objcopy` from GNU binutils (`bfd` actually [0]) when dealing with sparse ELF input file reports warning like:

```
Warning: Writing section `.sectionA' to huge (ie negative) file offset 0xa200c999.
```

Can we implement something like this in `llvm-objcopy`? Since the logic for copying is implemented within the `ELFObjcopy` which is being used in modules other than `llvm-objcopy`, is it OK to emit warning in the library it self?

[0] https://github.com/bminor/binutils-gdb/blob/master/bfd/binary.c#L277
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U81u2zwQfBrqsohBUbZsHXRwfvQdvqA5tEXOFLkSN6VIgaTi-u0Lyk6TAEEBgT_Y2d3RLEfGSKNDbNnulu3uC7kk40OrX5LXPvii9_rc_jAIrOa-f1F-PrOawxD8BP99-wk9uSWRjcDEgdW8H3QOS5UWae0Z2O6Ws909Ew2cDDrQKC25EU6UDMRZhojw8NgBuXlJMJBFCDj7kCKcZHAZaukXsurI-D3jb2vNr996fb4gWXWE50ApJ0VUibzLrDfX85GJPSQPZhkxsyUEh6NM9IqZ3trbD0PEBPy3FJyrpmk2Xza8rHfSwQmBptnihC5B9BMm88YZkqEItHKw9nW6eZePVR18J6cyBsH6kRQMPkAO5_Sc91YV9SoWuRXLav7w2D29D-JkSJmc0GPOXCLq3HPyerEYwSeDAZKRX9IQd2urBE__Z2VwovRX9mtDS32Q4ZxBEe3Aqu7TIC7jBZPSHPOQRMdEN1IyS79RfmKi6ydyPuTD9aXcjLrPV-vzNsmYcA0P-gKS4bxRTFSPYr8vdFvppmpkgW25LytR181uW5hW862ouZS9EroueaNLOTSN2mFVqerQy4JawcWWb8u6LEVTbjeoa9FXFR6UKssd1mzLcZJkN1mUjQ9jQTEu2B4Oh_2hsLJHG1dTCOHwBGuQCZE9EtpVyH4ZI9tySzHF9yqJksX2k9LVER4-SBsvVjDS6dULH2yQH2EslmDbfyiaa1-3mzn4F1SJiW4lGJno1h_4EwAA___fUjyx">