Re: [parisc-linux] [patch] Remove magic constant from gas/tc-hppa.c

Jeff Bailey <[email protected]>
Newsgroups gmane.comp.gnu.binutils,gmane.linux.ports.hppa
Message-ID <[email protected]>
Le samedi 21 octobre 2006 à 12:46 -0600, Matthew Wilcox a écrit :

> >    /* Set the default machine type.  */
> > -  if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, DEFAULT_LEVEL))
> > +#if TARGET_ARCH_SIZE == 64
> > +  if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, bfd_mach_hppa10))
> > +#else
> > +  if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, bfd_mach_hppa20w))
> > +#endif
> >      as_warn (_("could not set architecture and machine"));
> >  
> >    /* Folding of text and data segments fails miserably on the PA.
> 
> My personal preference would be to see this patch as:
> 
>  #if TARGET_ARCH_SIZE == 64
> -#define DEFAULT_LEVEL 25
> +#define DEFAULT_LEVEL bfd_mach_hppa20w
>  #else
> -#define DEFAULT_LEVEL 10
> +#define DEFAULT_LEVEL bfd_mach_hppa10
>  #endif
> 
> ... particularly since you seem to have got them the wrong way round in
> this patch.

Oh, whups.  /me wonders with which toolchain he used to build the test
binaries.

I opted for eliminating the DEFAULT_LEVEL because it's not clear at a
glance what it's a level of, it's only used in that one place, and the
construct isn't used in any of the other architectures.

In the tc-sparc.c file, they set a variable "mach" and just use that.  I
can do the same.  I'll cook it and resend after my afternoon honey-do's.

> I'd also dearly love it if someone could unify the hppa and hppa64 ports
> so we don't have to build two toolchains for one port.  Just like sparc,
> mips, s390 and i386.

In my local tree, I've been playing with extracting pieces out for use
in both with that in mind.  I'm a ways away from it.  I also don't have
an hppa-hpux system to test against, so I'm worried about accidentally
breaking that.  I should solve that and send some of the obvious pieces
of the hppa64-linux port in.

--
Jeff Bailey - http://www.raspberryginger.com/jbailey/
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQBFOm605M5hmdCYCpkRAuoVAKDtzyXL126n65Ih3zB8jP+QT4avvgCg9SRW
dPoxBLlx/lAsU2P5KDiZdgE=
=Cx9w
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.