diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 17 | ||||
-rw-r--r-- | bfd/bfdio.c | 26 | ||||
-rw-r--r-- | bfd/configure.com | 93 | ||||
-rw-r--r-- | bfd/hosts/alphavms.h | 10 | ||||
-rw-r--r-- | bfd/makefile.vms | 19 | ||||
-rw-r--r-- | bfd/vms-hdr.c | 4 |
6 files changed, 154 insertions, 15 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index d20e6e0..60f7718 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,16 @@ +2008-11-14 Tristan Gingold <gingold@adacore.com> + + * 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 <brobecker@adacore.com> * configure.in: Deactivate large-file support on native 32bit @@ -16,10 +29,6 @@ PR 7023 * elf.c (bfd_section_from_shdr <SHT_SYMTAB>): Fail on invalid sh_info. -2008-11-12 Tristan Gingold <gingold@adacore.com> - - * bfd.c (bfd_get_sign_extend_vma): Return 0 for mach-o. - 2008-11-11 Alan Modra <amodra@bigpond.net.au> * elf.c (assign_file_positions_for_non_load_sections): Consolidate diff --git a/bfd/bfdio.c b/bfd/bfdio.c index cb06453..7cba51f 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 929977c..de44dfc 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('"<http://www.sourceware.org/bugzilla/>"'); + 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 <unistd.h> 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 b2a85c2..0afda86 100644 --- a/bfd/hosts/alphavms.h +++ b/bfd/hosts/alphavms.h @@ -34,6 +34,7 @@ #include <time.h> #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 ad6b1ff..963441a 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 8e34bee..11e1af6 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"); |