[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/20833] x32 kernel build error
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug gold/20833] x32 kernel build error |
Date: |
Mon, 21 Nov 2016 22:03:18 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=20833
--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
X32 uses 32-bit pointers in 64-bit address space. It can reach
the full 64-bit address space:
address@hidden far-3]$ cat x.c
#include <stdio.h>
extern int foo (long long);
int
main ()
{
long long addr = 0xffffffffff600000LL;
int x = foo (addr);
printf ("0x%llx: %p\n", addr, x);
return 0;
}
address@hidden far-3]$ cat foo.S
.text
.p2align 4,,15
.globl foo
.type foo, @function
foo:
.LFB0:
.cfi_startproc
movl (%rdi), %eax
ret
.cfi_endproc
.LFE0:
.size foo, .-foo
.section .note.GNU-stack,"",@progbits
address@hidden far-3]$ gcc x.c foo.S -mx32
address@hidden far-3]$ ./a.out
0xffffffffff600000: 0x60c0c748
address@hidden far-3]$
0xffffffffff600000 is mapped to vsyscall page, which is invisible to
normal x32 application. In this sense, ld isn't wrong not to issue
an error to access below 0 for both LP64 and ILP32.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gold/20833] New: x32 kernel build error, markus at trippelsdorf dot de, 2016/11/17
- [Bug gold/20833] x32 kernel build error, hjl.tools at gmail dot com, 2016/11/17
- [Bug gold/20833] x32 kernel build error, markus at trippelsdorf dot de, 2016/11/17
- [Bug gold/20833] x32 kernel build error, hjl.tools at gmail dot com, 2016/11/17
- [Bug gold/20833] x32 kernel build error, hjl.tools at gmail dot com, 2016/11/18
- [Bug gold/20833] x32 kernel build error, ccoutant at gmail dot com, 2016/11/21
- [Bug gold/20833] x32 kernel build error, hjl.tools at gmail dot com, 2016/11/21
- [Bug gold/20833] x32 kernel build error,
hjl.tools at gmail dot com <=