5 ms·
Is linker ordering acrually undefined as the author suggests? I thought that linkers had a well-defined process for deciding what symbols to take from which ob
by nitrogen 10y ago
Is linker ordering acrually undefined as the author suggests? I thought that linkers had a well-defined process for deciding what symbols to take from which object.
- nitrogen 10y agos/acrually/actually/ (phone keyboards...)
- brucedawson 10y agoI'm the author but I'll chime in and say that yes, linker ordering is undefined (or at least only partially defined) in general, and definitely in this case. The C++ language says that the linker is free to choose any instantiation of an inline function because they are required to be identical. Failure to make them identical is an ODR violation, and the ODR implicitly says that the linker can grab whichever one it wants.