http://sourceware.org/bugzilla/show_bug.cgi?id=12327

           Summary: x86 relocatable kernel is broken
           Product: binutils
           Version: 2.22 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassig...@sources.redhat.com
        ReportedBy: hjl.to...@gmail.com


In linux kernel, we have ‘jiffies = jiffies_64;’ in vmlinux.lds.S.
The jiffies isn’t in any section. In kernel build, there is warning saying
jiffies is an absolute address and can't relocatable. In my system, this cause
boot panic. 

Kernel config has

CONFIG_RELOCATABLE=y

Kernel build log has

WARNING: Absolute relocations present
Offset     Info     Type     Sym.Value Sym.Name
c102cc8a 00de5a01   R_386_32 c170ba40  jiffies
c103635d 00de5a01   R_386_32 c170ba40  jiffies
c1036658 00de5a01   R_386_32 c170ba40  jiffies

Linker command is

ld -m elf_i386 --emit-relocs --build-id -o vmlinux -T
arch/x86/kernel/vmlinux.lds arch/x86/kernel/head_32.o arch/x86/kernel/head32.o
arch/x86/kernel/head.o arch/x86/kernel/init_task.o  init/built-in.o
--start-group  usr/built-in.o  arch/x86/built-in.o  kernel/built-in.o 
mm/built-in.o  fs/built-in.o  ipc/built-in.o  security/built-in.o 
crypto/built-in.o  block/built-in.o  lib/lib.a  arch/x86/lib/lib.a 
lib/built-in.o  arch/x86/lib/built-in.o  drivers/built-in.o  sound/built-in.o 
firmware/built-in.o  arch/x86/pci/built-in.o  arch/x86/oprofile/built-in.o 
arch/x86/power/built-in.o  arch/x86/video/built-in.o  net/built-in.o
--end-group .tmp_kallsyms2.o

arch/x86/kernel/vmlinux.lds has

OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(phys_startup_32)
jiffies = jiffies_64;
PHDRS {
 text PT_LOAD FLAGS(5); /* R_E */
 data PT_LOAD FLAGS(7); /* RWE */
 note PT_NOTE FLAGS(0); /* ___ */
}

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to