3 ms·
In general, the linker is written by people different to the people who write the compiler. I don't hate you I just don't control the whole stack. Also linker
by mhh__ 4y ago
In general, the linker is written by people different to the people who write the compiler.
I don't hate you I just don't control the whole stack.
Also linkers can tell you where the symbol was referenced if that place has a location in the code. This isn't universal but it's practically always been there for me.
- nuancebydefault 4y agoThanks for not hating me :p What i also find hard to understand is that generally linkers are "single pass" i.e. you need to feed them objects and libs in the correct order (callers prior to callees) for them to solve all links. Not sure if this requirement still is always there.
- JonChesterfield 4y agoThat requirement vhas been gone for decades if it ever existed, though static library semantics look a bit like that if you don't pass extra flags around them. Linkers are multiple pass if doing compiler optimisation things. Otherwise they're pretty close to cat + patch some pieces, single pass seems fair. It's not immediately obvious to me why linkers don't say which functions were making the undefined symbol call. A suspicion is that the linker may not know what the function name is for the corresponding instruction without digging it out of the debug info and the linker probably doesn't have the corresponding parser ready to hand. It probably could narrow it down to a source object file, though libraries make that difficult.
- WalterBright 4y agoI've written linkers. This one pass thing was gone before the 1980s.
- nuancebydefault 4y agoI've seen it being a problem maybe 10 years ago but i'm happy if it is fully a thing of the past.