This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gold alignment for 64-bit target in 32-bit binary
- From: Ian Lance Taylor <iant at google dot com>
- To: David Miller <davem at davemloft dot net>
- Cc: binutils at sourceware dot org
- Date: Sat, 19 Apr 2008 15:59:33 -0700
- Subject: Re: gold alignment for 64-bit target in 32-bit binary
- References: <20080416.044629.127623915.davem@davemloft.net>
David Miller <davem@davemloft.net> writes:
> If you try to link for a 64-bit target in a 32-bit gold binary, the
> output views are not aligned enough so we die with a SIGBUS on
> platforms like sparc.
>
> Simple sparc test case:
>
> -------------------- test.s --------------------
> .text
> .globl _start
> _start: nop
> -------------------- test.2 --------------------
>
> bash$ gcc -m64 -c -o test.o test.s
> bash$ ./ld-new -o test test.o
> Bus error (core dumped)
> bash$
>
> It seems things are 4-byte aligned when they need to be 8-byte
> aligned.
I haven't forgotten about this, but without access to a strict
alignment system I'm not sure how to track it down. Can you send me a
backtrace from the bus error?
There isn't supposed to be anything in gold which is based on the host
alignment.
Ian