linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "kerler" <kerler@newmail.net>
To: <linuxppc-dev@lists.linuxppc.org>
Cc: <gcc@gcc.gnu.org>
Subject: how to use macro in assemble language embedded in C?
Date: Tue, 26 Dec 2000 09:41:09 +0800	[thread overview]
Message-ID: <00d001c06edc$f3ec3d20$5ef1d092@chn.agilent.com> (raw)
In-Reply-To: orsnnd3d6f.fsf@guarana.lsd.ic.unicamp.br


hello,

When i use the assemble language embedded in C, how can i use the macro?

in the following code, i want to use the macro PT_R16 defined in
asm\ptrace.h.

=========temp.c==========
asm("#include <asm\\ptrace.h>\n\t");
void dummy (void)
{
    asm("stwu   %r1, -PT_R16(%r1)");             /* stack */
}
=========end of temp.c===

when i
      gcc -c temp.c
error message:
/tmp/cc8ztvPf.s: Assembler messages:
/tmp/cc8ztvPf.s:13: Error: Negative of non-absolute symbol PT_R16

if use
      gcc -S temp.c
the file temp.s is:

=========temp.s==========
        .file   "temp.c"
gcc2_compiled.:
        #include <asm\ptrace.h>

        .section        ".text"
        .align 2
        .globl dummy
        .type    dummy,@function
dummy:
        stwu 1,-16(1)
        stw 31,12(1)
        mr 31,1
        stwu   %r1, -PT_R16(%r1)
.L2:
        lwz 11,0(1)
        lwz 31,-4(11)
        mr 1,11
        blr
.Lfe1:
        .size    dummy,.Lfe1-dummy
        .ident  "GCC: (GNU) 2.95.2 20000220 (Debian GNU/Linux)"
======end of temp.s=============


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2000-12-26  1:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-23  5:52 kerne-2.4.0-test13pre3 with gcc-2.97 Kaoru Fukui
     [not found] ` <20001223142145.T5858@coruscant.gnumonks.org>
2000-12-23 13:30   ` Kaoru Fukui
2000-12-24  3:29 ` Alexandre Oliva
2000-12-24 13:53   ` Kaoru Fukui
2000-12-24 15:20     ` Thomas Sailer
2000-12-24 15:19   ` Thomas Sailer
2000-12-24 18:08     ` Alexandre Oliva
2000-12-26  1:41       ` kerler [this message]
     [not found]         ` <20001226221757.Postino-028251@smtp01.highway.ne.jp>
2000-12-27  3:33           ` how to use macro in assemble language embedded in C? kerler
2000-12-27 15:50             ` Alexandre Oliva
2000-12-27 23:37       ` kerne-2.4.0-test13pre3 with gcc-2.97 Richard Henderson
2000-12-24 15:16 ` Thomas Sailer
  -- strict thread matches above, loose matches on Subject: below --
2000-12-27 11:04 how to use macro in assemble language embedded in C? Kaoru Fukui

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='00d001c06edc$f3ec3d20$5ef1d092@chn.agilent.com' \
    --to=kerler@newmail.net \
    --cc=gcc@gcc.gnu.org \
    --cc=linuxppc-dev@lists.linuxppc.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 NNTP newsgroup(s).