LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-23-2004, 05:46 PM   #1
kishan
LQ Newbie
 
Registered: Feb 2004
Posts: 2

Rep: Reputation: 0
derefencing NULL pointer with gnu ld (link editor)


Hi,

I am porting software from HP-UX to RedHat
Enterprise. While using HP UX, i was able to
successfully dereference NULL pointers by using the
"-Z" option while compiling using aCC/gcc. But this
option does not exist on gnu ld (version: GNU ld
version 2.14.90.0.4 20030523). I am wondering if
there is a similar option that would enable me to
successfully dereference NULL pointers without
crashing the code on Redhat Linux (version: Enterprise
3.1).

Thanks,
Kishan
 
Old 02-23-2004, 05:49 PM   #2
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I didn't even know it was possible to dereference null pointers Ordinarily, that'd be an error, I'd think - unless you're actually trying to refer to something in memory at 0x0. What kind of situation would require something like that? (just curious)
 
Old 02-23-2004, 07:31 PM   #3
kishan
LQ Newbie
 
Registered: Feb 2004
Posts: 2

Original Poster
Rep: Reputation: 0
Well.. on certain compilers ( & coupled with link editors on that platform), it's possible to run code that could run into dereferencing 0x0 & not crash. A good example would be HP-UX. Frankly, any occurance of this scenario would be due to bad programming.

Since we are porting code from HP-UX to linux, there are a lot of such instances. Instead of going thro the entire source code for a potential crash, i was wondering if there was an easy way out... Just like HP-UX. I'm aware that on Solaris you could link lib0@0.so that fixes this. But i cant seem to find anything for linux.
 
Old 02-23-2004, 08:49 PM   #4
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Interesting... no, I don't know of any way to make it OK to dereference null pointers. Maybe someone else around here has an idea.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel Null Pointer Dereference Error Smillie Slackware 3 04-27-2005 06:21 PM
kernel NULL pointer problem branden_burger Linux - General 0 04-06-2005 10:57 AM
NULL pointer dereference error Mercman2000 Linux - General 1 03-21-2005 10:36 PM
freeConfModules called with NULL pointer... opioid Linux - Software 1 10-31-2004 10:04 PM
Null Pointer vijeesh_ep Programming 3 08-13-2004 03:51 PM


All times are GMT -5. The time now is 08:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration