public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* binutils: Strange ld error: Error: 0-bit reloc in dll
@ 2003-10-26  1:41 Gerrit P. Haase
  2003-10-26  8:18 ` Gerrit P. Haase
  0 siblings, 1 reply; 3+ messages in thread
From: Gerrit P. Haase @ 2003-10-26  1:41 UTC (permalink / raw)
  To: cygwin

Hallo,

I'm getting a 'I've never seen before' ld error:
 Error: 0-bit reloc in dll

Libtool issues the link command like this:
gcc -shared \
 $(OBJECTS) \
 -L/usr/lib \
 -L/usr/X11R6/lib $(LIBS) \
 -Wl,--export-dynamic \
 -Wl,--export-dynamic \
 -o .libs/cyggucharmap-3.dll \
 -Wl,--image-base=0x10000000 \
 -Wl,--out-implib,.libs/libgucharmap.dll.a
Error: 0-bit reloc in dll
Creating library file: .libs/libgucharmap.dll.a
collect2: ld returned 1 exit status
make[3]: *** [libgucharmap.la] Error 1
  
I tried to reorder the command, I tried to add some switches like
--export-all-symbols and -no-whole-archive, but it doesn't help.

A google search shows only one hit of interest:

http://article.gmane.org/gmane.comp.gnu.mingw.user/7425
where Danny Smith wrote at 29 May 2003:
>> gcc.exe -shared -Wl,--out-implib,libfoo.a -o foo.dll foo.o
>> Error: 0-bit reloc in dll
>> 
>> Any idea what I should look for to work around this issue?
>> 
> Did you use -r (or --relocateable) to construct the object?
> What version of ld?
> 
> The -r bug should be fixed in latest relwase candidade of binutils.
> Danny


Any ideas?  Was the '-r bug' which Danny fixed in the MinGW binutils
release candidate not fixed in the Cygwin binutils release, or is it
already included in the latest Cygwin binutils release?

I'm also not sure what is meant with 'Did you use -r ...', should I
use it or is there the bug and I shouldn't use it?

What I did at last was to change '-g -O2' to '-O2' to reduce the size
of the objects, because it was suggested in some other postings I
found that it happens only with big object files and I added the -r
flag to compile the objects for the dynamic library which results in
the same 'Error: 0-bit reloc in dll'.

Is it neccessary to recompile all the 25 libraries (which I need to
link the application to) with the -r switch?


Gerrit
-- 
=^..^=


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: binutils: Strange ld error: Error: 0-bit reloc in dll
  2003-10-26  1:41 binutils: Strange ld error: Error: 0-bit reloc in dll Gerrit P. Haase
@ 2003-10-26  8:18 ` Gerrit P. Haase
  2003-10-27 10:36   ` Hannu E K Nevalainen
  0 siblings, 1 reply; 3+ messages in thread
From: Gerrit P. Haase @ 2003-10-26  8:18 UTC (permalink / raw)
  To: cygwin

Additional info about the statements that it happens with big object
files:
$ d gucharmap-unicode-info.o
rw-r--r--  #gerrit:Admins  3.9M  Oct 25 19:27  gucharmap-unicode-info.o
1 regular files, with a total size of 3.9M.

May be that is just too big?

Gerrit

> I'm getting a 'I've never seen before' ld error:
>  Error: 0-bit reloc in dll

> Libtool issues the link command like this:
> gcc -shared \
>  $(OBJECTS) \
>  -L/usr/lib \
>  -L/usr/X11R6/lib $(LIBS) \
>  -Wl,--export-dynamic \
>  -Wl,--export-dynamic \
>  -o .libs/cyggucharmap-3.dll \
>  -Wl,--image-base=0x10000000 \
>  -Wl,--out-implib,.libs/libgucharmap.dll.a
> Error: 0-bit reloc in dll
> Creating library file: .libs/libgucharmap.dll.a
> collect2: ld returned 1 exit status
> make[3]: *** [libgucharmap.la] Error 1
  
> I tried to reorder the command, I tried to add some switches like
> --export-all-symbols and -no-whole-archive, but it doesn't help.

> A google search shows only one hit of interest:

> http://article.gmane.org/gmane.comp.gnu.mingw.user/7425
> where Danny Smith wrote at 29 May 2003:
>>> gcc.exe -shared -Wl,--out-implib,libfoo.a -o foo.dll foo.o
>>> Error: 0-bit reloc in dll
>>> 
>>> Any idea what I should look for to work around this issue?
>>> 
>> Did you use -r (or --relocateable) to construct the object?
>> What version of ld?
>> 
>> The -r bug should be fixed in latest relwase candidade of binutils.
>> Danny


> Any ideas?  Was the '-r bug' which Danny fixed in the MinGW binutils
> release candidate not fixed in the Cygwin binutils release, or is it
> already included in the latest Cygwin binutils release?

> I'm also not sure what is meant with 'Did you use -r ...', should I
> use it or is there the bug and I shouldn't use it?

> What I did at last was to change '-g -O2' to '-O2' to reduce the size
> of the objects, because it was suggested in some other postings I
> found that it happens only with big object files and I added the -r
> flag to compile the objects for the dynamic library which results in
> the same 'Error: 0-bit reloc in dll'.

> Is it neccessary to recompile all the 25 libraries (which I need to
> link the application to) with the -r switch?


> Gerrit



-- 
=^..^=


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: binutils: Strange ld error: Error: 0-bit reloc in dll
  2003-10-26  8:18 ` Gerrit P. Haase
@ 2003-10-27 10:36   ` Hannu E K Nevalainen
  0 siblings, 0 replies; 3+ messages in thread
From: Hannu E K Nevalainen @ 2003-10-27 10:36 UTC (permalink / raw)
  To: cygwin

> From: Gerrit P. Haase
> Sent: Saturday, October 25, 2003 9:46 PM

> Additional info about the statements that it happens with big object
> files:
> $ d gucharmap-unicode-info.o
> rw-r--r--  #gerrit:Admins  3.9M  Oct 25 19:27  gucharmap-unicode-info.o
> 1 regular files, with a total size of 3.9M.
>
> May be that is just too big?
>
> Gerrit

! NOTE: I write this without really knowing about anything WRT ld...
! Please, take all I say with a grain of salt, auto adjust details,
! and so on ;-] - I'm here just in hope to help.

 Hmm? That would be very strange IMO... assuming size is measured in bytes
it would imply a very odd usage of data types, i.e. 20 bits or some such:

$ for ((n=1;n<33;n++)) ;do v=$(( 1 << ( $n ) )) \
  ;echo "$n bits -> range $v";done
<snip>
16 bits -> range 65536
17 bits -> range 131072
18 bits -> range 262144
19 bits -> range 524288
20 bits -> range 1048576
21 bits -> range 2097152
22 bits -> range 4194304
23 bits -> range 8388608
24 bits -> range 16777216
<snip>

How about the sum of *.o sizes; does that step past some 'bit-boundary' in
line with whats shown above?

 What datatype is used for adding up *.o sizes in ld?
 Is there some legacy code in there?

I know that O.L.D. versions of MAC OS used the upper 8 bits of 32 bit
address pointers for some obscure data (remember: 24 bit address bus on some
MC68K's).

/Hannu E K Nevalainen, B.Sc. EE - 59?16.37'N, 17?12.60'E
-- printf("Timezone: %s\n", (DST)?"UTC+02":"UTC+01"); --
--END OF MESSAGE--


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

end of thread, other threads:[~2003-10-26 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-26  1:41 binutils: Strange ld error: Error: 0-bit reloc in dll Gerrit P. Haase
2003-10-26  8:18 ` Gerrit P. Haase
2003-10-27 10:36   ` Hannu E K Nevalainen

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