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

[PATCH 0/5] Rename a few internal symbols to avoid collisions


Jan ran into a global symbol name conflict between GDB and BFD here:
  https://sourceware.org/ml/gdb-patches/2017-02/msg00299.html

The BFD symbols in question are not part of the BFD API, however they
need to have external linkage.  Given that BFD is a library, I think
that it's BFD that should be a bit more careful in the name of symbols
it exports.  I.e., to avoid naming conflicts with projects that use
BFD, these symbols should have names in BFD's "internal namespace",
i.e,. they should have a "_bfd_" prefix.

Playing with:
 $ nm -A libbfd.a | grep " T " | grep -v " bfd" | grep -v " _bfd"
 $ nm -A libbfd.a | grep " B " | grep -v " bfd" | grep -v " _bfd"
 $ nm -A libbfd.a | grep " D " | grep -v " bfd" | grep -v " _bfd"

I noticed quite a few others that need similar treatment.  This series
fixes a few easy glaring ones, though there's a lot more that could be
done [which I don't really plan on doing].

OK?

Pedro Alves (5):
  bfd: Rename read_{signed,unsigned}_leb128, safe_read_leb128
  bfd: Rename real_{ftell, fseek, fopen}
  bfd: Rename warn_deprecated
  bfd: Rename bsd_write_armap and coff_write_armap
  bfd: Rename Chunk and S3Forced

 bfd/aout-target.h  |  2 +-
 bfd/aout-tic30.c   |  2 +-
 bfd/archive.c      | 20 ++++++------
 bfd/bfd-in.h       | 10 +++---
 bfd/bfd-in2.h      | 10 +++---
 bfd/bfdio.c        |  6 ++--
 bfd/cache.c        | 17 ++++++-----
 bfd/dwarf2.c       | 90 +++++++++++++++++++++++++++++++++++-------------------
 bfd/elf-attrs.c    |  8 ++---
 bfd/elf32-nds32.c  |  4 +--
 bfd/libbfd-in.h    | 24 +++++++--------
 bfd/libbfd.c       | 30 +++++++++---------
 bfd/libbfd.h       | 24 +++++++--------
 bfd/opncls.c       |  8 ++---
 bfd/srec.c         | 22 ++++++-------
 binutils/objcopy.c | 12 ++++----
 16 files changed, 159 insertions(+), 130 deletions(-)

-- 
2.5.5


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