diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2010-11-03 14:18:43 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2010-11-03 14:18:43 +0000 |
commit | 27dee630aae66dd61eb20135e7b8384088b1a496 (patch) | |
tree | 5d7a65630edd019c3798d373ffafb20c97d9b0a4 /gas/config/tc-i386-intel.c | |
parent | 3f9a327892c097ae5504004c6a11f7468df16c08 (diff) | |
download | gdb-27dee630aae66dd61eb20135e7b8384088b1a496.zip gdb-27dee630aae66dd61eb20135e7b8384088b1a496.tar.gz gdb-27dee630aae66dd61eb20135e7b8384088b1a496.tar.bz2 |
Properly fold _GLOBAL_OFFSET_TABLE_ in Intel syntax.
gas/
2010-11-03 H.J. Lu <hongjiu.lu@intel.com>
PR gas/12186
* config/tc-i386-intel.c (i386_intel_fold): Properly fold
_GLOBAL_OFFSET_TABLE_.
gas/testsuite/
2010-11-03 H.J. Lu <hongjiu.lu@intel.com>
PR gas/12186
* gas/i386/gotpc.s: Add more _GLOBAL_OFFSET_TABLE_ test.
* gas/i386/gotpc.d: Updated.
Diffstat (limited to 'gas/config/tc-i386-intel.c')
-rw-r--r-- | gas/config/tc-i386-intel.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c index 64d6824..1e563b2 100644 --- a/gas/config/tc-i386-intel.c +++ b/gas/config/tc-i386-intel.c @@ -227,15 +227,20 @@ static INLINE int i386_intel_check (const reg_entry *rreg, static INLINE void i386_intel_fold (expressionS *e, symbolS *sym) { + expressionS *exp = symbol_get_value_expression (sym); if (S_GET_SEGMENT (sym) == absolute_section) { offsetT val = e->X_add_number; - *e = *symbol_get_value_expression (sym); + *e = *exp; e->X_add_number += val; } else { + if (exp->X_op == O_symbol + && strcmp (S_GET_NAME (exp->X_add_symbol), + GLOBAL_OFFSET_TABLE_NAME) == 0) + sym = exp->X_add_symbol; e->X_add_symbol = sym; e->X_op_symbol = NULL; e->X_op = O_symbol; |