public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steve Fink <sfink@cs.berkeley.edu>
To: help-gcc@gnu.org
Subject: ld works, gcc doesn't & NS plugin problems
Date: Tue, 30 Nov 1999 18:24:00 -0000	[thread overview]
Message-ID: <82203e$esi$1@nnrp1.deja.com> (raw)

I don't know if these are related, but they might be...

I am trying to write a netscape plugin. It works, except their default
makefile.linux doesn't -- I have to switch from using gcc -shared to ld
-shared when generating the final shared lib. I have encountered this
before in simpler situations. Netscape gets a bus error.

But I can live with that without understanding it. What I can't figure
out is how to make the plugin work. Calling dynamically linked libc and
netscape symbols works fine. But when I call fstat() (or stat()), it
fills my struct stat buffer with junk. The exact same code works fine
when built as a standalone program, and the fstat call isn't failing
(read() also behaves correctly on the same fd). Is something about the
way I'm linking causing these things to get tangled up? How is fstat()
resolved, anyway? Doesn't seem to be in libc.so.

% gcc -shared -fPIC -c -Wall -g -DXP_UNIX -I../../../include
-I../Source/_gen -I. -I/usr/include ../Source/UnixShell.c
% ld -shared -o myplugin.so UnixShell.o stubs.o

% rpm -q -f /lib/libc.so.6
glibc-2.1.2-10
% rpm -q binutils
binutils-2.9.1.0.23-1
% gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
% ld -v
GNU ld version 2.9.1 (with BFD 2.9.1.0.23)
% netscape -v
Netscape 4.6/U.S., 04-May-99; (c) 1995-1998 Netscape Communications
Corp.


Sent via Deja.com http://www.deja.com/
Before you buy.

WARNING: multiple messages have this Message-ID
From: Steve Fink <sfink@cs.berkeley.edu>
To: help-gcc@gnu.org
Subject: ld works, gcc doesn't & NS plugin problems
Date: Tue, 30 Nov 1999 23:28:00 -0000	[thread overview]
Message-ID: <82203e$esi$1@nnrp1.deja.com> (raw)
Message-ID: <19991130232800.6vcoevMqk6wfqE2YZnW1Xcs5kxWXA_ySEODTGan3cqs@z> (raw)

I don't know if these are related, but they might be...

I am trying to write a netscape plugin. It works, except their default
makefile.linux doesn't -- I have to switch from using gcc -shared to ld
-shared when generating the final shared lib. I have encountered this
before in simpler situations. Netscape gets a bus error.

But I can live with that without understanding it. What I can't figure
out is how to make the plugin work. Calling dynamically linked libc and
netscape symbols works fine. But when I call fstat() (or stat()), it
fills my struct stat buffer with junk. The exact same code works fine
when built as a standalone program, and the fstat call isn't failing
(read() also behaves correctly on the same fd). Is something about the
way I'm linking causing these things to get tangled up? How is fstat()
resolved, anyway? Doesn't seem to be in libc.so.

% gcc -shared -fPIC -c -Wall -g -DXP_UNIX -I../../../include
-I../Source/_gen -I. -I/usr/include ../Source/UnixShell.c
% ld -shared -o myplugin.so UnixShell.o stubs.o

% rpm -q -f /lib/libc.so.6
glibc-2.1.2-10
% rpm -q binutils
binutils-2.9.1.0.23-1
% gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
% ld -v
GNU ld version 2.9.1 (with BFD 2.9.1.0.23)
% netscape -v
Netscape 4.6/U.S., 04-May-99; (c) 1995-1998 Netscape Communications
Corp.


Sent via Deja.com http://www.deja.com/
Before you buy.

             reply	other threads:[~1999-11-30 18:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-30 18:24 Steve Fink [this message]
1999-11-30 23:28 ` Steve Fink
1999-12-01 16:37 ` Arthur Gold
1999-12-31 22:24   ` Arthur Gold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='82203e$esi$1@nnrp1.deja.com' \
    --to=sfink@cs.berkeley.edu \
    --cc=help-gcc@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).