How can I get the command line GCC uses to invoke ld?
I have a problem for an AVR target where GCC apparently adds a linker option which I am trying to override, so I would like to look at the exact options GCC uses for ld.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
gcc -vto see what commands it runs. As in,This will print a lot of output, including the linker command. The actual output depends on the platform, but the linking command should be near the end. Alternatively, use
This is like
-v, but does not actually run any commands and quotes the options.Another option is
Look for the entry for
link.The above command line flags are listed in
gcc --helpand explained on the man page. Here’s GCC documentation for the spec files.