Bug 490797
Summary: | Ranlib and "ar -s" Can Not Regenerate Index | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Qian Cai <qcai> |
Component: | binutils | Assignee: | Nick Clifton <nickc> |
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | rawhide | CC: | jakub, jan.kratochvil, nickc |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2009-03-27 11:01:38 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: |
Description
Qian Cai
2009-03-18 05:08:50 UTC
Hi Cai, This is the correct behaviour. Once you have stripped all of the symbols out of the files in the archive (using the "strip lib.a" command) it is no longer possible to regenerate the symbol index. Basically there are no symbols left in the archive, so it is not possible to create an index based on them. If you change the strip command to only remove unneeded symbols then you will be able to create a symbol index. ie: # ar cr lib.a file1.o # strip --strip-unneeded lib.a # ar s lib.a # nm -s lib.a Archive index: main in file1.o file1.o: 0000000000000000 T main U puts Cheers Nick Thanks Nick! I'll fix the broken test case instead. Hi Nick, it is not obvious to me "ar -s" makes any different. Please see the following example, $ ar cr lib.a file1.o $ ls -l lib.a -rw-rw-r-- 1 caiqian caiqian 1018 2009-04-02 10:42 lib.a $ nm -s lib.a Archive index: main in file1.o file1.o: 00000000 T main U puts $ strip --strip-unneeded lib.a $ ls -l lib.a -rw-rw-r-- 1 caiqian caiqian 994 2009-04-02 10:42 lib.a $ nm -s lib.a Archive index: main in file1.o file1.o: 00000000 T main U puts $ ar -s lib.a $ ls -l lib.a -rw-rw-r-- 1 caiqian caiqian 994 2009-04-02 10:43 lib.a $ nm -s lib.a Archive index: main in file1.o file1.o: 00000000 T main U puts As you can see from the above, the file size and "nm -s" output did not change at all after "ar -s". Hi Cai,
> it is not obvious to me "ar -s" makes any different
It doesn't. :-)
It does make a difference on some versions of the ar program, notably those on some Unix and Solaris systems. These versions of ar do not automatically added a symbol index when the archive is created. But the binutils ar automatically adds a symbol index when an archive is created. So the -s option is supported mainly for backwards compatibility with these other versions of ar.
Cheers
Nick
Thanks a lot, Nick! Those test cases were written a few years back, and I happened to deal with them recently, so I guess they were using the different version of "ar" other than bintuils. |