I am wondering if gcc linker options (e.g.: -Wl,options) can change assembler instructions in the compiled executable, as this happens if you use certain gcc optimization options? Can the difference between using a linker option and not using it be seen when you compare the compiled binaries (e.g. comparing signatures)?
UPDATE
To be more precise I want to figure out if FLIRT signatures change when I use certain linking options during compilation process. These signatures only use library functions for creating the signatures.
For some linker options, changes can be seen in the produced binary, for example:
--strip-all
, --strip-debug
, --discard-all
)--as-needed
, --emit-relocs
)ld -o foo a.obj b.obj c.obj
and ld -o foo a.obj c.obj b.obj
will probably produce a different binary if a call from a to a function in c is resolved (the offset for the code from c.obj and thus the address of the function in c will probably be different)But even after linking, the signature of a binary could change. For example in Linux, when you optimize binary startup time by running prelink
Yes, you will see a different checksum on two binaries linked with different linker options--unless the option had no effect, such as when you specify a default option or an option that doesn't change the binary (-print-map).
What are you trying to figure out exactly? It sounds like you are having problems when you specify certain linker options and you are trying to figure out why. Tell us more and maybe we can give better assistance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With