Results 1 to 9 of 9

Thread: .elf format questions

  1. #1
    Join Date
    Sep 2010
    Beans
    6

    .elf format questions

    Hello everyone. Please excuse my noobness for second and bear with me.

    I'm trying to get my feet wet with programming and just started watching the "C" video tutorials on WiBit.net(love those guys for creating that site!). I was getting ready to reinstall Windows on my computer because I had problems creating .exe files using GCC on Ubuntu 12.04. I did some research and found out that gcc defaults to the .elf format. I also read about the .bin format as well.

    So here are my questions:

    1) Is there any difference "real" between .elf and .bin formats?

    2) Which is better(preferable) to use between the two?

    3) If the .elf format contains so much information in the format, why is it not used instead of .deb/.rpm/.tgz/etc?

    4) For ease of learning, should I install Windows and follow all of the tutorials, or learn the nuances on linux as I go along?

    Thank you so much for any who takes the time to respond.

  2. #2
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: .elf format questions

    If you are just learning C, I think it's a bad idea to worry about such things. All you need to know is:

    * Windows and Linux use different executable formats. Calling them just "Windows executables" and "Linux executables" is sufficient for now, without worrying about ELF and whatnot.

    * In Windows, executables are denoted by the .exe extension. File extensions are a purely Windows concept, and do not exist in Linux, thus executables in Linux can have any filename. In particular, there is no obligation that executables end in ".exe". When you say you "had problems creating .exe files", I suspect you expected your executable to have a filename ending in .exe, and were surprised that it did not. In fact, that is perfectly normal.

    If you are using Linux, I suggest you find Linux-centered resources to learn C. The sticky at the top of this forum probably has some.
    Last edited by Bachstelze; July 13th, 2012 at 09:44 PM.
    「明後日の夕方には帰ってるからね。」


  3. #3
    Join Date
    Sep 2010
    Beans
    6

    Re: .elf format questions

    Fair enough. Throughout school, I was often told I had a very bad habit of "doing too much at one time". LOL. I guess I'm one of those "big picture" types...I like to know where all the little cogs fit together when I start working on, or learning, something.

    However, I understand what you mean that I shouldn't worry about all of that for now.

    I've scanned through the stickies before--there is definitely a wealth of information there. I'll go ahead and get started. Wish me luck!

  4. #4
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: .elf format questions

    Quote Originally Posted by FitzLT View Post
    Fair enough. Throughout school, I was often told I had a very bad habit of "doing too much at one time". LOL. I guess I'm one of those "big picture" types...I like to know where all the little cogs fit together when I start working on, or learning, something.
    The point is precisely that by worrying too much about the details, you miss the big picture completely. This is a very, very common mistake among C programmers, even very experienced ones.
    「明後日の夕方には帰ってるからね。」


  5. #5
    Join Date
    Jun 2010
    Beans
    92

    Re: .elf format questions

    Quote Originally Posted by FitzLT View Post
    4) For ease of learning, should I install Windows and follow all of the tutorials, or learn the nuances on linux as I go along?
    My personal preference would be to learn 'C' on Linux for these reasons:

    1. All the tools you'll need are Open Source on Linux, which among other things means you won't need to spend money while learning. If you don't already have all the Windows tools be prepared to pay.

    2. The GNU 'C' compiler on Linux is ANSI 'C' (ANSI is the American National Standards Institute). To work well with the entire Windows environment, Microsoft 'C' compilers are not 100% ANSI.

  6. #6
    Join Date
    Nov 2005
    Location
    Sendai, Japan
    Beans
    11,296
    Distro
    Kubuntu

    Re: .elf format questions

    Why do you guys put "C" between quotes? Are you also learning "Python", or "English"?

    As for your points, 1. is wrong. There are a lot of free C compilers for Windows.
    「明後日の夕方には帰ってるからね。」


  7. #7
    Join Date
    Jun 2010
    Beans
    92

    Re: .elf format questions

    Quote Originally Posted by Bachstelze View Post
    Why do you guys put "C" between quotes? Are you also learning "Python", or "English"?

    As for your points, 1. is wrong. There are a lot of free C compilers for Windows.

    Over the years I got in the habit of putting 'C' in single quotes to differentiate from typos.

    Microsoft does have free Express versions of development packages. The Express versions are limited compared to their commercial versions. See the Visual C++ 2010 Express | Microsoft Visual Studio package. That would be my first choice for a free 'C' compiler/tools package for Windows development.

    As far as non-Microsoft free tools for Windows, they are not at all comprehensive solutions (very limited), they lack any real support, if any, and tend to be full of bugs.

    But on Linux the normal, everyday development tools (compilers, IDEs, editors, you name it) are Open Source and freely available to anyone, just a download away. And (most importantly to me) are actively supported.

  8. #8
    Join Date
    Feb 2009
    Beans
    1,469

    Re: .elf format questions

    Quote Originally Posted by Bachstelze View Post
    The point is precisely that by worrying too much about the details, you miss the big picture completely. This is a very, very common mistake among C programmers, even very experienced ones.
    I think this is a remarkably accurate insight.

  9. #9
    Join Date
    Sep 2010
    Beans
    6

    Re: .elf format questions

    Quote Originally Posted by trent.josephsen View Post
    I think this is a remarkably accurate insight.
    I completely agree.

    Quote Originally Posted by Bachstelze View Post
    Why do you guys put "C" between quotes? Are you also learning "Python", or "English"?
    Sorry. I was "supposedly" doing it for readability sake. It is kind of silly when looked at it that way.

    Quote Originally Posted by xb12x View Post
    My personal preference would be to learn 'C' on Linux for these reasons:

    1. All the tools you'll need are Open Source on Linux, which among other things means you won't need to spend money while learning. If you don't already have all the Windows tools be prepared to pay.

    2. The GNU 'C' compiler on Linux is ANSI 'C' (ANSI is the American National Standards Institute). To work well with the entire Windows environment, Microsoft 'C' compilers are not 100% ANSI.
    Thank you. I have since decided to follow the stickies at the top of this category to find either linux-specific, or OS-neutral, sources of information. Wish me luck--you all will probably hear from me as I [eventually] start to ask more programming-specific questions.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •