Re: relocation truncated to fit: R_386_PC32

From: Keith Owens (kaos@ocs.com.au)
Date: Tue Sep 19 2000 - 01:07:41 EST


On Mon, 18 Sep 2000 22:51:42 -0700,
"Armand" <armand@mwaz.com> wrote:
>drivers/char/rtc.o: file format elf32-i386
>--
> b9: 7e f5 jle b0 <.text.lock+0xb0>
> bb: e9 b6 00 00 00 jmp 176 <days_in_mo+0x70>
> bc: R_386_PC32 .text.init
> c0: 80 3d 00 00 00 00 00 cmpb $0x0,0x0
> c2: R_386_32 rtc_lock
> c7: f3 90 repz nop
> c9: 7e f5 jle c0 <.text.lock+0xc0>
> cb: e9 06 00 00 00 jmp d6 <.text.lock+0xd6>
> cc: R_386_PC32 .text.exit

That one is the culprit, it is this code in drivers/char/rtc.c. Copied
to Paul Gortmaker who wrote rtc.

static void __exit rtc_exit (void)
{
        /* interrupts and maybe timer disabled at this point by rtc_release */
        /* FIXME: Maybe??? */

        if (rtc_status & RTC_TIMER_ON) {
                spin_lock_irq (&rtc_lock); <============
                rtc_status &= ~RTC_TIMER_ON;
                del_timer(&rtc_irq_timer);
                spin_unlock_irq (&rtc_lock); <============

                printk(KERN_WARNING "rtc_exit(), and timer still running.\n");
        }

Sections marked __exit get discarded when the code is linked into the
kernel, they are kept when the code is a module. But the spin lock
code is kept (in another section) and relocation from .text.lock back
to .text.exit fails. Possible fixes:

Use RTC as a module.
Remove __exit from rtc_exit.
Compile rtc_exit conditional on not being a module.
Remove the spin locks.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 21:00:19 EST