This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug pch/16599] New: largefile.c:1: fatal error: had to relocate PCH
- From: "danglin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jul 2004 04:04:57 -0000
- Subject: [Bug pch/16599] New: largefile.c:1: fatal error: had to relocate PCH
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Executing on host: /mnt/gnu/gcc-3.3/objdir/gcc/xgcc -B/mnt/gnu/gcc-3.3/objdir/gc
c/ largefile.c -O0 -I. -S -o largefile.s (timeout = 300)
largefile.c:1: fatal error: had to relocate PCH
compilation terminated.
compiler exited with status 1
output is:
largefile.c:1: fatal error: had to relocate PCH
compilation terminated.
FAIL: largefile.c -O0 (test for excess errors)
Excess errors:
largefile.c:1: fatal error: had to relocate PCH
compilation terminated.
UNTESTED: gcc.dg/pch/largefile.c -O0 assembly comparison
* Default version of HOST_HOOKS_GT_PCH_USE_ADDRESS when mmap is present.
Map SIZE bytes of FD+OFFSET at BASE. Return 1 if we succeeded at
mapping the data at BASE, -1 if we couldn't.
This version assumes that the kernel honors the START operand of mmap
even without MAP_FIXED if START through START+SIZE are not currently
mapped with something. */
int
mmap_gt_pch_use_address (void *base, size_t size, int fd, size_t offset)
The START operand of mmap is NOT always honored without MAP_FIXED on the
PA under both hpux and linux. This is apparently a result of the strict
aliasing requirements of the hardware.
START is will be honored with MAP_FIXED, or mmap will fail. The current
implementation will generate a hard error if mmap doesn't honor START.
If this failure is caused by a previous mapping in the requested region,
then PCH behavior will be generally unreliable even on systems that honor
START without MAP_FIXED.
Thus, I believe we have to assume that mmap_gt_pch_use_address is called
before other mmap activity that might result in a mapping in the PCH
region. In that case, we can use or fallback to MAP_FIXED. The only
other fix that I can see is to eliminate the requirement that the PCH
file be mapped to a fixed address.
--
Summary: largefile.c:1: fatal error: had to relocate PCH
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: pch
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: danglin at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: hppa*-hp-hpux*, hppa*-unknown-linux-gnu
GCC host triplet: hppa*-hp-hpux*, hppa*-unknown-linux-gnu
GCC target triplet: hppa*-hp-hpux*, hppa*-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16599