/* Starting with just int main() { return 0; } we added code to produce the effect goals listed at the end */ #include int s[2] = { 1, 2 }; /* added to make ".data" 12 */ const long q[3] = { 1, 2, 3 }; /* added to make ".rodata" 48 */ const char t[] = "abcedef"; /* also part of making ".rodata" 48 */ char abcdefghijklkmno[] = "asdfasdf"; /* added to make ".strtab" grow by 17, where the variable name is the import part */ /* Added in an attem,pt to make ".got.plt" bigger. It didn't work. */ void func() { printf("print"); } int main() { int a = 0; int i; /* Added this loop to make ".text" bigger */ for(i=0; i<32; i++) { fprintf(stdout, "%d", i); /* used stderr to make ".rela.dyn" bigger */ malloc(sizeof(i)); /* added to make ".got.plt" bigger */ } func(); return 0; } /* Use `readelf -a` or `readelf -S`, or use `minireadelf`. Tasks: * make ".data" have the size 12 * make ".rodata" have the size 48 * make ".strtab" grow by 17 * make ".text" grow by at least 32 * make ".got.plt" bigger * make ".rela.dyn" bigger */