This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rfa] Enable 64-bit file_ptr


Hello,

This patch [finally] enables 64-bit file_ptr (aka off_t). If nothing else it lets GDB manipulate i386 core files larger than 2gb.

I've tested this on:

i386 Fedora Core 1:
little-endian, 32-bit bfd_vma, 64-bit file_ptr, ftello64

ia64 RHEL 3u1:
little-endian, 64-bit bfd_vma, 64-bit file_ptr, ftello64

amd64 RHEL 3u1:
little-endian, 64-bit bfd_vma, 64-bit file_ptr, ftello64

PPC NetBSD 1.6:
big-endian, 32-bit bfd_vma, 64-bit file_ptr, ftello

with "no regressions" (amd64 had a few pre-existing failures).

ok?
Andrew
2004-02-13  Andrew Cagney  <cagney@redhat.com>

	* bfd-in.h (file_ptr, ufile_ptr): Configure type using
	@bfd_file_ptr@.
	* bfd-in2.h: Re-generate.
	
Index: bfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in.h,v
retrieving revision 1.71
diff -u -r1.71 bfd-in.h
--- bfd-in.h	11 Feb 2004 23:23:20 -0000	1.71
+++ bfd-in.h	13 Feb 2004 15:56:21 -0000
@@ -160,16 +160,10 @@
 
 #endif /* not BFD64  */
 
-/* A pointer to a position in a file.  */
-/* FIXME:  This should be using off_t from <sys/types.h>.
-   For now, try to avoid breaking stuff by not including <sys/types.h> here.
-   This will break on systems with 64-bit file offsets (e.g. 4.4BSD).
-   Probably the best long-term answer is to avoid using file_ptr AND off_t
-   in this header file, and to handle this in the BFD implementation
-   rather than in its interface.  */
-/* typedef off_t	file_ptr; */
-typedef bfd_signed_vma file_ptr;
-typedef bfd_vma ufile_ptr;
+/* An offset into a file.  BFD always uses the largest possible offset
+   based on the build time availability of fseek, fseeko, or fseeko64.  */
+typedef @bfd_file_ptr@ file_ptr;
+typedef unsigned @bfd_file_ptr@ ufile_ptr;
 
 extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
 extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]