strange OS dependent behavior of bfd_get_flavour()
Andreas Schwab
schwab@linux-m68k.org
Fri Apr 30 10:19:28 GMT 2021
On Apr 30 2021, Peng Yu via Binutils wrote:
> Hi,
>
> #define PACKAGE 1
> #define PACKAGE_VERSION 1
> #include <bfd.h>
> #include <stdio.h>
>
> int main(int argc, char *argv[]) {
> bfd_init();
> bfd *bfd_h = bfd_openr(argv[1], 0);
> printf("bfd_get_flavour(bfd_h) = %d\n", bfd_get_flavour(bfd_h));
> bfd_close(bfd_h);
> }
>
>
> For the above C file, it returns the following on macOS.
>
> $ ./main.exe test_file
> bfd_get_flavour(bfd_h) = 17
>
> But it returns the following macOS.
>
> $ ./main.exe test_file
> bfd_get_flavour(bfd_h) = 5
You are using NULL as the target, which means the default target.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
More information about the Binutils
mailing list