MIPS64EL-UNKNOWN-LINUX-GNU-GCC cross-compile ELF-64 program __linux

Source: Internet
Author: User

When you compile a t.c file with MIPS64EL-UNKNOWN-LINUX-GNU-GCC,

The contents of t.c are as follows:

#include <stdio.h>

int main ()

{

return 0;

}


Mybox ~ # mips64el-unknown-linux-gnu-gcc-c T.C
Mybox ~ # Mips64el-unknown-linux-gnu-ld-o-M ELF64LTSMIP t T.O
Mips64el-unknown-linux-gnu-ld:cannot find elf64ltsmip:no such file or directory
t.o:in function ' main ':
T.C: (. text+0x0): Multiple definition of ' main '
T: (. text+0x0): defined here

You can solve this problem in the following ways:

Mips64el-unknown-linux-gnu-gcc-mabi=64-c t.c
Mips64el-unknown-linux-gnu-ld-m Elf64ltsmip-o T T.O

Use the following command to see what kinds of emulations the machine supports:
Mybox ~ # Mips64el-unknown-linux-gnu-ld-o-mabi=64 t T.O
mips64el-unknown-linux-gnu-ld:unrecognised emulation mode:abi=64
Supported Emulations:elf32ltsmipn32 elf32btsmipn32 ELF32LTSMIP ELF32BTSMIP ELF64LTSMIP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.