|
|
我最近在读某程序的源码,看到下面的定义:
static void show_dlts_and_exit(pcap_t *pd) __attribute__((noreturn));
查资料之后,得到下面的描述:
Normally, the compiler places the code it generates in the `text'
section. Sometimes, however, you need additional sections, or you
need certain particular functions to appear in special sections.
The `section' attribute specifies that a function lives in a
particular section. For example, the declaration:
extern void foobar (void) __attribute__ ((section ("bar")));
puts the function `foobar' in the `bar' section.
Some file formats do not support arbitrary sections so the
`section' attribute is not available on all platforms. If you
need to map the entire contents of a module to a particular
section, consider using the facilities of the linker instead.
那么,
1.对于section来说,这是可以随意由程序员定义的吗?
2.这样的段和我们说的代码段,数据段有什么关系吗?或者他们只是在不同的技术中用的不同的术语.
3.这种section有什么用处? |
|