bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/25120] New: Portability issues in binutils 2.33 due to lib


From: harald at gigawatt dot nl
Subject: [Bug binutils/25120] New: Portability issues in binutils 2.33 due to libctf
Date: Sun, 20 Oct 2019 15:32:03 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=25120

            Bug ID: 25120
           Summary: Portability issues in binutils 2.33 due to libctf
           Product: binutils
           Version: 2.33
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: harald at gigawatt dot nl
  Target Milestone: ---

binutils 2.32 was able to be compiled with tcc on uclibc-ng, but this does not
work with binutils 2.33.1 without hacks.

1:

libctf/ctf-archive.c uses __thread unconditionally. The configure script
detects support for this and conditionally defined HAVE_TLS, but the definition
is not guarded by HAVE_TLS. I am not sure what the best fix here is. Just
removing __thread lets this compile, but this obviously causes problems if
threads actually get created. From what I can see, only gold creates threads,
so maybe __thread can be removed when gold is disabled?

2:

libctf/ctf-impl.h provides no fallback definitions for
_libctf_printflike_/_libctf_unlikely_/_libctf_unused_/_libctf_malloc_ when
__GNUC__ is not defined. These need to be defined to expand to nothing, like
so:

  #define _libctf_printflike_(string_index,first_to_check)
  #define _libctf_unlikely_(x) (x)
  #define _libctf_unused_
  #define _libctf_malloc_

3:

libctf/swap.h and elfcpp/elfcpp_swap.h assume that if <byteswap.h> is present,
it defined bswap_64, but on uclibc-ng, it only does so when GCC is used. This
results in linker errors due do a missing definition of bswap_64. The presence
of bswap_64 should be detected by configure, and the existing static inline
fallback definition in *swap.h used if libc does not provide it.

4:

readelf fails to link due to libbfd.la not being linked, complaining about
undefined symbols bfd_close_all_done, bfd_get_error, bfd_errmsg,
bfd_get_section_by_name, bfd_malloc_and_get_section,
bfd_section_from_elf_index, bfd_fdopenr, bfd_check_format. The fact that this
only fails with tcc, not with gcc, suggests that there may be dead code in
readelf calling these functions that gets optimised away by gcc, but not by
tcc. If this is correct, then readelf should be linked against libbfd unless
the dead code can be removed, but I have not investigated this in detail.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]