没关系,这个历史问题与现代无关
一种方法可能比您想要的更黑客,是插入一个脚本来更改编译和汇编之间的节名称。例如:
gcc -fdata-sections -S -o test.s test.c
sed 's/^\t.section\t\.rodata\.__func__\.[0-9]*/\t.section .rom_data/' -i test.s
gcc -c test.s
您还可以尝试编写 clang 转换过程以将
__func__
声明放置在您选择的部分中,或者使用 libbfd 编写对象文件操作程序。