Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/gnu/dist/toolchain/gcc A small change elfos.h for VAX ELF. ...
details: https://anonhg.NetBSD.org/src/rev/653709ee626b
branches: trunk
changeset: 509416:653709ee626b
user: matt <matt%NetBSD.org@localhost>
date: Thu May 03 18:20:46 2001 +0000
description:
A small change elfos.h for VAX ELF. configure* need to about
{vax,arm*}--netbsdelf*. ARM ELF changes for NetBSD (from bjh).
diffstat:
gnu/dist/toolchain/gcc/config/arm/arm.h | 4 +
gnu/dist/toolchain/gcc/config/arm/elf.h | 55 ++++++
gnu/dist/toolchain/gcc/config/arm/netbsd-elf.h | 143 +++++++++++++++++
gnu/dist/toolchain/gcc/config/elfos.h | 2 +
gnu/dist/toolchain/gcc/configure | 200 +++++++++++++-----------
gnu/dist/toolchain/gcc/configure.in | 14 +-
6 files changed, 323 insertions(+), 95 deletions(-)
diffs (truncated from 1085 to 300 lines):
diff -r d905635eb30f -r 653709ee626b gnu/dist/toolchain/gcc/config/arm/arm.h
--- a/gnu/dist/toolchain/gcc/config/arm/arm.h Thu May 03 18:15:12 2001 +0000
+++ b/gnu/dist/toolchain/gcc/config/arm/arm.h Thu May 03 18:20:46 2001 +0000
@@ -199,7 +199,9 @@
"
/* Default is hard float, which doesn't define anything */
+#ifndef CPP_FLOAT_DEFAULT_SPEC
#define CPP_FLOAT_DEFAULT_SPEC ""
+#endif
#define CPP_ENDIAN_SPEC "\
%{mbig-endian: \
@@ -210,7 +212,9 @@
"
/* Default is little endian, which doesn't define anything. */
+#ifndef CPP_ENDIAN_DEFAULT_SPEC
#define CPP_ENDIAN_DEFAULT_SPEC ""
+#endif
#define CC1_SPEC ""
diff -r d905635eb30f -r 653709ee626b gnu/dist/toolchain/gcc/config/arm/elf.h
--- a/gnu/dist/toolchain/gcc/config/arm/elf.h Thu May 03 18:15:12 2001 +0000
+++ b/gnu/dist/toolchain/gcc/config/arm/elf.h Thu May 03 18:20:46 2001 +0000
@@ -163,6 +163,15 @@
#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32)
#endif
+/* Set CPP macros to reflect TARGET_DEFAULT */
+#ifndef CPP_FLOAT_DEFAULT_SPEC
+#define CPP_FLOAT_DEFAULT_SPEC "-D__SOFTFP__"
+#endif
+
+#ifndef CPP_APCS_PC_DEFAULT_SPEC
+#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
+#endif
+
#ifndef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS { "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" }
#endif
@@ -351,4 +360,50 @@
#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
fprintf (STREAM, "\t.align\t%d\n", POWER)
+/* following ripped from elfos.h */
+/* Switch into a generic section.
+ This is currently only used to support section attributes. */
+
+#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \
+do { \
+ static struct section_info \
+ { \
+ struct section_info *next; \
+ char *name; \
+ enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
+ } *sections; \
+ struct section_info *s; \
+ char *mode; \
+ enum sect_enum type; \
+ \
+ for (s = sections; s; s = s->next) \
+ if (!strcmp (NAME, s->name)) \
+ break; \
+ \
+ if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
+ type = SECT_EXEC, mode = "ax"; \
+ else if (DECL && DECL_READONLY_SECTION (DECL, RELOC)) \
+ type = SECT_RO, mode = "a"; \
+ else \
+ type = SECT_RW, mode = "aw"; \
+ \
+ if (s == 0) \
+ { \
+ s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
+ s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
+ strcpy (s->name, NAME); \
+ s->type = type; \
+ s->next = sections; \
+ sections = s; \
+ fprintf (FILE, ".section\t%s,\"%s\",@progbits\n", NAME, mode); \
+ } \
+ else \
+ { \
+ if (DECL && s->type != type) \
+ error_with_decl (DECL, "%s causes a section type conflict"); \
+ \
+ fprintf (FILE, ".section\t%s\n", NAME); \
+ } \
+} while (0)
+
#include "arm/aout.h"
diff -r d905635eb30f -r 653709ee626b gnu/dist/toolchain/gcc/config/arm/netbsd-elf.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gnu/dist/toolchain/gcc/config/arm/netbsd-elf.h Thu May 03 18:20:46 2001 +0000
@@ -0,0 +1,143 @@
+/* NetBSD/arm (RiscBSD) version.
+ Copyright (C) 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
+ Contributed by Mark Brinicombe (amb%physig.ph.kcl.ac.uk@localhost)
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* Human-readable target name for version string. */
+#define TARGET_VERSION fputs (" (ARM NetBSD/ELF)", stderr);
+
+/*#undef ASM_DECLARE_FUNCTION_NAME*/
+
+/* ARM6 family default cpu. */
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+
+/* APCS-32 is the default for ELF anyway. */
+/* Unsigned chars are the default anyway. */
+
+#include "arm/elf.h"
+
+/* We use VFP format for doubles. */
+/* XXX should be run-time configurable */
+#undef FLOAT_WORDS_BIG_ENDIAN
+#define FLOAT_WORDS_BIG_ENDIAN (TARGET_HARD_FLOAT || TARGET_BIG_END)
+/* This gets redefined in config/netbsd.h. */
+#undef TARGET_MEM_FUNCTIONS
+
+#define NETBSD_ELF
+
+#include <netbsd.h>
+
+/* Override standard NetBSD asm spec. What do they know? */
+#undef ASM_SPEC
+/* Don't bother telling the assembler the CPU type -- assume the compiler
+ won't generate bogus code and anyone using asm() knows what they're
+ doing. */
+#define ASM_SPEC "%{mbig-endian:-EB} \
+ %{mapcs-26:-mapcs-26} %{!mapcs-26:-mapcs-32} \
+ %{mapcs-float:-mapcs-float} \
+ %{mthumb-interwork:-mthumb-interwork} \
+ %{fpic:-k} %{fPIC:-k}"
+
+/* Some defines for CPP. */
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "\
+-Dunix -Darm -D__arm__ -D__NetBSD__ -D__ELF__ \
+-Asystem(unix) -Asystem(NetBSD) -Acpu(arm) -Amachine(arm)"
+
+/* Define _POSIX_SOURCE if necessary. */
+#undef CPP_SPEC
+#define CPP_SPEC "\
+%(cpp_cpu_arch) %(cpp_apcs_pc) %(cpp_float) %(cpp_endian) \
+%{posix:-D_POSIX_SOURCE} \
+"
+
+/* Because TARGET_DEFAULT sets ARM_FLAG_SOFT_FLOAT */
+#undef CPP_FLOAT_DEFAULT_SPEC
+#define CPP_FLOAT_DEFAULT_SPEC "-D__SOFTFP__ -D__VFP_FP__"
+
+/* Because we use VFP-format floats in the soft-float case */
+#undef CPP_FLOAT_SPEC
+#define CPP_FLOAT_SPEC "\
+%{msoft-float:\
+ %{mhard-float:%e-msoft-float and -mhard_float may not be used together} \
+ -D__SOFTFP__ -D__VFP_FP__} \
+%{!mhard-float:%{!msoft-float:%(cpp_float_default)}} \
+"
+
+#undef SIZE_TYPE
+#define SIZE_TYPE "unsigned int"
+
+#undef PTRDIFF_TYPE
+#define PTRDIFF_TYPE "int"
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef WCHAR_UNSIGNED
+#define WCHAR_UNSIGNED 0
+
+#undef WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#define HANDLE_SYSV_PRAGMA
+
+/* We don't have any limit on the length as out debugger is GDB. */
+#undef DBX_CONTIN_LENGTH
+
+/* NetBSD does its profiling differently to the Acorn compiler. We
+ don't need a word following the mcount call; and to skip it
+ requires either an assembly stub or use of fomit-frame-pointer when
+ compiling the profiling functions. */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(STREAM,LABELNO) \
+{ \
+ fprintf(STREAM, "\tmov\t%sip, %slr\n", REGISTER_PREFIX, REGISTER_PREFIX); \
+ fprintf(STREAM, "\tbl\t__mcount\n"); \
+}
+
+/* On the ARM `@' introduces a comment, so we must use something else
+ for .type directives. */
+#undef TYPE_OPERAND_FMT
+#define TYPE_OPERAND_FMT "%%%s"
+
+/* VERY BIG NOTE : Change of structure alignment for RiscBSD.
+ There are consequences you should be aware of...
+
+ Normally GCC/arm uses a structure alignment of 32 for compatibility
+ with armcc. This means that structures are padded to a word
+ boundary. Historically, NetBSD/arm has used an alignment of 8, and ARM
+ seem to be moving that way in their toolchain so we'll keep it.
+
+ This has several side effects that should be considered.
+ 1. Structures will only be aligned to the size of the largest member.
+ i.e. structures containing only bytes will be byte aligned.
+ structures containing shorts will be half word alinged.
+ structures containing ints will be word aligned.
+
+ This means structures should be padded to a word boundary if
+ alignment of 32 is required for byte structures etc.
+
+ 2. A potential performance penalty may exist if strings are no longer
+ word aligned. GCC will not be able to use word load/stores to copy
+ short strings.
+*/
+#undef STRUCTURE_SIZE_BOUNDARY
+#define STRUCTURE_SIZE_BOUNDARY 8
diff -r d905635eb30f -r 653709ee626b gnu/dist/toolchain/gcc/config/elfos.h
--- a/gnu/dist/toolchain/gcc/config/elfos.h Thu May 03 18:15:12 2001 +0000
+++ b/gnu/dist/toolchain/gcc/config/elfos.h Thu May 03 18:20:46 2001 +0000
@@ -58,7 +58,9 @@
/* Writing `int' for a bitfield forces int alignment for the structure. */
+#ifndef PCC_BITFIELD_TYPE_MATTERS
#define PCC_BITFIELD_TYPE_MATTERS 1
+#endif
/* Implicit library calls should use memcpy, not bcopy, etc. */
diff -r d905635eb30f -r 653709ee626b gnu/dist/toolchain/gcc/configure
--- a/gnu/dist/toolchain/gcc/configure Thu May 03 18:15:12 2001 +0000
+++ b/gnu/dist/toolchain/gcc/configure Thu May 03 18:20:46 2001 +0000
@@ -1311,7 +1311,7 @@
fi
# Find some useful tools
-for ac_prog in gawk mawk nawk awk
+for ac_prog in mawk gawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@@ -3170,6 +3170,12 @@
tm_file=arm/semiaof.h
tmake_file=arm/t-semiaof
;;
+ arm*-*-netbsdelf*)
+ tm_file=arm/netbsd-elf.h
+ xm_file="arm/xm-netbsd.h ${xm_file}"
+ tmake_file="t-netbsd arm/t-netbsd"
+ use_collect2=yes
+ ;;
arm*-*-netbsd*)
tm_file=arm/netbsd.h
xm_file="arm/xm-netbsd.h ${xm_file}"
@@ -5596,11 +5602,17 @@
xm_defines=USG
float_format=vax
;;
+ vax-*-netbsdelf*)
+ tm_file="${tm_file} vax/netbsd-elf.h"
+ tmake_file=t-netbsd
+ float_format=vax
+ use_collect2=yes
+ ;;
vax-*-netbsd*)
tm_file="${tm_file} netbsd.h vax/netbsd.h"
tmake_file=t-netbsd
float_format=vax
- use_collect2=yes
+ use_collect2=yes
;;
vax-*-openbsd*)
tmake_file="${tmake_file} vax/t-openbsd"
@@ -6086,7 +6098,7 @@
Home |
Main Index |
Thread Index |
Old Index