Probably something has changed in the BFD functions in binutils, because attaching metadata using tdelfeditor causes damage to binaries and libraries with the current binutils 2.35.x snapshot.
Steps to reproduce
Upgrade to the binutils contained in the Debian Bullseye / SID.
Build libr along with current binutils.
Try to build tdelibs => it will cause FTBFS.
After adding the metadata, an attempt to run the binary reports:
cannot execute binary file: Exec format error
If it is built without tdelfeditor support, the build is successful.
## Basic information
- TDE version: R14.0.9~pre
- Distribution: Bullseye / SID
- Hardware: any
## Description
Probably something has changed in the BFD functions in binutils, because attaching metadata using `tdelfeditor` causes damage to binaries and libraries with the current binutils 2.35.x snapshot.
## Steps to reproduce
1. Upgrade to the binutils contained in the Debian Bullseye / SID.
2. Build libr along with current binutils.
3. Try to build tdelibs => it will cause FTBFS.
After adding the metadata, an attempt to run the binary reports:
```
cannot execute binary file: Exec format error
```
If it is built without tdelfeditor support, the build is successful.
with binutils 2.34.90, the ELF content is slightly different after the first tdelfeditor call on a file. The file is still usable. Subsequent usage of tdelfeditor on the same file result in the file being corrupted and the format error being reported.
This is the error reported on the second call to tdelfeditor on the same file
BFD: ./newTDEApp.34: warning: empty loadable segment detected at vaddr=0, is this intentional?
BFD: ./newTDEApp.34: warning: empty loadable segment detected at vaddr=0x4000, is this intentional?
BFD: ./newTDEApp.34: warning: empty loadable segment detected at vaddr=0x5000, is this intentional?
with binutils 2.34.90, the ELF content is slightly different after the first tdelfeditor call on a file. The file is still usable. Subsequent usage of tdelfeditor on the same file result in the file being corrupted and the format error being reported.
This is the error reported on the second call to tdelfeditor on the same file
```
BFD: ./newTDEApp.34: warning: empty loadable segment detected at vaddr=0, is this intentional?
BFD: ./newTDEApp.34: warning: empty loadable segment detected at vaddr=0x4000, is this intentional?
BFD: ./newTDEApp.34: warning: empty loadable segment detected at vaddr=0x5000, is this intentional?
```
Basic information
Description
Probably something has changed in the BFD functions in binutils, because attaching metadata using
tdelfeditor
causes damage to binaries and libraries with the current binutils 2.35.x snapshot.Steps to reproduce
After adding the metadata, an attempt to run the binary reports:
If it is built without tdelfeditor support, the build is successful.
with binutils 2.34.90, the ELF content is slightly different after the first tdelfeditor call on a file. The file is still usable. Subsequent usage of tdelfeditor on the same file result in the file being corrupted and the format error being reported.
This is the error reported on the second call to tdelfeditor on the same file
Fixed by PR #5