rtld-elf - save/restore args fp regs as well (clang)
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 9 Nov 2014 21:27:54 +0000 (13:27 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 9 Nov 2014 21:27:54 +0000 (13:27 -0800)
commit9631883ec7333a05f8e824cb63b405893a1707ff
treea0704809d2fc53e6ce5744220726c2d35959e750
parent61b985c82beded4a9941a3b3d09c8f1acd83aa22
rtld-elf - save/restore args fp regs as well (clang)

* Note: this has no real effect on gcc based systems.

* fp registers %xmm0-7 can be used for arguments to procedures.  With
  GCC we didn't have to save/restore them for the rtld binder because
  rtld didn't use any FP registers and GCC did not insert any for
  structural copies.

  But CLANG does, so the binder has to save/restore these registers or
  dynamically linked calls which take FP arguments will explode on the
  first call.

* For example, A simple clang program to printf("%f", 1.0); a few times...
  the first output would be 0.0 instead of 1.0 due to the binder blowing
  away the procedure argument to dtoa().  The bug also blows up awk and
  dports and... well.

Reported-by: marino
libexec/rtld-elf/x86_64/rtld_start.S