This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

8bit and 16bit relocations in gold


Ian,

With the help of H. Peter Anvin I poked a bit more at the gold linux kernel 
boot problems.

First the crash happen really in the real mode code which has 8 and 16bit
relocations (arch/x86/boot/* in a modern linux kernel tree). This is
generated from a custom linker script (arch/x86/boot/setup.ld) 

Comparing to a good kernel we already see some differences just in the header:

e.g. in the setup.bin which is just the binary dump of that code

-0000200 46eb 6448 5372 0207 0000 0000 1000 2900      (bfd)
+0000200 46eb 6449 5372 0207 0000 0000 1000 2900      (gold) 

which is generated from this assembler code in header.S

        .section ".header", "a"
        .globl  hdr
hdr:
setup_sects:    .byte SETUPSECTS
root_flags:     .word ROOT_RDONLY
syssize:        .long SYSSIZE
ram_size:       .word RAMDISK
vid_mode:       .word SVGA_MODE
root_dev:       .word ROOT_DEV
boot_flag:      .word 0xAA55

relocations in the object file:

Relocation section '.rel.header' at offset 0xe64 contains 3 entries:
 Offset     Info    Type            Sym.Value  Sym. Name
00000010  00002f17 R_386_PC8         00000000   .inittext
0000001d  00003c14 R_386_16          00000000   kernel_version
00000033  00003d14 R_386_16          00000000   _end

So it looks like the PC8 and _16 relocations are not correctly processed
by gold.

-Andi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]