From: Paul Bame <bame@noam.fc.hp.com>
To: Alan Modra <amodra@puffin.external.hp.com>
Cc: parisc-linux@thepuffingroup.com
Subject: Re: [parisc-linux] Non-bootable kernel problems
Date: Thu, 13 Jul 2000 11:14:14 -0600 [thread overview]
Message-ID: <E13CmYw-00077l-00@noam.fc.hp.com> (raw)
In-Reply-To: Your message of "Thu, 13 Jul 2000 00:35:33 BST." <20000713003533.Y9568@linuxcare.com>
More info on this one -- and yes it's the old problem come back to
haunt us.
Witness two functions:
static void * a2(void) {
return (void *)&devinet_sysctl.devinet_root_dir;
}
static void * a3(void) {
return (void *)&devinet_sysctl;
}
And their return values:
a3 c028b22c a2 c0289574
a2 should be c028b574 -- it's off by 0x2000 as Richard noted earlier.
a3() is OK and a2() is broken.
Here's disassembly from vmlinux via objdump:
c021b27c <a2>:
c021b27c: 2b 6f 00 00 addil 1e000,dp,%r1
c021b280: e8 40 c0 00 bv r0(rp)
c021b284: 34 3c 2a e9 ldo -a8c(r1),ret0
c021b288 <a3>:
c021b288: 2b 6f 00 00 addil 1e000,dp,%r1
c021b28c: e8 40 c0 00 bv r0(rp)
c021b290: 34 3c 24 58 ldo 122c(r1),ret0
The two ldo instructions should be showing a difference of 0x348 -- the
ofset of the member within the struct which I calculated separately. As
shown, the offsets differ by 0x2348. This code is hosed.
The object file says:
00000000 <a2>:
0: 2b 60 00 00 addil 0,dp,%r1
0: R_PARISC_DPREL21L .data+0x78
4: e8 40 c0 00 bv r0(rp)
8: 34 3c 00 00 ldo 0(r1),ret0
8: R_PARISC_DPREL14R .data+0x3c0
Disassembly of section .text.a3:
00000000 <a3>:
0: 2b 60 00 00 addil 0,dp,%r1
0: R_PARISC_DPREL21L .data+0x78
4: e8 40 c0 00 bv r0(rp)
8: 34 3c 00 00 ldo 0(r1),ret0
8: R_PARISC_DPREL14R .data+0x78
I think this code is right, because 0x3c0-0x78 is 0x348. I think this
makes this a linker problem. The off-by-0x2000 is suspicious
since the ldo offset is 14 bits and 2^14 = 0x2000.
For completeness here's what came out of the compiler, which looks cool
to me:
a1:
.PROC
.CALLINFO FRAME=0,NO_CALLS
.ENTRY
addil LR'devinet_sysctl-$global$,%r27
bv %r0(%r2)
ldw RR'devinet_sysctl-$global$+844(%r1),%r28
.EXIT
.PROCEND
a2:
.PROC
.CALLINFO FRAME=0,NO_CALLS
.ENTRY
addil LR'devinet_sysctl-$global$,%r27
bv %r0(%r2)
ldo RR'devinet_sysctl-$global$+840(%r1),%r28
next prev parent reply other threads:[~2000-07-13 17:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-07-12 23:35 [parisc-linux] Non-bootable kernel problems Richard Hirst
2000-07-13 17:14 ` Paul Bame [this message]
2000-07-13 18:46 ` David Huggins-Daines
2000-07-13 21:14 ` David Huggins-Daines
2000-07-13 19:20 ` Jeffrey A Law
2000-07-14 16:10 ` David Huggins-Daines
2000-07-14 16:39 ` Jeffrey A Law
2000-07-14 18:53 ` David Huggins-Daines
2000-07-14 20:40 ` David Huggins-Daines
2000-07-14 22:14 ` GAS fix for reloc problems (was Re: [parisc-linux] Non-bootable kernel problems) David Huggins-Daines
2000-07-15 8:33 ` Alan Modra
2000-07-15 1:31 ` [parisc-linux] Non-bootable kernel problems Alan Modra
2000-07-13 23:45 ` David Huggins-Daines
2000-07-14 0:44 ` Alan Modra
2000-07-14 16:02 ` Jeffrey A Law
2000-07-14 16:02 ` David Huggins-Daines
2000-07-14 16:37 ` Jeffrey A Law
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=E13CmYw-00077l-00@noam.fc.hp.com \
--to=bame@noam.fc.hp.com \
--cc=amodra@puffin.external.hp.com \
--cc=parisc-linux@thepuffingroup.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox