← Back to team overview

touch-packages team mailing list archive

[Bug 1490352] Re: please backport aarch64 -Bsymbolic-functions fix to trusty

 

** Also affects: binutils-arm64-cross (Ubuntu)
   Importance: Undecided
       Status: New

** No longer affects: binutils-arm64-cross (Ubuntu)

** No longer affects: binutils (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to binutils in Ubuntu.
https://bugs.launchpad.net/bugs/1490352

Title:
  please backport aarch64 -Bsymbolic-functions fix to trusty

Status in binutils source package in Trusty:
  New
Status in binutils-arm64-cross source package in Trusty:
  New

Bug description:
  There is a bug in the version ld.bfd in trusty on arm64, where even if
  you pass -Bsymbolic-functions to ld, function pointer values are still
  subject to interposition by other shared objects. This was fixed and
  backported to the binutils-2_24 branch in January 2015.

  [Impact]
  Shared libraries for Go depend on -Bsymbolic-functions working
  properly and while it's unlikely that we'll ever support a version of
  Go on trusty that supports shared libraries, the arm64 builders for
  Go's build dashboard are trusty machines and so I can't run the shared
  library tests by default until this is fixed in trusty.

  It's also extremely confusing to debug the problems this causes.

  The bug existed on 32-bit ARM too, but there is a workaround: use gold
  instead (which does not have this bug). That doesn't apply to arm64 as
  there is no arm64 gold in trusty.

  [Test Case]

  $ cat shared.h
  typedef int (*intfunc)(void);
  int interpos(void);
  intfunc getintfunc(void);
  $ cat shared.c
  #include <stdio.h>
  #include "shared.h"

  int interpos(void) {
          return 0;
  }

  intfunc intfuncs[] = { interpos };

  intfunc
  getintfunc(void) {
          return intfuncs[0];
  }

  void
  callinterpos(void) {
          printf("calling interpos directly says %d\n", interpos());
  }
  $ cat main.c
  #include <stdio.h>
  #include "shared.h"

  int interpos(void) {
          return 1;
  }

  int main(int argc, char** argv) {
          callinterpos();
          printf("calling interpos via pointer says %d\n", getintfunc()());
  }

  $ gcc -shared -Wl,-Bsymbolic-functions -o libshared.so shared.c
  $ gcc -o main main.c ./libshared.so
  $ ./main
  calling interpos directly says 0
  calling interpos via pointer says 1

  The two values printed should be the same.

  [Regression Potential]
  It is ever so slightly possible that some package depends on the
  broken behaviour, but that seems pretty unlikely given that this
  behaviour does not occur on intel platforms.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/trusty/+source/binutils/+bug/1490352/+subscriptions


References