[ipxe-devel] [OpenBSD]: Error: unknown pseudo-op: `.reloc' + ld:arch/i386/scripts/i386.lds:97: syntax error

Jiri B jirib at devio.us
Mon Nov 23 23:49:51 UTC 2015


I gave ipxe another try on OpenBSD - as it updated their binutils to 2.17,
which should solve some older issues and which > 2.16 as described at ipxe
website[1]. But it fails again. Here's my data, requested on #ipxe.

(FYI, I don't have any working ipxe as something changes on OpenBSD and
previously working code fails on compressing bins, which should probably
be working on newer code but this fails earlier as stated in this mail.)



[1] http://ipxe.org/download

Issue 1 - Error: unknown pseudo-op: `.reloc'

cc  -DARCH=i386 -DPLATFORM=pcbios -march=i386 -fomit-frame-pointer -fstrength-reduce -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mpreferred-stack-boundary=2 -mregparm=3 -mrtd -freg-struct-return -m32 -fshort-wchar -Ui386 -Ulinux -DNVALGRIND -Iinclude -I. -Iarch/x86/include -Iarch/i386/include -Iarch/i386/include/pcbios -Os -g -ffreestanding -Wall -W -Wformat-nonliteral  -fno-stack-protector -fno-dwarf2-cfi-asm -fno-exceptions  -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-address -fno-PIE -nopie  -ffunction-sections -fdata-sections -include include/compiler.h   -DOBJECT=fault -c core/fault.c -o bin/fault.o
cc  -DARCH=i386 -DPLATFORM=pcbios -march=i386 -fomit-frame-pointer -fstrength-reduce -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mpreferred-stack-boundary=2 -mregparm=3 -mrtd -freg-struct-return -m32 -fshort-wchar -Ui386 -Ulinux -DNVALGRIND -Iinclude -I. -Iarch/x86/include -Iarch/i386/include -Iarch/i386/include/pcbios -Os -g -ffreestanding -Wall -W -Wformat-nonliteral  -fno-stack-protector -fno-dwarf2-cfi-asm -fno-exceptions  -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-address -fno-PIE -nopie  -ffunction-sections -fdata-sections -include include/compiler.h   -DOBJECT=fc -c net/fc.c -o bin/fc.o
/tmp//ccGCB8Um.s: Assembler messages:
/tmp//ccGCB8Um.s:6: Error: unknown pseudo-op: `.reloc'
Makefile.housekeeping:850: recipe for target 'bin/fc.o' failed
gmake: *** [bin/fc.o] Error 1

$ git bisect good
fbc4ba4b4ed13cc86cb8fdea0bac6c3be0164ed5 is the first bad commit
commit fbc4ba4b4ed13cc86cb8fdea0bac6c3be0164ed5
Author: Michael Brown <mcb30 at ipxe.org>
Date:   Wed Mar 4 18:48:19 2015 +0000

    [build] Fix the REQUIRE_SYMBOL mechanism
    At some point in the past few years, binutils became more aggressive
    at removing unused symbols.  To function as a symbol requirement, a
    relocation record must now be in a section marked with @progbits and
    must not be in a section which gets discarded during the link (either
    via --gc-sections or via /DISCARD/).
    Update REQUIRE_SYMBOL() to generate relocation records meeting these
    criteria.  To minimise the impact upon the final binary size, we use
    existing symbols (specified via the REQUIRING_SYMBOL() macro) as the
    relocation targets where possible.  We use R_386_NONE or R_X86_64_NONE
    relocation types to prevent any actual unwanted relocation taking
    place.  Where no suitable symbol exists for REQUIRING_SYMBOL() (such
    as in config.c), the macro PROVIDE_REQUIRING_SYMBOL() can be used to
    generate a one-byte-long symbol to act as the relocation target.
    If there are versions of binutils for which this approach fails, then
    the fallback will probably involve killing off REQUEST_SYMBOL(),
    redefining REQUIRE_SYMBOL() to use the current definition of
    REQUEST_SYMBOL(), and postprocessing the linked ELF file with
    something along the lines of "nm -u | wc -l" to check that there are
    no undefined symbols remaining.
    Signed-off-by: Michael Brown <mcb30 at ipxe.org>

:040000 040000 158adde6df79c5f376074616d834c72112ed5988 140aa989cb6f9ea5dd7c22a19d338f28d64ee08c M      src

Issue 2 - ld:arch/i386/scripts/i386.lds:97: syntax error

gcc  -Wall -W -Wformat-nonliteral -O2 -g -o util/zbin util/zbin.c
cc  -DARCH=i386 -DPLATFORM=pcbios -march=i386 -fomit-frame-pointer -fstrength-reduce -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mpreferred-stack-boundary=2 -mregparm=3 -mrtd -freg-struct-return -m32 -fshort-wchar -Ui386 -Ulinux -DNVALGRIND -Iinclude -I. -Iarch/x86/include -Iarch/i386/include -Iarch/i386/include/pcbios -Os -g -ffreestanding -Wall -W -Wformat-nonliteral  -fno-stack-protector -fno-dwarf2-cfi-asm -fno-exceptions  -fno-unwind-tables -fno-asynchronous-unwind-tables -Wno-address -fno-PIE -nopie  -ffunction-sections -fdata-sections -include include/compiler.h   -DOBJECT=version -DBUILD_NAME="\"1af41000.rom\"" \
        -DVERSION_MAJOR=1 \
        -DVERSION_MINOR=0 \
        -DVERSION_PATCH=0 \
        -DVERSION="\"1.0.0+ (3e04)\"" \
        -c core/version.c -o bin/version.1af41000.rom.o
ld  -m elf_i386_obsd -N --no-check-sections   --gc-sections -static -T arch/i386/scripts/i386.lds  -u _pcirom_start --defsym check__pcirom_start=_pcirom_start   -u obj_virtio_net --defsym check_obj_virtio_net=obj_virtio_net   -u obj_config --defsym check_obj_config=obj_config  --defsym pci_vendor_id=0x1af4 --defsym pci_device_id=0x1000 -e _pcirom_start bin/version.1af41000.rom.o bin/blib.a -o bin/1af41000.rom.tmp \
        --defsym _build_id=`perl -e 'printf "0x%08x", int ( rand ( 0xffffffff ) );'` \
        --defsym _build_timestamp=1448321974 \
        -Map bin/1af41000.rom.tmp.map
ld:arch/i386/scripts/i386.lds:97: syntax error
Makefile.housekeeping:1033: recipe for target 'bin/1af41000.rom.tmp' failed
gmake: *** [bin/1af41000.rom.tmp] Error 1
rm bin/version.1af41000.rom.o

3e04f0791e614772f3ffe3663e4c8da71e2bc981 is the first bad commit
commit 3e04f0791e614772f3ffe3663e4c8da71e2bc981
Author: Michael Brown <mcb30 at ipxe.org>
Date:   Tue Feb 24 16:13:55 2015 +0000

    [prefix] Use .bss16 as temporary stack space for calls to install_block
    Some decompression algorithms (e.g. LZMA) require large amounts of
    temporary stack space, which may not be made available by all
    prefixes.  Use .bss16 as a temporary stack for the duration of the
    calls to install_block (switching back to the external stack before we
    start making calls into code which might access variables in .bss16),
    and allow the decompressor to define a global symbol to force a
    minimum value on the size of .bss16.
    Signed-off-by: Michael Brown <mcb30 at ipxe.org>

:040000 040000 0b95b7ee3f9ed9d2edf00dea04fd95b255e8b83d 5e200727f8a9649ce3cae861b1dd41e7ff3f0eee M      src

More information about the ipxe-devel mailing list