some problem about freebsd kernel assembly

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
ocean390

some problem about freebsd kernel assembly

Post by ocean390 »

#define GEN_ENTRY(name) ALIGN_TEXT; .globl CNAME
(name); \
.type CNAME(name),@function; CNAME(name):
Is this AT&T syntax? I read through the gas manual, but I can't find what is this mean.
Thanks for your help
AR

Re:some problem about freebsd kernel assembly

Post by AR »

It creates a "global" function declaration.
ocean390

Re:some problem about freebsd kernel assembly

Post by ocean390 »

I do know it creates a global function,but the syntax is special. For example what is the @function mean? Is freebsd kernel assembly syntax is different from gas.
AR

Re:some problem about freebsd kernel assembly

Post by AR »

Looks like GAS to me, I'm reasonably sure they use GCC (and therefore GAS). [Especially since #define() means that it is being run through the GCC preprocessor (or at least some preprocessor)]

I believe .type is an ELF directive because ELFs support distinguishing between Data and functions, @function most likely just declares that it is code not data.
ocean390

Re:some problem about freebsd kernel assembly

Post by ocean390 »

Thanks for your help! I find the reason. The gas with FreeBSD is not the same as GNU's. It has its owm syntax. And the edition is 2.15.
Post Reply