please backport aarch64 -Bsymbolic-functions fix to trusty

Bug #1490352 reported by Michael Hudson-Doyle on 2015-08-31
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
binutils (Ubuntu)
Trusty
Undecided
Unassigned
binutils-arm64-cross (Ubuntu)
Trusty
Undecided
Unassigned

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.

description: updated
Matthias Klose (doko) on 2015-09-16
no longer affects: binutils-arm64-cross (Ubuntu)
no longer affects: binutils (Ubuntu)

Hello Michael, or anyone else affected,

Accepted binutils into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/binutils/2.24-5ubuntu14 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in binutils (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Michael Hudson-Doyle (mwhudson) wrote :

I have tested version 2.24-5ubuntu14 of binutils from trusty-proposed and confirmed that the bug has been fixed.

# dpkg -l binutils
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===============================-====================-====================-====================================================================
ii binutils 2.24-5ubuntu14 arm64 GNU assembler, linker and binary utilities

I have not yet tested the binutils-arm64-cross package as that is still in the unapproved queue.

tags: added: verification-done
removed: verification-needed
Brian Murray (brian-murray) wrote :

Hello Michael, or anyone else affected,

Accepted binutils-arm64-cross into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/binutils-arm64-cross/0.11.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in binutils-arm64-cross (Ubuntu Trusty):
status: New → Fix Committed
tags: removed: verification-done
tags: added: verification-needed
Michael Hudson-Doyle (mwhudson) wrote :

I have now verified the fix for the cross package too.

root@glamdring:/# dpkg -l binutils-aarch64-linux-gnu
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==========================-==================-==================-==========================================================
ii binutils-aarch64-linux-gnu 2.24-5ubuntu14cros amd64 GNU binary utilities, for aarch64-linux-gnu target

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package binutils - 2.24-5ubuntu14

---------------
binutils (2.24-5ubuntu14) trusty-proposed; urgency=medium

  * SRU: LP: #1490352.
  * Fix -Bsymbolic-functions on arm64.

 -- Michael Hudson-Doyle <email address hidden> Thu, 10 Sep 2015 22:22:45 +1200

Changed in binutils (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for binutils has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package binutils-arm64-cross - 0.11.2

---------------
binutils-arm64-cross (0.11.2) trusty-proposed; urgency=medium

  * SRU: LP: #1490352.
  * Build-depend on binutils-source (>= 2.24-5ubuntu14).

 -- Matthias Klose <email address hidden> Wed, 16 Sep 2015 16:22:45 +0200

Changed in binutils-arm64-cross (Ubuntu Trusty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers