64-bit memory models

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: 64-bit memory models

Post by NickJohnson »

Hmm, it seems you're right. Almost thought I had it there :P

Any other ideas?
Cognition
Member
Member
Posts: 191
Joined: Tue Apr 15, 2008 6:37 pm
Location: Gotham, Batmanistan

Re: 64-bit memory models

Post by Cognition »

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.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: 64-bit memory models

Post by NickJohnson »

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.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: 64-bit memory models

Post by Owen »

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.
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: 64-bit memory models

Post by NickJohnson »

Yeah, I tried -static too. It doesn't seem to affect anything.
Post Reply