tags:

views:

40

answers:

1

Hi,

Is it possible to specify what linker segment that a piece of code in a c++ source file will reside in? For example,

int foo() { ... } ---> place in Link Segment A

int bar() { ... } ---> place in Link Segment B

I vaguely recall some source code like the following

codea_ int foo () { ... }

Any ideas?

Thanks!

+2  A: 

Using gcc you can use the __attribute__((section)) syntax to specify the linker section for a symbol. (see here for details)

You should be able to use the same syntax in g++

Andrew Edgecombe