title: C++ objcopy to make class method weak
body: <p>I have this header file:</p>
  <h3>weather.h</h3>
  <pre><code>#ifndef _WEATHER_H_
  #define _WEATHER_H_
  
  #include &lt;string&gt;
  using namespace std;
  
  class Weather {
      private:
          int temp;
      
      public:
          Weather();
          string announce();
  };
  
  #endif
  </code></pre>
  <p>When I compile the related source file, I want to make announce and Weather (the default constructor) weak during compile time.</p>
  <p>To do so, the flow looks something like:</p>
  <pre><code>g++ -std=c++11 -g -Wall -c weather.cpp
  objcopy --weaken-symbol=announce --weaken-symbol=Weather weather.o weather.o
  </code></pre>
  <p>However, when I then compile another version of weather without the weakening? I still get a duplicate symbol error.</p>
  <p>I know --weaken exists, but this is just a sample and I do not want to blanket weaken every method in the class.</p>