From: Stephen Williams <steve@icarus.icarus.com>
To: Chris Howard <choward@intellistor.com>
Cc: c++-embedded@cygnus.com, crossgcc@cygnus.com
Subject: Re: gcc vs g++ and linking with as
Date: Thu, 25 Jun 1998 23:03:00 -0000 [thread overview]
Message-ID: <199806260603.XAA24037@icarus.icarus.com> (raw)
In-Reply-To: <35926CEF.9F0E576F@intellistor.com>
choward@intellistor.com said:
> Compiling with as,gcc and linking with ld works fine. Compiling with
> as,g++ and linking with ld does not work,
> undefined symbols for those things written in assembler.
Even in C you can have troubles. What I do is use the "asm" attribute
to declare external variables, i.e.:
extern unsigned char __index_space asm("__index_space__");
which causes __index_space__ to be the actual symbol name at link time.
A function would work like this:
int foo(int i) asm("test_symbol");
int foo(int i)
{
return i+1;
}
This works with (GNU) C and C++. It is a good thing to do even with C
because sometimes you get the leasing _, sometimes you don't. etc.
--
Steve Williams "The woods are lovely, dark and deep.
steve@icarus.com But I have promises to keep,
steve@picturel.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."
next prev parent reply other threads:[~1998-06-25 23:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-06-25 8:32 Chris Howard
1998-06-25 20:20 ` C. M. Heard/VVNET, Inc.
1998-06-25 23:03 ` Stephen Williams [this message]
1998-06-26 0:59 ` Robert J. Brown
1998-06-25 9:21 Dave Hansen
[not found] <s5923122.008@btree.com>
1998-06-25 10:53 ` Chris Howard
1998-06-25 11:26 Gary Mussar
1998-06-25 11:36 Gary Mussar
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=199806260603.XAA24037@icarus.icarus.com \
--to=steve@icarus.icarus.com \
--cc=c++-embedded@cygnus.com \
--cc=choward@intellistor.com \
--cc=crossgcc@cygnus.com \
/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).