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

Re: got space

On Mon, Mar 19, 2018 at 12:47:25PM -0400, Camm Maguire wrote:
> There are a few very large C source files in acl2 which are overflowing
> the 16bit gp relative relocation scheme for ELF_LITERAL relocations,
> pertaining to static functions.  Each function produces a reloc to .text
> with a unique addend, overflowing the 64k space accessible by the
> instruction.  I've looked at the gcc docs which seem to imply that
> -mlarge-data acknowledged this limitation at least with .data.
> -mlarge-text does not provide a 32bit address space as far as I can
> see.
> What is the canonical way to get gcc on alpha to compile and load really
> large files?  (GCL has its own linker, so these files are not processed
> by ld.)

I think the canonical sequence of instructions for calling a function
with large-text and large-data is:

adr := gp + immediate_16bit_offset
jsr (adr)
gp := pc + immediate_high_16bit_offset
gp := gp + immediate_low_16bit_offset

Thus the gp can be anywhere in a 32-bit adress space, but the jump
table can only be 64k.  I am not aware of a work around other then
splitting the program (or shareable library) into smaller chunks.
It's a pain; there are some other packages in the repository that
fail to build on Alpha because of gprel16 relocation overflows.

I've CCed the debian-alpha email list.  Maybe someone there knows
better and can comment further.


Reply to: