[Bug 207898] kernel linker behaves differently on amd64 vs. i386

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Mar 12 07:56:37 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207898

--- Comment #1 from Don Lewis <truckman at FreeBSD.org> ---
Most of the kernel linker code is MI, but there is some MD code in
/usr/src/sys/{amd64/amd64,i386/i386}/elf_machdep.c.  I didn't see anything
suspicious there.

The MI code is difficult to figure out, but that is where I suspect the problem
is.  I suspect that whether or not the problem is triggered depends on the
order of the relocation entries in the .ko file.  On amd64, I see this when I
run nm on the .ko file:

[snip]
                 U module_register_init
0000000000000000 b msg1
                 U msg1
0000000000000050 b msg2
                 U msg2
                 U strcpy
                 U uprintf

On i386, I see this:

[snip]
         U module_register_init
         U msg1
000014c4 b msg1
         U msg2
00001514 b msg2
         U strcpy
         U uprintf

Note that the "b" entries for msg1 and msg2 precede the "U" entries on amd64,
but the reverse is true on i386.

Unfortunately this is difficult to test because swapping the order of SRCS does
not change the order as reported by nm.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list