Skip to contentSkip to conversation

Link problems with 2.4.3 kernel

DISCUSSION Scott A McConnell 2 participants 3 messages Apr 16, 2001 – Apr 17, 2001 MIPS

lore
Share & tools
lore
#0 lore raw

Using Hardhat linux targeting a NEC VR5432 and a 2.4.0-test 5 kernel I get an image that looks like the following:

vmlinux: file format elf32-littlemips

Disassembly of section .text:

0000000080001000 <_ftext>:
...

    80002000: 6e 01 00 10 00 00 00 00 00 00 00 00 00 00 00 00

n...............
...

0000000080002288 <except_vec0_r4000>:
....
00000000800025bc <kernel_entry>:

--------------------------------------
using the cvs 2.4.3 kernel (about a week old) and the same tool chain I get an image that looks like:
Using a loadaddr of 8000000

vmlinux: file format elf32-littlemips

Disassembly of section .text:

0000000080000000 <_ftext>:

    80000000: 6b 01 00 10 00 00 00 00 00 00 00 00 00 00 00 00

k...............
...

0000000080000288 <except_vec0_r4000>:
....
00000000800005b0 <kernel_entry>:
...

--------------------------------------
If I change the loadaddr to 80001000 I get:

vmlinux: file format elf32-littlemips

Disassembly of section .text:

0000000080002000 <_ftext>:

    80002000: 6b 01 00 10 00 00 00 00 00 00 00 00 00 00 00 00

k...............
...

0000000080002288 <except_vec0_r4000>:
....

00000000800025b0 <kernel_entry>:

-------------------------------------

No matter what I do I can not get _ftext to appear at 80001000. I use identical ld.scripts for bother kernels.
At first I thought it was my binutils so I switched to the same tools that I used with my 2.4.0-test5 kernel.

Addresses appear to be off by 0x1000. Which is why my 2.4.3 kernel dies on the jump to init_arch out of kernel_entry.

Any thoughts about what I might be doing wrong?

Thanks,
Scott

#1 lore raw
Quoted 5 lines · Scott A McConnell

No matter what I do I can not get _ftext to appear at 80001000. I use identical ld.scripts for bother kernels.
At first I thought it was my binutils so I switched to the same tools that I used with my 2.4.0-test5 kernel.

Quoted 7 lines

Addresses appear to be off by 0x1000. Which is why my 2.4.3 kernel dies on the jump to init_arch out of kernel_entry.

Any thoughts about what I might be doing wrong?

Thanks,
Scott

I tracked it down to a missing:

ifdef LOADADDR
LINKFLAGS += -Ttext $(word 1,$(LOADADDR))
endif

in arch/mips/Makefile

I have no idea who added it or removed it.

I also am forced to edit the ld.script file to replace the LOADADDR inserted with sed with 80000000.

Am I suppose to be accomplishing what I did above some other way?

Scott

#2 lore raw
In reply to Scott A McConnell
Quoted 9 lines · Scott A McConnell

No matter what I do I can not get _ftext to appear at 80001000. I use identical ld.scripts for bother kernels.
At first I thought it was my binutils so I switched to the same tools that I used with my 2.4.0-test5 kernel.

Addresses appear to be off by 0x1000. Which is why my 2.4.3 kernel dies on the jump to init_arch out of kernel_entry.

Any thoughts about what I might be doing wrong?

Thinking you can change the address to 0x80001000. .text needs 8kb aligment for 32-bit kernels, 16kb for 64-bit.

Ralf