Re: got space
Greetings, and thanks so much for your reply!
As GCL has control over the linker, I think I see a solution for its
needs, but it will, as you suggest, entail moving the gp register around
within a give .o file. Judicious repetition of the got entries as
needed should ensure that any given setting will be able to access the
values it needs, which could only be foiled in principle were >64k/8
references made between GPDISP relocs.
I'll keep you posted of the results if you are interested.
Michael Cree <firstname.lastname@example.org> writes:
> 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
>> 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.
Camm Maguire email@example.com
"The earth is but one country, and mankind its citizens." -- Baha'u'llah