public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* hidden symbol __dso_handle reference: link error
@ 2007-05-11 20:30 Gary Hughes-Fenchel
  2007-05-11 20:38 ` Matthew Woehlke
  2007-08-02 19:33 ` hidden symbol __dso_handle reference: link error, lost attachments Gary Hughes-Fenchel
  0 siblings, 2 replies; 5+ messages in thread
From: Gary Hughes-Fenchel @ 2007-05-11 20:30 UTC (permalink / raw)
  To: gcc-help

I am seeing this:
  /usr/bin/ld: pgmreceiver: hidden symbol `__dso_handle' in
/usr/lib/gcc/x86_6
     4-redhat-linux/4.1.1/crtbegin.o is referenced by DSO
  26 /usr/bin/ld: final link failed: Nonrepresentable section on output
  27 collect2: ld returned 1 exit status

I am calling ld directly. I am building 2 separate libraries and trying
to link with the dynamic libraries. The libraries are being created with:
-fvisibility=default
-shared
-soname foo.so -lc mylib1.a mylib2.a

I don't have the option of either rebuilding the compiler (suggested in
one post at http://gcc.gnu.org/ml/libstdc++/2000-06/msg00134.html) or
ceasing to call ld directly. The version I'm using is:
g++ --version
g++ (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)

The linker I'm using is:
ld --version
GNU ld version 2.17.50.0.6-2.el5 20061020


Any assistance would be greatly appreciated.


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

* Re: hidden symbol __dso_handle reference: link error
  2007-05-11 20:30 hidden symbol __dso_handle reference: link error Gary Hughes-Fenchel
@ 2007-05-11 20:38 ` Matthew Woehlke
  2007-05-11 21:34   ` Gary Hughes-Fenchel
  2007-08-02 19:13   ` Gary Hughes-Fenchel
  2007-08-02 19:33 ` hidden symbol __dso_handle reference: link error, lost attachments Gary Hughes-Fenchel
  1 sibling, 2 replies; 5+ messages in thread
From: Matthew Woehlke @ 2007-05-11 20:38 UTC (permalink / raw)
  To: gcc-help

Gary Hughes-Fenchel wrote:
> I am seeing this:
>  /usr/bin/ld: pgmreceiver: hidden symbol `__dso_handle' in
> /usr/lib/gcc/x86_6
>     4-redhat-linux/4.1.1/crtbegin.o is referenced by DSO
>  26 /usr/bin/ld: final link failed: Nonrepresentable section on output
>  27 collect2: ld returned 1 exit status
> 
> I am calling ld directly. I am building 2 separate libraries and trying
> to link with the dynamic libraries. The libraries are being created with:
> -fvisibility=default
> -shared
> -soname foo.so -lc mylib1.a mylib2.a

Are you using '-shared' when you invoke gcc/g++ to compile your source 
objects?

-- 
Matthew
find / -user your -name base -print0 | xargs -0 chown us:us

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

* Re: hidden symbol __dso_handle reference: link error
  2007-05-11 20:38 ` Matthew Woehlke
@ 2007-05-11 21:34   ` Gary Hughes-Fenchel
  2007-08-02 19:13   ` Gary Hughes-Fenchel
  1 sibling, 0 replies; 5+ messages in thread
From: Gary Hughes-Fenchel @ 2007-05-11 21:34 UTC (permalink / raw)
  To: gcc-help

Matthew Woehlke wrote:
> Gary Hughes-Fenchel wrote:
>> I am seeing this:
>>  /usr/bin/ld: pgmreceiver: hidden symbol `__dso_handle' in
>> /usr/lib/gcc/x86_6
>>     4-redhat-linux/4.1.1/crtbegin.o is referenced by DSO
>>  26 /usr/bin/ld: final link failed: Nonrepresentable section on output
>>  27 collect2: ld returned 1 exit status
>>
>> I am calling ld directly. I am building 2 separate libraries and trying
>> to link with the dynamic libraries. The libraries are being created with:
>> -fvisibility=default
>> -shared
>> -soname foo.so -lc mylib1.a mylib2.a
> 
> Are you using '-shared' when you invoke gcc/g++ to compile your source 
> objects?
> 
No I was not. I tried it, and that cleared it up! Thanks!

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

* Re: hidden symbol __dso_handle reference: link error
  2007-05-11 20:38 ` Matthew Woehlke
  2007-05-11 21:34   ` Gary Hughes-Fenchel
@ 2007-08-02 19:13   ` Gary Hughes-Fenchel
  1 sibling, 0 replies; 5+ messages in thread
From: Gary Hughes-Fenchel @ 2007-08-02 19:13 UTC (permalink / raw)
  To: gcc-help

Matthew Woehlke wrote:
> Gary Hughes-Fenchel wrote:
>> I am seeing this:
>>  /usr/bin/ld: pgmreceiver: hidden symbol `__dso_handle' in
>> /usr/lib/gcc/x86_6
>>     4-redhat-linux/4.1.1/crtbegin.o is referenced by DSO
>>  26 /usr/bin/ld: final link failed: Nonrepresentable section on output
>>  27 collect2: ld returned 1 exit status
>>
>> I am calling ld directly. I am building 2 separate libraries and trying
>> to link with the dynamic libraries. The libraries are being created with:
>> -fvisibility=default
>> -shared
>> -soname foo.so -lc mylib1.a mylib2.a
> 
> Are you using '-shared' when you invoke gcc/g++ to compile your source 
> objects?
> 
Yes. I am attaching 3 files: BuildSmall, which is a bash script to build 
  the cpp files, reallysmall.cpp which contains main, and 
reallysmalllib.cpp which contains a call to stat & printf. I COULD have 
written a makefile but I think the bash script is even more trivial.

This apparently works using gcc 4.x, but not the version of gcc I am using.
  gcc --version
gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-53)

Upgrading gcc is not going to be an option for the actual product.

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

* Re: hidden symbol __dso_handle reference: link error, lost attachments
  2007-05-11 20:30 hidden symbol __dso_handle reference: link error Gary Hughes-Fenchel
  2007-05-11 20:38 ` Matthew Woehlke
@ 2007-08-02 19:33 ` Gary Hughes-Fenchel
  1 sibling, 0 replies; 5+ messages in thread
From: Gary Hughes-Fenchel @ 2007-08-02 19:33 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

Here is a less messy version of the error message:

  BuildReallySmall
compiling reallysmalllib
creating shared lib for reallysmalllib
compiling executable
linking in executable
/usr/bin/ld: reallysmall: hidden symbol `stat64' in 
/usr/lib64/libc_nonshared.a(stat64.oS) is referenced by DSO
collect2: ld returned 1 exit status

> The linker I'm using is:
> ld --version
> GNU ld version 2.17.50.0.6-2.el5 20061020
> 
> 
> Any assistance would be greatly appreciated.
> 
> 
> 


[-- Attachment #2: reallysmalllib.cpp --]
[-- Type: text/plain, Size: 254 bytes --]

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int shareme()
{
	int fstat_result;
	struct stat fstat_buf;

	fstat_result=stat("/rv/home/ghughesf/GarysTools.cpio",&fstat_buf);
	printf ("Hello World\n");
	return (0);
}

[-- Attachment #3: BuildReallySmall --]
[-- Type: text/plain, Size: 572 bytes --]

# First, clean
rm *.o *.a *.so *.lib *map.txt> /dev/null 2>&1

echo compiling reallysmalllib
c++ -Wall -Woverloaded-virtual -g -c reallysmalllib.cpp \
	-o reallysmalllib.o -fPIC -D_FILE_OFFSET_BITS=64
echo creating shared lib for reallysmalllib
ld -shared -soname reallysmalllib.so -o reallysmalllib.so \
	reallysmalllib.o 

echo compiling executable
c++ -Wall -Woverloaded-virtual -g -c reallysmall.cpp \
	-o reallysmall.o -fPIC  -D_FILE_OFFSET_BITS=64
echo linking in executable
c++ -Wall -Woverloaded-virtual -g reallysmall.o \
	reallysmalllib.so -o reallysmall -fPIC 

[-- Attachment #4: reallysmall.cpp --]
[-- Type: text/plain, Size: 69 bytes --]

extern int shareme();
int
main()
{
	(void) shareme();
	return (0);
}

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

end of thread, other threads:[~2007-08-02 19:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-11 20:30 hidden symbol __dso_handle reference: link error Gary Hughes-Fenchel
2007-05-11 20:38 ` Matthew Woehlke
2007-05-11 21:34   ` Gary Hughes-Fenchel
2007-08-02 19:13   ` Gary Hughes-Fenchel
2007-08-02 19:33 ` hidden symbol __dso_handle reference: link error, lost attachments Gary Hughes-Fenchel

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