1

I don't understand why linker fails if he does not find one of the shared libraries I pass to it using -l flag. They are shared, so their code is not copied into the binary, so in any case when process will start it will need to look for those libraries again in order to use their code. So what is the purpose of verifying it in link stage, isnt it obsolete? lets say he found them, does it guarantees that they will also exist when the process is executed? obviously no.. Same goes in the opposite direction, so I don't see any logic in verifying it in link time, but since I know that the people that wrote GCC are obviously very smart, I wonder what do I miss..

  • Of interest: [linux - Is it possible to link to a shared library without access to the library itself? - Stack Overflow](https://stackoverflow.com/questions/45014588/is-it-possible-to-link-to-a-shared-library-without-access-to-the-library-itself) (which *should* explain what is needed in the library in the link step, thus answer this question, but I haven't yet read the answer very carefully) – user202729 Nov 18 '22 at 20:15

0 Answers0