kernel using gcc-5.3 fails to boot right
Adrian Chadd
adrian at freebsd.org
Sat Aug 20 00:27:20 UTC 2016
On 17 August 2016 at 19:41, Warner Losh <imp at bsdimp.com> wrote:
> On Wed, Aug 17, 2016 at 8:29 PM, Adrian Chadd <adrian at freebsd.org> wrote:
>> thanks to warner, I went looking at relocation tables.
>>
>> It stems from how we're doing LO16/HI16 - we expect HI first, then LO
>> - then we update where_hi16. This .. doesn't work in the new world.
>>
>> eg:
>>
>> 0000bf9c R_MIPS_HI16 ctl3_lock
>> 0000bfa0 R_MIPS_LO16 ctl3_lock
>> 0000bfa8 R_MIPS_HI16 M_IPFW
>> 0000bfac R_MIPS_LO16 M_IPFW
>> 0000bfb8 R_MIPS_LO16 .bss
>> 0000bfa4 R_MIPS_HI16 __mtx_unlock_flags
>> 0000bfcc R_MIPS_LO16 __mtx_unlock_flags
>
> A grep suggests we implement them for efl_machdep.c:
>
> sys/mips/mips/elf_machdep.c: case R_MIPS_HI16: /* ((AHL + S) -
> ((short)(AHL + S)) >> 16 */
> sys/mips/mips/elf_machdep.c: case R_MIPS_LO16: /* AHL + S */
>
> Might see if you can debug fro there.
I'm a terrible, terrible person.
http://people.freebsd.org/~adrian/mips/20160819-mips-elf-reloc-gcc-5.3-1.diff
It's a totally terrible diff that needs tidying up, but it verifies
the basic functionality
seems to work. I'd appreciate some initial comments/feedback so I can
tidy it up enough
to get a more formal review.
Yes, it boots up and loads my modules fine. A lot of the modules now
trigger the log:
kldload: can't load random: No such file or directory
.. ipfw
elf_reloc_internal: called; where=0xc01010a0; LO16 REL with no HI16 first
elf_reloc_internal: called; where=0xc010111c; LO16 REL with no HI16 first
elf_reloc_internal: called; where=0xc01016ac; HI16 REL with no LO16 first
elf_reloc_internal: called; where=0xc0101680; HI16 REL with no LO16 first
elf_reloc_internal: called; where=0xc010226c; HI16 REL with no LO16 first
elf_reloc_internal: called; where=0xc0101f44; HI16 REL with no LO16 first
elf_reloc_internal: called; where=0xc0101750; LO16 REL with no HI16 first
elf_reloc_internal: called; where=0xc0101760; LO16 REL with no HI16 first
elf_reloc_internal: called; where=0xc0101794; LO16 REL with no HI16 first
...
ipfw2 initialized, divert loadable, nat loadable, default to accept,
logging disabled
.. libalias
elf_reloc_internal: called; where=0xc01245d4; LO16 REL with no HI16 first
elf_reloc_internal: called; where=0xc0124674; LO16 REL with no HI16 first
elf_reloc_internal: called; where=0xc0124720; LO16 REL with no HI16 first
elf_reloc_internal: called; where=0xc01247d4; LO16 REL with no HI16 first
elf_reloc_internal: called; where=0xc0125064; HI16 REL with no LO16 first
elf_reloc_internal: called; where=0xc012504c; HI16 REL with no LO16 first
elf_reloc_internal: called; where=0xc0125014; HI16 REL with no LO16 first
elf_reloc_internal: called; where=0xc01274b0; LO16 REL with no HI16 first
..
.. if_gif
elf_reloc_internal: called; where=0xc01360dc; LO16 REL with no HI16 first
elf_reloc_internal: called; where=0xc01361c4; LO16 REL with no HI16 first
elf_reloc_internal: called; where=0xc0136474; LO16 REL with no HI16 first
elf_reloc_internal: called; where=0xc0137108; HI16 REL with no LO16 first
.. etc
>
> Warner
More information about the freebsd-mips
mailing list