// riscv64-unknown-elf-gcc demo1.c -o demo -O3 --save-temps // riscv64-unknown-elf-objdump -d -t -r demo-demo1.o // demo.i: The preprocessed source, which expands any preprocessor // directives (things like #include or #ifdef). // demo.s : The output of the actual compiler, // which is an assembly file(a text file in the RISC - V assembly format) // .demo.o : The output of the assembler, // which is an un - linked object file(an ELF file, but not an executable ELF) // .demo : The output of the linker, // which is a linked executable(an executable ELF file).long global_symbol[2]; long global_symbol[2]; #define IDX 1 int main() { return global_symbol[IDX] != 0; } // Failed to compile because of global_symbol address // riscv64-unknown-elf-gcc demo.c -o demo -O3 -nostartfiles -nostdlib --save-temps -Wl,-Ttext-segment,0x80000000