On my own self-learning R.E. Starting with understanding ELF and hopefully whats going on with every byte.
I build 2 simple binaries: 1 with a variable and 1 without. For some reason, the one without is larger. Why is that?
-rwxrwxrwx 1 u root 15632 Feb 19 21:30 main
-rwxrwxrwx 1 u root 15624 Feb 19 21:30 a
a.c
int main() {
char a;
}
main.c
int main() {}
Makefile
CC=gcc
FLAGS=-O0 -fverbose-asm -no-pie
all: main a
main: main.c
$(CC) $(FLAGS) -o $@ $^
a: a.c
$(CC) $(FLAGS) -o $@ $^
-S
and compare the generated assembly, maybe you'll have your answer.