New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

how are "etext" and "end" defined on Darwin??


Post Reply New Thread Subscribe

 
Thread Tools
vanfanel

 
Member Since: Apr 03, 2008
Posts: 1
vanfanel is on a distinguished road

vanfanel is offline
Hello all, mac fellows!

I am trying to compile some basic low-level programs I had made on Linux, this time with Mac OSX 10.4.9 with Xcode Tools installed, wich gives me a gcc-based enviroment to start coding on MAC OSX.
I want to get some low-level memory access trial-and-error fun in the proccess, but I have found &etext and &end aren't defined.

In Linux, something like this works flawlessly:

extern etext;
exter end;

main () {
printf ("\n&etext = 0x0%d", &etext);
printf ("\n&end = 0x0%d", &end);}
}


In darwin, using gcc 4.0.1, trying to compile it bings some linked problem with undefined symbols: ld can' find where etext or end are defined!
I have read they are defined as DATASTART or something, but I've trued to extern those or define them myself with no luck.
Please, do you know how can I find the end of the code segment, globals segment, etc, in Darwin?? Where are those defined? How?

Thanks!!
QUOTE Thanks

Post Reply New Thread Subscribe


« XCode Noob | C++ in terminal »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 07:41 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?