Re: ld from binutils 2.9.1 mislinks Alpha kernel?

Mr. James W. Laferriere (babydr@nwrain.net)
Sat, 9 May 1998 14:57:50 -0700 (PDT)


Hello Maciej,

You might want to try binutils-2.9.1.0.4 at sunsite.unc.edu
/pub/Linux/GCC
Hth

On Sat, 9 May 1998, Maciej W. Rozycki wrote:
> Hi,
> It seems that on an Alpha for some reasons ld 2.9.1 links vmlinux
> differently from what ld 2.8.1.0.15 used to do. It sets the PT_LOAD
> segment such that it does not include ELF file and program headers:
>
> $ ld -V
> GNU ld version 2.9.1 (with BFD 2.9.1)
> Supported emulations:
> elf64alpha
> alpha
> $ objdump -p vmlinux
>
> vmlinux-2.9.1: file format elf64-alpha
>
> Program Header:
> LOAD off 0x0000000000010000 vaddr 0xfffffc0000310000 paddr
> 0xfffffc0000310000 align 2**16
> filesz 0x000000000011ba28 memsz 0x0000000000145e24 flags rwx
>
> versus:
>
> $ ld -V
> GNU ld version cygnus-2.8.1 (with BFD linux-2.8.1.0.15)
> Supported emulations:
> elf64alpha
> alpha
> $ objdump -p vmlinux
>
> vmlinux-2.8.1.0.15: file format elf64-alpha
>
> Program Header:
> LOAD off 0x0000000000000000 vaddr 0xfffffc0000300000 paddr
> 0xfffffc0000300000 align 2**20
> filesz 0x000000000012ba28 memsz 0x0000000000155e24 flags rwx
>
> Both ELF images seem to be equivalent wrt kernel text start address but
> the former one prevents aboot from loading the kernel (it insists on the
> segment start address being within the first fs block of uncompressed
> vmlinux).
>
> I am not sure whether the change of ld behaviour is intentional, but just
> in case a patch follows which allows vmlinux created with binutils 2.9.1
> to be booted by aboot.
>
> Maciej
>
> --
> + Maciej W. Rozycki, Technical University of Gdansk, Poland +
> +--------------------------------------------------------------+
> + e-mail: macro@ds2.pg.gda.pl, PGP key available +
>
> diff -u --recursive --new-file linux-2.1.100.macro/arch/alpha/vmlinux.lds linux-2.1.100/arch/alpha/vmlinux.lds
> --- linux-2.1.100.macro/arch/alpha/vmlinux.lds Wed May 14 07:41:00 1997
> +++ linux-2.1.100/arch/alpha/vmlinux.lds Sat May 9 15:10:00 1998
> @@ -1,10 +1,14 @@
> OUTPUT_FORMAT("elf64-alpha")
> ENTRY(__start)
> +PHDRS
> +{
> + load PT_LOAD FILEHDR PHDRS;
> +}
> SECTIONS
> {
> . = 0xfffffc0000310000;
> _text = .;
> - .text : { *(.text) }
> + .text : { *(.text) } :load
> .text2 : { *(.text2) }
> _etext = .;
, JimL
+-----------------------------------------------------------------------+
| James W. Laferriere - Network Engineer - babydr@nwrain.net |
| System Techniques - 25416 - 22nd S. - Kent, WA 98032 |
| Give me VMS -or- Give me Linux -but- only on AXP |
+-----------------------------------------------------------------------+
|-> Linux-Vax Port, Now in Progress !YAY! there's Progress To Report <-|
|-> Please See http://ucnet.canberra.edu.au/~mikal/vaxlinux/home.html <-|
|-> Maintainer: Michael Still mikal@blitzen.canberra.edu.au <-|
+-----------------------------------------------------------------------+