* Dynamic linker and .interp section
@ 2001-04-12 13:39 Michael Shmulevich
2001-04-12 14:09 ` Maciej W. Rozycki
0 siblings, 1 reply; 5+ messages in thread
From: Michael Shmulevich @ 2001-04-12 13:39 UTC (permalink / raw)
To: Linux/MIPS, FR Linux/MIPS
Hello,
My question may be a bit off-topic for this list, but still I consider
the list as a place that may answer me.
I am trying to create a cross-compile environement for linux system that
will use some specific dynamic linker. To do so I specify
-Wl,--dynamic-linker flag to gcc. However doing this I face several
problems:
- the place for the linker during the compilation must match the place
at the target system (if I pass -Wl,--dynamic-linker /xxx/yyy/ld.so then
for the executable kernel looks for /xxx/yyy/ld.so in order to execute
it. Instead I would like to use simply /lib/ld.so
- If I pass -Wl,--dynamic-linker /lib/ld.so, then the /lib/ld.so must
exist during the compilation and match the chosen system's architecture.
I don't want to create this file (/lib/ld.so) on my compilation machine,
as there are many architectures that get compiled there and I cannot use
the same ld.so for all of them.
- I saw that in gcc's spec file there is a mention of dynamic linker,
for example, this one is for PPC %:{!dynamic-linker:-dynamic-linker
/lib/ld.so.1}
This one is interesting because there is no /lib/ld.so.1 on my machine,
and it resides under /usr/local/powerpc-linux/lib. Still compiler seems
to ignore the fact that it is missing from /lib and creates the
corresponding .interp section and PT_INTERP header.
So my question sounds like: can I specify a non-existing linker and tell
ld to ignore missing file?
Thanks in advance for any response, no matter how insulting it may be :-)
--
Sincerely yours,
Michael Shmulevich
______________________________________
Software Developer
Jungo - R&D
email: michaels@jungo.com
web: http://www.jungo.com
Phone: 1-877-514-0537(USA) +972-9-8859365(Worldwide) ext. 233
Fax: 1-877-514-0538(USA) +972-9-8859366(Worldwide)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Dynamic linker and .interp section
2001-04-12 13:39 Dynamic linker and .interp section Michael Shmulevich
@ 2001-04-12 14:09 ` Maciej W. Rozycki
2001-04-12 14:29 ` Michael Shmulevich
2001-04-12 14:44 ` Michael Shmulevich
0 siblings, 2 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2001-04-12 14:09 UTC (permalink / raw)
To: Michael Shmulevich; +Cc: Linux/MIPS, FR Linux/MIPS
On Thu, 12 Apr 2001, Michael Shmulevich wrote:
> So my question sounds like: can I specify a non-existing linker and tell
> ld to ignore missing file?
You can. Ld never checks for its existence.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Dynamic linker and .interp section
2001-04-12 14:09 ` Maciej W. Rozycki
@ 2001-04-12 14:29 ` Michael Shmulevich
2001-04-12 14:46 ` Maciej W. Rozycki
2001-04-12 14:44 ` Michael Shmulevich
1 sibling, 1 reply; 5+ messages in thread
From: Michael Shmulevich @ 2001-04-12 14:29 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: Linux/MIPS, FR Linux/MIPS
Maciej W. Rozycki wrote:
> On Thu, 12 Apr 2001, Michael Shmulevich wrote:
>
>
>> So my question sounds like: can I specify a non-existing linker and tell
>> ld to ignore missing file?
>
>
> You can. Ld never checks for its existence.
As with binutils-2.10 it is not true. Not only ld looks for it, it opens
the file, checks the architecture and even checks for SO_NAME (adds it
do NEEDS list). I have tried it several times.
Sincerely yours,
Michael Shmulevich
______________________________________
Software Developer
Jungo - R&D
email: michaels@jungo.com
web: http://www.jungo.com
Phone: 1-877-514-0537(USA) +972-9-8859365(Worldwide) ext. 233
Fax: 1-877-514-0538(USA) +972-9-8859366(Worldwide)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Dynamic linker and .interp section
2001-04-12 14:09 ` Maciej W. Rozycki
2001-04-12 14:29 ` Michael Shmulevich
@ 2001-04-12 14:44 ` Michael Shmulevich
1 sibling, 0 replies; 5+ messages in thread
From: Michael Shmulevich @ 2001-04-12 14:44 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: Linux/MIPS, FR Linux/MIPS
Quick prove follow-up, sorry for dounple-posting
> You can. Ld never checks for its existence.
This one is for non-existing file:
/home/michaels/rg.ulibc/pkg/ulibc/extra/gcc-uClibc/gcc-uClibc-i386
-L/home/michaels/rg.ulibc/pkg/ulibc -Wl,-warn-common -o busybox cat.o
chmod_chown_chgrp.o clear.o cmdedit.o cp_mv.o date.o df.o dirname.o du.o
echo.o find.o grep.o gunzip.o gzip.o halt.o head.o hostname.o id.o
ifconfig.o init.o insmod.o interface.o kill.o klogd.o ln.o logger.o ls.o
lsmod.o mkdir.o mknod.o more.o mount.o mtab.o nfsmount.o nslookup.o
ping.o poweroff.o ps.o pwd.o reboot.o reset.o rm.o rmdir.o rmmod.o
route.o sed.o sh.o sleep.o stty.o sync.o syslogd.o tail.o tar.o tee.o
telnet.o test.o tftp.o touch.o true_false.o tty.o umount.o uname.o
usleep.o which.o whoami.o xargs.o yes.o busybox.o messages.o usage.o
utility.o
i386-linux-gcc: /lib/ld-ulibc.so.1: No such file or directory
i386-linux-gcc: /lib/ld-ulibc.so.1: No such file or directory
make: *** [busybox] Error 1
[michaels@kobie busybox]$
This one for empty file:
/home/michaels/rg.ulibc/pkg/ulibc/extra/gcc-uClibc/gcc-uClibc-i386
-L/home/michaels/rg.ulibc/pkg/ulibc -Wl,-warn-common -o busybox cat.o
chmod_chown_chgrp.o clear.o cmdedit.o cp_mv.o date.o df.o dirname.o du.o
echo.o find.o grep.o gunzip.o gzip.o halt.o head.o hostname.o id.o
ifconfig.o init.o insmod.o interface.o kill.o klogd.o ln.o logger.o ls.o
lsmod.o mkdir.o mknod.o more.o mount.o mtab.o nfsmount.o nslookup.o
ping.o poweroff.o ps.o pwd.o reboot.o reset.o rm.o rmdir.o rmmod.o
route.o sed.o sh.o sleep.o stty.o sync.o syslogd.o tail.o tar.o tee.o
telnet.o test.o tftp.o touch.o true_false.o tty.o umount.o uname.o
usleep.o which.o whoami.o xargs.o yes.o busybox.o messages.o usage.o
utility.o
/lib/ld-ulibc.so.1: file not recognized: File truncated
collect2: ld returned 1 exit status
make: *** [busybox] Error 1
[michaels@kobie busybox]$
--
Sincerely yours,
Michael Shmulevich
______________________________________
Software Developer
Jungo - R&D
email: michaels@jungo.com
web: http://www.jungo.com
Phone: 1-877-514-0537(USA) +972-9-8859365(Worldwide) ext. 233
Fax: 1-877-514-0538(USA) +972-9-8859366(Worldwide)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Dynamic linker and .interp section
2001-04-12 14:29 ` Michael Shmulevich
@ 2001-04-12 14:46 ` Maciej W. Rozycki
0 siblings, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2001-04-12 14:46 UTC (permalink / raw)
To: Michael Shmulevich; +Cc: Linux/MIPS, FR Linux/MIPS
On Thu, 12 Apr 2001, Michael Shmulevich wrote:
> > You can. Ld never checks for its existence.
>
> As with binutils-2.10 it is not true. Not only ld looks for it, it opens
> the file, checks the architecture and even checks for SO_NAME (adds it
> do NEEDS list). I have tried it several times.
It is. Otherwise I wouldn't be able to cross-compile and I am. Check
whether you link against a dynamic object. It might have the dynamic
linker as one of it's DT_NEEDED dependencies. For example it's the case
for libc.so.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-04-12 14:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-12 13:39 Dynamic linker and .interp section Michael Shmulevich
2001-04-12 14:09 ` Maciej W. Rozycki
2001-04-12 14:29 ` Michael Shmulevich
2001-04-12 14:46 ` Maciej W. Rozycki
2001-04-12 14:44 ` Michael Shmulevich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox