public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Dynamic Libraries under Solaris
@ 2000-05-02  4:11 Vinu V Nair
  2000-05-02  9:41 ` Alexandre Oliva
  0 siblings, 1 reply; 2+ messages in thread
From: Vinu V Nair @ 2000-05-02  4:11 UTC (permalink / raw)
  To: gcc-help

Hi

 When I try to build a shared library as follows
g++ -o libname.so -shared source.o
 where source.o is obtained as follows
g++ -c source.cxx,

 The linker cribbs saying

ld: fatal: relocations remain against allocatable but non-writable
sections.

Is this because the shared versions of libg++ and libstdc++ are not
present?

Again if I try to build the library by the following command

gcc -o libname.so -shared source.o it works. (source.o is made with g++)
But when I make the executable, 
(ie. g++ libname.so -o exacutable.) I end up with a very big one. 

What could be the reason for this?

Thanx
vinu

NB: This (both gcc and g++) works fine in Linux.

Vinu V. Nair   
Software Engineer
Silicon Automation Systems Limited
5281461/5281229-2213   

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

* Re: Dynamic Libraries under Solaris
  2000-05-02  4:11 Dynamic Libraries under Solaris Vinu V Nair
@ 2000-05-02  9:41 ` Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2000-05-02  9:41 UTC (permalink / raw)
  To: Vinu V Nair; +Cc: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

On May  2, 2000, Vinu V Nair <vinu@sasi.com> wrote:

> g++ -o libname.so -shared source.o
>  where source.o is obtained as follows
> g++ -c source.cxx,

You're missing -fPIC.

> NB: This (both gcc and g++) works fine in Linux.

GNU ld isn't as strict WRT -fPIC as Solaris' linker.  But it's
advantageous to use it on GNU/Linux too, since it allows for sharing
of code pages.

-- 
Alexandre Oliva    Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

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

end of thread, other threads:[~2000-05-02  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-02  4:11 Dynamic Libraries under Solaris Vinu V Nair
2000-05-02  9:41 ` Alexandre Oliva

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