views:

118

answers:

2

I've seen this term in the Python Lisp compiler and some C linker's sources.

My guess is that a fix-up is just some wrapper around an Assembly routine that makes sure the alignment is right, but I'm not sure at all about anything here.

+7  A: 

A "fixup" is a linker term. There's a pretty good discussion of it here:

http://www.microsoft.com/msj/0797/hood0797.aspx

Whenever a object file (.o, .obj) refers to some external symbol it will output placeholder code like "Put address 0 to register 5" and a note that says "Fill in that 0 with the actual address of symbol 'foo'". Some other object file will define 'foo', the linker will then go back and "fix up" the 0 to be the correct address.

Incidentally, if nobody defines 'foo' you get that retro 50's style error message blithering something like 'can't find reference to _foo' or even less comprehensible if you're using C++.

And pretty rarely you'll get a "fixup error" when the address of 'foo' doesn't fit where the linker wants to put it. Generally this comes from a fixup that requires a relative offset that is too large.

George Phillips
Great answer and link, thank you.
skypher
+1  A: 

Linker and Loaders is an interesting inker resource that explains a lot of jargon, and includes non x86 cpus here and there too:

http://www.iecc.com/linker/

from the comp.compilers moderator.

Marco van de Voort