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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:45:23+00:00 2026-05-13T05:45:23+00:00

How do you account for the difference between the size in bytes of a

  • 0

How do you account for the difference between the size in bytes of a compiled ELF file as reported by wc (relatively large) and size (sum total of sections in file – relatively small) under Linux?

Edit: For example, compile a very simple C++ program using g++ and run ‘wc myexe’ and ‘size myexe’ and wc may return, for example 500B, whilst size may return a total of 100 bytes for all sections.

Edit II: I understand the the two commands do different things, sorry I should have said that I’m not looking for the answer ‘because they’re different’. I want to know what exactly accounts for the difference. Why should the wc bytes be so much larger than the total sum of the size of the sections, which after all, comprises the executable part of the code.

  • 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-13T05:45:23+00:00Added an answer on May 13, 2026 at 5:45 am

    wc just counts the number of bytes in a file (and words and lines). It works on any normal files, not just object and executable files.

    size parses the headers of an object or executable file and shows information about the segments that the author of size thought would be useful, back when size was written (hint – long before Linux was born!).

    readelf and some of the other binutils programs read and parse the more modern ELF format files and show more info, including segments that size doesn’t know about.

    If you really want to understand what is going on under the hood, you can write your own readelf-like program, starting with /usr/include/elf.h, and parse the files for yourself. 🙂

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

Sidebar

Related Questions

Can anybody tell me what is the difference between standard iOS account and enterprise
Is there a difference between developing for a smartphone vs for a tablet? i.e.
I went through the developer forum to know the difference between managed an unmanaged
So at the suggestion of a colleague, I just tested the speed difference between
I need help getting my head around the difference between my current OOP notion
My question is: I know the difference between a Standard Individual program and a
Is there any way to find out an accurate difference between two NSDate ?
Is there a difference between ndb.gql and ndb.query ? (beside the syntax) for example
What is the difference between validates :presence and validates_presence_of ? Looking through ActiveModel it
Is there an difference between this (nested Installer) ServiceInstaller si = new ServiceInstaller(); si.ServiceName

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.