bfd: Rename real_{ftell, fseek, fopen}
authorPedro Alves <palves@redhat.com>
Fri, 17 Feb 2017 01:26:12 +0000 (01:26 +0000)
committerPedro Alves <palves@redhat.com>
Fri, 17 Feb 2017 01:26:12 +0000 (01:26 +0000)
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.

bfd/ChangeLog
bfd/bfdio.c
bfd/cache.c
bfd/dwarf2.c
bfd/libbfd-in.h
bfd/libbfd.h
bfd/opncls.c

index 34c9bb49e84d891b4feeb6e0e527913afb00c3aa..9b416ab4e34c37d0d26358ff60fed55cd2070e56 100644 (file)
@@ -1,3 +1,20 @@
+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.
index e73acdf612972e0bf768b4dd21e38dd7331c46ed..792ccdab923a98328f08e41a588190136213502c 100644 (file)
@@ -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;
index 0f8a9d1bef92662730c4b67f80b4041181cb932c..17bca8ba85deaa0a6022ec1e7cf3258fd1c3c8f2 100644 (file)
@@ -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;
index 25a9ebce7374428c6dce5ecf1bdbcbe8e524dbb8..722ee0d9f5501e9c75a7c84b993a5cd8d1cd62b7 100644 (file)
@@ -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.  */
index 2776d6270004366a41fb0b9380bb5dcbc44a5780..99251e246352ed17575dac7e030307f297f6a1ed 100644 (file)
@@ -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).  */
index 3ea747d2be300f533728faf5e7b6afda54eeffb0..f19b0db7ff8ea74d4fa193309a9ff0a257e3b97b 100644 (file)
@@ -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).  */
index b4d4dcf64643145e71e70dba29cd8208c945ddec..2ab7dfec9c856cabb10d94937272b9402585436b 100644 (file)
@@ -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);
This page took 0.033043 seconds and 4 git commands to generate.