[Bug 225775] btxld does not handle input with other than 2 PT_LOAD segments

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Feb 8 21:18:55 UTC 2018


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

            Bug ID: 225775
           Summary: btxld does not handle input with other than 2 PT_LOAD
                    segments
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: emaste at freebsd.org

Linking e.g. zfsloader reports (whitespace added for clarity):

cc -O2 -pipe -I/usr/home/emaste/src/freebsd-wip/stand/i386/btx/lib -nostdinc
-I/usr/obj/usr/home/emaste/src/freebsd-wip/amd64.amd64/stand/libsa32
-I/usr/home/emaste/src/freebsd-wip/stand/libsa -D_STANDALONE
-I/usr/home/emaste/src/freebsd-wip/sys -DLOADER_GELI_SUPPORT
-I/usr/home/emaste/src/freebsd-wip/stand/geli -DLOADER_DISK_SUPPORT -m32
-mcpu=i386 -ffreestanding -mno-mmx -mno-sse -mno-avx -mno-avx2 -msoft-float
-march=i386 -I. -I/usr/home/emaste/src/freebsd-wip/stand/common
-I/usr/home/emaste/src/freebsd-wip/stand/ficl
-I/usr/home/emaste/src/freebsd-wip/stand/ficl/i386
-I/usr/home/emaste/src/freebsd-wip/stand/common -DBF_DICTSIZE=15000
-DLOADER_UFS_SUPPORT -DLOADER_GZIP_SUPPORT -DLOADER_BZIP2_SUPPORT
-DLOADER_NET_SUPPORT -DLOADER_NFS_SUPPORT -DLOADER_TFTP_SUPPORT
-DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -DLOADER_ZFS_SUPPORT
-I/usr/home/emaste/src/freebsd-wip/stand/zfs
-I/usr/home/emaste/src/freebsd-wip/sys/cddl/boot/zfs -Wall
-I/usr/home/emaste/src/freebsd-wip/stand/i386 -DLOADER_PREFER_AMD64 -std=gnu99
-Wsystem-headers -Werror -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int
-Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value
-Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion
-Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch
-Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses
-Qunused-arguments  -nostdlib -Wl,-z,norelro -static -Ttext 0x0 -Wl,-z,norelro
-o zfsloader.sym
/usr/obj/usr/home/emaste/src/freebsd-wip/amd64.amd64/stand/i386/btx/lib/crt0.o
main.o conf.o vers.o chain.o boot.o commands.o console.o devopen.o interp.o
interp_backslash.o interp_parse.o ls.o misc.o module.o load_elf32.o
load_elf32_obj.o reloc_elf32.o load_elf64.o load_elf64_obj.o reloc_elf64.o
disk.o part.o dev_net.o bcache.o isapnp.o pnp.o interp_forth.o 
/usr/obj/usr/home/emaste/src/freebsd-wip/amd64.amd64/stand/ficl32/libficl.a 
/usr/obj/usr/home/emaste/src/freebsd-wip/amd64.amd64/stand/zfs32/libzfsboot.a
/usr/obj/usr/home/emaste/src/freebsd-wip/amd64.amd64/stand/i386/libi386/libi386.a
/usr/obj/usr/home/emaste/src/freebsd-wip/amd64.amd64/stand/geli/libgeliboot.a
/usr/obj/usr/home/emaste/src/freebsd-wip/amd64.amd64/stand/libsa32/libsa32.a

strip -R .comment -R .note -o zfsloader.bin zfsloader.sym

btxld -v -f aout -e 0x200000 -o zfsloader -l
/usr/obj/usr/home/emaste/src/freebsd-wip/amd64.amd64/stand/i386/btx/btxldr/btxldr
 -b /usr/obj/usr/home/emaste/src/freebsd-wip/amd64.amd64/stand/i386/btx/btx/btx
zfsloader.bin

btxld: zfsloader.bin: Warning: Ignoring extra elf PT_LOAD segments

kernel: ver=1.02 size=690 load=9000 entry=9010 map=16M pgctl=0:59
client: fmt=elf size=6bcd0 text=58834 data=afec bss=0 entry=0
output: fmt=aout size=6f000 text=1000 data=6d000 org=200000 entry=200000

btxld has:

                        case 2:
                            Warn(fname,
                                 "Ignoring extra %s PT_LOAD segments",
                                 fmtlist[fmt]);

i.e., it expects two PT_LOADs with a specific format, and just ignores the
third or later ones.

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


More information about the freebsd-bugs mailing list