linux-mips
[Top] [All Lists]

failed to merge string constant? (gcc 3.4.2 + binutils 2.15)

To: linux-mips@linux-mips.org
Subject: failed to merge string constant? (gcc 3.4.2 + binutils 2.15)
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Fri, 29 Oct 2004 22:58:17 +0900 (JST)
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
I have some strange kernel panic with gcc 3.4.2 + binutils 2.15.
Address of some string constant seems broken.

For example, scsi_init_procfs() is compled to following code.

int __init scsi_init_procfs(void)
{
        struct proc_dir_entry *pde;

        proc_scsi = proc_mkdir("scsi", NULL);
        if (!proc_scsi)
                goto err1;
...

803d47f4 <scsi_init_procfs> 27bdffe8    addiu   sp,sp,-24
803d47f8 <scsi_init_procfs+0x4> afb00010        sw      s0,16(sp)
803d47fc <scsi_init_procfs+0x8> 3c108030        lui     s0,0x8030
803d4800 <scsi_init_procfs+0xc> 2604c7e0        addiu   a0,s0,-14368
803d4804 <scsi_init_procfs+0x10> afbf0014       sw      ra,20(sp)
803d4808 <scsi_init_procfs+0x14> 0c03536f       jal     800d4dbc <proc_mkdir>
803d480c <scsi_init_procfs+0x18> 00002821       move    a1,zero

Then, 0x80300000-14368 = 0x802fc7e0 must contain a string "scsi".  But
when I loaded the kernel (ELF or binary), there is obvious wrong data.

802fc7e0  74 20 77 72 69 74 65 20  43 54 52 20 77 68 69 6c   t write CTR whil
802fc7f0  65 20 72 65 67 69 73 74  65 72 69 6e 67 2e 0a 00   e registering...
802fc800  3c 36 3e 73 65 72 69 6f  3a 20 69 38 30 34 32 20   <6>serio: i8042 
802fc810  25 73 20 70 6f 72 74 20  61 74 20 25 23 6c 78 2c   %s port at %#lx,

If I compiled kernel with -fno-merge-constants, this problem does not
happen.  gcc 3.3.4 + bintuils 2.15 also works fine.

Does anyone see this sort of problem?

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>
  • failed to merge string constant? (gcc 3.4.2 + binutils 2.15), Atsushi Nemoto <=