[phobos] Showstopper bug: Hello world fails on OSX!

Michel Fortin michel.fortin at michelf.com
Wed Nov 10 16:29:59 PST 2010


Le 2010-11-10 à 16:07, Brad Roberts a écrit :

> Returning for a second back to the original purpose of this thread.. has the
> problem been identified?  It doesn't look like it, but figured I'd ask.

More or less. What's clear is that the three-section (begin, content, end) trick is not very reliable on Mac OS X because of the linker, and it doesn't appear consistent across different OS versions (this bug seem to be 10.5.x only). The solution that is expected to work is to replace the three-section trick with something more reliable.

It's true that the discussion has extended to support of dynamic libraries. That's mainly because loading a library involves the same process about finding the address and size for different segments in the library, and the solution was inspired from code meant to work with dynamic libraries.

If all we wanted was to fix this bug, probably calling this function to get the address and size of a section instead of the current method would be enough:

	char* getsectdata(
	  const char* segname,
	  const char* sectname,
	  unsigned long* size);

It won't work with dynamic libraries, but I'd expect the hello world crash on 10.5.x to disappear.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/





More information about the phobos mailing list