Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
frank
Post
by frank » Sat Jul 26, 2003 1:01 pm
Why does the size of the kernel gets much bigger when you add a variable outside a function?
(which you give a value ofcourse)
example:
Code: Select all
unsigned char c = 5;
int main()
{
while (1)
{
}
}
I' ve always worked around this (I always declared my variables inside the function).
I linked like this:
Code: Select all
gcc -c file.c
ld -o file -Ttext 0x1000 -e start file.o
objcopy -R .note -R .comment -S -O binary file file.bin
The Pro from Dover
Post
by The Pro from Dover » Sat Jul 26, 2003 1:13 pm
Good question, and one which has come up before. See reply #4 in
this thread for Tim Robinson's explanation of the issue.