问题
I'm writing a bootable program that is 512 bytes, and I have to stick the 0xAA55 in the last 2 bytes of my 512 byte program image. So I've done that. Now my linker script, should be pretty simple. I was just curious about what this syntax means
.foo : { *(.*) }
I was given it as an example. There is no .foo section, and before that, I change the program counter to
. = 0x1000 //To account for the elf header which I will strip later
So after this directive is
.foo : { *(.*) }
What does this do?
回答1:
It stores in section .foo
all code, data, bss, rodata, etcetera (the second *
) from all object files (the first *
) that aren't yet assigned to any previously defined section.
来源:https://stackoverflow.com/questions/12763041/what-does-foo-mean-in-a-linker-script