aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2019-10-12 19:40:42 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2019-10-12 19:40:42 +0000
commit1aea083d4bfb7538499eae0271dae740e7efa240 (patch)
tree39ff8dc8ba1508da8f1405a29fec27ecbc7a579d
parenta0f08eceae9af418c25c7cca7cb5fa67f0ff5037 (diff)
downloadgcc-1aea083d4bfb7538499eae0271dae740e7efa240.zip
gcc-1aea083d4bfb7538499eae0271dae740e7efa240.tar.gz
gcc-1aea083d4bfb7538499eae0271dae740e7efa240.tar.bz2
lib2funcs.S (__gcc_plt_call): Load branch target to %r21.
* config/pa/lib2funcs.S (__gcc_plt_call): Load branch target to %r21. Load PIC register after branch target. Fix white space. * config/pa/milli64.S ($$dyncall): Separate LINUX and non LINUX implementations. Load PIC register after branch target. Don't clobber function pointer when it points to function descriptor. Use nullification instead of branch in LINUX implementation. From-SVN: r276925
-rw-r--r--libgcc/ChangeLog9
-rw-r--r--libgcc/config/pa/lib2funcs.S12
-rw-r--r--libgcc/config/pa/milli64.S23
3 files changed, 30 insertions, 14 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 815118d..4d2a32c 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,12 @@
+2019-10-12 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/lib2funcs.S (__gcc_plt_call): Load branch target to %r21.
+ Load PIC register after branch target. Fix white space.
+ * config/pa/milli64.S ($$dyncall): Separate LINUX and non LINUX
+ implementations. Load PIC register after branch target. Don't
+ clobber function pointer when it points to function descriptor.
+ Use nullification instead of branch in LINUX implementation.
+
2019-10-03 John David Anglin <danglin@gcc.gnu.org>
* config/pa/fptr.c: Disable -Warray-bounds warning.
diff --git a/libgcc/config/pa/lib2funcs.S b/libgcc/config/pa/lib2funcs.S
index b401b61..a2db5b3 100644
--- a/libgcc/config/pa/lib2funcs.S
+++ b/libgcc/config/pa/lib2funcs.S
@@ -55,13 +55,13 @@ __gcc_plt_call
; An inline version of dyncall so we don't have to worry
; about long calls to millicode, PIC and other complexities.
bb,>=,n %r22,30,L$foo
- depi 0,31,2,%r22
- ldw 4(%r22),%r19
- ldw 0(%r22),%r22
+ depi 0,31,2,%r22
+ ldw 0(%r22),%r21
+ ldw 4(%r22),%r19
L$foo
- ldsid (%r22),%r1
- mtsp %r1,%sr0
- ble 0(%sr0,%r22)
+ ldsid (%r21),%r1
+ mtsp %r1,%sr0
+ ble 0(%sr0,%r21)
copy %r31,%r2
ldw -8(%r30),%r2
diff --git a/libgcc/config/pa/milli64.S b/libgcc/config/pa/milli64.S
index 1e46f50..36040e9 100644
--- a/libgcc/config/pa/milli64.S
+++ b/libgcc/config/pa/milli64.S
@@ -222,19 +222,26 @@ GSYM($$dyncall)
.proc
.callinfo millicode
.entry
- bb,>=,n %r22,30,LREF(1) ; branch if not plabel address
- depi 0,31,2,%r22 ; clear the two least significant bits
- ldw 4(%r22),%r19 ; load new LTP value
- ldw 0(%r22),%r22 ; load address of target
-LSYM(1)
#ifdef LINUX
- bv %r0(%r22) ; branch to the real target
+ extru,<> %r22,30,1,%r0 ; nullify if plabel bit set
+ bv,n %r0(%r22) ; branch to target
+ ldw -2(%r22),%r21 ; load address of target
+ bv %r0(%r21) ; branch to the real target
+ ldw 2(%r22),%r19 ; load new LTP value
#else
+ bb,>=,n %r22,30,LREF(1) ; branch if not plabel address
+ ldw -2(%r22),%r21 ; load address of target to r21
+ ldsid (%sr0,%r21),%r1 ; get the "space ident" selected by r21
+ ldw 2(%r22),%r19 ; load new LTP value
+ mtsp %r1,%sr0 ; move that space identifier into sr0
+ be 0(%sr0,%r21) ; branch to the real target
+ stw %r2,-24(%r30) ; save return address into frame marker
+LSYM(1)
ldsid (%sr0,%r22),%r1 ; get the "space ident" selected by r22
mtsp %r1,%sr0 ; move that space identifier into sr0
- be 0(%sr0,%r22) ; branch to the real target
-#endif
+ be 0(%sr0,%r22) ; branch to the target
stw %r2,-24(%r30) ; save return address into frame marker
+#endif
.exit
.procend
#endif