Hi, Maybe something like that works for you? cat test.cc #define _str(x) #x #define str(x) _str(x) #define PLACE_HERE(section,data) \ asm(".pushsection " str(section) "\n\t" \ ".quad 999f \n\t" \ ".long " str(__LINE__) "\n\t" \ ".long " str(data) "\n\t" \ ".section .rodata\n\t" \ "999: .string \"" __FILE__ "\"\n\t" \ ".popsection") const int* get_data() { PLACE_HERE(.custom,123); static const int data = 123; return & data; } inline const int* inline_get_data() { PLACE_HERE(.custom,123); static const int inline_data = 123; return & inline_data; } int main() { (void) get_data(); (void) inline_get_data(); return 0; } Regards Bernd.