You copied the Doc URL to your clipboard.

3.13 __attribute__((section("name"))) function attribute

The section function attribute enables you to place code in different sections of the image.


In the following example, the function foo is placed into an RO section named new_section rather than .text.

int foo(void) __attribute__((section ("new_section")));
int foo(void)
  return 2;