Bug 3110 - unsupported relocation type {R_SPARC_H44, R_SPARC_WDISP30, R_SPARC_64}
Summary: unsupported relocation type {R_SPARC_H44, R_SPARC_WDISP30, R_SPARC_64}
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.17
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-23 11:15 UTC by Pawel Sikora
Modified: 2006-09-11 15:02 UTC (History)
1 user (show)

See Also:
Host:
Target: sparc64-sun-solaris2.9
Build:
Last reconfirmed:


Attachments
reduced lib. (41.58 KB, application/octet-stream)
2006-08-23 11:38 UTC, Pawel Sikora
Details
reduced lib. (143.00 KB, application/octet-stream)
2006-08-23 11:38 UTC, Pawel Sikora
Details
reduced lib. (576.56 KB, application/octet-stream)
2006-08-23 11:48 UTC, Pawel Sikora
Details
Preserve output file formats of copied archive elements unless explicitly requiested otherwise (1.08 KB, patch)
2006-09-08 15:08 UTC, Nick Clifton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Sikora 2006-08-23 11:15:30 UTC
$ 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
Comment 1 Pawel Sikora 2006-08-23 11:26:18 UTC
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.
Comment 2 Pawel Sikora 2006-08-23 11:38:08 UTC
Created attachment 1240 [details]
reduced lib.
Comment 3 Pawel Sikora 2006-08-23 11:38:25 UTC
Created attachment 1241 [details]
reduced lib.
Comment 4 Pawel Sikora 2006-08-23 11:48:01 UTC
Created attachment 1242 [details]
reduced lib.
Comment 5 Nick Clifton 2006-09-08 15:07:35 UTC
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
Comment 6 Nick Clifton 2006-09-08 15:08:25 UTC
Created attachment 1290 [details]
Preserve output file formats of copied archive elements unless explicitly requiested otherwise
Comment 7 Pawel Sikora 2006-09-11 08:13:02 UTC
works fine :)
Comment 8 Nick Clifton 2006-09-11 14:41:01 UTC
Patch checked in.z
Comment 9 Pawel Sikora 2006-09-11 14:56:17 UTC
(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
Comment 10 Pawel Sikora 2006-09-11 15:02:20 UTC
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