Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-16-2006, 06:34 AM
|
#1
|
LQ Newbie
Registered: Apr 2006
Posts: 11
Rep:
|
source code
hi,
this is my first post.i want to know as to how do i see the source code for programs compiled in gcc .there is a command but i am not getting it .could anyone help me out.
bye
|
|
|
04-16-2006, 06:41 AM
|
#2
|
LQ Newbie
Registered: Jan 2005
Posts: 10
Rep:
|
i think that you maybe find the "Building and Installing Software Packages for
Linux" article can answer your question.
|
|
|
04-16-2006, 07:47 AM
|
#3
|
LQ Newbie
Registered: Apr 2006
Posts: 11
Original Poster
Rep:
|
reply
hi
sorry to confuse u guys. i meant how do i see the assembly code of the program written and not the "source code".
bye
|
|
|
04-16-2006, 08:42 AM
|
#4
|
Senior Member
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938
Rep:
|
You'd need a disassembler. Once code has been compiled it's no longer 'human-readable' because it's in binary (or can be viewed as hex). A disassembler or decompiler would give you some idea of the source code, but it wouldn't be as the programmer wrote it, it would be a 'best guess' of the disassembler. If you want source code, most linux programs provide it.
|
|
|
04-16-2006, 01:28 PM
|
#5
|
LQ Newbie
Registered: Apr 2006
Posts: 11
Original Poster
Rep:
|
url
hi,
where do i get the disassembler from,could u send me the link for the d/w.
|
|
|
04-16-2006, 02:04 PM
|
#6
|
Senior Member
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938
Rep:
|
Search for dasm2. I'm not sure what you're hoping to gain from this...it's only going to give you a whole load of assembly language that'll be incredibly difficult to understand.
|
|
|
04-17-2006, 01:41 PM
|
#7
|
LQ Newbie
Registered: Apr 2006
Posts: 11
Original Poster
Rep:
|
hi,
my aim is just to optimize the code when there are memory constraints,and by looking at assembly i hope to get an idea of writing efficent programs.
thx
bye
|
|
|
04-17-2006, 03:30 PM
|
#8
|
Senior Member
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938
Rep:
|
Quote:
Originally Posted by saif_shakeel
hi,
my aim is just to optimize the code when there are memory constraints,and by looking at assembly i hope to get an idea of writing efficent programs.
thx
bye
|
Well you're not going to learn that from disassembled code. You're better of reading a book about optimising assembly language or joining some forums/newsgroups. Disassembled code isn't going to be optimised or efficient, even if it was originally written that way because when the code was compiled certain things may have happened to it (like loops being unrolled) that are not how the programmer originally wrote it. In short even a program written in assembly language will look different once it's been compiled and disassembled.
|
|
|
04-18-2006, 01:59 AM
|
#9
|
LQ Newbie
Registered: Apr 2006
Posts: 11
Original Poster
Rep:
|
re
hi
thx for the info,i will keep that in mind.
bye
|
|
|
All times are GMT -5. The time now is 05:06 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|