Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9126587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:04:31+00:00 2026-06-17T07:04:31+00:00

I have installed ARM cross compiler tool chain on my x86 Ubuntu12.04 linux. now

  • 0

I have installed ARM cross compiler tool chain on my x86 Ubuntu12.04 linux.

now I have arm-linux-gnueabi-gcc cross compiler.

I have coded simple hello world program as follow

#include <stdio.h>
int main(){
  printf("hello world\n");
  return 0;
}

and I cross compiled this program using

arm-linux-gnueabi-gcc -o a a.c -static

the result of compiled binary is as follow

$ file a
a: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically lined, for GNU/Linux 2.6.31, not stripped

if I run this binary on my ARM debian linux on QEMU
it says ‘Illegal Instruction’

but if I compile the same source code with gcc on my ARM debian linux, it runs fine.

the file result on the two binary are same.
what is wrong with my cross compiled ARM binary??

thank you in advance.

meltdown@meltdown-VirtualBox:/var/www$ arm-linux-gnueabi-readelf --file-header --arch-specific a
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x8881
  Start of program headers:          52 (bytes into file)
  Start of section headers:          368052 (bytes into file)
  Flags:                             0x5000002, has entry point, Version5 EABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
      Number of program headers:         7
  Size of section headers:           40 (bytes)
  Number of section headers:         30
  Section header string table index: 27
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-A"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: VFPv3-D16
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_HardFP_use: SP and DP
  Tag_CPU_unaligned_access: v6
  Tag_DIV_use: Not allowed
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:04:32+00:00Added an answer on June 17, 2026 at 7:04 am

    Could you run the readelf command in order to determine which ARM architecture your cross compiler targets? We need to see if this target is supported by Qemu.

    arm-linux-gnueabi-readelf --file-header --arch-specific a
    

    Moreover, you can check the output of dmesg in your emulated system. It should contain a description of the illegal instruction.

    Also, you can run your program in a debugger to see which intruction fails.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have arm-linux-androideabi-gcc installed in my computer, but when I try to compiler even
I want to build a static hello world from C using arm-linux-gnueabi-gcc as opposed
I have created a cross compiled arm executable. I want to find the library
Closest I've found was: Are WinRT Metro apps cross-compatible (x86/64 and ARM)? I haven't
I have pixman installed on my arm target, for bench-marking purposes i want to
I will have (maybe) to work soon on ARM platform hosting a linux distribution
I have installed MinGW in Windows Vista, so I can use gcc but it
I have installed Android SDK and packages. Since I had an error when opening
I have installed my dependencies using bundle package Then transferred them to the offline
I have installed the following components of SQL Server 2012: management tools - complete

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.