title: What does bazel alwayslink = true mean?
body: <p>I'm new to bazel. Here's the explanation in bazel doc:</p>
  
  <p><a href="https://docs.bazel.build/versions/master/be/c-cpp.html#cc_library.alwayslink" rel="nofollow noreferrer">https://docs.bazel.build/versions/master/be/c-cpp.html#cc_library.alwayslink</a></p>
  
  <blockquote>
    <p>alwayslink</p>
    
    <p>Boolean; optional; nonconfigurable; default is 0</p>
    
    <p>If 1, any binary that depends (directly or indirectly) on this C++
    library will link in all the object files for the files listed in
    srcs, even if some contain no symbols referenced by the binary. This
    is useful if your code isn't explicitly called by code in the binary,
    e.g., if your code registers to receive some callback provided by some
    service.</p>
  </blockquote>
  
  <p>I don't quite understand the last sentence: <code>e.g., if your code registers to receive some callback provided by some service.</code> Can anyone give and example? Thanks!</p>