[oi-dev] strange compiler error
Toomas Soome
tsoome at me.com
Fri Nov 4 21:12:50 UTC 2022
> On 4. Nov 2022, at 22:47, Friedrich Kink <friedrich.kink at fkink.de> wrote:
>
> hmm but I understand the manpage that -b is the linker switch and binary the input format key word, which is valid see below. And even I use it like '-Wl,-b,binary` it gives the same error.
>
how about -Wl,-b -Wl,binary ?
rgds,
toomas
> objdump -i
> BFD header file version (GNU Binutils) 2.39
> elf32-i386-sol2
> (header little endian, data little endian)
> i386
> elf32-iamcu
> (header little endian, data little endian)
> iamcu
> coff-i386
> (header little endian, data little endian)
> i386
> pei-i386
> (header little endian, data little endian)
> i386
> elf64-x86-64-sol2
> (header little endian, data little endian)
> i386
> pe-x86-64
> (header little endian, data little endian)
> i386
> pei-x86-64
> (header little endian, data little endian)
> i386
> elf64-little
> (header little endian, data little endian)
> i386
> iamcu
> elf64-big
> (header big endian, data big endian)
> i386
> iamcu
> elf32-little
> (header little endian, data little endian)
> i386
> iamcu
> elf32-big
> (header big endian, data big endian)
> i386
> iamcu
> srec
> (header endianness unknown, data endianness unknown)
> i386
> iamcu
> symbolsrec
> (header endianness unknown, data endianness unknown)
> i386
> iamcu
> verilog
> (header endianness unknown, data endianness unknown)
> i386
> iamcu
> tekhex
> (header endianness unknown, data endianness unknown)
> i386
> iamcu
> binary
> (header endianness unknown, data endianness unknown)
> i386
> iamcu
> ihex
> (header endianness unknown, data endianness unknown)
> i386
> iamcu
> plugin
> (header little endian, data little endian)
>
> elf32-i386-sol2 elf32-iamcu coff-i386 pei-i386 elf64-x86-64-sol2
> i386 elf32-i386-sol2 ----------- coff-i386 pei-i386 elf64-x86-64-sol2
> iamcu --------------- elf32-iamcu --------- -------- -----------------
>
> pe-x86-64 pei-x86-64 elf64-little elf64-big elf32-little elf32-big
> i386 pe-x86-64 pei-x86-64 elf64-little elf64-big elf32-little elf32-big
> iamcu --------- ---------- elf64-little elf64-big elf32-little elf32-big
>
> srec symbolsrec verilog tekhex binary ihex plugin
> i386 srec symbolsrec verilog tekhex binary ihex ------
> iamcu srec symbolsrec verilog tekhex binary ihex ------
>
>
> Am 04.11.2022 um 21:34 schrieb Toomas Soome:
>> You pass -b ( to linker) but not “binary”.
>>
>> Sent from my iPhone
>>
>>> On 4. Nov 2022, at 22:14, Friedrich Kink via oi-dev <oi-dev at openindiana.org> <mailto:oi-dev at openindiana.org> wrote:
>>>
>>> Hi all,
>>>
>>> I try to compile the newest asterisk version, but I get the following linker error:
>>>
>>> /usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r -Wl,-b binary -o res_geolocation/pidf_lo_test.o res_geolocation/pidf_lo_test.xml
>>> ld: fatal: file binary: open failed: No such file or directory
>>>
>>> /usr/gcc/7/bin/gcc -g -nostartfiles -nodefaultlibs -nostdlib -r -Wl,--format=binary -o res_geolocation/pidf_lo_test.o res_geolocation/pidf_lo_test.xml
>>> ld: fatal: unrecognized option '--format=binary'
>>> ld: fatal: use the -z help option for usage information
>>>
>>> according to the man page (man ld) both variants are allowed, so I'd assume that it works (s. below)
>>>
>>> ..
>>>
>>>
>>> -b input-format
>>> --format=input-format
>>> ld may be configured to support more than one kind of object file.
>>> If your ld is configured this way, you can use the -b option to
>>> specify the binary format for input object files that follow this
>>> option on the command line. Even when ld is configured to support
>>> alternative object formats, you don't usually need to specify this,
>>> as ld should be configured to expect as a default input format the
>>> most usual format on each machine. input-format is a text string,
>>> the name of a particular format supported by the BFD libraries.
>>> (You can list the available binary formats with objdump -i.)
>>>
>>> You may want to use this option if you are linking files with an
>>> unusual binary format. You can also use -b to switch formats
>>> explicitly (when linking object files of different formats), by
>>> including -b input-format before each group of object files in a
>>> particular format.
>>>
>>> The default format is taken from the environment variable
>>> "GNUTARGET".
>>>
>>> You can also define the input format from a script, using the
>>> command "TARGET";
>>>
>>> Any idea what else could be wrong?
>>>
>>> kind regards,
>>>
>>> Fritz
>>>
>>>
>>> _______________________________________________
>>> oi-dev mailing list
>>> oi-dev at openindiana.org <mailto:oi-dev at openindiana.org>
>>> https://openindiana.org/mailman/listinfo/oi-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openindiana.org/pipermail/oi-dev/attachments/20221104/07fba990/attachment.html>
More information about the oi-dev
mailing list