Re: got space
Greetings! This algorithm appears to work:
For each GPDISP reloc, check if it corresponds with a local function
symbol start address, and if so, set gp to the max got address used so
far. (These are 'toplevel' and guaranteed to be run regardless of
branch evaluation.) Then when processing LITERAL, repeat cached got
entries (zero addends are cached) if out of range, and always alloc a
fresh got slot if there is a non-zero addend. Check that each LITERAL
is in 16bit address range or abort.
Michael Cree <email@example.com> 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 firstname.lastname@example.org
"The earth is but one country, and mankind its citizens." -- Baha'u'llah