From: Jan-Benedict G. <jb...@us...> - 2005-09-23 08:57:51
|
Update of /cvsroot/linux-vax/toolchain/patches In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17145 Modified Files: binutils-000001-tc_vax_c90fy.patch gcc-000003-add-vax-linux-target.patch Log Message: - Refreshing the patches, adjusting to non-BFD-assembler removal in mainline code. Index: gcc-000003-add-vax-linux-target.patch =================================================================== RCS file: /cvsroot/linux-vax/toolchain/patches/gcc-000003-add-vax-linux-target.patch,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- gcc-000003-add-vax-linux-target.patch 17 May 2005 10:13:30 -0000 1.6 +++ gcc-000003-add-vax-linux-target.patch 23 Sep 2005 08:57:43 -0000 1.7 @@ -1,27 +1,85 @@ -This patch adds vax-*-linux* as a generic VAX ELF target. We'll add the -Linux-specific definitions later. - -ChangeLog: - - * gcc/config.gcc add vax-*-linux* target - * gcc/config/vax/linux.h: add placeholder header for Linux definitions - diff -Nurp src-gcc-fresh/gcc/config/vax/linux.h src-gcc-hacked/gcc/config/vax/linux.h --- src-gcc-fresh/gcc/config/vax/linux.h 1970-01-01 01:00:00.000000000 +0100 -+++ src-gcc-hacked/gcc/config/vax/linux.h 2005-05-17 12:09:40.000000000 +0200 -@@ -0,0 +1,3 @@ ++++ src-gcc-hacked/gcc/config/vax/linux.h 2005-09-12 20:44:49.000000000 +0200 +@@ -0,0 +1,31 @@ ++#ifndef _CONFIG_VAX_LINUX_H ++/* ++ * Copyright (C) 2005 Free Software Foundation, Inc. ++ * ++ * This file is part of GCC. ++ * ++ * GCC 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. ++ * ++ * GCC 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 GCC; see the file COPYING. If not, write to ++ * ++ * Free Software Foundation ++ * 51 Franklin Street, Fifth Floor ++ * Boston, MA 02110-1301 ++ * USA ++ */ + -+/* Linux-specific definitions for VAX will go here */ ++/* ++ * This file contains definitions specific to Linux using GNU libc and ++ * the ELF binary format. ++ */ ++ ++#endif /* _CONFIG_VAX_LINUX_H */ +diff -Nurp src-gcc-fresh/gcc/config/vax/uclinux.h src-gcc-hacked/gcc/config/vax/uclinux.h +--- src-gcc-fresh/gcc/config/vax/uclinux.h 1970-01-01 01:00:00.000000000 +0100 ++++ src-gcc-hacked/gcc/config/vax/uclinux.h 2005-09-12 20:44:49.000000000 +0200 +@@ -0,0 +1,31 @@ ++#ifndef _CONFIG_VAX_UCLINUX_H ++/* ++ * Copyright (C) 2005 Free Software Foundation, Inc. ++ * ++ * This file is part of GCC. ++ * ++ * GCC 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. ++ * ++ * GCC 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 GCC; see the file COPYING. If not, write to ++ * ++ * Free Software Foundation ++ * 51 Franklin Street, Fifth Floor ++ * Boston, MA 02110-1301 ++ * USA ++ */ + ++/* ++ * This file contains definitions specific to Linux using the small uClibc ++ * and the ELF binary format. ++ */ ++ ++#endif /* _CONFIG_VAX_UCLINUX_H */ diff -Nurp src-gcc-fresh/gcc/config.gcc src-gcc-hacked/gcc/config.gcc ---- src-gcc-fresh/gcc/config.gcc 2005-05-09 20:51:44.000000000 +0200 -+++ src-gcc-hacked/gcc/config.gcc 2005-05-17 12:09:40.000000000 +0200 -@@ -2209,6 +2209,9 @@ vax-*-sysv*) # VAXen running system V +--- src-gcc-fresh/gcc/config.gcc 2005-09-12 18:58:44.000000000 +0200 ++++ src-gcc-hacked/gcc/config.gcc 2005-09-12 20:44:49.000000000 +0200 +@@ -2237,6 +2237,12 @@ vax-*-sysv*) # VAXen running system V tmake_file=vax/t-memfuncs use_fixproto=yes ;; -+vax-*-linux*) # vax running linux ELF binary format -+ tm_file="${tm_file} elfos.h linux.h vax/linux.h vax/elf.h" ++vax-*-uclinux*) # VAXen running Linux ELF with uClibc ++ tm_file="${tm_file} elfos.h linux.h vax/elf.h vax/uclinux.h" ++ ;; ++vax-*-linux*) # VAXen running Linux ELF with GNU libc ++ tm_file="${tm_file} elfos.h linux.h vax/elf.h vax/linux.h" + ;; vax-*-netbsdelf*) tm_file="${tm_file} elfos.h netbsd.h netbsd-elf.h vax/elf.h vax/netbsd-elf.h" Index: binutils-000001-tc_vax_c90fy.patch =================================================================== RCS file: /cvsroot/linux-vax/toolchain/patches/binutils-000001-tc_vax_c90fy.patch,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- binutils-000001-tc_vax_c90fy.patch 5 Jun 2005 15:57:46 -0000 1.1 +++ binutils-000001-tc_vax_c90fy.patch 23 Sep 2005 08:57:43 -0000 1.2 @@ -1,44 +1,7 @@ -This patch removes K&Risms from tc-vax.c. - -2005-06-03 Jan-Benedict Glaw <jb...@lu...> - - gas/config/ - * tc-vax.c Big K&R update; remove unneeded parentheses at #defines; - Put #error text into quotes. - (md_begin): Add 'void' for no arguments. - (md_number_to_chars): Remove K&R argument declaration. - (md_apply_fix3): Dito. - (md_chars_to_number): Dito. - (md_assemble): Dito. - (md_estimate_size_before_relax): Dito. - (md_convert_frag): Dito. - (md_ri_to_chars): Dito. - (tc_aout_fix_to_chars): Dito. - (vip_begin): Dito. - (vip): Dito. - (vip_op_defaults): Dito. - (vip_op): Dito. - (md_create_short_jump): Dito. - (main): Dito. - (mumble): Dito. - (md_create_short_jump): Dito. - (md_create_long_jump): Dito. - (md_parse_option): Dito. - (md_show_usage): Dito. - (md_undefined_symbol): Dito. - (md_section_align): Dito. - (md_pcrel_from): Dito. - (tc_headers_hook): Dito. - (tc_gen_reloc): Dito. - (vax_reg_parse): Dito. Also, 'return' isn't a function, so remove - pointless braces around the return value. - (bignum_copy): K&R update. Also remove 'register' keyword. - (md_longopts): Add some spaces. - diff -Nurp src-binutils-fresh/gas/config/tc-vax.c src-binutils-hacked/gas/config/tc-vax.c ---- src-binutils-fresh/gas/config/tc-vax.c 2005-06-02 23:30:19.000000000 +0200 -+++ src-binutils-hacked/gas/config/tc-vax.c 2005-06-03 00:21:55.000000000 +0200 -@@ -283,7 +283,7 @@ static void vip PARAMS ((struct vit *, c +--- src-binutils-fresh/gas/config/tc-vax.c 2005-08-13 13:37:12.000000000 +0200 ++++ src-binutils-hacked/gas/config/tc-vax.c 2005-09-12 20:04:50.000000000 +0200 +@@ -279,7 +279,7 @@ static void vip PARAMS ((struct vit *, c static int vax_reg_parse PARAMS ((char, char, char, char)); void @@ -47,7 +10,7 @@ { const char *errtxt; FLONUM_TYPE *fP; -@@ -304,10 +304,7 @@ md_begin () +@@ -300,10 +300,7 @@ md_begin () } void @@ -59,24 +22,12 @@ { number_to_chars_littleendian (con, value, nbytes); } -@@ -316,10 +313,7 @@ md_number_to_chars (con, value, nbytes) - that they reference. */ - - void /* Knows about order of bytes in address. */ --md_apply_fix3 (fixP, valueP, seg) -- fixS *fixP; -- valueT *valueP; -- segT seg ATTRIBUTE_UNUSED; -+md_apply_fix3 (fixS *fixP, valueT*valueP, segT seg ATTRIBUTE_UNUSED) - { - valueT value = * valueP; - #ifdef BFD_ASSEMBLER -@@ -335,10 +329,12 @@ md_apply_fix3 (fixP, valueP, seg) +@@ -330,10 +327,12 @@ md_apply_fix (fixP, valueP, seg) fixP->fx_done = 1; } -+/* Convert a number from VAX byte order (little endian) into host -+ byte order. ++/* Convert a number from VAX byte order (little endian) ++ into host byte order. + con is the buffer to convert, + nbytes is the length of the given buffer. */ long @@ -87,7 +38,7 @@ { long retval; for (retval = 0, con += nbytes - 1; nbytes--; con--) -@@ -359,10 +355,10 @@ md_chars_to_number (con, nbytes) +@@ -354,10 +353,10 @@ md_chars_to_number (con, nbytes) */ static int @@ -102,7 +53,7 @@ { int significant_littlenums_dropped; -@@ -403,11 +399,10 @@ bignum_copy (register LITTLENUM_TYPE *in +@@ -398,11 +397,10 @@ bignum_copy (register LITTLENUM_TYPE *in return (significant_littlenums_dropped); } @@ -116,7 +67,7 @@ { /* Non-zero if operand expression's segment is not known yet. */ int is_undefined; -@@ -1284,9 +1279,7 @@ md_assemble (instruction_string) +@@ -1268,9 +1266,7 @@ md_assemble (instruction_string) Return the correct fr_subtype in the frag and the growth beyond fr_fix. */ int @@ -127,9 +78,9 @@ { if (RELAX_LENGTH (fragP->fr_subtype) == STATE_UNDF) { -@@ -1442,16 +1435,12 @@ md_estimate_size_before_relax (fragP, se +@@ -1425,10 +1421,8 @@ md_estimate_size_before_relax (fragP, se + * Caller will turn frag into a ".space 0". */ - #ifdef BFD_ASSEMBLER void -md_convert_frag (headers, seg, fragP) - bfd *headers ATTRIBUTE_UNUSED; @@ -137,18 +88,10 @@ - fragS *fragP; +md_convert_frag (bfd *headers ATTRIBUTE_UNUSED, segT seg ATTRIBUTE_UNUSED, + fragS *fragP) - #else - void --md_convert_frag (headers, seg, fragP) -- object_headers *headers ATTRIBUTE_UNUSED; -- segT seg ATTRIBUTE_UNUSED; -- fragS *fragP; -+md_convert_frag (object_headers *headers ATTRIBUTE_UNUSED, -+ segT seg ATTRIBUTE_UNUSED, fragS *fragP) - #endif { char *addressP; /* -> _var to change. */ -@@ -1601,9 +1590,7 @@ md_convert_frag (headers, seg, fragP) + char *opcodeP; /* -> opcode char(s) to change. */ +@@ -1577,9 +1571,7 @@ md_convert_frag (headers, seg, fragP) bit 0 as pcrel. */ #ifdef comment void @@ -159,20 +102,7 @@ { /* this is easy */ md_number_to_chars (the_bytes, ri.r_address, sizeof (ri.r_address)); -@@ -1620,10 +1607,8 @@ md_ri_to_chars (the_bytes, ri) - #ifdef OBJ_AOUT - #ifndef BFD_ASSEMBLER - void --tc_aout_fix_to_chars (where, fixP, segment_address_in_file) -- char *where; -- fixS *fixP; -- relax_addressT segment_address_in_file; -+tc_aout_fix_to_chars (char *where, fixS *fixP, -+ relax_addressT segment_address_in_file) - { - /* - * In: length of relocation (or of address) in chars: 1, 2 or 4. -@@ -1797,13 +1782,13 @@ static const short int vax_operand_width +@@ -1737,13 +1729,13 @@ static const short int vax_operand_width * */ #if (VIT_OPCODE_SYNTHETIC != 0x80000000) @@ -185,25 +115,26 @@ #if (VIT_OPCODE_SPECIAL != 0x40000000) - You have just broken the encoding below, which assumes the 0x40 M bit means - 'I am not to be "optimised" the way normal branches are'. -+#error "You have just broken the encoding below, which assumes the 0x40 MSB " \ -+ "bit means 'I am not to be "optimised" the way normal branches are'." ++#error "You have just broken the encoding below, which assumes the 0x40 " \ ++ "M bit means 'I am not to be "optimised" the way normal branches are'." #endif static const struct vot -@@ -1872,9 +1857,9 @@ static const struct vot +@@ -1812,9 +1804,10 @@ static const struct vot */ static const char * -vip_begin (synthetic_too, immediate, indirect, displen) - int synthetic_too; /* 1 means include jXXX op-codes. */ - const char *immediate, *indirect, *displen; -+vip_begin (int synthetic_too, /* 1 means include jXXX op-codes. */ -+ const char *immediate, -+ const char *indirect, const char *displen) ++vip_begin (int synthetic_too, ++ const char *immediate, /* 1 means include jXXX op-codes. */ ++ const char *indirect, ++ const char *displen) { const struct vot *vP; /* scan votstrs */ const char *retval = 0; /* error text */ -@@ -1920,9 +1905,8 @@ vip_begin (synthetic_too, immediate, ind +@@ -1860,9 +1853,8 @@ vip_begin (synthetic_too, immediate, ind */ static void @@ -215,7 +146,7 @@ { /* How to bit-encode this opcode. */ struct vot_wot *vwP; -@@ -2147,7 +2131,7 @@ main () +@@ -2087,7 +2079,7 @@ main () * R4 * R5 * R6 @@ -224,7 +155,7 @@ * R8 * R9 * R10 -@@ -2160,18 +2144,18 @@ main () +@@ -2100,18 +2092,19 @@ main () */ #include "safe-ctype.h" @@ -236,6 +167,8 @@ -int /* return -1 or 0:15 */ -vax_reg_parse (c1, c2, c3, c4) /* 3 chars of register name */ - char c1, c2, c3, c4; /* c3 == 0 if 2-character reg name */ +-{ +- int retval; /* return -1:15 */ +#define AP 12 +#define FP 13 +#define SP 14 @@ -244,27 +177,25 @@ +/* Returns the register number of something like '%r15' or 'ap', supplied + in four single chars. Returns -1 if the register isn't recognized, + 0..15 otherwise. */ + +- retval = -1; +int +vax_reg_parse (char c1, char c2, char c3, char c4) - { -- int retval; /* return -1:15 */ -- -- retval = -1; -+ int retval = -1; ++{ ++ int retval = -1; /* return -1:15 */ #ifdef OBJ_ELF if (c1 != '%') /* register prefixes are mandatory for ELF */ -@@ -2232,7 +2216,8 @@ vax_reg_parse (c1, c2, c3, c4) /* 3 char +@@ -2172,7 +2165,7 @@ vax_reg_parse (c1, c2, c3, c4) /* 3 char retval = PC; else retval = -1; - return (retval); -+ + return retval; } /* -@@ -2255,7 +2240,7 @@ vax_reg_parse (c1, c2, c3, c4) /* 3 char +@@ -2195,7 +2188,7 @@ vax_reg_parse (c1, c2, c3, c4) /* 3 char */ /* @@ -273,7 +204,7 @@ * * Arg block. * -@@ -2387,9 +2372,7 @@ vip_metacharacters[256] = +@@ -2327,9 +2320,7 @@ vip_metacharacters[256] = static char vip_metacharacters[256]; static void @@ -284,7 +215,7 @@ { unsigned char t; -@@ -2399,10 +2382,9 @@ vip_op_1 (bit, syms) +@@ -2339,10 +2330,8 @@ vip_op_1 (bit, syms) /* Can be called any time. More arguments may appear in future. */ static void @@ -292,19 +223,19 @@ - const char *immediate; - const char *indirect; - const char *displen; -+vip_op_defaults (const char *immediate, -+ const char *indirect, ++vip_op_defaults (const char *immediate, const char *indirect, + const char *displen) { vip_op_1 (VIP_IMMEDIATE, immediate); vip_op_1 (VIP_INDIRECT, indirect); -@@ -2470,15 +2452,11 @@ vip_op_defaults (immediate, indirect, di +@@ -2410,15 +2399,12 @@ vip_op_defaults (immediate, indirect, di * Again, I dare not explain it: just trace ALL the code! */ +/* Dissect user-input 'optext' (which is something like "@B^foo@bar(AP)[FP]:") + using the vop in vopP. vopP's vop_access and vop_width. We fill _ndx, _reg, + _mode, _short, _warn, _error, _expr_begin, _expr_end and _nbytes. */ ++ static void -vip_op (optext, vopP) - /* user's input string e.g.: "@B^foo@bar(AP)[FP]:" */ @@ -318,7 +249,7 @@ { /* track operand text forward */ char *p; -@@ -3173,7 +3151,8 @@ char my_immediate[200]; +@@ -3113,7 +3099,8 @@ char my_immediate[200]; char my_indirect[200]; char my_displen[200]; @@ -328,7 +259,7 @@ { printf ("enter immediate symbols eg enter # "); gets (my_immediate); -@@ -3259,9 +3238,8 @@ main () +@@ -3199,9 +3186,8 @@ main () } } @@ -336,12 +267,12 @@ - char *text; - int value; +void -+mumble (char *text, int value) ++mumble (char *text, intvalue) { printf ("%s:", text); if (value >= 0) -@@ -3280,12 +3258,10 @@ int md_long_jump_size = 6; - const int md_reloc_size = 8; /* Size of relocation record */ +@@ -3219,12 +3205,10 @@ int md_short_jump_size = 3; + int md_long_jump_size = 6; void -md_create_short_jump (ptr, from_addr, to_addr, frag, to_symbol) @@ -357,7 +288,7 @@ { valueT offset; -@@ -3299,12 +3275,8 @@ md_create_short_jump (ptr, from_addr, to +@@ -3238,12 +3222,8 @@ md_create_short_jump (ptr, from_addr, to } void @@ -372,15 +303,15 @@ { valueT offset; -@@ -3325,16 +3297,14 @@ const char *md_shortopts = "d:STt:V"; +@@ -3264,16 +3244,14 @@ const char *md_shortopts = "d:STt:V"; struct option md_longopts[] = { #ifdef OBJ_ELF #define OPTION_PIC (OPTION_MD_BASE) - {"pic", no_argument, NULL, OPTION_PIC}, -+ { "pic", no_argument, NULL, OPTION_PIC }, ++ { "pic", no_argument, NULL, OPTION_PIC, }, #endif - {NULL, no_argument, NULL, 0} -+ { NULL, no_argument, NULL, 0 } ++ { NULL, no_argument, NULL, 0, }, }; size_t md_longopts_size = sizeof (md_longopts); @@ -392,7 +323,7 @@ { switch (c) { -@@ -3409,8 +3379,7 @@ md_parse_option (c, arg) +@@ -3348,8 +3326,7 @@ md_parse_option (c, arg) } void @@ -402,7 +333,7 @@ { fprintf (stream, _("\ VAX options:\n\ -@@ -3435,17 +3404,14 @@ VMS options:\n\ +@@ -3374,17 +3351,14 @@ VMS options:\n\ /* We have no need to default values of symbols. */ symbolS * @@ -422,7 +353,7 @@ { return size; /* Byte alignment is fine */ } -@@ -3454,8 +3420,7 @@ md_section_align (segment, size) +@@ -3393,16 +3367,13 @@ md_section_align (segment, size) On the vax, they're relative to the address of the offset, plus its size. */ long @@ -432,19 +363,7 @@ { return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address; } -@@ -3463,8 +3428,7 @@ md_pcrel_from (fixP) - #ifdef OBJ_AOUT - #ifndef BFD_ASSEMBLER - void --tc_headers_hook(headers) -- object_headers *headers; -+tc_headers_hook (object_headers *headers) - { - #ifdef TE_NetBSD - N_SET_INFO(headers->header, OMAGIC, M_VAX4K_NETBSD, 0); -@@ -3476,9 +3440,7 @@ tc_headers_hook(headers) - #ifdef BFD_ASSEMBLER arelent * -tc_gen_reloc (section, fixp) - asection *section ATTRIBUTE_UNUSED; |