linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: ld bug?
@ 2000-09-15  2:55 Iain Sandoe
  0 siblings, 0 replies; 7+ messages in thread
From: Iain Sandoe @ 2000-09-15  2:55 UTC (permalink / raw)
  To: Takashi Oe, linuxppc-dev


> c039c3e0 D int_control
>
> as opposed to c03ac3e0 used in vmlinux.  So, it appears that ld or

This looks about the same as the difference reported by ksymoops (when it
refuses to work - reporting a mismatch between System.map and /proc/ksyms).

but I was seeing that on 2.2.17 (however, using the toolchain upgrades
recommended for 2.4.0).

Iain.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: ld bug?
@ 2000-09-15 13:09 mikejc
  2000-09-15 14:08 ` Takashi Oe
  0 siblings, 1 reply; 7+ messages in thread
From: mikejc @ 2000-09-15 13:09 UTC (permalink / raw)
  To: Takashi Oe; +Cc: linuxppc-dev


I believe that ld has done the right thing here.

The lwz instruction sign extends the displacement when calculating r9 +
0xc3e4.

at the lwz instruction:

lis r9,-16326        r9 = 0xc03a0000

lwz r0,-15388(r9)         0xc03a0000   (r9)
                        + 0xffffc3e4   (displacement)
                          ----------
                     ea = 0xc039c3e4


Mike Corrigan



Hi,

Well, I've just had a kernel hang at "Freeing unused kernel memory:..."
with linux-2.4.0-test8 + numerous patches, and I've traced the hang to
what apears (to me) to be a ld bug.

The kernel hangs at the call to spin_unlock_irq() in schedule() of
kernel/sched.c.  For me (UP kernel), spin_unlock_irq() is defined to be

struct int_control_struct
{
     void (*int_cli)(void);
     void (*int_sti)(void);
     void (*int_restore_flags)(unsigned long);
     void (*int_save_flags)(unsigned long *);
     void (*int_set_lost)(unsigned long);
};
extern struct int_control_struct int_control;

extern void __no_use_sti(void);

#define __sti()               int_control.int_sti()
#define local_irq_enable()    __sti()
#define spin_unlock(lock)     do { } while (0)
#define spin_unlock_irq(lock) \
     do { spin_unlock(lock);  local_irq_enable();       } while (0)


>From objdump output of kernel/sched.o:

     458:       3d 20 00 00     lis     r9,0
                        45a: R_PPC_ADDR16_HA    int_control+0x4
     45c:       80 09 00 04     lwz     r0,4(r9)
                        45e: R_PPC_ADDR16_LO    int_control+0x4
     460:       7c 08 03 a6     mtlr    r0
     464:       4e 80 00 21     blrl

So, if I'm reading this correctly, the compiler is generating correct
assembly.  Now, objdump output of vmlinux (kernel) for the same segment
says:

c02164c4:       3d 20 c0 3a     lis     r9,-16326
c02164c8:       80 09 c3 e4     lwz     r0,-15388(r9)
c02164cc:       7c 08 03 a6     mtlr    r0
c02164d0:       4e 80 00 21     blrl

However, from "nm vmlinux | grep int_control", "int_control" is at

c039c3e0 D int_control

as opposed to c03ac3e0 used in vmlinux.  So, it appears that ld or
something is acting up.  I've tried various version of binutils from
2.9.1.0.990418 to 2.10.0.18, but all have produced the same output.
Except for 2.9.1.0.990414, all 2.10.x versions that I tried are from
ftp://devel.linuxppc.org/users/fsirl/R5/RPMS/.

gcc is 2.95.3-2c (also from fsirl directory).

If I change some totally (and seemingly) unrelated files a bit, vmlinux
produced may be correct.  I tried to look at if any section's size
matters, but I don't see any pattern unfortunately.


Takashi Oe


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: zeroing pages in the idle task?
@ 2000-09-13 19:32 Geert Uytterhoeven
  2000-09-15  2:28 ` ld bug? Takashi Oe
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2000-09-13 19:32 UTC (permalink / raw)
  To: David A. Gatwood; +Cc: Takashi Oe, Paul Mackerras, mlan, linuxppc-dev


On Wed, 13 Sep 2000, David A. Gatwood wrote:
> On Wed, 13 Sep 2000, Takashi Oe wrote:
> > > Since the only use of this number is for oohs and aahs, there's not a
> > > lot of motivation to try and work out if OF is wrong and work out the
> > > correct number.
> >
> > Could you possibly tell me how one might implement this?  That is: how one
> > would measure/calculate this.  On NuBus, there is no OF, so I'd like to
> > implement.
>
> Ask the guys at Newer Tech for their Clockometer sources.  I don't know if
> they'd be willing to open-source them, but it's worth a shot.  As I
> understand it, their program does just what you're looking for.

On the m68k, we have some code to guestimate the CPU clock based on the
BogoMIPS (see get_cpuinfo() in arch/m68k/kernel/setup.c). Since we didn't care
about the overhead incurred by interrupt processing, it's not that accurate
though (I get 24.8 MHz on my 25 MHz 68040).

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-09-15 14:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-09-15  2:55 ld bug? Iain Sandoe
  -- strict thread matches above, loose matches on Subject: below --
2000-09-15 13:09 mikejc
2000-09-15 14:08 ` Takashi Oe
2000-09-13 19:32 zeroing pages in the idle task? Geert Uytterhoeven
2000-09-15  2:28 ` ld bug? Takashi Oe
2000-09-15  3:00   ` Kaoru Fukui
2000-09-15  3:16   ` Paul Mackerras
2000-09-15  3:44     ` Takashi Oe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).