Definition of fix-up?
Asked Answered
M

2

5

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.

Mountford answered 6/7, 2009 at 16:42 Comment(0)
S
12

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.

Snailpaced answered 6/7, 2009 at 22:45 Comment(0)
C
1

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.

Characteristically answered 26/11, 2009 at 22:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.