public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* RE: Error: 0-bit reloc in dll
@ 2003-11-18 21:28 Michael.Gogins
  2003-11-25 16:49 ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Michael.Gogins @ 2003-11-18 21:28 UTC (permalink / raw)
  To: binutils

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? Thanks for any insight you can provide.

g++ -shared --enable-stdcall-fixups --enable-runtime-pseudo-reloc --noinhibit-ex
ec --split-by-reloc tt_wrap.o -Llib -L3sw/LSERV/lib/implib -lLSAPIW32 -L/lib/Pyt
hon2.3/config -lpython2.3 -lSM -lICE -L/usr/X11R6/lib  -lXm -lXt -lX11 /usr/loca
l/lib/libsybdb.a /usr/local/lib/libsrv.a /usr/local/lib/libamb.a -lstdc++ -lm -L
Aggregator -lAggregator -LAmbInterface -lAmbInterface -LApp -lApp -LAppWin -lApp
Win -LBrowser -lBrowser -LCallAccount -lCallAccount -LCharges -lCharges DB/libDB
.a -LContentious -lContentious -Ldlist -ldlist -LDsm -lDsm -LDTE -lDTE -LExInter
face -lExInterface -LExposure -lExposure -Lfinance -lfinance -LFmsInterface -lFm
sInterface -LFutureTrade -lFutureTrade -LFXCashTrade -lFXCashTrade -LFXOptionTra
de -lFXOptionTrade -LFXOptionTrade -lFXOptionTrade -LGLI -lGLI -LGui -lGui -Lins
tr -linstr -LInstrument -linstrument -LIROptTrade -lIROptTrade -LMc -lMc -Lmmcas
h -lmmcash -LMMCashTrade -lMMCashTrade mrm/libmrm.a -LObserver -lObserver -LOpen
Client -lOpenClient -LOpenServer -lOpenServer -LOrders  -lOrders -LParser -lPars
er -LProcess -lProcess -LRecord -lRecord -LRep -lRep -LRtf -lRtf -LRtfServer -lR
tfServer -Lrw -lrwtool -Lsettlements -lsettlements -LSocket -lSocket -LSocketCli
ent -lSocketClient -LSocketServer -lSocketServer -LSQLBuilder -lSQLBuilder -LSys
Param -lSysParam -LSystem -lSystem -LTBag -lTBag -LTFO -lTFO -LTFOTools -lTFOToo
ls -Ltpm -ltpm -LTradeAction -lTradeAction -LUAM -lUAM -LUserParam -lUserParam -
LUserTrade -lUserTrade -LView -lView -LView -lView -Lxpm -lxpm -Lzip -lzip -Llib
 -L3sw/LSERV/lib/implib -lLSAPIW32 -L/lib/Python2.3/config -lpython2.3 -lSM -lIC
E -L/usr/X11R6/lib  -lXm -lXt -lX11 /usr/local/lib/libsybdb.a /usr/local/lib/lib
srv.a /usr/local/lib/libamb.a -lstdc++ -lm -LAggregator -lAggregator -LAmbInterf
ace -lAmbInterface -LApp -lApp -LAppWin -lAppWin -LBrowser -lBrowser -LCallAccou
nt -lCallAccount -LCharges -lCharges DB/libDB.a -LContentious -lContentious -Ldl
ist -ldlist -LDsm -lDsm -LDTE -lDTE -LExInterface -lExInterface -LExposure -lExp
osure -Lfinance -lfinance -LFmsInterface -lFmsInterface -LFutureTrade -lFutureTr
ade -LFXCashTrade -lFXCashTrade -LFXOptionTrade -lFXOptionTrade -LFXOptionTrade
-lFXOptionTrade -LGLI -lGLI -LGui -lGui -Linstr -linstr -LInstrument -linstrumen
t -LIROptTrade -lIROptTrade -LMc -lMc -Lmmcash -lmmcash -LMMCashTrade -lMMCashTr
ade mrm/libmrm.a -LObserver -lObserver -LOpenClient -lOpenClient -LOpenServer -l
OpenServer -LOrders  -lOrders -LParser -lParser -LProcess -lProcess -LRecord -lR
ecord -LRep -lRep -LRtf -lRtf -LRtfServer -lRtfServer -Lrw -lrwtool -Lsettlement
s -lsettlements -LSocket -lSocket -LSocketClient -lSocketClient -LSocketServer -
lSocketServer -LSQLBuilder -lSQLBuilder -LSysParam -lSysParam -LSystem -lSystem
-LTBag -lTBag -LTFO -lTFO -LTFOTools -lTFOTools -Ltpm -ltpm -LTradeAction -lTrad
eAction -LUAM -lUAM -LUserParam -lUserParam -LUserTrade -lUserTrade -LView -lVie
w -LView -lView -Lxpm -lxpm -Lzip -lzip -Llib -L3sw/LSERV/lib/implib -lLSAPIW32
-L/lib/Python2.3/config -lpython2.3 -lSM -lICE -L/usr/X11R6/lib  -lXm -lXt -lX11
 /usr/local/lib/libsybdb.a /usr/local/lib/libsrv.a /usr/local/lib/libamb.a -lstd
c++ -lm -LAggregator -lAggregator -LAmbInterface -lAmbInterface -LApp -lApp -LAp
pWin -lAppWin -LBrowser -lBrowser -LCallAccount -lCallAccount -LCharges -lCharge
s DB/libDB.a -LContentious -lContentious -Ldlist -ldlist -LDsm -lDsm -LDTE -lDTE
 -LExInterface -lExInterface -LExposure -lExposure -Lfinance -lfinance -LFmsInte
rface -lFmsInterface -LFutureTrade -lFutureTrade -LFXCashTrade -lFXCashTrade -LF
XOptionTrade -lFXOptionTrade -LFXOptionTrade -lFXOptionTrade -LGLI -lGLI -LGui -
lGui -Linstr -linstr -LInstrument -linstrument -LIROptTrade -lIROptTrade -LMc -l
Mc -Lmmcash -lmmcash -LMMCashTrade -lMMCashTrade mrm/libmrm.a -LObserver -lObser
ver -LOpenClient -lOpenClient -LOpenServer -lOpenServer -LOrders  -lOrders -LPar
ser -lParser -LProcess -lProcess -LRecord -lRecord -LRep -lRep -LRtf -lRtf -LRtf
Server -lRtfServer -Lrw -lrwtool -Lsettlements -lsettlements -LSocket -lSocket -
LSocketClient -lSocketClient -LSocketServer -lSocketServer -LSQLBuilder -lSQLBui
lder -LSysParam -lSysParam -LSystem -lSystem -LTBag -lTBag -LTFO -lTFO -LTFOTool
s -lTFOTools -Ltpm -ltpm -LTradeAction -lTradeAction -LUAM -lUAM -LUserParam -lU
serParam -LUserTrade -lUserTrade -LView -lView -LView -lView -Lxpm -lxpm -Lzip -
lzip -o _tt.dll
Info: resolving __XmStrings by linking to __imp___XmStrings (auto-import)
Info: resolving _XtStrings by linking to __imp__XtStrings (auto-import)
Info: resolving _xmFormWidgetClass by linking to __imp__xmFormWidgetClass (auto-
import)
Info: resolving _xmLabelWidgetClass by linking to __imp__xmLabelWidgetClass (aut
o-import)
Info: resolving _xmPushButtonWidgetClass by linking to __imp__xmPushButtonWidget
Class (auto-import)
Info: resolving _XtShellStrings by linking to __imp__XtShellStrings (auto-import
)
Info: resolving _applicationShellWidgetClass by linking to __imp__applicationShe
llWidgetClass (auto-import)
Info: resolving _xmFrameWidgetClass by linking to __imp__xmFrameWidgetClass (aut
o-import)
Info: resolving _xmTextWidgetClass by linking to __imp__xmTextWidgetClass (auto-
import)
Info: resolving _xmTextFieldWidgetClass by linking to __imp__xmTextFieldWidgetCl
ass (auto-import)
Info: resolving _xmScaleWidgetClass by linking to __imp__xmScaleWidgetClass (aut
o-import)
Info: resolving _xmListWidgetClass by linkinError: 0-bit reloc in dll
g to __imp__xmListWidgetClass (auto-import)
Info: resolving _xmArrowButtonWidgetClass by linking to __imp__xmArrowButtonWidg
etClass (auto-import)
Info: resolving _xmRowColumnWidgetClass by linking to __imp__xmRowColumnWidgetCl
ass (auto-import)
Info: resolving _xmToggleButtonWidgetClass by linking to __imp__xmToggleButtonWi
dgetClass (auto-import)
collect2: ld returned 1 exit status
make: *** [_tt.dll] Error 1

Michael Gogins
Senior Software Engineer
Front Capital Systems 

SunGard Trading Systems 
560 Lexington Avenue
Telephone: 212 317 7455 
E-mail address Michael.Gogins@front.com 
www.front.com 

The information transmitted is intended only for the intended recipient and may contain confidential and/or privileged material. Any further transmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

 

	 

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

* Re: Error: 0-bit reloc in dll
  2003-11-18 21:28 Error: 0-bit reloc in dll Michael.Gogins
@ 2003-11-25 16:49 ` Nick Clifton
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Clifton @ 2003-11-25 16:49 UTC (permalink / raw)
  To: Michael.Gogins; +Cc: binutils

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;
  		    }
  		}
  	    }
        

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

* Re: Error: 0-bit reloc in dll
  2001-03-19 23:20 luca.spinacci
@ 2001-03-23 15:02 ` Nick Clifton
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Clifton @ 2001-03-23 15:02 UTC (permalink / raw)
  To: luca.spinacci; +Cc: binutils

Hi Luca,

> Error: 0-bit reloc in dll
> 
> What means "Error: 0-bit reloc in dll"?

It means that linker was asked to perform a relocation (*) of a type
it was not expecting.  In the context of the shared link that you are
trying to do, the linker knows that only a few. certain types of
relocations can legally be present, and if it detects any others it
emits this error message.

This problem is almost certainly the result of the undefined symbols
that the linker reported earlier:

> Cannot export maketable__6amicmd: symbol not found

Fix these problems and the 0-bit relocs should go away.

Cheers
        Nick

(*) A relocation is an instruction to the linker to change part or all
of the value at a certain address in the executable.  This allows
instructions to be modifed, data to be changed and so.  Relocations
are typically used to "fill in the blanks" where the address of a
symbol can only be determiend at link time, not assembly time.

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

* Error: 0-bit reloc in dll
@ 2001-03-19 23:20 luca.spinacci
  2001-03-23 15:02 ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: luca.spinacci @ 2001-03-19 23:20 UTC (permalink / raw)
  To: binutils

Hi all,

I compiled source files with -fpic option and tried to build a shared
incremental library as follows:

$ ld -shared -o liami.sl *.o

obtaining...

Cannot export maketable__6amicmd: symbol not found
Cannot export mangle__13smdb_iterator: symbol not found
Cannot export markAllFields__8smdb_row: symbol not found
Cannot export markAllKeys__8smdb_row: symbol not found
Cannot export markAllValues__8smdb_row: symbol not found
Cannot export markField__13smdb_iteratorUi: symbol not found
Cannot export markField__8smdb_rowUi: symbol not found
Cannot export markFields__13smdb_iteratorRC14smdb_field_set: symbol not found
Cannot export markFields__8smdb_rowRC14smdb_field_set: symbol not found
Cannot export markMissingField__13smdb_iterator: symbol not found
Error: 0-bit reloc in dll
Error: 0-bit reloc in dll
Error: 0-bit reloc in dll
Error: 0-bit reloc in dll
Error: 0-bit reloc in dll
...

infinite looping.

What means "Error: 0-bit reloc in dll"?

Regards,
Luca.


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

end of thread, other threads:[~2003-11-25 16:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-18 21:28 Error: 0-bit reloc in dll Michael.Gogins
2003-11-25 16:49 ` Nick Clifton
  -- strict thread matches above, loose matches on Subject: below --
2001-03-19 23:20 luca.spinacci
2001-03-23 15:02 ` Nick Clifton

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