From: Hiroyuki Machida <machida@sm.sony.co.jp>
To: kk@ddeorg.soft.net, flo@rfc822.org, ian@zembu.com
Cc: binutils@sourceware.cygnus.com, linux@cthulhu.engr.sgi.com,
debian-mips@lists.debian.org
Subject: Re: MIPS gas problem
Date: Fri, 21 Apr 2000 10:52:25 +0900 [thread overview]
Message-ID: <20000421105225J.machida@sm.sony.co.jp> (raw)
In-Reply-To: <20000420164812.17210.qmail@daffy.airs.com>
I rewrite the test program which is not depending your gcc version
or config. Please try this.
#define P1 10
#define P2 12
#define P1STR "10"
#define P2STR "12"
#define AL1 (2<<(P1-1))
#define AL2 (2<<(P2-1))
asm(
" .globl globalc;\n"
" .rdata;\n"
" .type globalc,@object;\n"
" .size globalc,1;\n"
"globalc:\n"
" .byte 97;\n"
);
asm(
" .globl global1;\n"
" .align " P1STR ";\n"
" .type global1,@object;\n"
" .size global1,4;\n"
"global1:\n"
" .word 0;\n"
);
asm(
" .globl global2;\n"
" .align " P2STR ";\n"
" .type global2,@object;\n"
" .size global2,4;\n"
"global2:\n"
" .word 1;\n"
);
int total_ng=0;
void check(char *addr, unsigned long al)
{
unsigned long mask = (al -1);
if ((unsigned long) addr & mask){
total_ng ++;
printf("err:%x expected:%x\n", addr,
(unsigned long) addr & ~mask);
}
}
int
main(void)
{
extern int global1, global2;
extern char globalc;
printf("* readonly gloabl\n");
printf("chcking align:%x\n",AL1);
check((char *)&global1,AL1);
printf("%x\n", &global1);
printf("chcking align:%x\n",AL2);
check((char *)&global2,AL2);
printf("%x\n", &global2);
printf("\n");
if (total_ng) {
printf("NG:%d\n",total_ng);
} else {
printf("OK\n");
}
printf("\n");
return total_ng;
}
next prev parent reply other threads:[~2000-04-21 2:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-20 2:13 MIPS gas problem Hiroyuki Machida
2000-04-20 10:16 ` Florian Lohoff
2000-04-20 12:07 ` Koundinya.K
[not found] ` <20000420164812.17210.qmail@daffy.airs.com>
2000-04-21 1:52 ` Hiroyuki Machida [this message]
2000-04-24 5:06 ` Koundinya.K
2000-04-21 3:30 ` Hiroyuki Machida
[not found] ` <20000421154859.3820.qmail@daffy.airs.com>
2000-04-24 3:16 ` Hiroyuki Machida
2000-04-24 3:16 ` Hiroyuki Machida
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=20000421105225J.machida@sm.sony.co.jp \
--to=machida@sm.sony.co.jp \
--cc=binutils@sourceware.cygnus.com \
--cc=debian-mips@lists.debian.org \
--cc=flo@rfc822.org \
--cc=ian@zembu.com \
--cc=kk@ddeorg.soft.net \
--cc=linux@cthulhu.engr.sgi.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