lkml.org 
[lkml]   [2005]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: __init()
Date
From

On Thu, 11 Aug 2005, raja wrote:

> Hi,
> Is there any way to execute my own __init() instead of default
> __init() while running an executable.
> -

Sure you link your object file with your own instead of using
the default....

gcc -c -o myprog.o myprog.c
as -o start.o start.S

ld -o myprog myprog.o start.o /lib/libc.so.6
| | |___ runtime lib
| |__________________ Your startup
|__________________________ Your program

Startup starts with a label _start. You may have to write it
in assembly. It calls main() and must never return. Instead
it calls exit() with whatever main() returned, to quit.

__init() is some M$ thing. Linux executables start with
_start().

Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
Warning : 98.36% of all statistics are fiction.
.
I apologize for the following. I tried to kill it with the above dot :

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-11 14:50    [W:0.065 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site