|
From: <pi...@li...> - 2000-05-02 00:06:05
|
Hello Kaz, Thanks for your answer, it is much appreciated kaz Kojima wrote: > Can you please give us the result of readelf -r ld.so? It shows > relocations of ld.so. Sure. Here it goes : --8<--8<--SNIP-SNIP--8<--8<-- Relocation section '.rela.text' at offset 0x1710 contains 15 entries: Offset Info Type Symbol's Value Symbol's Name Addend 00003288 000a5 R_SH_RELATIVE 00010ec0 00006294 000a5 R_SH_RELATIVE 00010faa 00007b98 000a5 R_SH_RELATIVE 00010faa 00007fdc 000a5 R_SH_RELATIVE 00010faa 00008208 000a5 R_SH_RELATIVE 00010faa 00008558 000a5 R_SH_RELATIVE 00010faa 00008c10 000a5 R_SH_RELATIVE 00010faa 00008f80 000a5 R_SH_RELATIVE 00010faa 0000ca3c 000a5 R_SH_RELATIVE 00010faa 0000cdac 000a5 R_SH_RELATIVE 00010faa 0000f550 000a5 R_SH_RELATIVE 00010ec0 0000f670 000a5 R_SH_RELATIVE 00010ec0 00010374 000a5 R_SH_RELATIVE 00010f0c 00010654 000a5 R_SH_RELATIVE 00010ec0 00010d50 000a5 R_SH_RELATIVE 00010ec0 Relocation section '.rela.got' at offset 0x17c4 contains 65 entries: Offset Info Type Symbol's Value Symbol's Name Addend 00023924 000a5 R_SH_RELATIVE 00001f60 000239f4 000a5 R_SH_RELATIVE 00010160 000239f0 000a5 R_SH_RELATIVE 00023890 00023980 000a5 R_SH_RELATIVE 00023c10 000239e4 000a5 R_SH_RELATIVE 00023bfc 00023930 000a5 R_SH_RELATIVE 00023c24 00023988 000a5 R_SH_RELATIVE 00023e58 00023934 000a5 R_SH_RELATIVE 00023e5c 00023920 000a5 R_SH_RELATIVE 0000b660 00023950 000a5 R_SH_RELATIVE 00023e64 00023984 000a5 R_SH_RELATIVE 00023e6c 000239d0 000a5 R_SH_RELATIVE 00023898 000239e8 000a5 R_SH_RELATIVE 0000dbc0 00023998 000a5 R_SH_RELATIVE 00023e78 0002399c 000a5 R_SH_RELATIVE 00023e7c 00023914 000a5 R_SH_RELATIVE 00023e88 000239b4 000a5 R_SH_RELATIVE 0000b0e0 00023944 000a5 R_SH_RELATIVE 00023e90 0002392c 000a5 R_SH_RELATIVE 00023e98 00023978 000a5 R_SH_RELATIVE 00023e9c 000239b0 000a5 R_SH_RELATIVE 0000b140 00023940 000a5 R_SH_RELATIVE 00001ee0 0002394c 000a5 R_SH_RELATIVE 00023ea4 00023958 000a5 R_SH_RELATIVE 000135c4 0002397c 000a5 R_SH_RELATIVE 00023eb0 00023a00 000a5 R_SH_RELATIVE 00010780 000239fc 000a5 R_SH_RELATIVE 000107a0 0002398c 000a5 R_SH_RELATIVE 00023894 000239f8 000a5 R_SH_RELATIVE 00023eb8 000239e0 000a5 R_SH_RELATIVE 00023ef4 00023970 000a5 R_SH_RELATIVE 00023ebc 000239ec 000a5 R_SH_RELATIVE 0002389c 000239a8 000a5 R_SH_RELATIVE 0001216c 00023928 000a5 R_SH_RELATIVE 00023ec0 000239d4 000a5 R_SH_RELATIVE 00023ecc 000239d8 000a5 R_SH_RELATIVE 00023ed0 00023948 000a5 R_SH_RELATIVE 00023ee8 000239ac 000a5 R_SH_RELATIVE 00023864 000239a4 000a5 R_SH_RELATIVE 00023ef0 000239c4 011a3 R_SH_GLOB_DAT 00023c04 __libc_internal_tsd_set + 0 00023a08 015a3 R_SH_GLOB_DAT 00000000 __pthread_mutex_lock + 0 0002396c 016a3 R_SH_GLOB_DAT 00023c08 _dl_profile_output + 0 00023910 017a3 R_SH_GLOB_DAT 00023c0c __libc_stack_end + 0 00023994 018a3 R_SH_GLOB_DAT 00023888 _dl_debug_fd + 0 00023964 019a3 R_SH_GLOB_DAT 00023c14 _dl_initial_searchlist + 0 000239a0 01ea3 R_SH_GLOB_DAT 00023e50 _dl_platformlen + 0 00023974 020a3 R_SH_GLOB_DAT 00023e54 _dl_debug_impcalls + 0 00023a04 021a3 R_SH_GLOB_DAT 00000000 __pthread_mutex_init + 0 0002395c 026a3 R_SH_GLOB_DAT 00023e60 _dl_profile + 0 000239b8 028a3 R_SH_GLOB_DAT 00023e70 _dl_global_scope_alloc + 0 00023954 02aa3 R_SH_GLOB_DAT 00023e74 __libc_enable_secure + 0 00023960 02ca3 R_SH_GLOB_DAT 00023e80 _dl_global_scope + 0 000239c0 02da3 R_SH_GLOB_DAT 00023e8c __libc_internal_tsd_get + 0 00023a10 02fa3 R_SH_GLOB_DAT 00000000 __pthread_mutex_unlock + 0 0002393c 032a3 R_SH_GLOB_DAT 00023e94 _dl_lazy + 0 000239cc 033a3 R_SH_GLOB_DAT 0000b780 _dl_debug_state + 0 00023a0c 035a3 R_SH_GLOB_DAT 00000000 __pthread_mutex_destroy + 0 00023918 038a3 R_SH_GLOB_DAT 00023ea0 _dl_main_searchlist + 0 00023990 03ea3 R_SH_GLOB_DAT 00023eac _dl_origin_path + 0 0002391c 042a3 R_SH_GLOB_DAT 00023eb4 _dl_starting_up + 0 000239bc 044a3 R_SH_GLOB_DAT 0000ca70 _dl_mcount + 0 000239dc 047a3 R_SH_GLOB_DAT 00023830 _dl_fpu_control + 0 00023938 048a3 R_SH_GLOB_DAT 00023ec4 _dl_loaded + 0 00023968 04aa3 R_SH_GLOB_DAT 00023ec8 _dl_profile_map + 0 000239c8 04ca3 R_SH_GLOB_DAT 00023ed4 _r_debug + 0 Relocation section '.rela.plt' at offset 0x1ad0 contains 25 entries: Offset Info Type Symbol's Value Symbol's Name Addend 000238ac 015a4 R_SH_JMP_SLOT 00000000 __pthread_mutex_lock + 0 000238b0 01ba4 R_SH_JMP_SLOT 0000cdc0 _dl_sysdep_start + 0 000238b4 021a4 R_SH_JMP_SLOT 00000000 __pthread_mutex_init + 0 000238b8 022a4 R_SH_JMP_SLOT 0000d990 malloc + 0 000238bc 025a4 R_SH_JMP_SLOT 000082c0 _dl_lookup_versioned_symb + 0 000238c0 02ba4 R_SH_JMP_SLOT 00007920 _dl_lookup_symbol + 0 000238c4 02ea4 R_SH_JMP_SLOT 0000daa0 calloc + 0 000238c8 02fa4 R_SH_JMP_SLOT 00000000 __pthread_mutex_unlock + 0 000238cc 033a4 R_SH_JMP_SLOT 0000b780 _dl_debug_state + 0 000238d0 034a4 R_SH_JMP_SLOT 00005060 _dl_dst_substitute + 0 000238d4 035a4 R_SH_JMP_SLOT 00000000 __pthread_mutex_destroy + 0 000238d8 037a4 R_SH_JMP_SLOT 0000b550 _dl_init_next + 0 000238dc 039a4 R_SH_JMP_SLOT 0000db20 realloc + 0 000238e0 03aa4 R_SH_JMP_SLOT 0000c1f0 _dl_check_all_versions + 0 000238e4 03ba4 R_SH_JMP_SLOT 0000b730 _dl_debug_initialize + 0 000238e8 03fa4 R_SH_JMP_SLOT 0000c250 _dl_start_profile + 0 000238ec 040a4 R_SH_JMP_SLOT 00009460 _dl_relocate_object + 0 000238f0 041a4 R_SH_JMP_SLOT 00004f50 _dl_dst_count + 0 000238f4 043a4 R_SH_JMP_SLOT 000078d0 _dl_unload_cache + 0 000238f8 045a4 R_SH_JMP_SLOT 0000b880 _dl_debug_message + 0 000238fc 046a4 R_SH_JMP_SLOT 000070c0 _dl_map_object + 0 00023900 049a4 R_SH_JMP_SLOT 0000b190 _dl_signal_error + 0 00023904 04da4 R_SH_JMP_SLOT 0000b380 _dl_catch_error + 0 00023908 04ea4 R_SH_JMP_SLOT 0000daf0 free + 0 0002390c 04fa4 R_SH_JMP_SLOT 0000a460 _dl_map_object_deps + 0 --8<--8<--SNIP-SNIP--8<--8<-- > I imagine that your ld.so has .rela.text and the relocation > R_SH_DIR32 or so. It needs the modification of .text segment > of ld.so and becomes the cause of fail as you describe. Sounds pretty much like the problem I have > Ordinary this type of relocation isn't problem at all since > ld.so will modify the .text segment of the ELF object using > mprotect. But in the bootstrap of ld.so, there is not working > ld.so yet :-) That would explain :) From what I have been able to gather (and understand), offsets are extracted out of the relocation table, added to the load address and a new fixed-up value is simply written to it (which fails). There is nothing fancy there. > I want to know also which version of toolchain and their patch I use : - binutils-000218 with the binutils-000205 SH patch and the modifications by hand described in Jerome's FAQ. My target name is "sh-pc-linux-gnu" and your PIC patches for SH (binutils-000123-000131 if I remember correctly). I had to patch some things by hand because of syntax changes between binutils 000205 and 000218. - gcc-core 2.95.2 with the gcc-2.95.2-000203 SH patch and gcc-2.95.2-symbol-vis-000205 patch. Again, my target name is "sh-pc-linux-gnu" The kernel compiles and works dandy with these tools, and so do statically linked programs and the bootloader I created for that particular board (and that I can't disclose unfortunately). > do you use. Niibe-san's visibility patchs for gcc/binutils may > solve your problem. Please check > ftp://ftp.m17n.org/pub/linux-sh/binutils-000218-000219.diff.gz > and > ftp://ftp.m17n.org/pub/linux-sh/gcc-symbol-vis-000219.diff.gz I'll give them a try right now ! Thanks, Take care --- Pierre-Philippe Coupard <pi...@li...> Software Engineer, Lineo, Inc. 801-426-5001 x 208 --- |