File: labels.h

package info (click to toggle)
nasm 3.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,660 kB
  • sloc: ansic: 129,101; asm: 40,471; perl: 8,238; sh: 4,146; makefile: 1,281; xml: 726; python: 582; lisp: 578; sed: 11
file content (42 lines) | stat: -rw-r--r-- 1,299 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* SPDX-License-Identifier: BSD-2-Clause */
/* Copyright 1996-2018 The NASM Authors - All Rights Reserved */

/*
 * labels.h  header file for labels.c
 */

#ifndef LABELS_H
#define LABELS_H

#include "compiler.h"

enum label_type {
    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 */
};

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);
bool declare_label(const char *label, enum label_type type,
                   const char *special);
void set_label_mangle(enum directive which, const char *what);
int init_labels(void);
void cleanup_labels(void);
const char *local_scope(const char *label);

extern uint64_t global_offset_changed;

#endif /* LABELS_H */