gcc __attribute__((alias))

__attribute__((alias)): 为一个symbol声明一个别名


return-type newname([arguments-list]) __attribute__((alias("oldname")))

oldname: 原始函数名

newname: 原始函数的别名


#include <stdio.h>
#include <stdlib.h>

void foo()
{
printf("\nInside %s\n",__FUNCTION__);
}

void _foo() __attribute__((alias("foo")));

//@Author : forest
int main(int args,char ** argv)
{
_foo();
return EXIT_SUCCESS;
}
http://www.szpxe.com/article/view/128471
http://www.cnblogs.com/respawn/archive/2012/07/09/2582548.html

原文地址:https://www.cnblogs.com/moonflow/p/2637874.html