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

--- Comment #23 from Mark Millard <marklmi26-f...@yahoo.com> ---
(In reply to Mark Millard from comment #22)

In my rush for time and interruptions, my wording sounds like
I was saying the workaround was not attempted. Better to show
details:

>From the .kld:

Relocation section with addend (.rela.toc):
r_offset     r_info       r_type              st_value         st_name +
r_addend
. . .
0000000000f8 018400000026 R_PPC64_ADDR64      0000000000000000
pcpu_entry_linux_idr_cache + 0
. . .

Relocation section with addend (.rela.debug_info):
r_offset     r_info       r_type              st_value         st_name +
r_addend
. . .
00000001f60b 018400000026 R_PPC64_ADDR64      0000000000000000
pcpu_entry_linux_idr_cache + 0
. . .

Symbol table (.symtab) contains 818 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
. . .
   388: 0000000000000000    48 OBJECT  LOCAL  DEFAULT   19
pcpu_entry_linux_idr_cache
. . .


>From the contributing .o:

Relocation section with addend (.rela.toc):
r_offset     r_info       r_type              st_value         st_name +
r_addend
000000000000 004900000026 R_PPC64_ADDR64      0000000000000000 lockstat_enabled
+ 0
000000000008 005000000026 R_PPC64_ADDR64      0000000000000000
pcpu_entry_linux_idr_cache + 0
000000000010 002c00000026 R_PPC64_ADDR64      0000000000000000 all_cpus + 0
000000000018 004e00000026 R_PPC64_ADDR64      0000000000000000 mp_maxid + 0
000000000020 002d00000026 R_PPC64_ADDR64      0000000000000000 dpcpu_off + 0
. . .
Relocation section with addend (.rela.debug_info):
r_offset     r_info       r_type              st_value         st_name +
r_addend
. . .
000000000096 005000000026 R_PPC64_ADDR64      0000000000000000
pcpu_entry_linux_idr_cache + 0
00000000009f 001900000001 R_PPC64_ADDR32      0000000000000000 .debug_str + 2c9
. . .

Relocation section with addend (.rela.debug_line):
r_offset     r_info       r_type              st_value         st_name +
r_addend
000000000889 001300000026 R_PPC64_ADDR64      0000000000000000 .text + 0
. . .

Symbol table (.symtab) contains 81 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
. . .
    80: 0000000000000000    48 OBJECT  GLOBAL DEFAULT   13
pcpu_entry_linux_idr_cache

So a "LOCAL" resulted from a "GLOBAL". This looks to mean it was
turned back into a static.

Looking . . .

# Meta data file
/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/powerpc.powerpc64/sys/GENERIC64vtsc-NODBG/modules/usr/src/sys/modules/linuxkpi/linuxkpi.kld.meta
CMD /usr/local/powerpc64-unknown-freebsd13.0/bin/ld -m elf64ppc_fbsd -d
-warn-common --build-id=sha1 -r -d -o linuxkpi.kld linux_compat.o
linux_current.o linux_hrtimer.o linux_idr.o linux_kmod.o linux
_kthread.o linux_lock.o linux_page.o linux_pci.o linux_radix.o linux_rcu.o
linux_seq_file.o linux_schedule.o linux_slab.o linux_tasklet.o linux_usb.o
linux_work.o
CMD ctfmerge -L VERSION -g -o linuxkpi.kld linux_compat.o linux_current.o
linux_hrtimer.o linux_idr.o linux_kmod.o linux_kthread.o linux_lock.o
linux_page.o linux_pci.o linux_radix.o linux_rcu.o linux
_seq_file.o linux_schedule.o linux_slab.o linux_tasklet.o linux_usb.o
linux_work.o
CMD :> export_syms
CMD awk -f /usr/src/sys/conf/kmod_syms.awk linuxkpi.kld  export_syms | xargs
-J% /usr/local/powerpc64-unknown-freebsd13.0/bin/objcopy % linuxkpi.kld

# more /usr/src/sys/conf/kmod_syms.awk
# $FreeBSD: head/sys/conf/kmod_syms.awk 101438 2002-08-06 19:31:04Z iedowse $

# Read global symbols from object file.
BEGIN {
        while ("${NM:='nm'} -g " ARGV[1] | getline) {
                if (match($0, /^[^[:space:]]+ [^AU] (.*)$/)) {
                        syms[$3] = $2
                }
        }
        delete ARGV[1]
}

# De-list symbols from the export list.
{
        delete syms[$0]
}

# Strip commons, make everything else local.
END {
        for (member in syms) {
                if (syms[member] == "C")
                        print "-N" member
                else
                        print "-L" member
        }
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-emulation@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-emulation
To unsubscribe, send any mail to "freebsd-emulation-unsubscr...@freebsd.org"

Reply via email to