title: Invalid firmware using static libraries
body: <p>I'm working on <a href="https://github.com/platformio/platformio/issues/119" rel="nofollow">PlatformIO issue #119</a> and trying to build firmware for ESP8266 SoC and I have a strange problem.
  Could I ask you to help me understand what is the difference between linking project with a few object files and linking project with these object files which are archived in the static library (lib.a).</p>
  
  <p>For example:</p>
  
  <pre><code>&gt; ~/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-g++ -o .pioenvs/esp01_8266/firmware.elf -nostdlib -Wl,--no-check-section -u call_user_start -Wl,-static -T ~/.platformio/packages/ldscripts/script.ld .pioenvs/esp01_8266/src/piomain.o -L~/.platformio/packages/sdk-esp8266/lib -L.pioenvs/esp01_8266 -Wl,--start-group .pioenvs/esp01_8266/libESP8266WebServer.a .pioenvs/esp01_8266/libESP8266WiFi.a -lpp -lmain -lwpa -llwip -lnet80211 -lphy -lhal  -lgcc -lc -Wl,--end-group
  </code></pre>
  
  <p>If I replace ".pioenvs/esp01_8266/libESP8266WebServer.a " and ".pioenvs/esp01_8266/libESP8266WiFi.a" with the *.obj files, the firmware will be worked. </p>
  
  <pre><code>~/.platformio/packages/toolchain-xtensa/bin/xtensa-lx106-elf-g++ -o .pioenvs/esp01_8266/firmware.elf -nostdlib -Wl,--no-check-section -u call_user_start -Wl,-static -T ~/.platformio/packages/ldscripts/esp8266.ld .pioenvs/esp01_8266/src/piomain.o -L~/.platformio/packages/sdk-esp8266/lib -L.pioenvs/esp01_8266 -Wl,--start-group .pioenvs/esp01_8266/ESP8266WebServer/ESP8266WebServer.o .pioenvs/esp01_8266/ESP8266WiFi/ESP8266WiFi.o .pioenvs/esp01_8266/ESP8266WiFi/WiFiClient.o .pioenvs/esp01_8266/ESP8266WiFi/WiFiServer.o .pioenvs/esp01_8266/ESP8266WiFi/WiFiUdp.o  -lpp -lmain -lwpa -llwip -lnet80211 -lphy -lhal -lgcc -lc -Wl,--end-group
  </code></pre>
  
  <p>P.S: In both cases the firmware compiles good, without linker's errors. However, the only 2-nd approch (with *.objs instead lib.a) works on the device.</p>