All of lore.kernel.org
 help / color / mirror / Atom feed
* Q: -fpic and $_GLOBAL_OFFSET_TABLE_
@ 2003-07-15 13:19 Oleg Nesterov
  2003-07-15 23:24 ` hp
  2003-07-16 10:03 ` Keyboard and Mouse library jeff
  0 siblings, 2 replies; 16+ messages in thread
From: Oleg Nesterov @ 2003-07-15 13:19 UTC (permalink / raw)
  To: linux-assembly

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.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2003-07-17 22:12 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-15 13:19 Q: -fpic and $_GLOBAL_OFFSET_TABLE_ Oleg Nesterov
2003-07-15 23:24 ` hp
2003-07-16 10:03 ` Keyboard and Mouse library jeff
2003-07-15 19:54   ` Luciano Miguel Ferreira Rocha
2003-07-15 23:15   ` hp
2003-07-16  6:49     ` hp
2003-07-17  7:17     ` jeff
2003-07-16  3:09   ` linuxassembly
2003-07-16  6:46     ` hp
2003-07-16  8:07       ` linuxassembly
2003-07-17 16:45         ` Maciej Hrebien
2003-07-17 19:26           ` linuxassembly
2003-07-17 20:11             ` Maciej Hrebien
2003-07-17 22:12             ` hp
2003-07-17 12:29     ` jeff
2003-07-17 20:14       ` Konstantin Boldyshev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.