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 7995959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:34:32+00:00 2026-06-04T14:34:32+00:00

Recently I tried to write a simple compiler on the linux platform by myself.

  • 0

Recently I tried to write a simple compiler on the linux platform by myself.

When it comes to the backend of the compiler, I decided to generate ELF-formatted binaries without using a third-party library, such as libelf.

Instead I want to try to write machine code directly into the file coresponding to the ELF ABI just by using the write() function and controlling all details of the ELF file.

The advantage of this approach is that I can control everything for my compiler.

But I am hesitating. Is that way feasible, considering how detailed the ELF ABI is?

I hope for any suggestions and pointers to good available resources available.

  • 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-04T14:34:33+00:00Added an answer on June 4, 2026 at 2:34 pm

    How easy/feasible this is depends on what features you want to support. If you want to use dynamic linking, you have to deal with the symbol table, relocations, etc. And of course if you want to be able to link with existing libraries, even static ones, you’ll have to support whatever they need. But if your goal is just to make standalone static ELF binaries, it’s really very easy. All you need is a main ELF header (100% boilerplate) and 2 PT_LOAD program headers: one to load your program’s code segment, the other to load its data segment. In theory they could be combined, but security-hardened kernels do not allow a given page to be both writable and executable, so it would be smart to separate them.

    Some suggested reading:

    http://www.linuxjournal.com/article/1059

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

Sidebar

Related Questions

I'm at a beginner level in FORTRAN. Recently, I tried designing a simple program
I have recently tried to write an application in c# using EWS to read
I've recently tried to write something in F# making use of Microsoft Solver Foundation
I recently tried to write shortcuts for build-in object functions in JavaScript. Here it
I recently tried to combine SEAM and GWT in a project - but failed
I recently tried to figure out how to use freeglut with NetBeans 7. I
I recently tried using the Cloud9 online IDE . It starts by creating a
I recently tried to pull some results and was struggling to work out the
I've recently tried to optimize my site for speed and brandwith. Amongst many other
I'm recently tried to make a custom tabcontrol that able to move the tab

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.