$ sparc64-sun-solaris2.9-strip --strip-debug *.a BFD: st3IYdGV/greg_weekday.o: unsupported relocation type R_SPARC_H44 sparc64-sun-solaris2.9-strip: st3IYdGV/greg_weekday.o: Bad value BFD: stbZAhUO/operations_posix_windows.o: unsupported relocation type R_SPARC_WDISP30 sparc64-sun-solaris2.9-strip: stbZAhUO/operations_posix_windows.o: Bad value BFD: BFD 2.17.50.0.3 20060715 assertion fail reloc.c:4818 BFD: stCu0HdI/instantiate_cpp_grammar.o: unsupported relocation type R_SPARC_64 sparc64-sun-solaris2.9-strip: stCu0HdI/instantiate_cpp_grammar.o: Bad value
the main trick here is that boost archives were built with "<shared-linkable>true" option. it means they can be used as statically linked parts of shared objects. strip works perfect with these *.o files extracted from *.a so i think it assumes content of *.a to strictly.
Created attachment 1240 [details] reduced lib.
Created attachment 1241 [details] reduced lib.
Created attachment 1242 [details] reduced lib.
Hi Pawel, The real problem here appears to be that the libraries you are stripping contain object files of different target types (elf64-big and elf64-sparc). Objcopy was assuming that you wanted to convert all of the object files in the library to one particular file format (elf64-big - the format of the first file in the library). The error messages arose because objcopy was unable to convert some of the relocs in the object files from elf64-big to elf64-sparc. The uploaded patch should fix this problem, so that by default objcopy will preserve the file formats of copied archive elements unless it has been given the -O (or --output-target) command line switch. Please could you try it out and let me know how you get on. Cheers Nick
Created attachment 1290 [details] Preserve output file formats of copied archive elements unless explicitly requiested otherwise
works fine :)
Patch checked in.z
(In reply to comment #8) > Patch checked in.z thanks. i have one more sparc64 issue. the sparc64-sun-solaris2.9-ld rejects boost's static libraries with 'skipping incompatible...'. as far i can see, the `nomachine` objects causes this linker error. e.g. libboost_filesystem.a: convenience.o: ELF 64-bit MSB relocatable, SPARC V9 exception.o: ELF 64-bit MSB relocatable, no machine <=== operations_posix_windows.o: ELF 64-bit MSB relocatable, SPARC V9 path_posix_windows.o: ELF 64-bit MSB relocatable, SPARC V9
simple testcase: $ sparc64-sun-solaris2.9-g++ -o /dev/null -Wl,--whole-archive libboost_filesystem.a /local/devel/toolchain41/sparc64-sun-solaris2.9/lib/gcc/sparc64-sun-solaris2.9/4.1.2/../../../../sparc64-sun-solaris2.9/bin/ld: libboost_filesystem.a(exception.o): Relocations in generic ELF (EM: 0) (...) libboost_filesystem.a(exception.o): could not read symbols: File in wrong format collect2: ld returned 1 exit status