Date: Fri, 19 Aug 2016 17:27:18 -0700 From: Adrian Chadd <adrian@freebsd.org> To: Warner Losh <imp@bsdimp.com> Cc: "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org> Subject: Re: kernel using gcc-5.3 fails to boot right Message-ID: <CAJ-Vmon-BNY7W3gvvn5LNnz4GXqYk5WMi6fqJ=-TrJ48y%2BNjZg@mail.gmail.com> In-Reply-To: <CANCZdfrbYpYvN-cE2Ww5Kgami-e4Ag-ecPj_NjcPaEw=c3yeXg@mail.gmail.com> References: <CAJ-VmomVS_fmYo2pvTm85x9tqfRnbcggWW9NLa28BJpfjaFozg@mail.gmail.com> <CAJ-Vmon19GF6N-90avR3%2BPeXkSC=BkNt7Cy2CiVY%2BbwFN5iuMQ@mail.gmail.com> <CAJ-Vmo=DAgC7x8FECWu_ne-usU4jdCyojFL2HuAJAFj8hmasMA@mail.gmail.com> <CAJ-Vmon6vKJUb8ZfRZv_v%2BphekH0TsW6Vpia_B_sg2k76wQ6PQ@mail.gmail.com> <CAJ-VmonXi4Ri3KGq1J=ACLHn89tQme6kLcmBcn_8R8FquVu61Q@mail.gmail.com> <CAJ-VmonrT5xwaNQXVyZmK7t=%2BL3VE94xkNZvSSKZC=2PeV0DzQ@mail.gmail.com> <CANCZdfrbYpYvN-cE2Ww5Kgami-e4Ag-ecPj_NjcPaEw=c3yeXg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 17 August 2016 at 19:41, Warner Losh <imp@bsdimp.com> wrote: > On Wed, Aug 17, 2016 at 8:29 PM, Adrian Chadd <adrian@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmon-BNY7W3gvvn5LNnz4GXqYk5WMi6fqJ=-TrJ48y%2BNjZg>