Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy would changing a structure size, change the size of an executable?
    primarykey
    data
    text
    <p>Very strange issue I'm working to debug, currently at a loss so I wanted to see if anyone had any thoughts/ideas. </p> <p>There's a define in one of the char drivers in my code base (this is one of many drivers within a uCLinux distribution):</p> <pre><code>#define MAX_BUFSIZE 500 </code></pre> <p>When I build like this I see the output package size:</p> <pre><code>-rw-rw-r-- 1 mike users 1720620 Jan 16 11:00 gcl-kernel.pkg </code></pre> <p>When I change the define to 1000 and rebuild:</p> <pre><code>#define MAX_BUFSIZE 1000 -rw-rw-r-- 1 mike users 2359596 Jan 16 11:17 gcl-kernel.pkg </code></pre> <p>The overall kernel image greatly increases. That one <code>#define</code> was the <strong><em>only</em></strong> change. AFAIK, this should have changed the RAM size of the executable when running, it should not have done anything to the executable's size. </p> <p>So my question: </p> <p><em>can anyone think of any reason that a structure being modified would change the final image size?</em></p> <hr> <p>Other analysis/information if you care:</p> <p>I tracked usage of this to one structure defined in a header file: </p> <pre><code>typedef struct { int head; int tail; int status; int active; void * dev[MAX_BUFSIZE]; char free[MAX_BUFSIZE]; canmsg_t data[MAX_BUFSIZE]; int count; } msg_fifo_t; </code></pre> <p>Anytime I change the size of any of those arrays, the executable size changes. Anytime a new object of this type shows up or is removed in the code the executable size changes, ex:</p> <pre><code>extern msg_fifo_t Tx_Bufx[]; extern msg_fifo_t Rx_Buf[]; </code></pre> <p>has a different output executable size then:</p> <pre><code>extern msg_fifo_t Tx_Bufx[]; //extern msg_fifo_t Rx_Buf[]; </code></pre> <p>I've tried but I can't seem to create a smaller version of this issue on my x86 system to debug the problem, it must have something to do with the environment. (coldfire tool chain building for a uCLinux 2.4 kernel).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload