Bug 807823 - elflint doesn't recognize SHF_INFO_LINK on relocation sections
elflint doesn't recognize SHF_INFO_LINK on relocation sections
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: elfutils (Show other bugs)
rawhide
x86_64 Linux
unspecified Severity low
: ---
: ---
Assigned To: Roland McGrath
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-28 16:14 EDT by Sverd Johnsen
Modified: 2012-07-10 17:01 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-02 18:27:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
*** failure in ../libelf/libelf.so (230.21 KB, application/gzip)
2012-03-28 16:14 EDT, Sverd Johnsen
no flags Details

  None (edit)
Description Sverd Johnsen 2012-03-28 16:14:42 EDT
Created attachment 573441 [details]
*** failure in ../libelf/libelf.so

Description of problem:

Extracting symbols... done
PASS: run-arextract.sh
PASS: run-arsymtest.sh
PASS: newfile
PASS: test-nlist
PASS: update1
PASS: update2
PASS: update3
PASS: update4
PASS: run-show-die-info.sh
PASS: run-get-files.sh
PASS: run-get-lines.sh
PASS: run-get-pubnames.sh
PASS: run-get-aranges.sh
PASS: run-allfcts.sh
PASS: run-show-abbrev.sh
PASS: run-line2addr.sh
PASS: hash
PASS: newscn
PASS: run-strip-test.sh
PASS: run-strip-test2.sh
PASS: run-strip-test3.sh
PASS: run-strip-test4.sh
PASS: run-strip-test5.sh
PASS: run-strip-test6.sh
PASS: run-strip-test7.sh
PASS: run-strip-test8.sh
PASS: run-strip-groups.sh
PASS: run-strip-reloc.sh
PASS: run-unstrip-test.sh
PASS: run-unstrip-test2.sh
PASS: run-ecp-test.sh
PASS: run-ecp-test2.sh
PASS: run-alldts.sh
PASS: run-elflint-test.sh
section [36] '.symtab': symbol 307: st_value out of bounds
*** failure in ../src/ld
section [36] '.symtab': symbol 312: st_value out of bounds
*** failure in ../libelf/libelf.so
FAIL: run-elflint-self.sh
PASS: run-ranlib-test.sh
PASS: run-ranlib-test2.sh
PASS: run-ranlib-test3.sh
PASS: run-ranlib-test4.sh
PASS: run-addrscopes.sh
PASS: run-strings-test.sh
PASS: run-funcscopes.sh
PASS: run-find-prologues.sh
PASS: run-allregs.sh
PASS: run-readelf-test1.sh
PASS: run-readelf-test2.sh
PASS: run-readelf-test3.sh
PASS: run-readelf-test4.sh
PASS: run-readelf-twofiles.sh
PASS: run-native-test.sh
PASS: run-bug1-test.sh
PASS: dwfl-bug-addr-overflow
PASS: run-addrname-test.sh
PASS: dwfl-bug-fd-leak
PASS: dwfl-bug-report
PASS: run-dwfl-bug-offline-rel.sh
PASS: run-dwfl-addr-sect.sh
PASS: run-disasm-x86.sh
PASS: run-disasm-x86-64.sh
PASS: run-early-offscn.sh
PASS: run-dwarf-getmacros.sh
PASS: run-test-flag-nobits.sh
PASS: run-prelink-addr-test.sh
PASS: run-dwarf-getstring.sh
PASS: run-rerequest_tag.sh
PASS: msg_tst
PASS: md5-sha1-test
PASS: asm-tst1
PASS: asm-tst2
PASS: asm-tst3
PASS: asm-tst4
PASS: asm-tst5
PASS: asm-tst6
PASS: asm-tst7
PASS: asm-tst8
PASS: asm-tst9
=====================================================
1 of 76 tests failed
Please report to http://bugzilla.redhat.com/bugzilla/
=====================================================
make[2]: *** [check-TESTS] Error 1


System: x86_64, gcc 4.7.0, glibc 2.15. Not Fedra
Comment 1 Mark Wielaard 2012-03-28 16:25:36 EDT
> section [36] '.symtab': symbol 307: st_value out of bounds
> *** failure in ../src/ld
> section [36] '.symtab': symbol 312: st_value out of bounds
> *** failure in ../libelf/libelf.so
> [...]
> System: x86_64, gcc 4.7.0, glibc 2.15. Not Fedra

This smells like the following binutils bug:
http://sourceware.org/bugzilla/show_bug.cgi?id=13621

Could you check that your binutils contains that fix?
Comment 2 Sverd Johnsen 2012-03-28 17:49:12 EDT
Looks like the binutils snapshot I'm using is missing that commit, at least from what I could tell after a quick look in linker.c 

Thanks, that was quick.

Rebuilding with -fuse-linker-plugin yields:

Extracting symbols... done
PASS: run-arextract.sh
PASS: run-arsymtest.sh
PASS: newfile
PASS: test-nlist
PASS: update1
PASS: update2
PASS: update3
PASS: update4
PASS: run-show-die-info.sh
PASS: run-get-files.sh
PASS: run-get-lines.sh
PASS: run-get-pubnames.sh
PASS: run-get-aranges.sh
PASS: run-allfcts.sh
PASS: run-show-abbrev.sh
PASS: run-line2addr.sh
PASS: hash
PASS: newscn
PASS: run-strip-test.sh
PASS: run-strip-test2.sh
PASS: run-strip-test3.sh
PASS: run-strip-test4.sh
PASS: run-strip-test5.sh
PASS: run-strip-test6.sh
PASS: run-strip-test7.sh
PASS: run-strip-test8.sh
PASS: run-strip-groups.sh
PASS: run-strip-reloc.sh
PASS: run-unstrip-test.sh
PASS: run-unstrip-test2.sh
PASS: run-ecp-test.sh
PASS: run-ecp-test2.sh
PASS: run-alldts.sh
PASS: run-elflint-test.sh
section [10] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../src/addr2line
section [10] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../src/elfcmp
section [10] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../src/elflint
section [10] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../src/findtextrel
section [10] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../src/ld
section [10] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../src/nm
section [10] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../src/objdump
section [10] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../src/readelf
section [10] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../src/size
section [10] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../src/strip
section [ 9] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../libelf/libelf.so
section [ 9] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../libdw/libdw.so
section [ 9] '.rela.plt' has wrong flags: expected none and possibly ALLOC, is ALLOC|INFO_LINK
*** failure in ../libasm/libasm.so
FAIL: run-elflint-self.sh
PASS: run-ranlib-test.sh
PASS: run-ranlib-test2.sh
PASS: run-ranlib-test3.sh
PASS: run-ranlib-test4.sh
PASS: run-addrscopes.sh
PASS: run-strings-test.sh
PASS: run-funcscopes.sh
PASS: run-find-prologues.sh
PASS: run-allregs.sh
PASS: run-readelf-test1.sh
PASS: run-readelf-test2.sh
PASS: run-readelf-test3.sh
PASS: run-readelf-test4.sh
PASS: run-readelf-twofiles.sh
PASS: run-native-test.sh
PASS: run-bug1-test.sh
PASS: dwfl-bug-addr-overflow
PASS: run-addrname-test.sh
PASS: dwfl-bug-fd-leak
PASS: dwfl-bug-report
PASS: run-dwfl-bug-offline-rel.sh
PASS: run-dwfl-addr-sect.sh
PASS: run-disasm-x86.sh
PASS: run-disasm-x86-64.sh
PASS: run-early-offscn.sh
PASS: run-dwarf-getmacros.sh
PASS: run-test-flag-nobits.sh
PASS: run-prelink-addr-test.sh
PASS: run-dwarf-getstring.sh
PASS: run-rerequest_tag.sh
PASS: msg_tst
PASS: md5-sha1-test
PASS: asm-tst1
PASS: asm-tst2
PASS: asm-tst3
PASS: asm-tst4
PASS: asm-tst5
PASS: asm-tst6
PASS: asm-tst7
PASS: asm-tst8
PASS: asm-tst9
=====================================================
1 of 76 tests failed
Please report to http://bugzilla.redhat.com/bugzilla/
=====================================================

ld -v
GNU ld (GNU Binutils) 2.22.0.20120323

ld.gold -v
GNU gold (GNU Binutils 2.22.0.20120323) 1.11

Guess I'll just ignore that for now :)
Comment 3 Roland McGrath 2012-03-28 18:05:11 EDT
I think your compiler setup is actually using gold.  Can you verify that?

Relocation sections do have a shndx in sh_info and so really ought to have SHF_INFO_LINK set.  From what I can see, only gold actually does it.
So I've just changed elflint to accept the flag being set, but not require it.
Really it probably ought to insist on it except for --gnu-ld mode, but I didn't bother with those nontrivial changes.
Comment 4 Mark Wielaard 2012-04-03 05:46:05 EDT
There are now a couple of extra fixes and testcases for issues found against gold linked binaries in elfutils git. Would you happen to be able to test against that? http://git.fedorahosted.org/git/elfutils.git
Comment 5 Fedora Update System 2012-06-25 05:07:48 EDT
elfutils-0.154-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/elfutils-0.154-1.fc17
Comment 6 Fedora Update System 2012-06-25 05:07:55 EDT
elfutils-0.154-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/elfutils-0.154-1.fc16
Comment 7 Fedora Update System 2012-06-25 20:33:40 EDT
Package elfutils-0.154-1.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing elfutils-0.154-1.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-9846/elfutils-0.154-1.fc17
then log in and leave karma (feedback).
Comment 8 Fedora Update System 2012-07-02 18:27:07 EDT
elfutils-0.154-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2012-07-10 17:01:13 EDT
elfutils-0.154-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.