Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Linking assembled PIC code with Linux libc library
@ 2005-04-09 12:09 Sergio Ruiz
  2005-04-09 13:49 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Sergio Ruiz @ 2005-04-09 12:09 UTC (permalink / raw)
  To: linux-mips

Hi, i can't link assembled pic code against the libc running my
embedded-mips-box under debian, and this is what i do:

bluebox@bluebox:~$ as -al -EL -membedded-pic -mips1 -o prueba."o" prueba."s"

ld -L/usr/lib -lc -EL -o prueba prueba.o
ld: aviso: no se puede encontrar el símbolo de entrada __start; usando
por omisión 0000000000400280
prueba.o: En la función `main':
prueba.o(.text+0x8): relocation truncated to fit: R_MIPS_GNU_REL16_S2
printf@@GLIBC_2.0

I've been looking everywhere without any luck.
Any help is appreciated!
Thanks

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

* Re: Linking assembled PIC code with Linux libc library
  2005-04-09 12:09 Linking assembled PIC code with Linux libc library Sergio Ruiz
@ 2005-04-09 13:49 ` Daniel Jacobowitz
       [not found]   ` <e02bc661050409113820cceae3@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2005-04-09 13:49 UTC (permalink / raw)
  To: Sergio Ruiz; +Cc: linux-mips

On Sat, Apr 09, 2005 at 02:09:14PM +0200, Sergio Ruiz wrote:
> Hi, i can't link assembled pic code against the libc running my
> embedded-mips-box under debian, and this is what i do:
> 
> bluebox@bluebox:~$ as -al -EL -membedded-pic -mips1 -o prueba."o" prueba."s"

PIC != embedded-pic.  You shouldn't be using -membedded-pic.

In fact, you shouldn't be using as directly, or ld.  Always use GCC to
assemble and link, and it will take care of the options for you.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

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

* Re: Linking assembled PIC code with Linux libc library
       [not found]       ` <e02bc66105041012091afdf306@mail.gmail.com>
@ 2005-04-10 19:27         ` Sergio Ruiz
  2005-04-11 16:09           ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Sergio Ruiz @ 2005-04-10 19:27 UTC (permalink / raw)
  To: linux-mips

But if I use GCC with my assembler code, and I use a simple 'printf'
function, the assembler code I get is totally different than the
original one, so I cant debug it.

any other possibility?

thanks,

Sergio

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

* Re: Linking assembled PIC code with Linux libc library
  2005-04-10 19:27         ` Sergio Ruiz
@ 2005-04-11 16:09           ` Ralf Baechle
  0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2005-04-11 16:09 UTC (permalink / raw)
  To: Sergio Ruiz; +Cc: linux-mips

On Sun, Apr 10, 2005 at 09:27:58PM +0200, Sergio Ruiz wrote:

> But if I use GCC with my assembler code, and I use a simple 'printf'
> function, the assembler code I get is totally different than the
> original one, so I cant debug it.

Sounds like you're being surprised by the gcc 3.4 optimization where gcc
may replace certain functions such as printf with a whole sequence of
calls to more basic stdio functions?

  Ralf

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

end of thread, other threads:[~2005-04-11 16:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-09 12:09 Linking assembled PIC code with Linux libc library Sergio Ruiz
2005-04-09 13:49 ` Daniel Jacobowitz
     [not found]   ` <e02bc661050409113820cceae3@mail.gmail.com>
     [not found]     ` <20050409215140.GA15253@nevyn.them.org>
     [not found]       ` <e02bc66105041012091afdf306@mail.gmail.com>
2005-04-10 19:27         ` Sergio Ruiz
2005-04-11 16:09           ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox