Announcement

Collapse
No announcement yet.

Linux Preparing To Finally Remove Support For The a.out Format

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by caligula View Post
    I guess this is different, but many C tutorials introduce the concept of 'a.out' executable to save some typing when compiling stuff:

    $ echo "#include..." > hello.c
    $ gcc hello.c
    $ ./a.out

    Imagine the horror if you had to write this instead:

    $ gcc hello.c -o hello
    $ ./hello

    Requires 9 characters more.
    Some compilers still use a.out naming when not specified without actually being a.out format.
    Michael Larabel
    https://www.michaellarabel.com/

    Comment


    • #12
      Originally posted by caligula View Post
      I guess this is different, but many C tutorials introduce the concept of 'a.out' executable to save some typing when compiling stuff:

      $ echo "#include..." > hello.c
      $ gcc hello.c
      $ ./a.out

      Imagine the horror if you had to write this instead:

      $ gcc hello.c -o hello
      $ ./hello

      Requires 9 characters more.
      This will make some people unhappy and some scripts to break, but I wish the C compilers by default now take the route of naming the executable binary generated whatever name the file containing main() (or whatever the entry point is -- I don't make the rules) is, and get rid of the filename extension ("main.c" compiles to "main")

      Comment


      • #13
        Originally posted by caligula View Post
        I guess this is different, but many C tutorials introduce the concept of 'a.out' executable to save some typing when compiling stuff:

        $ echo "#include..." > hello.c
        $ gcc hello.c
        $ ./a.out

        Imagine the horror if you had to write this instead:

        $ gcc hello.c -o hello
        $ ./hello

        Requires 9 characters more.
        It is different, yes, and nothing will change in this move for 99.9% of people. Compilers have defaulted to creating an ELF executable for some time, even while keeping a.out as the default file name. a.out, even when the resulting binary is ELF, remains the default name because a lot of scripts would break if the default binary artifact ever changed its name.

        Comment


        • #14
          Originally posted by shmerl View Post
          How will gcc output look without specifying the linked binary?
          Exactly the same. The default compiler output is named a.out, but it's been an elf binary for decades now.

          Comment


          • #15
            Originally posted by Michael View Post

            Some compilers still use a.out naming when not specified without actually being a.out format.
            They can always switch to a.elf

            Comment


            • #16
              Originally posted by KesZerda View Post

              Exactly the same. The default compiler output is named a.out, but it's been an elf binary for decades now.
              Makes sense to rename it then for clarity.

              Comment


              • #17
                Originally posted by shmerl View Post

                Makes sense to rename it then for clarity.
                Disagree. Renaming would break scripts, and for what? Most people don't care what the binary format is, nor have even heard of a.out as a binary format. If they do care, cursory inspection of it will show it to be ELF (this was true even when I did my comp sci degree ~15 years ago). Documentation will confirm. If you do care, you should have been specifying the binary format in your build scripts.

                Comment


                • #18
                  Originally posted by shopt View Post

                  Disagree. Renaming would break scripts, and for what?
                  What kind of scripts rely on a.out? And if some do, they can be rewritten so nothing would rely on it. Good opportunity to fix obsolete stuff.

                  Comment


                  • #19
                    Originally posted by shmerl View Post

                    What kind of scripts rely on a.out? And if some do, they can be rewritten so nothing would rely on it. Good opportunity to fix obsolete stuff.
                    Probably the same scripts that rely on holding down space to overheat the CPU?
                    (For those that have been living under a rock: https://xkcd.com/1172/ )

                    Comment


                    • #20
                      Originally posted by ids1024 View Post
                      I wonder where one would even find an old a.out executable, and whether or not it would still work fine on Linux before this.
                      My first guess would have been the old Loki games native-linux ports, but cursory googling suggests they are ELF. They had their own issues running on a modern linux install, but they were all userspace last I checked.

                      Comment

                      Working...
                      X