[llvm-dev] [LLVM-DEV][LLD] RFC Range Thunks Implementation review for ARM and Mips

Rafael EspĂ­ndola via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 5 16:14:57 PDT 2017


> Proposed implementation for range extension thunks
> At a high-level we need to solve the following problems:
> - Assign addresses more than once
> - Maintain state between successive calls of createThunks()
> - Synchronization of the linker script and the OutputSection after adding thunks

This last past seems to be the messier. The issue is not with the
patch, is with the existing infrastructure that uses a completely
different representation for linker scripts and non linker scripts.

What I think is needed is for the writer to create a dummy "script"
and use what is now LinkerScript::assignAddresses. That "script" would

* Contain only OutputSectionCommand.
* All string manipulations would have been moved before assignAddress.
* All the orphan handling would have been made explicit before assignAddress.
* Each OutputSectionCommand would contain just a InputSectionDescription.

With this the thunk creation should be able to add thunk to a single location.

Cheers,
Rafael


More information about the llvm-dev mailing list