如何使用gcc更改C程序的入口点? [英] How to change entry point of C program with gcc?

查看:437
本文介绍了如何使用gcc更改C程序的入口点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改使用gcc编译的C程序的入口点?
就像下面的代码一样

How to change the entry point of a C program compiled with gcc ?
Just like in the following code

#include<stdio.h>
int entry()  //entry is the entry point instead of main
 {
   return 0;
 }

推荐答案

这是一个链接器设置:

-Wl,-eentry

-Wl,...事物将参数传递给链接器,并且链接器采用-e参数来设置入口函数

the -Wl,... thing passes arguments to the linker, and the linker takes a -e argument to set the entry function

这篇关于如何使用gcc更改C程序的入口点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆