Netboot Mailing List (by thread)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross-compile problem (continued)



--pgp-sign-Multipart_Thu_Jul_17_13:17:00_1997-1
Content-Type: text/plain; charset=US-ASCII

Gero Kuhlmann writes:
 > When using an a.out compiler under Unix or any DOS C compiler I know of,
 > the compiler itself appends _one_ underscore at the beginning of any public
 > name. Since assemblers don't do this, you have to append this one under-
 > score in assembler modules. Appending _two_ underscores in assembler modules
 > is IMHO just a convention, which is not necessary. If the name is __inet_ntoa
 > in the assembler module, the C compiler can access it as _inet_ntoa, e.g.
 > with one leading underscore. However, this only applies to a.out under UNIX
 > and most DOS compilers. The ELF format does NOT use leading underscores.
 > Therefore, if you define inet_ntoa in a module compiled with an ELF compiler,
 > it will appear exactly like this in the resulting object file. Again, even
 > with ELF it's still common practice to use two leading underscores in assem-
 > bler routines in a library.

There are actually some rules about name-spaces as defined by POSIX. I
forgot the details, but user programs must never have any symbols
(even local symbols!) that start with an underscore. I think, double
underscore is also defined and the restrictions are even stronger. It
might be OK to use single underscores in libraries, but I cannot vouch
for it.


Markus

--
Markus Gutschke                         Internet: markus@infoscape.com
Infoscape, Inc                          Phone:    +1-415-537-3778
657 Mission Street, Suite 200
San Francisco, CA 94105

Disclaimer: The above message represents my personal opinion; It does
            not constitute an offical statement by Infoscape!

--pgp-sign-Multipart_Thu_Jul_17_13:17:00_1997-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP MESSAGE-----
Version: 2.6.2

iQCVAwUBM859wBqJqDLErwMxAQGf4wP+P+T7hLr62amW59Tbm9ztwQ00AK0FYmHY
nMboEo9qwhJj6sE9KDjdDi4EkU4TsaSFh2+rfaNjyIz9QUmqw7MajNqf4n0hItKd
/KT1FGMLmQ64UgPI1Vdi6GoF8dzHhsbz/Bwby/3O+aFz+CjwQKEj4ZjHW6RvrLdp
HiIoj+92BVY=
=RRsK
-----END PGP MESSAGE-----

--pgp-sign-Multipart_Thu_Jul_17_13:17:00_1997-1--



For requests or suggestions regarding this mailing list archive please write to netboot@gkminix.han.de.