llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Provide a way to avoid ADRP instructions to make code 100% position independent.

Open llvmbot opened this issue 8 years ago • 1 comments

Bugzilla Link 37543
Version 6.0
OS All
Reporter LLVM Bugzilla Contributor
CC @DMG862

Extended Description

For environments where code will be executed and cannot meet the page alignment requirements of ADRP, it would be nice to be able to tell the compiler that emitting ADRP instructions are not necessary.

A good option might be to implement 'tiny' for mcmodel

The primary goal is for 100% position independent code.

Please see http://lists.llvm.org/pipermail/llvm-dev/2018-May/123465.html for a discussion of this issue.

llvmbot avatar May 21 '18 16:05 llvmbot

Hello

Tiny code code has been implemented in rL340397. It is fresh off the presses, and does not currently handle TLS relocations, in case that is something that you need.

It should allow pic code without relying on page boundaries (although this was not the main motivation and may not be tested well). If you find any places it is not as pic as you'd expect, I'm interested to see where and why.

Let me know if you try it, how it goes. Dave

DMG862 avatar Aug 22 '18 16:08 DMG862