[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/18646] New: function pointer values are still interposed with -B
From: |
michael.hudson at canonical dot com |
Subject: |
[Bug ld/18646] New: function pointer values are still interposed with -Bsymbolic-functions on ARM |
Date: |
Thu, 09 Jul 2015 00:54:16 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=18646
Bug ID: 18646
Summary: function pointer values are still interposed with
-Bsymbolic-functions on ARM
Product: binutils
Version: 2.26 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: michael.hudson at canonical dot com
Target Milestone: ---
Created attachment 8422
--> https://sourceware.org/bugzilla/attachment.cgi?id=8422&action=edit
fix ported from aarch64
If this code is in a shared library, linked with -Bsymbolic-functions ld.bfd on
arm (32):
#include <stdio.h>
#include "dep.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());
}
and this code is in a linked executable:
#include <stdio.h>
#include "dep/dep.h"
int interpos() {
return 1;
}
int main(int argc, char** argv) {
callinterpos();
printf("calling interpos via pointer says %d\n", getintfunc()());
}
then running the executable prints
calling interpos directly says 0
calling interpos via pointer says 1
when it should print 0 twice. Luckily for me, the isomorphic bug got fixed for
aarch64 recently in
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=0941db698eba22727c9a944b5da5c76ae93cc664
and the same fix (attached) fixes the problem for ARM too.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/18646] New: function pointer values are still interposed with -Bsymbolic-functions on ARM,
michael.hudson at canonical dot com <=