[PATCH] D19024: ELF: Give automatically generated __start_* and __stop_* symbols hidden visibility.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 11:11:10 PDT 2016


pcc created this revision.
pcc added reviewers: rafael, ruiu.
pcc added a subscriber: llvm-commits.

These symbols describe a property of a linkage unit, so it seems reasonable
to limit their visibility to the linkage unit. Furthermore the use cases I
am aware of do not require more than hidden visibility.

This is a departure from the behavior of the bfd and gold linkers. However,
it is unclear that the decision to give these symbols default visibility
in those linkers was made deliberately. The __start_*/__stop_* feature
was added to the bfd linker in 1994 [1], while the visibility feature was
added about five years later [2], so it may have been that the visibility
of these symbols was not considered. The feature was implemented in gold
[3] in the same way; the behavior may have simply been copied from bfd.

The only related discussion I could find on the binutils mailing list [4]
was a user issue which would most likely not have occurred if the symbols
had hidden visibility.

[1] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=5efddb2e7c3229b569a862205f61d42860af678b
[2] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=0fc731e447cd01e7fc35197b487ff0e4fd25afca
[3] https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=bfd58944a64b0997a310b95fbe0423338961e71c
[4] https://sourceware.org/ml/binutils/2014-05/msg00011.html

http://reviews.llvm.org/D19024

Files:
  ELF/SymbolTable.cpp
  ELF/SymbolTable.h
  ELF/Writer.cpp
  test/ELF/startstop-shared.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19024.53433.patch
Type: text/x-patch
Size: 4588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160412/40dba91e/attachment.bin>


More information about the llvm-commits mailing list