Operating System - Linux
1821638 Members
3244 Online
109633 Solutions
New Discussion

Missing -Z option in HP LINUX GCC LD

 
karthik_gcc
New Member

Missing -Z option in HP LINUX GCC LD

Hi
i cannot able to find out -Z option in the ld in my HP linux box. The system configuration i am using is as follows,
Linux 2.6.9-55.0.2.ELsmp #1 SMP Tue x86_64 x86_64 x86_64 GNU/Linux
and
GNU ld version 2.15.92.0.2 20040927
and
gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-8)

can any one advice an alternate option for -Z in HP linux systems? i need this option for dereferencing NULL pointers while creating shared libraries and executables.

Thanks.
1 REPLY 1
Matti_Kurkela
Honored Contributor

Re: Missing -Z option in HP LINUX GCC LD

In Linux on x86_64 architecture, dereferencing a NULL pointer is always an illegal operation and is treated as a fatal error by the operating system.

Relying on being able to dereference NULL pointers is a bad programming practice. It is not guaranteed to be portable. In HP-UX platform, you can get away with it; but on Linux, you cannot.

If you're porting HP-UX software to Linux and find that a function in the software relies on dereferencing NULL pointers to work, you must fix (or redesign and re-implement) that function as part of the porting effort.

MK
MK