LoongArch: Fix ld "undefined reference" error with --enable-shared
commitd2fddb6d783320726328707d53aa74e3c48616ef
authormengqinggang <mengqinggang@loongson.cn>
Tue, 13 Jun 2023 08:07:12 +0000 (13 16:07 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Fri, 16 Jun 2023 09:32:02 +0000 (16 17:32 +0800)
treef4bf27986a363d92aeafbf4cc586b8e0276a3157
parent8203d5e72e3991afbb7adf8c44e6f80a59ca379d
LoongArch: Fix ld "undefined reference" error with --enable-shared

  Because _bfd_read_unsigned_leb128 is hidden visibility, so it can't
  be referenced out of shared object.

  The new function loongarch_get_uleb128_length just used to call
  _bfd_read_unsigned_leb128.

bfd/ChangeLog:

* elfxx-loongarch.c (loongarch_get_uleb128_length): New function.
* elfxx-loongarch.h (loongarch_get_uleb128_length): New function.

gas/ChangeLog:

* config/tc-loongarch.c (md_apply_fix): Use
loongarch_get_uleb128_length.
bfd/elfxx-loongarch.c
bfd/elfxx-loongarch.h
gas/config/tc-loongarch.c