diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/labels.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/include/labels.h b/include/labels.h index 9cf57c1b..32df8071 100644 --- a/include/labels.h +++ b/include/labels.h @@ -48,17 +48,22 @@ enum mangle_index { }; enum label_type { - LBL_LOCAL, /* Must be zero */ - LBL_GLOBAL, + LBL_NONE = -1, /* No label */ + LBL_LOCAL = 0, /* Must be zero */ LBL_STATIC, + LBL_GLOBAL, LBL_EXTERN, + LBL_REQUIRED, /* Like extern but emit even if unused */ LBL_COMMON, LBL_SPECIAL, /* Magic symbols like ..start */ LBL_BACKEND /* Backend-defined symbols like ..got */ }; -bool lookup_label(const char *label, int32_t *segment, int64_t *offset); -bool is_extern(const char *label); +enum label_type lookup_label(const char *label, int32_t *segment, int64_t *offset); +static inline bool is_extern(enum label_type type) +{ + return type == LBL_EXTERN || type == LBL_REQUIRED; +} void define_label(const char *label, int32_t segment, int64_t offset, bool normal); void backend_label(const char *label, int32_t segment, int64_t offset); |