Bug 807823 - elflint doesn't recognize SHF_INFO_LINK on relocation sections
Summary: elflint doesn't recognize SHF_INFO_LINK on relocation sections
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: elfutils
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Roland McGrath
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-28 20:14 UTC by Sverd Johnsen
Modified: 2012-07-10 21:01 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-02 22:27:07 UTC
Type: ---


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

Description Sverd Johnsen 2012-03-28 20:14:42 UTC
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 20:25:36 UTC
> 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 21:49:12 UTC
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 22:05:11 UTC
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 09:46:05 UTC
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 09:07:48 UTC
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 09:07:55 UTC
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-26 00:33:40 UTC
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 22:27:07 UTC
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 21:01:13 UTC
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.