public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Using linker script instead of library in Gold
@ 2011-07-13 15:46 Aleksandar Simeonov
  2011-07-13 19:39 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Aleksandar Simeonov @ 2011-07-13 15:46 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils, rich

Hi Ian,
I have one short question today. Situation is as follow: instead of
having lib.so as shared library, on our Linux distribution we have ld
linker script:
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf32-tradlittlemips)
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a  AS_NEEDED (
/lib/ld.so.1 ) )

Is Gold capable of using it (for ld is enough to put -lc in command
line) and if yes, what command option should be used?

Thanks in advance for your answer.

Aleksandar


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using linker script instead of library in Gold
  2011-07-13 15:46 Using linker script instead of library in Gold Aleksandar Simeonov
@ 2011-07-13 19:39 ` Ian Lance Taylor
  2011-07-14  9:05   ` Aleksandar Simeonov
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2011-07-13 19:39 UTC (permalink / raw)
  To: Aleksandar Simeonov; +Cc: binutils, rich

Aleksandar Simeonov <Aleksandar.Simeonov@RT-RK.com> writes:

> I have one short question today. Situation is as follow: instead of
> having lib.so as shared library, on our Linux distribution we have ld
> linker script:
> /* GNU ld script
>    Use the shared library, but some functions are only in
>    the static library, so try that secondarily.  */
> OUTPUT_FORMAT(elf32-tradlittlemips)
> GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a  AS_NEEDED (
> /lib/ld.so.1 ) )
>
> Is Gold capable of using it (for ld is enough to put -lc in command
> line) and if yes, what command option should be used?

This is normal on any glibc-based system.  gold supports this without
requiring any special options.

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using linker script instead of library in Gold
  2011-07-13 19:39 ` Ian Lance Taylor
@ 2011-07-14  9:05   ` Aleksandar Simeonov
  2011-07-14 22:07     ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Aleksandar Simeonov @ 2011-07-14  9:05 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils, rich

Yes, but still when I do linking I got error like:
../../mips-linux-gnu-ld.gold: Attempt to open /usr/lib/libc.so succeeded
../../mips-linux-gnu-ld.gold: warning: skipping incompatible
/usr/lib/libc.so while searching for c
../../mips-linux-gnu-ld.gold: error: cannot find -lc

Maybe I overlooked something?

Aleksandar

On 13/07/2011 17:46, Ian Lance Taylor wrote:
> Aleksandar Simeonov <Aleksandar.Simeonov@RT-RK.com> writes:
> 
>> I have one short question today. Situation is as follow: instead of
>> having lib.so as shared library, on our Linux distribution we have ld
>> linker script:
>> /* GNU ld script
>>    Use the shared library, but some functions are only in
>>    the static library, so try that secondarily.  */
>> OUTPUT_FORMAT(elf32-tradlittlemips)
>> GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a  AS_NEEDED (
>> /lib/ld.so.1 ) )
>>
>> Is Gold capable of using it (for ld is enough to put -lc in command
>> line) and if yes, what command option should be used?
> 
> This is normal on any glibc-based system.  gold supports this without
> requiring any special options.
> 
> Ian
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using linker script instead of library in Gold
  2011-07-14  9:05   ` Aleksandar Simeonov
@ 2011-07-14 22:07     ` Ian Lance Taylor
  2011-07-15 18:19       ` Aleksandar Simeonov
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2011-07-14 22:07 UTC (permalink / raw)
  To: Aleksandar Simeonov; +Cc: binutils, rich

Aleksandar Simeonov <Aleksandar.Simeonov@RT-RK.com> writes:

> Yes, but still when I do linking I got error like:
> ../../mips-linux-gnu-ld.gold: Attempt to open /usr/lib/libc.so succeeded
> ../../mips-linux-gnu-ld.gold: warning: skipping incompatible
> /usr/lib/libc.so while searching for c
> ../../mips-linux-gnu-ld.gold: error: cannot find -lc
>
> Maybe I overlooked something?

It means that the OUTPUT_FORMAT string in your libc.so,
elf32-tradlittlemips, was not recognized or did not match the target
recognized for the .o files.  What string are you passing to the
Target_selector constructor?

Ian


> On 13/07/2011 17:46, Ian Lance Taylor wrote:
>> Aleksandar Simeonov <Aleksandar.Simeonov@RT-RK.com> writes:
>> 
>>> I have one short question today. Situation is as follow: instead of
>>> having lib.so as shared library, on our Linux distribution we have ld
>>> linker script:
>>> /* GNU ld script
>>>    Use the shared library, but some functions are only in
>>>    the static library, so try that secondarily.  */
>>> OUTPUT_FORMAT(elf32-tradlittlemips)
>>> GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a  AS_NEEDED (
>>> /lib/ld.so.1 ) )
>>>
>>> Is Gold capable of using it (for ld is enough to put -lc in command
>>> line) and if yes, what command option should be used?
>> 
>> This is normal on any glibc-based system.  gold supports this without
>> requiring any special options.
>> 
>> Ian
>> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Using linker script instead of library in Gold
  2011-07-14 22:07     ` Ian Lance Taylor
@ 2011-07-15 18:19       ` Aleksandar Simeonov
  0 siblings, 0 replies; 5+ messages in thread
From: Aleksandar Simeonov @ 2011-07-15 18:19 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils, rich

Thanks,
You were right. Problem was that I used elf32-mips instead of
elf32-tradlittlemips as name. I fixed that, and now that part work
(still there are some other issues :-)).

Aleksandar

On 14/07/2011 19:15, Ian Lance Taylor wrote:
> Aleksandar Simeonov <Aleksandar.Simeonov@RT-RK.com> writes:
> 
>> Yes, but still when I do linking I got error like:
>> ../../mips-linux-gnu-ld.gold: Attempt to open /usr/lib/libc.so succeeded
>> ../../mips-linux-gnu-ld.gold: warning: skipping incompatible
>> /usr/lib/libc.so while searching for c
>> ../../mips-linux-gnu-ld.gold: error: cannot find -lc
>>
>> Maybe I overlooked something?
> 
> It means that the OUTPUT_FORMAT string in your libc.so,
> elf32-tradlittlemips, was not recognized or did not match the target
> recognized for the .o files.  What string are you passing to the
> Target_selector constructor?
> 
> Ian
> 
> 
>> On 13/07/2011 17:46, Ian Lance Taylor wrote:
>>> Aleksandar Simeonov <Aleksandar.Simeonov@RT-RK.com> writes:
>>>
>>>> I have one short question today. Situation is as follow: instead of
>>>> having lib.so as shared library, on our Linux distribution we have ld
>>>> linker script:
>>>> /* GNU ld script
>>>>    Use the shared library, but some functions are only in
>>>>    the static library, so try that secondarily.  */
>>>> OUTPUT_FORMAT(elf32-tradlittlemips)
>>>> GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a  AS_NEEDED (
>>>> /lib/ld.so.1 ) )
>>>>
>>>> Is Gold capable of using it (for ld is enough to put -lc in command
>>>> line) and if yes, what command option should be used?
>>>
>>> This is normal on any glibc-based system.  gold supports this without
>>> requiring any special options.
>>>
>>> Ian
>>>
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-07-15 10:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-13 15:46 Using linker script instead of library in Gold Aleksandar Simeonov
2011-07-13 19:39 ` Ian Lance Taylor
2011-07-14  9:05   ` Aleksandar Simeonov
2011-07-14 22:07     ` Ian Lance Taylor
2011-07-15 18:19       ` Aleksandar Simeonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).