aboutsummaryrefslogtreecommitdiff
path: root/gas/config/obj-elf.c
diff options
context:
space:
mode:
authorChristian Eggers <ceggers@gmx.de>2020-11-01 09:10:14 +0100
committerAlan Modra <amodra@gmail.com>2020-11-03 18:17:35 +1030
commit05862db73fb5cad8bdae85e240b7b4713aad327e (patch)
treef2580205f7c0391e50ddf6ca07ce761675d67a6f /gas/config/obj-elf.c
parent706d7ce94809f3d647450eb54e2e77e4732bd9af (diff)
downloadgdb-05862db73fb5cad8bdae85e240b7b4713aad327e.zip
gdb-05862db73fb5cad8bdae85e240b7b4713aad327e.tar.gz
gdb-05862db73fb5cad8bdae85e240b7b4713aad327e.tar.bz2
gas: fix symbol value calculation for versioned symbol aliases
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. Signed-off-by: Christian Eggers <ceggers@gmx.de>
Diffstat (limited to 'gas/config/obj-elf.c')
-rw-r--r--gas/config/obj-elf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index f061ea6..93eb81e 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));