Index: bfd/coffcode.h =================================================================== RCS file: /cvs/src/src/bfd/coffcode.h,v retrieving revision 1.136 diff -b -u -r1.136 coffcode.h --- bfd/coffcode.h 26 Mar 2007 12:22:59 -0000 1.136 +++ bfd/coffcode.h 10 Apr 2007 15:48:23 -0000 @@ -4380,7 +4380,7 @@ dst->symbol.name = (char *) (src->u.syment._n._n_n._n_offset); /* We use the native name field to point to the cached field. */ - src->u.syment._n._n_n._n_zeroes = (long) dst; + src->u.syment._n._n_n._n_zeroes = (bfd_vma) dst; dst->symbol.section = coff_section_from_bfd_index (abfd, src->u.syment.n_scnum); dst->symbol.flags = 0; Index: bfd/coffgen.c =================================================================== RCS file: /cvs/src/src/bfd/coffgen.c,v retrieving revision 1.56 diff -b -u -r1.56 coffgen.c --- bfd/coffgen.c 2 Apr 2007 16:51:13 -0000 1.56 +++ bfd/coffgen.c 10 Apr 2007 15:48:24 -0000 @@ -726,7 +726,7 @@ /* FIXME: We should use a union here. */ s->u.syment.n_value = (bfd_vma)((combined_entry_type *) - ((unsigned long) s->u.syment.n_value))->offset; + ((bfd_vma) s->u.syment.n_value))->offset; s->fix_value = 0; } if (s->fix_line) @@ -1640,7 +1640,7 @@ } internal_ptr->u.syment._n._n_n._n_offset = - ((long) + ((bfd_vma) (string_table + (internal_ptr + 1)->u.auxent.x_file.x_n.x_offset)); } @@ -1652,13 +1652,13 @@ if (internal_ptr->u.syment.n_numaux > 1 && coff_data (abfd)->pe) internal_ptr->u.syment._n._n_n._n_offset = - ((long) + ((bfd_vma) copy_name (abfd, (internal_ptr + 1)->u.auxent.x_file.x_fname, internal_ptr->u.syment.n_numaux * symesz)); else internal_ptr->u.syment._n._n_n._n_offset = - ((long) + ((bfd_vma) copy_name (abfd, (internal_ptr + 1)->u.auxent.x_file.x_fname, (size_t) bfd_coff_filnmlen (abfd))); @@ -1682,11 +1682,11 @@ if (newstring == NULL) return NULL; strncpy (newstring, internal_ptr->u.syment._n._n_name, i); - internal_ptr->u.syment._n._n_n._n_offset = (long int) newstring; + internal_ptr->u.syment._n._n_n._n_offset = (bfd_vma) newstring; internal_ptr->u.syment._n._n_n._n_zeroes = 0; } else if (internal_ptr->u.syment._n._n_n._n_offset == 0) - internal_ptr->u.syment._n._n_n._n_offset = (long int) ""; + internal_ptr->u.syment._n._n_n._n_offset = (bfd_vma) ""; else if (!bfd_coff_symname_in_debug (abfd, &internal_ptr->u.syment)) { /* Long name already. Point symbol at the string in the @@ -1698,7 +1698,7 @@ return NULL; } internal_ptr->u.syment._n._n_n._n_offset = - ((long int) + ((bfd_vma) (string_table + internal_ptr->u.syment._n._n_n._n_offset)); } @@ -1707,7 +1707,7 @@ /* Long name in debug section. Very similar. */ if (debug_section == NULL) debug_section = build_debug_section (abfd); - internal_ptr->u.syment._n._n_n._n_offset = (long int) + internal_ptr->u.syment._n._n_n._n_offset = (bfd_vma) (debug_section + internal_ptr->u.syment._n._n_n._n_offset); } } @@ -1784,7 +1784,7 @@ if (coffsymbol (symbol)->native != NULL && coffsymbol (symbol)->native->fix_value) ret->value = coffsymbol (symbol)->native->u.syment.n_value - - (unsigned long) obj_raw_syments (abfd); + (bfd_vma) obj_raw_syments (abfd); } /* Return the COFF syment for a symbol. */ @@ -1807,7 +1807,7 @@ if (csym->native->fix_value) psyment->n_value = psyment->n_value - - (unsigned long) obj_raw_syments (abfd); + (bfd_vma) obj_raw_syments (abfd); /* FIXME: We should handle fix_line here. */ @@ -1893,7 +1893,7 @@ if (! combined->fix_value) val = (bfd_vma) combined->u.syment.n_value; else - val = combined->u.syment.n_value - (unsigned long) root; + val = combined->u.syment.n_value - (bfd_vma) root; fprintf (file, "(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) 0x", combined->u.syment.n_scnum, Index: bfd/elf-eh-frame.c =================================================================== RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v retrieving revision 1.54 diff -b -u -r1.54 elf-eh-frame.c --- bfd/elf-eh-frame.c 4 Jan 2007 13:30:39 -0000 1.54 +++ bfd/elf-eh-frame.c 10 Apr 2007 15:48:25 -0000 @@ -917,7 +917,7 @@ { if (!ent->cie) { - ecie = ecies + (unsigned long) ent->cie_inf; + ecie = ecies + (bfd_vma) ent->cie_inf; ent->cie_inf = ecie->cie.cie_inf; } ent->new_offset = offset; Index: bfd/peicode.h =================================================================== RCS file: /cvs/src/src/bfd/peicode.h,v retrieving revision 1.50 diff -b -u -r1.50 peicode.h --- bfd/peicode.h 20 Sep 2006 11:35:07 -0000 1.50 +++ bfd/peicode.h 10 Apr 2007 15:48:26 -0000 @@ -565,7 +565,7 @@ /* Initialise the internal symbol structure. */ ent->u.syment.n_sclass = sclass; ent->u.syment.n_scnum = section->target_index; - ent->u.syment._n._n_n._n_offset = (long) sym; + ent->u.syment._n._n_n._n_offset = (bfd_vma) sym; sym->symbol.the_bfd = vars->abfd; sym->symbol.name = vars->string_ptr; Index: binutils/resres.c =================================================================== RCS file: /cvs/src/src/binutils/resres.c,v retrieving revision 1.7 diff -b -u -r1.7 resres.c --- binutils/resres.c 16 Jun 2005 09:18:19 -0000 1.7 +++ binutils/resres.c 10 Apr 2007 15:48:27 -0000 @@ -475,7 +475,7 @@ else /* named id */ { - if (fseek (fres, -sizeof (ord), SEEK_CUR) != 0) + if (fseek (fres, - ((long) sizeof (ord)), SEEK_CUR) != 0) fatal ("%s: %s: could not seek in file", program_name, filename); id_s = read_unistring (&len); id->named = 1; Index: gas/symbols.c =================================================================== RCS file: /cvs/src/src/gas/symbols.c,v retrieving revision 1.83 diff -b -u -r1.83 symbols.c --- gas/symbols.c 15 Mar 2007 12:11:49 -0000 1.83 +++ gas/symbols.c 10 Apr 2007 15:48:29 -0000 @@ -2728,14 +2728,20 @@ const char *name = S_GET_NAME (sym); if (!name || !name[0]) name = "(unnamed)"; - fprintf (file, "sym %lx %s", (unsigned long) sym, name); + + fprintf (file, "sym "); + fprintf_vma (file, (bfd_vma) sym); + fprintf (file, " %s", name); if (LOCAL_SYMBOL_CHECK (sym)) { struct local_symbol *locsym = (struct local_symbol *) sym; if (local_symbol_get_frag (locsym) != &zero_address_frag && local_symbol_get_frag (locsym) != NULL) - fprintf (file, " frag %lx", (long) local_symbol_get_frag (locsym)); + { + fprintf (file, " frag "); + fprintf_vma (file, (bfd_vma) local_symbol_get_frag (locsym)); + } if (local_symbol_resolved_p (locsym)) fprintf (file, " resolved"); fprintf (file, " local"); @@ -2743,7 +2749,10 @@ else { if (sym->sy_frag != &zero_address_frag) - fprintf (file, " frag %lx", (long) sym->sy_frag); + { + fprintf (file, " frag "); + fprintf_vma (file, (bfd_vma) sym->sy_frag); + } if (sym->written) fprintf (file, " written"); if (sym->sy_resolved) @@ -2817,7 +2826,9 @@ void print_expr_1 (FILE *file, expressionS *exp) { - fprintf (file, "expr %lx ", (long) exp); + fprintf (file, "expr "); + fprintf_vma (file,(bfd_vma) exp); + fprintf (file, " "); switch (exp->X_op) { case O_illegal: Index: gas/write.c =================================================================== RCS file: /cvs/src/src/gas/write.c,v retrieving revision 1.112 diff -b -u -r1.112 write.c --- gas/write.c 26 Mar 2007 12:23:48 -0000 1.112 +++ gas/write.c 10 Apr 2007 15:48:31 -0000 @@ -2486,7 +2486,9 @@ print_fixup (fixS *fixp) { indent_level = 1; - fprintf (stderr, "fix %lx %s:%d", (long) fixp, fixp->fx_file, fixp->fx_line); + fprintf (stderr, "fix "); + fprintf_vma (stderr, (bfd_vma) fixp); + fprintf (stderr, " %s:%d", fixp->fx_file, fixp->fx_line); if (fixp->fx_pcrel) fprintf (stderr, " pcrel"); if (fixp->fx_pcrel_adjust) @@ -2503,8 +2505,11 @@ fprintf (stderr, " tcbit"); if (fixp->fx_done) fprintf (stderr, " done"); - fprintf (stderr, "\n size=%d frag=%lx where=%ld offset=%lx addnumber=%lx", - fixp->fx_size, (long) fixp->fx_frag, (long) fixp->fx_where, + fprintf (stderr, "\n size=%d frag=", + fixp->fx_size); + fprintf_vma (stderr, (bfd_vma) fixp->fx_frag); + fprintf (stderr, " where=%ld offset=%lx addnumber=%lx", + (long) fixp->fx_where, (long) fixp->fx_offset, (long) fixp->fx_addnumber); fprintf (stderr, "\n %s (%d)", bfd_get_reloc_code_name (fixp->fx_r_type), fixp->fx_r_type); Index: gprof/cg_print.c =================================================================== RCS file: /cvs/src/src/gprof/cg_print.c,v retrieving revision 1.12 diff -b -u -r1.12 cg_print.c --- gprof/cg_print.c 9 May 2005 06:55:24 -0000 1.12 +++ gprof/cg_print.c 10 Apr 2007 15:48:40 -0000 @@ -76,7 +76,7 @@ } printf (_("\ngranularity: each sample hit covers %ld byte(s)"), - (long) hist_scale * sizeof (UNIT)); + (long) hist_scale * (long) sizeof (UNIT)); if (print_time > 0.0) printf (_(" for %.2f%% of %.2f seconds\n\n"), Index: gprof/hist.c =================================================================== RCS file: /cvs/src/src/gprof/hist.c,v retrieving revision 1.17 diff -b -u -r1.17 hist.c --- gprof/hist.c 10 Apr 2007 08:47:50 -0000 1.17 +++ gprof/hist.c 10 Apr 2007 15:48:40 -0000 @@ -464,7 +464,7 @@ if (bsd_style_output) { printf (_("\ngranularity: each sample hit covers %ld byte(s)"), - (long) hist_scale * sizeof (UNIT)); + (long) hist_scale * (long) sizeof (UNIT)); if (total_time > 0.0) { printf (_(" for %.2f%% of %.2f %s\n\n"), Index: include/splay-tree.h =================================================================== RCS file: /cvs/src/src/include/splay-tree.h,v retrieving revision 1.13 diff -b -u -r1.13 splay-tree.h --- include/splay-tree.h 10 May 2005 10:21:08 -0000 1.13 +++ include/splay-tree.h 10 Apr 2007 15:48:40 -0000 @@ -36,6 +36,14 @@ #include "ansidecl.h" +#ifndef _WIN64 + typedef unsigned long int libi_uhostptr_t; + typedef long int libi_shostptr_t; +#else + typedef unsigned long long libi_uhostptr_t; + typedef long long libi_shostptr_t; +#endif + #ifndef GTY #define GTY(X) #endif @@ -44,8 +52,8 @@ these types, if necessary. These types should be sufficiently wide that any pointer or scalar can be cast to these types, and then cast back, without loss of precision. */ -typedef unsigned long int splay_tree_key; -typedef unsigned long int splay_tree_value; +typedef libi_uhostptr_t splay_tree_key; +typedef libi_uhostptr_t splay_tree_value; /* Forward declaration for a node in the tree. */ typedef struct splay_tree_node_s *splay_tree_node; Index: include/coff/internal.h =================================================================== RCS file: /cvs/src/src/include/coff/internal.h,v retrieving revision 1.21 diff -b -u -r1.21 internal.h --- include/coff/internal.h 19 Mar 2007 23:06:06 -0000 1.21 +++ include/coff/internal.h 10 Apr 2007 15:48:40 -0000 @@ -419,8 +419,8 @@ char _n_name[SYMNMLEN]; /* old COFF version */ struct { - long _n_zeroes; /* new == 0 */ - long _n_offset; /* offset into string table */ + bfd_vma _n_zeroes; /* new == 0 */ + bfd_vma _n_offset; /* offset into string table */ } _n_n; char *_n_nptr[2]; /* allows for overlaying */ } _n; Index: libiberty/strerror.c =================================================================== RCS file: /cvs/src/src/libiberty/strerror.c,v retrieving revision 1.12 diff -b -u -r1.12 strerror.c --- libiberty/strerror.c 28 Mar 2005 02:09:01 -0000 1.12 +++ libiberty/strerror.c 10 Apr 2007 15:48:44 -0000 @@ -469,6 +469,9 @@ #else +#undef sys_nerr +#undef sys_errlist + extern int sys_nerr; extern char *sys_errlist[]; =