summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2010-07-29 10:12:29 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2010-07-30 00:51:44 +0400
commitd7b654c73da25a597f526303b967fcb713c0ae20 (patch)
tree60869d921f31d1e80c55f6ecde44e768fb87f1c1
parent16cbf9b5c24437e83362da988e5a49fd458ae6c6 (diff)
downloadnasm-d7b654c73da25a597f526303b967fcb713c0ae20.tar.gz
elf: Move stabs symbol table format into outelf.h
Get rid of code duplication Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--output/outelf.h9
-rw-r--r--output/outelf32.c8
-rw-r--r--output/outelf64.c8
3 files changed, 9 insertions, 16 deletions
diff --git a/output/outelf.h b/output/outelf.h
index b47f3177..8ab76b0d 100644
--- a/output/outelf.h
+++ b/output/outelf.h
@@ -80,6 +80,15 @@ extern const struct elf_known_section elf_known_sections[];
#define sec_stabstr (nsections-2)
#define sec_rel_stab (nsections-1)
+/* stabs symbol table format */
+struct stabentry {
+ uint32_t n_strx;
+ uint8_t n_type;
+ uint8_t n_other;
+ uint16_t n_desc;
+ uint32_t n_value;
+};
+
/* dwarf */
#define sec_debug_aranges (nsections-10)
#define sec_rela_debug_aranges (nsections-9)
diff --git a/output/outelf32.c b/output/outelf32.c
index 14df371f..a85acf04 100644
--- a/output/outelf32.c
+++ b/output/outelf32.c
@@ -142,14 +142,6 @@ static struct SAA *elf_build_symtab(int32_t *, int32_t *);
static struct SAA *elf_build_reltab(int32_t *, struct Reloc *);
static void add_sectname(char *, char *);
-struct stabentry {
- uint32_t n_strx;
- uint8_t n_type;
- uint8_t n_other;
- uint16_t n_desc;
- uint32_t n_value;
-};
-
struct erel {
int offset, info;
};
diff --git a/output/outelf64.c b/output/outelf64.c
index e6cd8d86..9807c2a2 100644
--- a/output/outelf64.c
+++ b/output/outelf64.c
@@ -143,14 +143,6 @@ static struct SAA *elf_build_symtab(int32_t *, int32_t *);
static struct SAA *elf_build_reltab(uint64_t *, struct Reloc *);
static void add_sectname(char *, char *);
-struct stabentry {
- uint32_t n_strx;
- uint8_t n_type;
- uint8_t n_other;
- uint16_t n_desc;
- uint32_t n_value;
-};
-
struct erel {
int offset, info;
};