public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Rename a few internal symbols to avoid collisions
@ 2017-02-17  0:18 Pedro Alves
  2017-02-17  0:18 ` [PATCH 2/5] bfd: Rename real_{ftell, fseek, fopen} Pedro Alves
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Pedro Alves @ 2017-02-17  0:18 UTC (permalink / raw)
  To: binutils

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-17  2:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-17  0:18 [PATCH 0/5] Rename a few internal symbols to avoid collisions Pedro Alves
2017-02-17  0:18 ` [PATCH 2/5] bfd: Rename real_{ftell, fseek, fopen} Pedro Alves
2017-02-17  0:18 ` [PATCH 1/5] bfd: Rename read_{signed,unsigned}_leb128, safe_read_leb128 Pedro Alves
2017-02-17  0:18 ` [PATCH 3/5] bfd: Rename warn_deprecated Pedro Alves
2017-02-17  0:24 ` [PATCH 5/5] bfd: Rename Chunk and S3Forced Pedro Alves
2017-02-17  0:24 ` [PATCH 4/5] bfd: Rename bsd_write_armap and coff_write_armap Pedro Alves
2017-02-17  1:06 ` [PATCH 0/5] Rename a few internal symbols to avoid collisions Alan Modra
2017-02-17  2:16   ` Pedro Alves
2017-02-17  2:30     ` Pedro Alves
2017-02-17  2:53       ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).