diff options
author | mengqinggang <mengqinggang@loongson.cn> | 2023-06-13 16:07:12 +0800 |
---|---|---|
committer | liuzhensong <liuzhensong@loongson.cn> | 2023-06-16 17:32:02 +0800 |
commit | d2fddb6d783320726328707d53aa74e3c48616ef (patch) | |
tree | f4bf27986a363d92aeafbf4cc586b8e0276a3157 /gas/config | |
parent | 8203d5e72e3991afbb7adf8c44e6f80a59ca379d (diff) | |
download | gdb-d2fddb6d783320726328707d53aa74e3c48616ef.zip gdb-d2fddb6d783320726328707d53aa74e3c48616ef.tar.gz gdb-d2fddb6d783320726328707d53aa74e3c48616ef.tar.bz2 |
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.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-loongarch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c index 5ca9de4..d1c5ce2 100644 --- a/gas/config/tc-loongarch.c +++ b/gas/config/tc-loongarch.c @@ -1382,7 +1382,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_LARCH_SUB_ULEB128: { unsigned int len = 0; - _bfd_read_unsigned_leb128 (NULL, (bfd_byte *)buf, &len); + len = loongarch_get_uleb128_length ((bfd_byte *)buf); bfd_byte *endp = (bfd_byte*) buf + len -1; /* Clean the uleb128 value to 0. Do not reduce the length. */ memset (buf, 0x80, len - 1); |