This is the mail archive of the binutils-cvs@sourceware.org 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]

[binutils-gdb] bfd: Rename real_{ftell, fseek, fopen}


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c7c3d11bead272b718bade379e3441ff239bbd16

commit c7c3d11bead272b718bade379e3441ff239bbd16
Author: Pedro Alves <palves@redhat.com>
Date:   Fri Feb 17 01:26:12 2017 +0000

    bfd: Rename real_{ftell, fseek, fopen}
    
    Give these bfd-internal symbols with external linkage a _bfd_ prefix
    to avoid collisions in the global symbol namespace.
    
    bfd/ChangeLog:
    2017-02-17  Pedro Alves  <palves@redhat.com>
    
    	* bfdio.c (real_ftell): Rename to ...
    	(_bfd_real_ftell): ... this.
    	(real_fseek): Rename to ...
    	(_bfd_real_fseek): ... this.
    	(real_fopen): Rename to ...
    	(_bfd_real_fopen): ... this.
    	* libbfd-in.h (real_ftell): Rename to ...
    	(_bfd_real_ftell): ... this.
    	(real_fseek): Rename to ...
    	(_bfd_real_fseek): ... this.
    	(real_fopen): Rename to ...
    	(_bfd_real_fopen): ... this.
    	* cache.c, dwarf2.c, opncls.c: Adjust all callers.
    	* libbfd.h: Regenerate.

Diff:
---
 bfd/ChangeLog   | 17 +++++++++++++++++
 bfd/bfdio.c     |  6 +++---
 bfd/cache.c     | 17 +++++++++--------
 bfd/dwarf2.c    |  3 ++-
 bfd/libbfd-in.h |  6 +++---
 bfd/libbfd.h    |  6 +++---
 bfd/opncls.c    |  8 ++++----
 7 files changed, 41 insertions(+), 22 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 34c9bb4..9b416ab 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,22 @@
 2017-02-17  Pedro Alves  <palves@redhat.com>
 
+	* bfdio.c (real_ftell): Rename to ...
+	(_bfd_real_ftell): ... this.
+	(real_fseek): Rename to ...
+	(_bfd_real_fseek): ... this.
+	(real_fopen): Rename to ...
+	(_bfd_real_fopen): ... this.
+	* libbfd-in.h (real_ftell): Rename to ...
+	(_bfd_real_ftell): ... this.
+	(real_fseek): Rename to ...
+	(_bfd_real_fseek): ... this.
+	(real_fopen): Rename to ...
+	(_bfd_real_fopen): ... this.
+	* cache.c, dwarf2.c, opncls.c: Adjust all callers.
+	* libbfd.h: Regenerate.
+
+2017-02-17  Pedro Alves  <palves@redhat.com>
+
 	* dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
 	* libbfd.c (read_unsigned_leb128): Rename to ...
 	(_bfd_read_unsigned_leb128): ... this.
diff --git a/bfd/bfdio.c b/bfd/bfdio.c
index e73acdf..792ccda 100644
--- a/bfd/bfdio.c
+++ b/bfd/bfdio.c
@@ -41,7 +41,7 @@
 #endif
 
 file_ptr
-real_ftell (FILE *file)
+_bfd_real_ftell (FILE *file)
 {
 #if defined (HAVE_FTELLO64)
   return ftello64 (file);
@@ -53,7 +53,7 @@ real_ftell (FILE *file)
 }
 
 int
-real_fseek (FILE *file, file_ptr offset, int whence)
+_bfd_real_fseek (FILE *file, file_ptr offset, int whence)
 {
 #if defined (HAVE_FSEEKO64)
   return fseeko64 (file, offset, whence);
@@ -82,7 +82,7 @@ close_on_exec (FILE *file)
 }
 
 FILE *
-real_fopen (const char *filename, const char *modes)
+_bfd_real_fopen (const char *filename, const char *modes)
 {
 #ifdef VMS
   char *vms_attr;
diff --git a/bfd/cache.c b/bfd/cache.c
index 0f8a9d1..17bca8b 100644
--- a/bfd/cache.c
+++ b/bfd/cache.c
@@ -212,7 +212,7 @@ close_one (void)
       return TRUE;
     }
 
-  to_kill->where = real_ftell ((FILE *) to_kill->iostream);
+  to_kill->where = _bfd_real_ftell ((FILE *) to_kill->iostream);
 
   return bfd_cache_delete (to_kill);
 }
@@ -262,7 +262,8 @@ bfd_cache_lookup_worker (bfd *abfd, enum cache_flag flag)
   if (bfd_open_file (abfd) == NULL)
     ;
   else if (!(flag & CACHE_NO_SEEK)
-	   && real_fseek ((FILE *) abfd->iostream, abfd->where, SEEK_SET) != 0
+	   && _bfd_real_fseek ((FILE *) abfd->iostream,
+			       abfd->where, SEEK_SET) != 0
 	   && !(flag & CACHE_NO_SEEK_ERROR))
     bfd_set_error (bfd_error_system_call);
   else
@@ -280,7 +281,7 @@ cache_btell (struct bfd *abfd)
   FILE *f = bfd_cache_lookup (abfd, CACHE_NO_OPEN);
   if (f == NULL)
     return abfd->where;
-  return real_ftell (f);
+  return _bfd_real_ftell (f);
 }
 
 static int
@@ -289,7 +290,7 @@ cache_bseek (struct bfd *abfd, file_ptr offset, int whence)
   FILE *f = bfd_cache_lookup (abfd, whence != SEEK_CUR ? CACHE_NO_SEEK : CACHE_NORMAL);
   if (f == NULL)
     return -1;
-  return real_fseek (f, offset, whence);
+  return _bfd_real_fseek (f, offset, whence);
 }
 
 /* Note that archive entries don't have streams; they share their parent's.
@@ -609,15 +610,15 @@ bfd_open_file (bfd *abfd)
     {
     case read_direction:
     case no_direction:
-      abfd->iostream = real_fopen (abfd->filename, FOPEN_RB);
+      abfd->iostream = _bfd_real_fopen (abfd->filename, FOPEN_RB);
       break;
     case both_direction:
     case write_direction:
       if (abfd->opened_once)
 	{
-	  abfd->iostream = real_fopen (abfd->filename, FOPEN_RUB);
+	  abfd->iostream = _bfd_real_fopen (abfd->filename, FOPEN_RUB);
 	  if (abfd->iostream == NULL)
-	    abfd->iostream = real_fopen (abfd->filename, FOPEN_WUB);
+	    abfd->iostream = _bfd_real_fopen (abfd->filename, FOPEN_WUB);
 	}
       else
 	{
@@ -647,7 +648,7 @@ bfd_open_file (bfd *abfd)
 	  if (stat (abfd->filename, &s) == 0 && s.st_size != 0)
 	    unlink_if_ordinary (abfd->filename);
 #endif
-	  abfd->iostream = real_fopen (abfd->filename, FOPEN_WUB);
+	  abfd->iostream = _bfd_real_fopen (abfd->filename, FOPEN_WUB);
 	  abfd->opened_once = TRUE;
 	}
       break;
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 25a9ebc..722ee0d 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -906,7 +906,8 @@ read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash)
 
   abbrev_ptr = stash->dwarf_abbrev_buffer + offset;
   abbrev_end = stash->dwarf_abbrev_buffer + stash->dwarf_abbrev_size;
-  abbrev_number = safe_read_leb128 (abfd, abbrev_ptr, &bytes_read, FALSE, abbrev_end);
+  abbrev_number = _bfd_safe_read_leb128 (abfd, abbrev_ptr, &bytes_read,
+					 FALSE, abbrev_end);
   abbrev_ptr += bytes_read;
 
   /* Loop until we reach an abbrev number of 0.  */
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index 2776d62..99251e2 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -782,9 +782,9 @@ extern void _bfd_abort
 
 /* Manipulate a system FILE but using BFD's "file_ptr", rather than
    the system "off_t" or "off64_t", as the offset.  */
-extern file_ptr real_ftell (FILE *file);
-extern int real_fseek (FILE *file, file_ptr offset, int whence);
-extern FILE *real_fopen (const char *filename, const char *modes);
+extern file_ptr _bfd_real_ftell (FILE *file);
+extern int _bfd_real_fseek (FILE *file, file_ptr offset, int whence);
+extern FILE *_bfd_real_fopen (const char *filename, const char *modes);
 
 /* List of supported target vectors, and the default vector (if
    bfd_default_vector[0] is NULL, there is no default).  */
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 3ea747d..f19b0db 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -787,9 +787,9 @@ extern void _bfd_abort
 
 /* Manipulate a system FILE but using BFD's "file_ptr", rather than
    the system "off_t" or "off64_t", as the offset.  */
-extern file_ptr real_ftell (FILE *file);
-extern int real_fseek (FILE *file, file_ptr offset, int whence);
-extern FILE *real_fopen (const char *filename, const char *modes);
+extern file_ptr _bfd_real_ftell (FILE *file);
+extern int _bfd_real_fseek (FILE *file, file_ptr offset, int whence);
+extern FILE *_bfd_real_fopen (const char *filename, const char *modes);
 
 /* List of supported target vectors, and the default vector (if
    bfd_default_vector[0] is NULL, there is no default).  */
diff --git a/bfd/opncls.c b/bfd/opncls.c
index b4d4dcf..2ab7dfe 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -219,7 +219,7 @@ bfd_fopen (const char *filename, const char *target, const char *mode, int fd)
     nbfd->iostream = fdopen (fd, mode);
   else
 #endif
-    nbfd->iostream = real_fopen (filename, mode);
+    nbfd->iostream = _bfd_real_fopen (filename, mode);
   if (nbfd->iostream == NULL)
     {
       bfd_set_error (bfd_error_system_call);
@@ -1288,7 +1288,7 @@ separate_debug_file_exists (const char *name, const unsigned long crc)
 
   BFD_ASSERT (name);
 
-  f = real_fopen (name, FOPEN_RB);
+  f = _bfd_real_fopen (name, FOPEN_RB);
   if (f == NULL)
     return FALSE;
 
@@ -1321,7 +1321,7 @@ separate_alt_debug_file_exists (const char *name,
 
   BFD_ASSERT (name);
 
-  f = real_fopen (name, FOPEN_RB);
+  f = _bfd_real_fopen (name, FOPEN_RB);
   if (f == NULL)
     return FALSE;
 
@@ -1704,7 +1704,7 @@ bfd_fill_in_gnu_debuglink_section (bfd *abfd,
      .gnu_debuglink section, we insist upon the user providing us with a
      correct-for-section-creation-time path, but this need not conform to
      the gdb location algorithm.  */
-  handle = real_fopen (filename, FOPEN_RB);
+  handle = _bfd_real_fopen (filename, FOPEN_RB);
   if (handle == NULL)
     {
       bfd_set_error (bfd_error_system_call);


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