[Rpm-maint] [rpm-software-management/rpm] debugedit: don't reorder sections (#565)

Sergei Trofimovich notifications at github.com
Sat Oct 6 16:59:52 UTC 2018


In https://bugs.gentoo.org/666954 debugedit processed
crtbeginS.o from gcc-8.2.0 and turned into invalid ELF:

```
$ cp crtbeginS-ok-7.3.0.o.back crtbeginS-ok-7.3.0.o
$ debugedit -i -b $(pwd) -d /usr/src/debug -l ./foo crtbeginS-ok-7.3.0.o
$ export LANG=C
$ readelf -a crtbeginS-ok-7.3.0.o.back >/dev/null && echo ok
readelf: Warning: [ 9]: Info field (8) should index a relocatable section.
ok

$ readelf -a crtbeginS-ok-7.3.0.o >/dev/null && echo ok
readelf: Warning: [ 9]: Info field (8) should index a relocatable section.
readelf: Error:  bad symbol index: 54495f00 in reloc
readelf: Error:  bad symbol index: 656c6261 in reloc
readelf: Error:  bad symbol index: 62615465 in reloc
readelf: Error:  bad symbol index: 69665f61 in reloc
readelf: Warning: local symbol 11 found at index >= symtab's sh_info value of 11
readelf: Warning: local symbol 14 found at index >= symtab's sh_info value of 11
readelf: Warning: local symbol 15 found at index >= symtab's sh_info value of 11
```

Ths fix is not to reorder sections as debugedit does not
account for offset change.

debugedit already does it for final executables and shared libraries.

Bug: https://bugs.gentoo.org/666954
Closes: https://github.com/rpm-software-management/rpm/issues/423
Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/565

-- Commit Summary --

  * debugedit: don't reorder sections

-- File Changes --

    M tools/debugedit.c (7)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/565.patch
https://github.com/rpm-software-management/rpm/pull/565.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/565
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20181006/1d9ef7dd/attachment.html>


More information about the Rpm-maint mailing list