This is the mail archive of the
mailing list for the binutils project.
Forcing ld to link 32 and 64 bit code together
- From: Jack Black <theworkaccount2 at gmail dot com>
- To: binutils at sourceware dot org
- Date: Fri, 3 Jan 2014 09:20:55 -0500
- Subject: Forcing ld to link 32 and 64 bit code together
- Authentication-results: sourceware.org; auth=none
I know you're reading this just to say "it can't be done." But listen.
I'm making some code that will exist in the transition between a 32
bit non-paged environment to a 64 bit paged environment. So my 32 bit
code will turn on 64 bit page tables, and then it needs to jump to 64
bit code. I want to end the 32 bit code with a relative jump to the
symbol name for the 64 bit code, and I just want the linker to fill in
the offset for me (or else I'm just going to have to manually emit the
bytes myself and fix up the offset manually every time the code
Is it possible to override the (understandable, correct) behavior of
ld to force it to link 32 and 64 bit together? If not, is there a
specific place I can look in the source to disable the sanity check
for linking 32 and 64 bit code together?