What does .foo : { *(.*) } mean in a linker script?

我与影子孤独终老i 提交于 2019-12-24 16:24:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!