Generate Assembly code and Binary code also

This is a discussion on Generate Assembly code and Binary code also within the C Programming forums, part of the General Programming Boards category; $ objdump -d a.out > big.S $ objdump -d foo.o > small.S $ ls -l *.S -rw-r--r-- 1 sc sc ...

  1. #16
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,335
    $ objdump -d a.out > big.S
    $ objdump -d foo.o > small.S
    $ ls -l *.S
    -rw-r--r-- 1 sc sc 15313 2011-07-07 07:36 big.S
    -rw-r--r-- 1 sc sc 5566 2011-07-07 07:36 small.S


    You can run objdump on object files and executables, and get the asm.
    But these would be huge files for a project of any size.

    What are you planning to do with them once you've got them?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  2. #17
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,490
    Wouldn't
    "gcc <with -S> && gcc <normally> " ...and different names in -o
    be enough to solve your problem as suggested by 'tabstop' to run gcc twice?
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Convert assembly>machine code, machine code>assembly
    By wenxinleong in forum C Programming
    Replies: 12
    Last Post: 06-23-2011, 10:42 PM
  2. Converting C code to DLX assembly code
    By xyz3 in forum C Programming
    Replies: 2
    Last Post: 05-17-2010, 02:01 PM
  3. GCC option to get assembly code AND C code
    By AntoineC in forum C Programming
    Replies: 2
    Last Post: 04-29-2010, 09:04 AM
  4. assembly code for release code?
    By George2 in forum Windows Programming
    Replies: 4
    Last Post: 07-09-2008, 11:17 AM
  5. To generate bar code from a number
    By darkducke in forum C Programming
    Replies: 18
    Last Post: 01-16-2008, 05:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21