Bird
0
0

What is wrong with this command?

medium📝 Debug Q7 of 15
C - Basics and Execution Environment
What is wrong with this command?
gcc -S file.o -o file.s
AMissing -c flag for compilation
BCannot generate assembly from object file
COutput file name should be file.o
Dgcc does not support -S option
Step-by-Step Solution
Solution:
  1. Step 1: Understand -S option

    '-S' generates assembly code from source, not from object files.
  2. Step 2: Check input file type

    Input 'file.o' is object code; cannot be converted back to assembly with gcc -S.
  3. Final Answer:

    Cannot generate assembly from object file -> Option B
  4. Quick Check:

    -S requires source, not object file [OK]
Quick Trick: -S works on source, not object files [OK]
Common Mistakes:
  • Trying to assemble from object files
  • Confusing -S with -c
  • Assuming gcc can reverse object to assembly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes