Re: The system directories can't be changed?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Pan ruochen wrote:
> Hi Andi,
>
> I did try -nodefaultlibs with -L options. But it didn't seem to work.
> Here is the link map:
> =========================================================
> Memory Configuration
>
> Name             Origin             Length             Attributes
> *default*        0x0000000000000000 0xffffffffffffffff
>
> Linker script and memory map
>
> LOAD 1.o
> LOAD /opt/CodeSourcery/Sourcery_G++_Lite/bin/../mips-linux-gnu/libc/soft-float/el/usr/lib/libc.so
> START GROUP
> LOAD /opt/CodeSourcery/Sourcery_G++_Lite/bin/../mips-linux-gnu/libc/soft-float/el/lib/libc.so.6
> LOAD /opt/CodeSourcery/Sourcery_G++_Lite/bin/../mips-linux-gnu/libc/soft-float/el/usr/lib/libc_nonshared.a
> LOAD /opt/CodeSourcery/Sourcery_G++_Lite/bin/../mips-linux-gnu/libc/soft-float/el/lib/ld.so.1
> END GROUP
> =========================================================
> The system directories take precedence of -L directories.
>
> The linker options are
> -nodefaultlibs -nostdlib -L$(UCLIBC)/lib -lc
>
>
> ----
> Best 
> PRC
> Dec 17,2009
>
>   
Hey,

I was checking on my system and the problem is that $(UCLIBC)/lib
doesn't have a libc.so, only a libc.so.0 (linked to
libuClibc-0.9.30.so). But the linker searches for a file named libc.so.
So, I created a link from libc.so -> libc.so.0 ...

Just to clear up: when you're using the gcc driver for linking (instead
of explicitly calling ld), then -nostdlib will cause the default
libraries and system start files(!!) to be omitted, -nodefaultlibs will
cause only the default libraries to omitted. When you're using ld for
linking, then -nostdlib causes the linker to search only for directories
specified on the command-line, -nodefaultlibs isn't a linker option ...

- Andi -

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux