Find the answer to your Linux question:
Results 1 to 4 of 4
i built my own cross compiler for arm... and wrote a simple c program to print 'hello world' when i typed $arm-elf-gcc -Wall -g -o helloworld helloworld.c it worked however ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    6

    hello


    i built my own cross compiler for arm... and wrote a simple c program to print 'hello world'
    when i typed $arm-elf-gcc -Wall -g -o helloworld helloworld.c
    it worked
    however when i do
    $./helloworld
    the output is
    bash: ./helloworld: cannot execute binary file
    ........could anybody tell me what the error could be
    and how to resolve the issue
    ?

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,875
    You wrote your own cross compiler? That is really cool. You've gone from noob to uber-geek on here in a matter of seconds. I'm impressed.

    Your Linux skills need some refining, though. If you want a file to be executable, you have to tell the shell it's executable. Try doing:

    Code:
    chmod u+x helloworld
    check the man page ('man chmod') for more details on using the chmod command.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Oct 2008
    Posts
    6

    hi

    thanks a lot....
    but i compiled the latest version of gdb so that i can use the command:
    arm-elf-run
    to execute the binary files........


    i would like to repeat the cross compilation for i386 ... any idea where the documentation can be found.... cos if i follow the same procedure that i followed for arm it gives many errors.

  4. #4
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,875
    Sorry, I know absolutely nothing of cross-compiling, so I dont think I'm going to be much help to you. I know about filesystem permissions (as you can see) but it didn't get you very far.

    Can anyone else help?
    Linux user #126863 - see http://linuxcounter.net/

Posting Permissions

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