On Mon, Mar 05, 2012 at 04:01:45PM -0800, ron minnich wrote:
I'm seeing the ld problem on all my linux systems.
What distro do you have? This got fixed in Fedora updates at least.
I would normally work around build tool defects (and have done so on many occasions). Unfortunately, this LD one is too severe. The issue is that SeaBIOS needs to have certain tables and code entry points at specific memory locations - this is a requirement for compatibility. The SeaBIOS build generates an LD script to locate the appropriate sections at the correct addresses. Unfortunately, the broken version of LD gets confused with alignment and refuses to place data at the locations they need to be. Not much that can be done - any solution would effectively require not using LD - might as well write our own LD (with the limited requirements of seabios) than try to work around it.
-Kevin
The solution in other projects I have worked on is to have an initialized struct and just copy it at runtime to the right place. This gets around all the issues with ld (which have been issues in various ways for 12 years now ... just different ones :)
How big are the tables? If they're not that big then just copying them to where they need to be at startup might be the best solution. LD is going to continue to break, always has and always will. Just a thought.
This fails on recent arch and ubuntu. If you can find a way not to use this kind of LD trick, life will be easier.
Of course if this is going to mess up entry points then we're out of luck.
thanks
ron