aboutsummaryrefslogtreecommitdiff
path: root/gas/expr.h
diff options
context:
space:
mode:
authorMark Harmstone <mark@harmstone.com>2022-04-07 14:47:17 +0100
committerNick Clifton <nickc@redhat.com>2022-04-07 14:47:17 +0100
commit145667f8d991932165a70d7c1551620be44e4b4f (patch)
tree1166831bf54cbafa71f078c8a567a4fd2b36ee21 /gas/expr.h
parent591cc9fbbfd6d51131c0f1d4a92e7893edcc7a28 (diff)
downloadbinutils-145667f8d991932165a70d7c1551620be44e4b4f.zip
binutils-145667f8d991932165a70d7c1551620be44e4b4f.tar.gz
binutils-145667f8d991932165a70d7c1551620be44e4b4f.tar.bz2
Add support for COFF secidx relocations
bfd * coff-i386.c (in_reloc_p): Add R_SECTION. (howto_table): Add R_SECTION. (coff_pe_i386_relocation_section): Add support for R_SECTION. (coff_i386_reloc_type_lookup): Add support for BFD_RELOC_16_SECCIDX. * coff-x86_64.c (in_reloc_p): Add R_SECTION. (howto_table): Add R_SECTION. (coff_pe_amd64_relocation_section): Add support for R_SECTION. (coff_amd64_reloc_type_lookup): Add support for BFD_RELOC_16_SECCIDX. * reloc.c: Add BFD_RELOC_16_SECIDX. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. gas * config/tc-i386.c (pe_directive_secidx): New function. (md_pseudo_table): Add support for secidx. (x86_cons_fix_new): Likewise. (tc_gen_reloc): Likewise. * expr.c (op_rank): Add O_secidx. * expr.h (operatorT): Likewise. * symbols.c (resolve_symbol_value): Add support for O_secidx. * testsuite/gas/i386/secidx.s: New test source file. * testsuite/gas/i386/secidx.d: New test driver file. * testsuite/gas/i386/i386.exp: Run new test. include * coff/i386.h: Define R_SECTION. * coff/x86_64.h: Likewise. ld * testsuite/ld-pe/secidx1.s: New test source file. * testsuite/ld-pe/secidx2.s: New test source file. * testsuite/ld-pe/secidx.d: New test driver file. * testsuite/ld-pe/secidx_64.d: New test driver file. * testsuite/ld-pe/pe.exp: Add new tests.
Diffstat (limited to 'gas/expr.h')
-rw-r--r--gas/expr.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/gas/expr.h b/gas/expr.h
index 3471e7c..dff4085 100644
--- a/gas/expr.h
+++ b/gas/expr.h
@@ -18,28 +18,27 @@
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
-/*
- * By popular demand, we define a struct to represent an expression.
- * This will no doubt mutate as expressions become baroque.
- *
- * Currently, we support expressions like "foo OP bar + 42". In other
- * words we permit a (possibly undefined) symbol, a (possibly
- * undefined) symbol and the operation used to combine the symbols,
- * and an (absolute) augend. RMS says this is so we can have 1-pass
- * assembly for any compiler emissions, and a 'case' statement might
- * emit 'undefined1 - undefined2'.
- *
- * The type of an expression used to be stored as a segment. That got
- * confusing because it overloaded the concept of a segment. I added
- * an operator field, instead.
- */
+/* By popular demand, we define a struct to represent an expression.
+ This will no doubt mutate as expressions become baroque.
+
+ Currently, we support expressions like "foo OP bar + 42". In other
+ words we permit a (possibly undefined) symbol, a (possibly
+ undefined) symbol and the operation used to combine the symbols,
+ and an (absolute) augend. RMS says this is so we can have 1-pass
+ assembly for any compiler emissions, and a 'case' statement might
+ emit 'undefined1 - undefined2'.
+
+ The type of an expression used to be stored as a segment. That got
+ confusing because it overloaded the concept of a segment. I added
+ an operator field, instead. */
/* This is the type of an expression. The operator types are also
used while parsing an expression.
NOTE: This enumeration must match the op_rank array in expr.c. */
-typedef enum {
+typedef enum
+{
/* An illegal expression. */
O_illegal,
/* A nonexistent expression. */
@@ -50,6 +49,8 @@ typedef enum {
O_symbol,
/* X_add_symbol + X_add_number - the base address of the image. */
O_symbol_rva,
+ /* The section index of X_add_symbol. */
+ O_secidx,
/* A register (X_add_number is register number). */
O_register,
/* A big value. If X_add_number is negative or 0, the value is in
@@ -112,7 +113,8 @@ typedef enum {
O_max
} operatorT;
-typedef struct expressionS {
+typedef struct expressionS
+{
/* The main symbol. */
symbolS *X_add_symbol;
/* The second symbol, if needed. */
@@ -182,12 +184,10 @@ extern unsigned int get_single_number (void);
extern symbolS *make_expr_symbol (expressionS * expressionP);
extern int expr_symbol_where (symbolS *, const char **, unsigned int *);
extern void current_location (expressionS *);
-
extern symbolS *expr_build_uconstant (offsetT);
extern symbolS *expr_build_dot (void);
extern uint32_t generic_bignum_to_int32 (void);
extern uint64_t generic_bignum_to_int64 (void);
-
-int resolve_expression (expressionS *);
+extern int resolve_expression (expressionS *);
extern bool literal_prefix_dollar_hex;