ld and holes in the address space

Greg McGary greg@mcgary.org
Mon Oct 2 21:41:00 GMT 2006

I have an employer who desires that ld be able to populate the .text
address space around "holes".  The addresses and sizes of the holes
will be declared in the linker script.

A naive implementation will fit as many complete objects as possible
up to a hole's start address, then link the next object after the
hole's end address.

A complex implementation for code would will right up to a hole's
start address, possibly splitting an object across the hole and
inserting a jump to span the hole.  (Obviously, data can't be split
across holes).  The complex implementation has many thorny problems on
machines that have short- and long-displacement branches, as this
employer's CPU has.  I prefer not to open that can of worms.

Has anything like this been contemplated before?  If I implement this, 
what are the chances that the maintainers will want this feature?


More information about the Binutils mailing list