3.15 __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;
Non-ConfidentialPDF file icon PDF versionARM DUI0774E
Copyright © 2014-2016 ARM. All rights reserved.