Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision |
ns32ktoolchain [2023/04/12 10:48] – [Building binutils] admin | ns32ktoolchain [2023/04/12 10:54] – [Standalone binaries] admin |
---|
The option ''-ffreestanding'' disables "hosted" environment where ''main()'' is the first "user" function in the programm called by **crt0.o**. | The option ''-ffreestanding'' disables "hosted" environment where ''main()'' is the first "user" function in the programm called by **crt0.o**. |
| |
NOTE! GCC sometimes emits "built-in" functions like ''__udivdi3'' and requres "compiler runtime" library [[https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html|libgcc]] for target processor. Smplify arithmetic expressions. | NOTE! GCC sometimes emits "built-in" functions like ''__udivdi3'' and requres "compiler runtime" library [[https://gcc.gnu.org/onlinedocs/gccint/Libgcc.html|libgcc]] for target processor. Just smplify your arithmetic expressions to avoid this. |
| |
Another useful GCC option is ''-fomit-frame-pointer'' - it disables usage of the ''fp'' register (frame pointer) and use ''sp''-related (stack pointer) addressing for local variables like "old" compilers. GCC also supports ''-fpic'' option to compile PIC (Position-Independent Code) with ''sb''-related addressing ''0(_glblvar(sb))''. | Another useful GCC option is: ''-fomit-frame-pointer'' - it disables usage of the ''fp'' register (frame pointer) and use ''sp''-related (stack pointer) addressing for local variables like "old" compilers. GCC also supports ''-fpic'' option to compile PIC (Position-Independent Code) with ''sb''-related addressing ''0(_glblvar(sb))''. GNU ld [[https://sourceware.org/binutils/docs/ld.pdf|documentation]] . |
| |
Test object file with disassembler: | Test object file with disassembler: |