LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-02-2010, 08:30 AM   #1
thelink123
Member
 
Registered: Aug 2008
Location: India, Kerala
Distribution: openSUSE 11
Posts: 46

Rep: Reputation: 15
Thumbs up 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.
 
Old 09-02-2010, 08:38 AM   #2
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
Have a look at the man page for readelf.
 
Old 09-02-2010, 08:56 AM   #3
thelink123
Member
 
Registered: Aug 2008
Location: India, Kerala
Distribution: openSUSE 11
Posts: 46

Original Poster
Rep: Reputation: 15
Thumbs up

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).
 
Old 09-02-2010, 09:57 AM   #4
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
TCP Retransmission & lost segments problem under Linux but not under XP debuser123 Linux - Networking 22 12-16-2007 05:34 PM
gl program showing nothing on screen nacio Programming 0 04-05-2007 05:16 PM
TOP, showing a program i don't believe i started JerryMcFarts Linux - Security 4 04-20-2005 02:37 AM


All times are GMT -5. The time now is 04:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration