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

Jeff Bailey jbailey@raspberryginger.com
Mon Oct 23 02:35:00 GMT 2006


Le samedi 21 octobre 2006 à 19:38 -0400, John David Anglin a écrit :
>        if (bfd_get_mach (stdoutput) < pa11)
> 
> You missed the above pa11 and a couple of pa20 uses.  It would
> be nice if the duplication present in the definition of the enum
> pa_arch and the bfd_mach_* defines could be eliminated.  However,
> I think using the bfd_mach values in the opcode table would be
> ugly.

Other architectures seem to have the same problem.  They generally seem
to use the bfd_mach_* values in the tc-* files, and some other define in
the opcode headers.

> Ultimately, it would be nice to turn all the TARGET_ARCH_SIZE
> tests into runtime checks.

Sheesh!  Between you, Matthew and Carlos...  =)

So as requested, here it is.  I've gone as far as I can until I finish
the job with bfd.  I have a bit of this work done from the hppa64
hacking I've been doing, but that part isn't ready for submission yet.

Tested on hppa-linux (with the testsuite), hppa64-linux (with my
simpleasm hacks), and a specific extra taste to make sure that %mrp is
handled correctly.

2006-10-21  Jeff Bailey  <jbailey@raspberryginger.com>

        * config/tc-hppa.c: Do not define DEFAULT_LEVEL.
        Add variables for architecture size.
        Add mach member to struct pd_reg and populate pre_defined_registers.
        (need_pa11_opcode): Use bfd_mach_hppa11 instead of pa11 for
        consistency.
        (need_pa11_opcode): Use defines from bfd.h instead of magic numbers.
        (pa_ip): Likewise.
        (pa_level): Likewise.
        (pa_parse_number): Use binutils hash instead of home-brew one.
        (md_begin): Use defines from bfd.h instead of DEFAULT_LEVEL.
        (init_default_arch): New function.
        (hppa_target_format): New function.
        (hppa_print_statistics): New function.
        (reg_name_search): Removed.
        (setup_reg_hash): New function.

        * config/tc-hppa.h: Redefine TARGET_FORMAT as hppa_target_format()
        and in terms of ELF_TARGET_FORMAT and ELF64_TARGET_FORMAT for OBJ_ELF.
        Remove extra definitions of TRUE and FALSE.

        * configure.in: Define DEFAULT_ARCH for hppa.
        * configure: Regenerate.
        * configure.tgt: Specify arch for hppa and hppa64.


--
Jeff Bailey - http://www.raspberryginger.com/jbailey/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas-hppa.diff
Type: text/x-patch
Size: 49596 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20061023/28bb1833/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Ceci est une partie de message num?riquement sign?e
URL: <https://sourceware.org/pipermail/binutils/attachments/20061023/28bb1833/attachment.sig>


More information about the Binutils mailing list