Hmm, it seems you're right. Almost thought I had it there
Any other ideas?
64-bit memory models
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: 64-bit memory models
Possibly -flto and then use the gold linker. There's also the option of -fwhole-program, though you'd have to compile differently. Lastly there's always the option of switching to an clang + LLVM based build system and using their intermediate files to perform whole program optimization (a bit more complicated but doable).
Reserved for OEM use.
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: 64-bit memory models
That seems like a bit of a hack... I'm surprised there isn't any way to get GCC to do this properly. All it needs to do is emit a R_X86_64_PC32 relocation for an external symbol. I might go bug the GCC people directly and see if I can't get an answer.
For now, I can deal with not being able to directly reference global variables in other translation units (doing so is so-so design-wise anyway, and I can deal with a restricted environment for this component) but it would be nice to fix this eventually.
For now, I can deal with not being able to directly reference global variables in other translation units (doing so is so-so design-wise anyway, and I can deal with a restricted environment for this component) but it would be nice to fix this eventually.
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: 64-bit memory models
Hmm, random thought: Tried "-static"?
In dynamic mode, the symbols could theortically be to other DSOs. In static mode, this wouldn't be the case.
In dynamic mode, the symbols could theortically be to other DSOs. In static mode, this wouldn't be the case.
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: 64-bit memory models
Yeah, I tried -static too. It doesn't seem to affect anything.