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

The Archive Base Latest Questions

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

So I found out that C(++) programs actually don’t compile to plain binary (I

  • 0

So I found out that C(++) programs actually don’t compile to plain “binary” (I may have gotten some things wrong here, in that case I’m sorry :D) but to a range of things (symbol table, os-related stuff,…) but…

  • Does assembler “compile” to pure binary? That means no extra stuff besides resources like predefined strings, etc.

  • If C compiles to something else than plain binary, how can that small assembler bootloader just copy the instructions from the HDD to memory and execute them? I mean if the OS kernel, which is probably written in C, compiles to something different than plain binary – how does the bootloader handle it?

edit: I know that assembler doesn’t “compile” because it only has your machine’s instruction set – I didn’t find a good word for what assembler “assembles” to. If you have one, leave it here as comment and I’ll change it.

  • 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-05-13T13:28:09+00:00Added an answer on May 13, 2026 at 1:28 pm

    C typically compiles to assembler, just because that makes life easy for the poor compiler writer.

    Assembly code always assembles (not “compiles”) to relocatable object code. You can think of this as binary machine code and binary data, but with lots of decoration and metadata. The key parts are:

    • Code and data appear in named “sections”.

    • Relocatable object files may include definitions of labels, which refer to locations within the sections.

    • Relocatable object files may include “holes” that are to be filled with the values of labels defined elsewhere. The official name for such a hole is a relocation entry.

    For example, if you compile and assemble (but don’t link) this program

    int main () { printf("Hello, world\n"); }
    

    you are likely to wind up with a relocatable object file with

    • A text section containing the machine code for main

    • A label definition for main which points to the beginning of the text section

    • A rodata (read-only data) section containing the bytes of the string literal "Hello, world\n"

    • A relocation entry that depends on printf and that points to a “hole” in a call instruction in the middle of a text section.

    If you are on a Unix system a relocatable object file is generally called a .o file, as in hello.o, and you can explore the label definitions and uses with a simple tool called nm, and you can get more detailed information from a somewhat more complicated tool called objdump.

    I teach a class that covers these topics, and I have students write an assembler and linker, which takes a couple of weeks, but when they’ve done that most of them have a pretty good handle on relocatable object code. It’s not such an easy thing.

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

Sidebar

Related Questions

I found out that in order to open a Gmail compose screen you'd have
I found out that it is possible to open the windows explorer with a
I found out that I can use a different theme in an C# WPF
I found out that HTML form supports only two enctype types. They are application/x-www-form-urlencoded
I found out that the FormWizard only __init__ 's once, when the url is
Just found out that the video output of the iPad is not a system
I found out that in C# a+=1 is not equal to a = a+1.
I just found out that every time onclick event for my <button> placed inside
I've just found out that there is a possibility to host a Windows Forms
I just found out that in FF, if you are dynamically creating an OPTION

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.