This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: relocation truncated to fit: R_X86_64_PC32 against undefined symbol `len'


On Apr  5 09:51, Richard wrote:
> 
> Hello Everyone,
> 
> I recently (two weeks ago or so) upgraded the cygwin installation on
> an XP 64 bit (corp edition) box and in getting things running on it
> again I've been having various troubles, even though I was VERY
> careful to watch for any installation errors - none were noticed.
> Normally I don't do development on this box but copy over from other
> systems. I had at least one program that was not behaving correctly
> - it would apparently hide output sent to stdout among other
> mysteries. After fiddling with things I decided to just rebuild on
> that box from sources - it's almost all gnu c. (Note that this code
> needs to run unchanged on many different platforms.)
> 
> At some point I get to the gcc call to bind together three object
> files into an executable - all the object files having just been
> built with zero errors - and I get this particular "undefined
> reference to `len'" error. Of course I went hunting for the use of
> 'len' - which is a pretty absurd effort as a simple grep matches on
> coutless noise such as 'filename' or 'strlen', etc. However, a
> thorough search revealed no uses of just 'len', yet I don't deny I
> could possibly have overlooked it. Even so, this directory was taken
> wholesale from a 64 bit system (Win 7) with an older cygwin
> installation where the code compiles and runs fine. So somehow I
> don't think it's actually in my code but rather a library reference
> problem somehow.
> 
> The specific set of error output from make is:
> 
> $ gcc -o ctjc.exe ctjc.o hashc.o sha1.o;
> ctjc.o:ctjc.c:(.text+0x2287): undefined reference to `len'
> ctjc.o:ctjc.c:(.text+0x2287): relocation truncated to fit:
> R_X86_64_PC32 against undefined symbol `len'
> /usr/bin/ld: ctjc.o: bad reloc address 0x0 in section `.pdata'
> /usr/bin/ld: final link failed: Invalid operation
> collect2: error: ld returned 1 exit status
> 
> Any assistance greatly appreciated.

As I outlined in other mail to this list just a couple of days ago,
the "relocation truncated to fit" stuff is a red herring.  It's just
a side-effect of the way addressing and relocation on x86_64 works.

The important part of the message is the first one: undefined reference
to `len'.  That's what you have to look for.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpiaTezvJEa4.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]