For some linker options, changes can be seen in the resulting binary, for example:
- Options for eliminating / saving debugging symbols (
--strip-all , --strip-debug , --discard-all ) - Parameters for deleting / saving unused partitions, for example. a section containing a function that is never mentioned in other sections. These sections can be easily removed. Or save sections / content moving. (
--as-needed , --emit-relocs ) - Parameters for including one static library or another compatible one (for example, library version x.0 vs version x.1)
- The order in which objects and static libraries are placed on the command line. For example,
ld -o foo a.obj b.obj c.obj and ld -o foo a.obj c.obj b.obj will probably create another binary if the call from a to the function from c is allowed (offset for the code from c.obj and therefore the function address in c will probably be different)
But even after linking, the signature of the binary may change. For example, on Linux, when you optimize your binary startup time by running prelink
source share