diff options
Diffstat (limited to 'bxgen.c')
-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, }, }; |