diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-07-19 14:25:27 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-07-19 14:25:27 +0200 |
commit | 5cf65bed5e3112e72bb4619d8372c9c649ca8753 (patch) | |
tree | 8bd5dd8608dab86753d505da1a4f298a28e8ce5d | |
parent | d37f496059bba635eeb4ecd4262b9a05f088d09d (diff) | |
download | bxgen-5cf65bed5e3112e72bb4619d8372c9c649ca8753.zip |
Separate ELF dump function
-rwxr-xr-x | bxgen.c | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -1706,13 +1706,6 @@ Symbol_Entry elf_symbol( i64 sym_value = read_i64(LE, begin + 8, end); i64 sym_size = read_i64(LE, begin + 16, end); - Offset_Size dst = - sym_shndx >= 0 && - sym_shndx < elf_section_headers(b).num ? elf_section(b, sym_shndx).data - : (Offset_Size) {0}; - - BX_CHECK(dst.size == 0 || sym_value + sym_size <= dst.size, "Buffer overflow", (Symbol_Entry) {0}); - u8 type = (sym_info & 0xf) == 0 ? SYM_NONE : (sym_info & 0xf) == 1 ? SYM_DATA : (sym_info & 0xf) == 2 ? SYM_PROC : @@ -1721,7 +1714,7 @@ Symbol_Entry elf_symbol( (sym_info & 0xf) == 6 ? SYM_TLS : SYM_SPECIFIC; - BX_CHECK(type != SYM_NONE || (sym_info & 0xf) == 0, "Unknown symbol type", (Symbol_Entry) {0}); + BX_CHECK(type == SYM_SPECIFIC, "Unknown symbol type", (Symbol_Entry) {0}); u8 bind = (sym_info >> 4) == 1 ? BIND_GLOBAL : (sym_info >> 4) == 2 ? BIND_WEAK : @@ -1732,7 +1725,7 @@ Symbol_Entry elf_symbol( .type = type, .bind = bind, .value = { - .offset = dst.offset + sym_value, + .offset = sym_value, .size = sym_size, }, }; |