Skip to contentSkip to conversation

Remove magic constant from gas/tc-hppa.c

PATCH Matthew Wilcox 1 participant 1 message Oct 21, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 16 lines · Jeff Bailey
(quoted diff) +0 -6
@@ -105,12 +105,6 @@ typedef som_symbol_type obj_symbol_type;
 #endif
 #endif /* OBJ_SOM */
 
-#if TARGET_ARCH_SIZE == 64
-#define DEFAULT_LEVEL 25
-#else
-#define DEFAULT_LEVEL 10
-#endif
-
 /* Various structures and types used internally in tc-hppa.c.  */
 
 /* Unwind table and descriptor.  FIXME: Sync this with GDB version.  */
@@ -8259,7 +8253,11 @@ md_begin (void)
   call_info_root = NULL;
 

Review md_begin (void) · line 8263

Quoted 10 lines
(quoted diff) +5 -1
   /* 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.

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.
_______________________________________________
parisc-linux mailing list [email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux