LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux command for showing the segments of a program (https://www.linuxquestions.org/questions/linux-newbie-8/linux-command-for-showing-the-segments-of-a-program-829930/)

thelink123 09-02-2010 07:30 AM

Linux command for showing the segments of a program
 
Hi,

Could you tell me the Linux command for showing the different segments of a program. The output of the command should show me which elements go to stack, heap, and data segments.

brianL 09-02-2010 07:38 AM

Have a look at the man page for readelf.

thelink123 09-02-2010 07:56 AM

Code:

$ readelf.exe  -a test_structure.o
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start


I got the error like this when i gave the object file as input to readelf command. (I am running the linux command using Cygwin in Windows).

brianL 09-02-2010 08:57 AM

If it was created with Cygwin, it won't be a Linux object file. Have a look at the man page for objdump, see if that works. Can't think of anything else.


All times are GMT -5. The time now is 05:51 AM.