diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d20e6e022e..60f7718fc4 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,16 @@ +2008-11-14 Tristan Gingold + + * configure.com: Handle bfd_default_target_size, BFD_HOST_LONG_LONG, + BFD_HOST_64BIT_LONG_LONG, BFD_HOSTPTR_T, bfd_file_ptr. + Generate bfdver.h. + * vms-hdr.c (_bfd_vms_write_hdr): Use strdup/free instead of alloca. + * hosts/alphavms.h: Defines macros to bypass i18n. + * makefile.vms (OBJS): Update file list. + (DEFS): Remove VMS_DEBUG, const, add DEBUGDIR. + (CFLAGS): Update flags. + * bfdio.c (real_fopen): Add code specific to VMS: extract attributes + from modes. + 2008-11-13 Joel Brobecker * configure.in: Deactivate large-file support on native 32bit @@ -16,10 +29,6 @@ PR 7023 * elf.c (bfd_section_from_shdr ): Fail on invalid sh_info. -2008-11-12 Tristan Gingold - - * bfd.c (bfd_get_sign_extend_vma): Return 0 for mach-o. - 2008-11-11 Alan Modra * elf.c (assign_file_positions_for_non_load_sections): Consolidate diff --git a/bfd/bfdio.c b/bfd/bfdio.c index cb06453e01..7cba51ff83 100644 --- a/bfd/bfdio.c +++ b/bfd/bfdio.c @@ -86,11 +86,37 @@ close_on_exec (FILE *file) FILE * real_fopen (const char *filename, const char *modes) { +#ifdef VMS + char vms_modes[4]; + char *vms_attr; + + /* On VMS, fopen allows file attributes as optionnal arguments. + We need to use them but we'd better to use the common prototype. + In fopen-vms.h, they are separated from the mode with a comma. + Split here. */ + vms_attr = strchr (modes, ','); + if (vms_attr == NULL) + { + /* No attributes. */ + return close_on_exec (fopen (filename, modes)); + } + else + { + /* Attribute found - rebuild modes. */ + size_t modes_len = vms_attr - modes; + + BFD_ASSERT (modes_len < sizeof (vms_modes)); + memcpy (vms_modes, modes, modes_len); + vms_modes[modes_len] = 0; + return close_on_exec (fopen (filename, vms_modes, vms_attr + 1)); + } +#else /* !VMS */ #if defined (HAVE_FOPEN64) return close_on_exec (fopen64 (filename, modes)); #else return close_on_exec (fopen (filename, modes)); #endif +#endif /* !VMS */ } /* diff --git a/bfd/configure.com b/bfd/configure.com index 929977ce8f..de44dfc25f 100644 --- a/bfd/configure.com +++ b/bfd/configure.com @@ -49,12 +49,30 @@ $DECK ERASE(match_pos); COPY_TEXT('64'); ENDIF; + match_pos := SEARCH_QUIETLY('@bfd_default_target_size@', FORWARD, EXACT, rang); + IF match_pos <> 0 THEN; + POSITION(BEGINNING_OF(match_pos)); + ERASE(match_pos); + COPY_TEXT('64'); + ENDIF; match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang); IF match_pos <> 0 THEN; POSITION(BEGINNING_OF(match_pos)); ERASE(match_pos); COPY_TEXT('0'); ENDIF; + match_pos := SEARCH_QUIETLY('@BFD_HOST_LONG_LONG@', FORWARD, EXACT, rang); + IF match_pos <> 0 THEN; + POSITION(BEGINNING_OF(match_pos)); + ERASE(match_pos); + COPY_TEXT('0'); + ENDIF; + match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG_LONG@', FORWARD, EXACT, rang); + IF match_pos <> 0 THEN; + POSITION(BEGINNING_OF(match_pos)); + ERASE(match_pos); + COPY_TEXT('0'); + ENDIF; match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang); IF match_pos <> 0 THEN; POSITION(BEGINNING_OF(match_pos)); @@ -75,6 +93,24 @@ $DECK ERASE(match_pos); COPY_TEXT('uint64'); ENDIF; + match_pos := SEARCH_QUIETLY('@BFD_HOSTPTR_T@', FORWARD, EXACT, rang); + IF match_pos <> 0 THEN; + POSITION(BEGINNING_OF(match_pos)); + ERASE(match_pos); + COPY_TEXT('uint64'); + ENDIF; + match_pos := SEARCH_QUIETLY('@bfd_file_ptr@', FORWARD, EXACT, rang); + IF match_pos <> 0 THEN; + POSITION(BEGINNING_OF(match_pos)); + ERASE(match_pos); + COPY_TEXT('bfd_signed_vma'); + ENDIF; + match_pos := SEARCH_QUIETLY('unsigned @bfd_file_ptr@ ufile_ptr', FORWARD, EXACT, rang); + IF match_pos <> 0 THEN; + POSITION(BEGINNING_OF(match_pos)); + ERASE(match_pos); + COPY_TEXT('bfd_vma ufile_ptr'); + ENDIF; WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file")); QUIT $ EOD @@ -152,6 +188,61 @@ $endif $ $ write sys$output "Generated `bfd.h' from `bfd-in2.h'." $! +$! create bfdver.h +$! +$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input - + []version.h /output=[]bfdver.h +$DECK +! +! Copy file, changing lines with macros (@@) +! +! + vfile := CREATE_BUFFER("vfile", "configure.in"); + rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile)); + match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang); + IF match_pos <> 0 THEN; + POSITION(BEGINNING_OF(match_pos)); + ERASE(match_pos); + vers := CURRENT_LINE-")"; + ELSE; + vers := "unknown"; + ENDIF; + versnum := vers - "." - "."; + + file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name")); + rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file)); + + match_pos := SEARCH_QUIETLY('@bfd_version@', FORWARD, EXACT, rang); + IF match_pos <> 0 THEN; + POSITION(BEGINNING_OF(match_pos)); + ERASE(match_pos); + COPY_TEXT(versnum); + ENDIF; + match_pos := SEARCH_QUIETLY('@bfd_version_string@', FORWARD, EXACT, rang); + IF match_pos <> 0 THEN; + POSITION(BEGINNING_OF(match_pos)); + ERASE(match_pos); + COPY_TEXT('"'); + COPY_TEXT(vers); + COPY_TEXT('"'); + ENDIF; + match_pos := SEARCH_QUIETLY('@bfd_version_package@', FORWARD, EXACT, rang); + IF match_pos <> 0 THEN; + POSITION(BEGINNING_OF(match_pos)); + ERASE(match_pos); + COPY_TEXT('"(GNU Binutils) "'); + ENDIF; + match_pos := SEARCH_QUIETLY('@report_bugs_to@', FORWARD, EXACT, rang); + IF match_pos <> 0 THEN; + POSITION(BEGINNING_OF(match_pos)); + ERASE(match_pos); + COPY_TEXT('""'); + ENDIF; + WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file")); + QUIT +$ EOD +$ write sys$output "Generated `bfdver.h' from 'version.h' and `configure.in'." +$! $! $! create targmatch.h $! @@ -210,6 +301,8 @@ $ create []config.h #define HAVE_TIME_H 1 /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Disable NLS */ +#undef ENABLE_NLS $! $ write sys$output "Generated `config.h'" diff --git a/bfd/hosts/alphavms.h b/bfd/hosts/alphavms.h index b2a85c2d87..0afda86e6f 100644 --- a/bfd/hosts/alphavms.h +++ b/bfd/hosts/alphavms.h @@ -34,6 +34,7 @@ #include #include "bfd.h" +#include "filenames.h" #ifndef BFD_HOST_64_BIT /* Make the basic types 64-bit quantities on the host. @@ -67,3 +68,12 @@ typedef BFD_HOST_64_BIT int64_type; #endif extern int getpagesize PARAMS ((void)); + +/* No intl. */ +#define gettext(Msgid) (Msgid) +#define dgettext(Domainname, Msgid) (Msgid) +#define dcgettext(Domainname, Msgid, Category) (Msgid) +#define textdomain(Domainname) while (0) /* nothing */ +#define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ +#define _(String) (String) +#define N_(String) (String) diff --git a/bfd/makefile.vms b/bfd/makefile.vms index ad6b1fff92..963441a62d 100644 --- a/bfd/makefile.vms +++ b/bfd/makefile.vms @@ -18,11 +18,12 @@ TARGETOBJS = cpu-vax.obj endif -OBJS=archive.obj,archures.obj,bfd.obj,cache.obj,coffgen.obj,corefile.obj,\ - format.obj,init.obj,libbfd.obj,opncls.obj,reloc.obj,section.obj,syms.obj,\ - targets.obj,hash.obj,linker.obj,elf.obj,srec.obj,binary.obj,tekhex.obj,\ - ihex.obj,stab-syms.obj,vms.obj,vms-hdr.obj,vms-gsd.obj,vms-tir.obj,\ - vms-misc.obj,$(TARGETOBJS) +OBJS=archive.obj,archive64.obj,archures.obj,bfd.obj,bfdio.obj,binary.obj,\ + cache.obj,coffgen.obj,compress.obj,corefile.obj,dwarf2.obj,elf.obj,\ + format.obj,hash.obj,ihex.obj,init.obj,libbfd.obj,linker.obj,opncls.obj,\ + reloc.obj,section.obj,simple.obj,srec.obj,stab-syms.obj,syms.obj,\ + targets.obj,tekhex.obj,\ + vms.obj,vms-hdr.obj,vms-gsd.obj,vms-tir.obj,vms-misc.obj,$(TARGETOBJS) ifeq ($(CC),gcc) ifeq ($(ARCH),ALPHA) @@ -30,18 +31,18 @@ DEFS=/define=(SELECT_VECS="&vms_alpha_vec",SELECT_ARCHITECTURES="&bfd_alpha_arch "HAVE_vms_alpha_vec=1") else DEFS=/define=(SELECT_VECS="&vms_vax_vec",SELECT_ARCHITECTURES="&bfd_vax_arch",\ -"HAVE_vms_vax_vec=1","VMS_DEBUG") +"HAVE_vms_vax_vec=1") endif CFLAGS=/include=([],[-.include])$(DEFS) else ifeq ($(ARCH),ALPHA) DEFS=/define=(SELECT_VECS="&vms_alpha_vec",SELECT_ARCHITECTURES="&bfd_alpha_arch",\ -"HAVE_vms_alpha_vec=1","unlink=remove","const=","VMS_DEBUG",) +"HAVE_vms_alpha_vec=1","unlink=remove","DEBUGDIR=NULL") else DEFS=/define=(SELECT_VECS="&vms_vax_vec",SELECT_ARCHITECTURES="&bfd_vax_arch",\ -"HAVE_vms_vax_vec=1","unlink=remove","const=","VMS_DEBUG") +"HAVE_vms_vax_vec=1","unlink=remove","const=") endif -CFLAGS=/noopt/debug/include=([],[-.include])$(DEFS)/warnings=disable=(missingreturn,implicitfunc,longextern) +CFLAGS=/noopt/debug/show=incl/name=(as_is,shortened)/include=([],[-.include])$(DEFS)/warnings=disable=(missingreturn,longextern) endif diff --git a/bfd/vms-hdr.c b/bfd/vms-hdr.c index 8e34beef3a..11e1af6010 100644 --- a/bfd/vms-hdr.c +++ b/bfd/vms-hdr.c @@ -212,8 +212,7 @@ _bfd_vms_write_hdr (bfd *abfd, int objtype) char *fname, *fout, *fptr; fptr = bfd_get_filename (abfd); - fname = alloca (strlen (fptr) + 1); - strcpy (fname, fptr); + fname = strdup (fptr); fout = strrchr (fname, ']'); if (fout == 0) fout = strchr (fname, ':'); @@ -238,6 +237,7 @@ _bfd_vms_write_hdr (bfd *abfd, int objtype) *fptr = 0; } _bfd_vms_output_counted (abfd, fout); + free (fname); } else _bfd_vms_output_counted (abfd, "NONAME"); diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 414fa46792..e36d5f4058 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2008-11-14 Tristan Gingold + + * configure.com: Get version from configure.in of bfd. + * makefile.vms-in (DEBUG_OBJS): Add dwarf.obj. + (CFLAGS): Update flags. + 2008-11-13 Hans-Peter Nilsson Alan Modra diff --git a/binutils/configure.com b/binutils/configure.com index 99463d5ecd..55c68791e4 100644 --- a/binutils/configure.com +++ b/binutils/configure.com @@ -53,9 +53,9 @@ $DECK ! ! Get VERSION from configure.in ! - mfile := CREATE_BUFFER("mfile", "CONFIGURE.IN"); + mfile := CREATE_BUFFER("mfile", "[-.bfd]CONFIGURE.IN"); rang := CREATE_RANGE(BEGINNING_OF(mfile), END_OF(mfile)); - match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(binutils, ', FORWARD, EXACT, rang); + match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang); IF match_pos <> 0 THEN; POSITION(BEGINNING_OF(match_pos)); ERASE(match_pos); diff --git a/binutils/makefile.vms-in b/binutils/makefile.vms-in index a809d1b13c..1b593f4060 100644 --- a/binutils/makefile.vms-in +++ b/binutils/makefile.vms-in @@ -22,7 +22,9 @@ DEFS=/define=("TARGET=$(TARGET)") LIBS=,gnu_cc_library:libgcc/lib,sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crt0.obj else CFLAGS=/noopt/debug/include=([],[-.include],[-.bfd])$(DEFS)\ -/warnings=disable=(missingreturn,implicitfunc,longextern) +/name=(as_is,shortened)\ +/warnings=disable=(missingreturn,longextern)\ +/prefix=(all,except=("getopt","optarg","optopt","optind","opterr")) DEFS=/define=("TARGET=$(TARGET)","const=","unlink=remove") LIBS=,sys$$library:vaxcrtl.olb/lib endif @@ -34,7 +36,7 @@ LIBIBERTY = [-.libiberty]libiberty.olb/lib OPCODES_DEP = [-.opcodes]libopcodes.olb OPCODES = [-.opcodes]libopcodes.olb/lib -DEBUG_OBJS = rddbg.obj,debug.obj,stabs.obj,ieee.obj,rdcoff.obj +DEBUG_OBJS = rddbg.obj,debug.obj,stabs.obj,ieee.obj,rdcoff.obj,dwarf.obj WRITE_DEBUG_OBJS = $(DEBUG_OBJS),wrstabs.obj diff --git a/include/ChangeLog b/include/ChangeLog index beb78b71f2..1348b13346 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,13 @@ +2008-11-14 Tristan Gingold + + * fopen-vms.h (FOPEN_RB): Use a single string to match the + standard prototype. + (FOPEN_WB): Ditto. + (FOPEN_AB): Ditto. + (FOPEN_RUB): Ditto. + (FOPEN_WUB): Ditto. + (FOPEN_AUB): Ditto. + 2008-10-21 Alan Modra * obstack.h (obstack_finish ): Cast result to void *. diff --git a/include/fopen-vms.h b/include/fopen-vms.h index da76b7fb59..dde22baaf5 100644 --- a/include/fopen-vms.h +++ b/include/fopen-vms.h @@ -9,12 +9,12 @@ the application unable to be configured for both "same" and "binary" variant systems. */ -#define FOPEN_RB "rb","rfm=var" -#define FOPEN_WB "wb","rfm=var" -#define FOPEN_AB "ab","rfm=var" -#define FOPEN_RUB "r+b","rfm=var" -#define FOPEN_WUB "w+b","rfm=var" -#define FOPEN_AUB "a+b","rfm=var" +#define FOPEN_RB "rb,rfm=var" +#define FOPEN_WB "wb,rfm=var" +#define FOPEN_AB "ab,rfm=var" +#define FOPEN_RUB "r+b,rfm=var" +#define FOPEN_WUB "w+b,rfm=var" +#define FOPEN_AUB "a+b,rfm=var" #define FOPEN_RT "r" #define FOPEN_WT "w" diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index fd9d300021..55ecb20600 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,10 @@ +2008-11-14 Tristan Gingold + + * makefile.vms (OBJS): Update objects list. + (CFLAGS): Update. + (libiberty.olb): Remove alloca-conf.h dependency. + * config.h-vms: Use new macro sets, use builtin alloca. + 2008-10-22 Daniel Jacobowitz * Makefile.in (CPPFLAGS): Define. diff --git a/libiberty/config.h-vms b/libiberty/config.h-vms index ccac6a2bcc..33e409d150 100644 --- a/libiberty/config.h-vms +++ b/libiberty/config.h-vms @@ -1,13 +1,8 @@ -#ifndef NEED_strerror -#define NEED_strerror -#endif -#ifndef NEED_basename -#define NEED_basename -#endif -#ifndef NEED_psignal -#define NEED_psignal -#endif -#ifndef NEED_on_exit -#define NEED_on_exit -#endif - +#define HAVE_SYS_STAT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_TIMES 1 +#include +#define C_alloca __ALLOCA diff --git a/libiberty/makefile.vms b/libiberty/makefile.vms index 6a7dd45718..39eac30de6 100644 --- a/libiberty/makefile.vms +++ b/libiberty/makefile.vms @@ -8,18 +8,21 @@ # OBJS=bcopy.obj,bcmp.obj,getopt.obj,obstack.obj,xexit.obj,xmalloc.obj,hex.obj,\ - getopt1.obj,cplus-dem.obj,strncasecmp.obj,strcasecmp.obj,strdup.obj,\ - concat.obj,getruntime.obj,getpagesize.obj,alloca.obj,xstrerror.obj,\ - xmemdup.obj,xstrdup.obj,xatexit.obj,choose-temp.obj,fnmatch.obj,objalloc.obj + getopt1.obj,cplus-dem.obj,cp-demangle.obj,cp-demint.obj,\ + asprintf.obj vasprintf.obj,mkstemps.obj,\ + concat.obj,getruntime.obj,getpagesize.obj,xstrerror.obj,\ + xmemdup.obj,xstrdup.obj,xatexit.obj,choose-temp.obj,fnmatch.obj,\ + objalloc.obj,safe-ctype.obj,hashtab.obj,lbasename.obj,argv.obj,\ + lrealpath.obj,make-temp-file.obj,unlink-if-ordinary.obj ifeq ($(CC),gcc) CFLAGS=/include=([],[-.include]) else # assume dec c -CFLAGS=/noopt/debug/include=([],[-.include])/define=("const=")/warnings=disable=(missingreturn,implicitfunc) +CFLAGS=/noopt/debug/include=([],[-.include])/warnings=disable=(missingreturn)/name=(as_is,shortened)/define=(HAVE_CONFIG_H=1)/prefix=(all,except=("getopt","optarg","optopt","optind","opterr")) endif -libiberty.olb: config.h alloca-conf.h $(OBJS) +libiberty.olb: config.h $(OBJS) purge lib/create libiberty *.obj diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 9c36338a19..ee6bd107bf 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2008-11-14 Tristan Gingold + + * makefile.vms (OBJS): Update list of objects. + (DEFS): Update + (CFLAGS): Update. + 2008-11-06 Chao-ying Fu * mips-opc.c (synciobdma, syncs, syncw, syncws): Move these diff --git a/opcodes/makefile.vms b/opcodes/makefile.vms index fc8704831e..6cd8ec2c47 100644 --- a/opcodes/makefile.vms +++ b/opcodes/makefile.vms @@ -6,8 +6,8 @@ # Created by Klaus K"ampf, kkaempf@progis.de # # -ifeq ($(ARCH),alpha) -OBJS=alpha-dis.obj,alpha-opc.obj,dis-buf.obj,disassemble.obj +ifeq ($(ARCH),ALPHA) +OBJS=alpha-dis.obj,alpha-opc.obj,dis-init.obj,dis-buf.obj,disassemble.obj FORMAT=OBJ_EVAX ARCHDEF="ARCH_alpha" else @@ -20,9 +20,9 @@ ifeq ($(CC),gcc) DEFS=/define=($(FORMAT)) CFLAGS=/include=([],[-.include],[-.bfd])$(DEFS) else -DEFS=/define=($(FORMAT),"const=") +DEFS=/define=($(FORMAT)) CFLAGS=/noopt/debug/include=([],[-.include],[-.bfd])$(DEFS)\ -/warnings=disable=(missingreturn,implicitfunc,longextern) +/name=(as_is,shortened)/warnings=disable=(missingreturn,longextern) endif libopcodes.olb: sysdep.h $(OBJS)