Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
how are "etext" and "end" defined on Darwin??
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="vanfanel" data-source="post: 627996" data-attributes="member: 52515"><p>Hello all, mac fellows!</p><p></p><p>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.</p><p>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.</p><p></p><p>In Linux, something like this works flawlessly:</p><p></p><p>extern etext;</p><p>exter end;</p><p></p><p>main () {</p><p> printf ("\n&etext = 0x0%d", &etext);</p><p> printf ("\n&end = 0x0%d", &end);} </p><p>}</p><p></p><p></p><p>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!</p><p>I have read they are defined as DATASTART or something, but I've trued to extern those or define them myself with no luck.</p><p>Please, do you know how can I find the end of the code segment, globals segment, etc, in Darwin?? Where are those defined? How?</p><p></p><p>Thanks!!</p></blockquote><p></p>
[QUOTE="vanfanel, post: 627996, member: 52515"] 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]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
how are "etext" and "end" defined on Darwin??
Top