public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* where did memcpy come from????
@ 2002-11-06  8:18 Mark Cianfaglione
  2002-11-06 10:10 ` Wei Qin
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Cianfaglione @ 2002-11-06  8:18 UTC (permalink / raw)
  To: gcc-help

I've been trying to cross compile a piece of code that I'm trying to port
and I'm getting the following error:

GNU ld version 2.11.94 20020209
./obj/uip_arp.o: In function `uip_arp_arpin':
./obj/uip_arp.o(.text+0x56c): undefined reference to `memcpy'
*** Error exit code 1

Stop.
[ethernet]=23=> 

When I look at the source (the 'C' file) there is no reference to memcpy. In
the assembler file it is there...

My question is... Is this normal? And if it is how does one correct the
error?

Mark



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

* Re: where did memcpy come from????
  2002-11-06  8:18 where did memcpy come from???? Mark Cianfaglione
@ 2002-11-06 10:10 ` Wei Qin
  0 siblings, 0 replies; 2+ messages in thread
From: Wei Qin @ 2002-11-06 10:10 UTC (permalink / raw)
  To: Mark Cianfaglione; +Cc: gcc-help


It is normal to see memcpy, but not not normal if it cannot be found.

Compiler generates memcpy for structure copying.
So if you have something like

struct {
...
} x,y;

x=y;

a memcpy will be generated (x86 has the rep instruction, so memcpy can be
saved).

Normally memcpy should be in libc, which is linked by default. You may
use the -v switch of gcc to see which libraries are linked.

Wei


On Wed, 6 Nov 2002, Mark Cianfaglione wrote:

> I've been trying to cross compile a piece of code that I'm trying to port
> and I'm getting the following error:
>
> GNU ld version 2.11.94 20020209
> ./obj/uip_arp.o: In function `uip_arp_arpin':
> ./obj/uip_arp.o(.text+0x56c): undefined reference to `memcpy'
> *** Error exit code 1
>
> Stop.
> [ethernet]=23=>
>
> When I look at the source (the 'C' file) there is no reference to memcpy. In
> the assembler file it is there...
>
> My question is... Is this normal? And if it is how does one correct the
> error?
>
> Mark
>
>
>
>

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

end of thread, other threads:[~2002-11-06 18:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-06  8:18 where did memcpy come from???? Mark Cianfaglione
2002-11-06 10:10 ` Wei Qin

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).