[llvm-dev] [cfe-dev] How to debug if LTO generate wrong code?

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Mon May 30 03:18:18 PDT 2016

On Mon, May 30, 2016 at 02:12:09AM +0000, Shi, Steven via llvm-dev wrote:
> Hi Joerg,
> My firmware case is I need load my firmware to run in high address
> which is hardware required. It is not that my firmware really need
> large static data and text code. My firmware modules are shared library
> (like a DLL) built with "-fpic", and firmware loader will load them to
> high address (larger than 2GB). I think this need is quite common to
> system software, like firmware, driver and kernel mode code.

It sounds more like there a confusion about what symbols are internal
and what not. The normal code model on AMD64 requires code and data to
fit into 2GB, but non-local symbols are accessed indirectly. That
doesn't happen in your case. For functions, that's normally partially
the job of the linker (via stubs), but for data the compiler has to be
aware of it. The load address is irrelevant for PIC.


More information about the llvm-dev mailing list