Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Definition of fix-up?

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.

like image 770
Leslie P. Polzer Avatar asked Dec 23 '22 10:12

Leslie P. Polzer


1 Answers

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.

like image 107
George Phillips Avatar answered Dec 26 '22 07:12

George Phillips