Bug 249467
| Summary: | eu-readelf -n vs .debug files | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Jan Kratochvil <jan.kratochvil> |
| Component: | elfutils | Assignee: | Roland McGrath <roland> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | rawhide | ||
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | 0.131-1.fc7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2007-11-13 00:13:26 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
There is no problem in eu-strip, just in eu-readelf. It uses the phdrs instead of sections to look for notes. readelf (bintuils) will show you that the contents are fine. It's on my list to make eu-readelf handle notes in .debug files, but it is not a big priority. ELF first pages in the core files have corrupted/missing SHDR as it just does not fit there. So one needs to locate NT_GNU_BUILD_ID from the core files by PHDR only. This cannot be changed. But separate .debug files have only the corrupted (not updated) PHDR offsets while SHDR is right there. Wouldn't it be best to implement/fix PHDR offsets updating in EU-STRIP? The debug-id consumers now need a workaround to differentiate looking up the build-id NOTE in the ELF main file from the core (PHDR) the ELF separate debug file (SHDR). No, it's best that phdrs remain untouched by strip. The proper procedure should be to use shdrs when available and phdrs when not. When you have a partial or corrupt ELF file such that the shdrs are not usable, then shdrs are not available, so don't use them. I have changed readelf upstream to use sections in preference to phdrs. This should be fixed in 0.130. This issue should be resolved by elfutils-0.130. If there is still a problem, reopen or file a new bug report with complete test case details. elfutils-0.130-3.fc7 has been pushed to the Fedora 7 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update elfutils' elfutils-0.131-1.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report. |
Description of problem: eu-strip debug file separation corrupts the embedded build-id note. Version-Release number of selected component (if applicable): elfutils-0.128-2.fc7.x86_64 How reproducible: Always. Steps to Reproduce: 1. echo 'int main (void) { return 0; }' >main.c;gcc -o main main.c -Wl,--build-id;echo ORIG;eu-readelf -a main|grep -A99 Owner;eu-strip --strip-debug -f main.debug main;echo STRIPPED-BASE;eu-readelf -a main|grep -A99 Owner;echo STRIPPEd-DEBUG;eu-readelf -a main.debug|grep -A99 Owner Actual results: ORIG Owner Data size Type GNU 16 VERSION OS: Linux, ABI: 2.6.9 GNU 20 <unknown>: 3 STRIPPED-BASE Owner Data size Type GNU 16 VERSION OS: Linux, ABI: 2.6.9 GNU 20 <unknown>: 3 STRIPPEd-DEBUG Owner Data size Type 4 <unknown>: 20 Expected results: ORIG Owner Data size Type GNU 16 VERSION OS: Linux, ABI: 2.6.9 GNU 20 <unknown>: 3 STRIPPED-BASE Owner Data size Type GNU 16 VERSION OS: Linux, ABI: 2.6.9 GNU 20 <unknown>: 3 STRIPPEd-DEBUG Owner Data size Type GNU 16 VERSION OS: Linux, ABI: 2.6.9 GNU 20 <unknown>: 3 Additional info: