please backport aarch64 -Bsymbolic-functions fix to trusty

Bug #1490352 reported by Michael Hudson-Doyle
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
binutils (Ubuntu)
Trusty
Fix Released
Undecided
Unassigned
binutils-arm64-cross (Ubuntu)
Trusty
Fix Released
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
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :
Matthias Klose (doko)
no longer affects: binutils-arm64-cross (Ubuntu)
no longer affects: binutils (Ubuntu)
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

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
Revision history for this message
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
Revision history for this message
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
Revision history for this message
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
Revision history for this message
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
Revision history for this message
Chris J Arges (arges) wrote : Update 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.

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.