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

  • Home
  • SEARCH
  • 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 620533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:46:28+00:00 2026-05-13T18:46:28+00:00

I have a sample assembly file that I compile with nasm: nasm -f elf

  • 0

I have a sample assembly file that I compile with nasm:

nasm -f elf syscall.asm 

This generates a syscall.o file. I try to link it with ld:

ld -o syscall syscall.o

The ld command fails with the following error:

ld: i386 architecture of input file `syscall.o' is incompatible with i386:x86-64 output

However, if I do

ld -o syscall syscall.o -melf_i386

the command succeeds and I get a syscall executable.

Figuring out that nasm is not generating object code in x86-64 format I added “BITS 64” directive to the beginning of the syscall.asm file.

Then attempting to assemble syscall.asm with nasm gave the following error:

error: elf output format does not support 64-bit code

That seems strange because doing “file /usr/bin/nasm” on my terminal gives:

/usr/bin/nasm: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

My 64-bit Fedora Core 11 has the latest version of nasm installed and my CPU is Intel Core 2 Duo E7200.

[EDIT]

My question is how do I get nasm to emit object files that is compatible with i386:x86-64.

  • 1 1 Answer
  • 1 View
  • 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-05-13T18:46:28+00:00Added an answer on May 13, 2026 at 6:46 pm

    Try using elf64 as the output format.

    Example run:

    $ cat elf64.asm
    section .text
            jmp [rax]
    $ nasm -f elf64 elf64.asm
    $ objdump -Sr elf64.o
    
    elf64.o:     file format elf64-x86-64
    
    
    Disassembly of section .text:
    
    0000000000000000 <.text>:
       0:   ff 20                   jmpq   *(%rax)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this sample configuration in my assemblyinfo file. // You can specify all
I read John Robbins' article TFS 2010 Build Number and Assembly File Versions: Completely
I'm trying to get the Registration-Free Activation of COM Components: A Walkthrough sample from
So I've got this nice little MVVM solution, and things work great. I've got
I know this question has been posted here before, and I've trawled through as
I have developped an asmx webservice with visual studio and I deploy on IIS
Looks like I am struck with a simple issue. I am hosting a precompiled
Integrating SimpleModal with ASP.NET I want to thank Eric for producing SimpleModal and compliment
I'm starting to work with Maven but am not yet successfully thinking in Maven's
Hello another question concerning debugging : Automatically generating test cases when i know the

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.