From: James Bottomley <James.Bottomley@steeleye.com>
To: "Carlos O'Donell" <carlos@baldric.uwo.ca>
Cc: John David Anglin <dave@hiauly1.hia.nrc.ca>,
dave.anglin@nrc-cnrc.gc.ca,
PARISC list <parisc-linux@lists.parisc-linux.org>
Subject: Re: [parisc-linux] r19 (aka pic-register akak ltp) not restored on entry back to libc from libpthread?
Date: 19 Sep 2003 13:26:44 -0500 [thread overview]
Message-ID: <1063996009.1832.34.camel@mulgrave> (raw)
In-Reply-To: <20030919175142.GI18225@systemhalted>
On Fri, 2003-09-19 at 12:51, Carlos O'Donell wrote:
> mutex_unlock becomes:
> __libc_maybe_call (__pthread_mutex_unlock, (m), (*(int *)(m) = 0))
This seems all to work:
A test file
main() {
int t1 = 4;
__libc_maybe_call(test1, (t1), (t1=3));
}
compiles (PIC) to:
00000000 <main>:
[...]
20: 2a 60 00 00 addil 0,r19,%r1
20: R_PARISC_DLTIND21L .LC0
24: 48 21 00 00 ldw 0(r1),r1
24: R_PARISC_DLTIND14R .LC0
28: 0c 20 10 94 ldw 0(,r1),r20
2c: 0c 74 12 98 stw r20,c(,r3)
30: 0c 78 10 94 ldw c(,r3),r20
34: 86 80 20 3a cmpib,=,n 0,r20,58 <main+0x58>
38: 0c 78 10 94 ldw c(,r3),r20
3c: 0c 70 10 9a ldw 8(,r3),r26
40: 08 14 02 56 copy r20,r22
44: 08 13 02 44 copy r19,r4
48: eb e0 00 00 b,l 50 <main+0x50>,r31
48: R_PARISC_PCREL17F $$dyncall
4c: 08 1f 02 42 copy r31,rp
50: 08 04 02 53 copy r4,r19
[...]
00000000 <.LC0>:
0: 00 00 00 00 break 0,0
0: R_PARISC_PLABEL32 test1
[...]
00010578 <$$dyncall>:
10578: c7 d6 c0 12 bb,>=,n r22,1e,10588 <$$dyncall+0x10>
1057c: d6 c0 1c 1e depwi 0,31,2,r22
10580: 0e c8 10 93 ldw 4(,r22),r19
10584: 0e c0 10 96 ldw 0(,r22),r22
10588: ea c0 c0 00 bv r0(r22)
1058c: 6b c2 3f d1 stw rp,-18(sp)
The $$dyncall is where we indirect through r20 (which contains the
function pointer). Note the copy restoring r19 around this.
James
next prev parent reply other threads:[~2003-09-19 18:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-19 13:56 [parisc-linux] r19 (aka pic-register akak ltp) not restored on entry back to libc from libpthread? Carlos O'Donell
2003-09-19 16:56 ` John David Anglin
2003-09-19 17:51 ` Carlos O'Donell
2003-09-19 18:26 ` James Bottomley [this message]
2003-09-19 18:55 ` [parisc-linux] r19 (aka pic-register akak ltp) not restored on John David Anglin
2003-09-19 19:28 ` Carlos O'Donell
2003-09-19 20:10 ` John David Anglin
2003-09-21 15:45 ` [parisc-linux] Found the r19 problem! Carlos O'Donell
2003-09-21 16:39 ` [parisc-linux] " John David Anglin
2003-09-21 18:53 ` Carlos O'Donell
2003-09-21 18:55 ` Carlos O'Donell
2003-09-21 19:12 ` John David Anglin
2003-09-21 19:16 ` Carlos O'Donell
2003-09-21 19:18 ` John David Anglin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1063996009.1832.34.camel@mulgrave \
--to=james.bottomley@steeleye.com \
--cc=carlos@baldric.uwo.ca \
--cc=dave.anglin@nrc-cnrc.gc.ca \
--cc=dave@hiauly1.hia.nrc.ca \
--cc=parisc-linux@lists.parisc-linux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.