From: Oleg Nesterov <oleg@tv-sign.ru>
To: linux-gcc@vger.kernel.org
Subject: Q: -fpic and $_GLOBAL_OFFSET_TABLE_
Date: Wed, 16 Jul 2003 18:30:21 +0400 [thread overview]
Message-ID: <E19cnIT-0003sJ-00@mail.tv-sign.ru> (raw)
Hello.
I thought, that &GOT == $_GLOBAL_OFFSET_TABLE_ + .
$ cat test.c
void test(void)
{
asm volatile (
"addl $_GLOBAL_OFFSET_TABLE_, %eax\n"
"addl $_GLOBAL_OFFSET_TABLE_, %ecx\n"
);
}
$ cc -c -fpic -fomit-frame-pointer test.c && ld -shared -o test.so test.o && objdump -d test.so
test.so: file format elf32-i386
Disassembly of section .text:
0000018c <test>:
18c: 05 0d 10 00 00 addl $0x100d,%eax ==> &GOT = 0x18c + 0x100d = 0x1199
191: 81 c1 07 10 00 00 addl $0x1007,%ecx ==> &GOT = 0x191 + 0x1007 = 0x1198
197: c3 ret
How can it be?
Oleg.
reply other threads:[~2003-07-16 14:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E19cnIT-0003sJ-00@mail.tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=linux-gcc@vger.kernel.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).