This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: Error: 0-bit reloc in dll


Hi Michael,

> I am building a Python 2.3 extension module in Cygwin using gcc
> version 3.3.1 (cygming special) with binutils version 2.14.90. The
> DLL is a port of Solaris code and links in Sybase OpenClient Windows
> DLLs (and other DLLs) via import libraries that I make with strings
> and dlltool. The DLL also links with the X Windows libraries because
> the ported code references those libraries. Note the error report in
> the middle of the X windows import fixups (see link line below). I
> have no problem building a "toy" Python extension on Cygwin using
> similar rules. Other possibly relevant factors include the large
> size of the tt_wrap.o object and the need for repeating libraries on
> the link line thanks to interlibrary dependencies: 
>
> What causes this and what can I do about it?

> Error: 0-bit reloc in dll

The error message is produced when the linker is attempting to
translate the relocations in the input files into the PE required
format and it encounters a relocation type that it does not
recognise.  In this case it would appear that the linker is
encountering a null reloc.  (ie one that has already been processed).

You could try applying the patch below and then rebuilding the linker
- it might work, but I have not tested it.

Alternatively, if you can create a *small* testcase we could
investigate further.  I suspect that the bug might be related to the
multiple inclusions of the libraries.  Maybe the reloc is resolved in
a library the first time it is encountered and then the linker cannot
handle the resolved reloc when it loads the library for a second
time.  This is just a guess though.

Cheers
        Nick

Index: ld/pe-dll.c
===================================================================
RCS file: /cvs/src/src/ld/pe-dll.c,v
retrieving revision 1.64
diff -c -3 -p -r1.64 pe-dll.c
*** ld/pe-dll.c	31 Oct 2003 05:32:44 -0000	1.64
--- ld/pe-dll.c	25 Nov 2003 16:45:48 -0000
*************** generate_reloc (bfd *abfd, struct bfd_li
*** 1166,1171 ****
--- 1166,1174 ----
  		      einfo (_("%XError: %d-bit reloc in dll\n"),
  			     relocs[i]->howto->bitsize);
  		      break;
+ 		    case 0:
+ 		      /* Ignore null relocs.  */
+ 		      break;
  		    }
  		}
  	    }
        


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