I am asking for help by professionals because of lack of my knowledge in using GCC and ld.I'm writing OS for educational purposes, and i have a problem with compiling and linking C code. To be honest, the is no any problem, but I'm confused by the unncessary data in output files generated by the GCC and LD like
GCC: (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 symtab..strtab..shstrtab..text..eh_frame..data..comment
.ELF..|
and etc. I really need to know which parameters use both with gcc and ld to reduce this unuseful (for my OS) data
Parameters I used before: -c -nostdlib -nostdinc -fno-builtin -fno-stack-protector -fstrength-reduce -finline-functions I also use linker script to organise segments.
I tried objcopy to reduce such blocks as .comment and .note from output, for me it was the best solution
objcopy -R .note -R .comment -S -O binary kernel.o kernel.bin