Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Helge Deller <Helge.Deller@ruhr-uni-bochum.de>
To: parisc-linux@thepuffingroup.com,
	LaMont Jones <lamont@security.hp.com>,
	Grant Grundler <grundler@cup.hp.com>
Subject: Re: [parisc-linux] Missing directories from CVS
Date: Fri, 24 Sep 1999 10:13:13 +0200	[thread overview]
Message-ID: <99092410263805.00271@P100> (raw)
In-Reply-To: 19990923185853.4632E18708@security.hp.com

Am Thu, 23 Sep 1999 schrieb LaMont Jones:
> > And on this one "cc" gets picky about pointer math.
> > Here's my diff for mkImage.c:
> 
> > <     *entry_point = *(unsigned long*)(ptr + 6*sizeof(long));
> > ---
> > >     *entry_point = *(unsigned long*)((char *)ptr + 6*sizeof(long));
> OK, so I'm too lazy to go look...  what type is ptr?  I'd guess that
> it's declared void*, since that's the only way the pointer math could
> work in gcc and not in HP-cc.

Yes.

> 
> > Any objections to committing this change?
> > On second thought, both changes should be written as:
> > 	*entry_point = ((unsigned long *)ptr)[6];
> > and	
> > 	short magic = ((short *)ptr)[1];
> How about just using filehdr.h, or copying struct header from it, and
> using the real structure...?  (I think we've released the format enough
> that we could clone the structure, failing that:
> 
>   struct header {
> 	unsigned short magic;
> 	short fill0;
> 	long fill[5];
> 	unsigned long entry_point;
>   };
> will fit the bill quite nicely.

Yes, I think this would be the best solution. When I wrote the program, I tried
to include the header-files som.h and elf.h, but then I always got
different errors from every of the arch-compilers (iA32 or hpux).  So maybe it
is best to use the structure as above and write the structure-layout directly
into the source.  
Does someone want to fill it in and commit it ?

> 
> LaMont "I hate magic offsets" Jones
Helge "master of bad pointer arithmetic" Deller :-)

  reply	other threads:[~1999-09-24  9:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-23  3:13 [parisc-linux] Missing directories from CVS Ryan Bradetich
1999-09-23 15:30 ` Grant Grundler
1999-09-23 16:59   ` Grant Grundler
1999-09-23 18:58     ` LaMont Jones
1999-09-24  8:13       ` Helge Deller [this message]
1999-09-24 14:44         ` LaMont Jones

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=99092410263805.00271@P100 \
    --to=helge.deller@ruhr-uni-bochum.de \
    --cc=grundler@cup.hp.com \
    --cc=lamont@security.hp.com \
    --cc=parisc-linux@thepuffingroup.com \
    /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