64-bit write() system call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First, I have also posted this on ubuntuforums.org. I know that's bad
form, but I don't think there will be many cross-readers here.

The default address size is 64 bits in 64-bit mode. But when I look at
the assembly language for the write() syscall, gcc uses only 32 bits of
the address:

	.file	"oneChar.c"
	.data
	.type	aLetter, @object
	.size	aLetter, 1
aLetter:
	.byte	65
	.text
.globl main
	.type	main, @function
main:
	pushq	%rbp             // <== 64-bit addresses
	movq	%rsp, %rbp       // <==
	movl	$1, %edx
	movl	$aLetter, %esi   // <== 32-bit address
	movl	$1, %edi
	call	write
	movl	$0, %eax
	leave
	ret
	.size	main, .-main
	.ident	"GCC: (GNU) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)"
	.section	.note.GNU-stack,"",@progbits

Can anyone point me to discussions of what is going on here?

Bob



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux