linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Hiep Tran" <hiep@netvisiontel.co.kr>
To: "ML linuxppc-embedded" <linuxppc-embedded@ozlabs.org>
Subject: Problem when accessing variables
Date: Tue, 29 Mar 2005 13:11:16 +0900	[thread overview]
Message-ID: <003801c53415$5a62d030$c800a8c0@hieptran> (raw)
In-Reply-To: be784d868895f716feaf92e8fe93f826@freescale.com

Hi all,

I just joint to embedded software world and I am facing with a problem 
related to ppc_405-gcc compiler. My problem is my source code if compiled by 
gcc compiler and run on Linux platform, everything is OK, but if my source 
code is compiled with ppc_405-gcc and transfering to Power PC and to be run, 
I am always facing with "pointer problem" described as follows:

I have file called "hashtable.c", which contains some functions to 
manipulate a structure in C programming language (it's really a hashtable 
structure, which I am implementing). These functions include adding, 
removing, lookupping etc on a input pointer parameter, which point to a 
hashtable structure.

I have another file called "test.c", which will use functions of hashtable, 
which mentioned above. And in this file, I can manipulate my hashtable 
structure by calling functions in file "hashtable.c" only. But if I access 
to members of hashtable structure or hashtable's node structure directly 
(without calling hashtable functions to receive these structure's members) 
then my test program is always died by a invalid pointer, which is referring 
to structure's member. the test.c and hashtable.c files were compiled and 
linked together.

But if I copy all functions in hashtable.c and paste to test.c and then 
compile, create my program by using the test.c file only the my test program 
is run well.

I think my problem related to linking between object files (it's seem to me 
that, pointers, which are allocated memory, or global variables declared in 
this file will cause problem when access it in another file) on ppc_405-gcc 
compiler because my problem is still run well on Linux computer when it was 
compiled and linked by gcc compiler.

My temporary solution is I added a new function to the file hashtable.c, 
this function returns data members, which reside inside node structures of 
hashtable structure and I can access these data pointers without facing any 
problem.

Anyone could give me any option to set to ppc_405-gcc compiler or any 
solution to help to me passing the problem.

Thanks,
Hiep Tran

  reply	other threads:[~2005-03-29  4:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-09  1:47 RFC: PHY Abstraction Layer II Andy Fleming
2005-03-09  2:14 ` Benjamin Herrenschmidt
2005-03-09  3:42   ` David S. Miller
2005-03-09  3:50     ` Benjamin Herrenschmidt
2005-03-09 17:24       ` Andy Fleming
2005-03-10 23:01         ` James Chapman
2005-03-10 23:06           ` Benjamin Herrenschmidt
2005-03-10 23:27             ` Jeff Garzik
2005-03-10 23:27               ` Benjamin Herrenschmidt
2005-03-15  0:41           ` Andy Fleming
2005-03-15 19:18             ` James Chapman
2005-03-18 23:14               ` Andy Fleming
2005-03-24 21:48               ` Andy Fleming
2005-03-25 22:56                 ` Andy Fleming
2005-03-28 23:45                   ` Kumar Gala
2005-03-29  4:11                     ` Hiep Tran [this message]
     [not found]                 ` <42625DDB.4090600@katalix.com>
2005-05-10 17:04                   ` Andy Fleming
2005-05-12  6:08                     ` Pantelis Antoniou
2005-05-25 23:00                     ` Kumar Gala
2005-03-09 17:17   ` Andy Fleming
2005-05-26 18:32 ` Stephen Hemminger
2005-05-26 18:45   ` Andy Fleming
2005-05-31 17:59 ` Stephen Hemminger
2005-06-01 20:45   ` Andy Fleming
2005-06-01 21:19     ` Stephen Hemminger
2005-06-01 22:42       ` Andy Fleming
2005-06-01 21:41     ` Stephen Hemminger
2005-06-01 22:36       ` Andy Fleming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003801c53415$5a62d030$c800a8c0@hieptran' \
    --to=hiep@netvisiontel.co.kr \
    --cc=linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).