title: Position independent code: what is the difference at compile time?
body: <p>Reading through the <a href="https://www.gnu.org/software/libtool/manual/libtool.html#Creating-object-files" rel="nofollow">libtool docs</a> I wondered why we need to tell the compiler to produce position independent code. After all, the object file which is produced does not yet know where in address space it will be linked at, so one single object file should be position independent at all times, shouldn't it? And further, to produce shared object libs, wouldn't that simply mean baking together all the object files which make out that lib and possibly setting all relative references which have become "intern" to the baked-together lib, while leaving all other references (absolute and relative) to be filled out later by the linker-loader? Why is this a concern also for the compiler?</p>