Re: Dynamic linking is go (again)

Izumi Tsutsui <[email protected]>
Newsgroups gmane.os.netbsd.ports.sh3,gmane.os.netbsd.ports.dreamcast
Message-ID <[email protected]>
In article <[email protected]>
[email protected] wrote:

> Hm, you mean dynamic executables?  Well, here's the two I have been
> using as test cases, they are linked dynamically against the libc.so
> that was in the dynkit:  <URL:http://mc.pp.se/dc/files/dyntestbins.tar.gz>

Hmm, both executables work fine with ld.elf_so and libc.so.12.100
built by my cross toolchain. I'll check libgcc.a and linker setting etc.

> > - libexec/ld.elf_so/arch/sh3/mdreloc.c lacks some function declarations
> >   (and copyright notice).
> 
> Which function declarations?

I got the following warnings:
---
/usr/local/bin/shle--netbsdelf-gcc -O  -Wall -Wstrict-prototypes \
-Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-uninitialized  \
-Werror   -fpic -DELFSIZE=32 -DLIBDIR=\"/usr/lib\" \
-D_PATH_RTLD=\"/libexec/ld.elf_so\" -I/usr/src/libexec/ld.elf_so \
-DRTLD_LOADER -D_RTLD_SOURCE -nostdinc -isystem \
/export/NetBSD/dreamcast/root/usr/include  -c \
/usr/src/libexec/ld.elf_so/arch/sh3/mdreloc.c
/usr/src/libexec/ld.elf_so/arch/sh3/mdreloc.c:20: \
warning: no previous prototype for `_rtld_relocate_nonplt_self'
/usr/src/libexec/ld.elf_so/arch/sh3/mdreloc.c:185: \
warning: function declaration isn't a prototype
/usr/src/libexec/ld.elf_so/arch/sh3/mdreloc.c:211: \
warning: function declaration isn't a prototype
*** Error code 1

Stop.
nbmake: stopped in /usr/src/libexec/ld.elf_so
---

I applied the following patch:

--- arch/sh3/mdreloc.c.0	2003-07-05 05:50:17.000000000 +0900
+++ arch/sh3/mdreloc.c	2003-07-04 01:05:12.000000000 +0900
@@ -7,6 +7,9 @@
 #include "rtld.h"
 
 void _rtld_bind_start(void);
+void _rtld_relocate_nonplt_self(Elf_Dyn *, Elf_Addr);
+caddr_t _rtld_bind(const Obj_Entry *, Elf_Word);
+int _rtld_relocate_plt_object(const Obj_Entry *, const Elf_Rela *, caddr_t *);
 
 void
 _rtld_setup_pltgot(const Obj_Entry *obj)


---
Izumi Tsutsui
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.