[PATCH] gas: fix symbol value calculation for versioned symbol aliases
Christian Eggers
ceggers@gmx.de
Sun Nov 1 08:10:14 GMT 2020
Symbol value is in bytes while fragS::fr_address is in octets. Fixes GAS
symver12 and symver13 tests on ELF targets with with OCTETS_PER_BYTE>1.
* config/obj-elf (elf_frob_symbol): Fix symbol value calculation
for versioned symbol aliases.
* po/gas.pot: Regenerate.
Signed-off-by: Christian Eggers <ceggers@gmx.de>
---
gas/config/obj-elf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index f061ea61f3e..93eb81e98a4 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -2588,7 +2588,8 @@ elf_frob_symbol (symbolS *symp, int *puntp)
because we are in the middle of the final loop. */
S_SET_VALUE (symp2,
(S_GET_VALUE (symp)
- - symbol_get_frag (symp)->fr_address));
+ - (symbol_get_frag (symp)->fr_address
+ / OCTETS_PER_BYTE)));
symbol_set_frag (symp2, symbol_get_frag (symp));
--
2.26.2
More information about the Binutils
mailing list