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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:45:50+00:00 2026-06-17T09:45:50+00:00

I’m running a little test while trying to understand a larger problem . Here’s

  • 0

I’m running a little test while trying to understand a larger problem. Here’s my test env:

head.h:

#define MAX_BUFSIZE 500

typedef struct {
    int head;
    int tail;
    int status;
    int active;
    void * dev[MAX_BUFSIZE];
    char free[MAX_BUFSIZE];
    int count;
} msg_fifo_t;

extern msg_fifo_t TxBufx[];
extern msg_fifo_t Rx_Buf[];

test.c:

#include <stdio.h>
#include "head.h"

//msg_fifo_t TxBufx[10];  // This is the important line

int main(int argc, char * argv[])
{
    // This part isn't really important...
    printf("Hello Test\n");

    return 0;
 }

So I used these files and ran three tests to see what sizes I got –

test #1 (code as is above):

> gcc -Os test.c
> ls -al a.out
-rwxrwxr-x 1 mike mike 7158 Jan 17 11:13 a.out
> size a.out
text   data     bss     dec    hex   filename
1170    256       8    1434    59a   a.out

test #2 (uncomment the “important” line):

> gcc -Os test.c
> ls -al a.out
-rwxrwxr-x 1 mike mike 7181 Jan 17 11:14 a.out
> size a.out
text   data     bss     dec    hex   filename
1170    256   25208   26634   680a   a.out

test #3 (uncomment the “important” line and change TxBufx size to 100)

> gcc -Os test.c
> ls -al a.out
-rwxrwxr-x 1 mike mike 7181 Jan 17 11:14 a.out
> size a.out
text   data     bss     dec    hex   filename
1170    256  252008  253434  3ddfa   a.out

So now my questions:

  • It would appear that bss size has almost no bearing on the “size” of an executable (as reported from the ls -al command) – Can anyone explain to me why that is?

  • Is that trait specific to the compiler/linker/or platform?

  • Is there a better tool than size to understand what is happening here? (meaning what is really making up the 7181 bytes that is my executable?)

  • 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-17T09:45:51+00:00Added an answer on June 17, 2026 at 9:45 am

    The amount of data in the bss segment has no effect on the size on disk of your executable because of what the bss segment is — this is the section of your program used for variables initialized to zero. Since the content of this section is known in advance (all zeroes), the only thing actually stored in the executable file is the size of this region.

    So the things that do change as your code changes are the size of the data segment — representing variables statically initialized to non-zero values, and the size of the code segment, representing the compiled executable instructions corresponding to your program.

    As for tools to use, the objdump(1) utility on most Unix systems (it’s part of the GNU toolchain) or the otool(1) utility on MacOS X can both be used to get more detailed information about what sections make up your executable, and what symbols are in each one.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I have a French site that I want to parse, but am running into
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.