mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Start work on updating p_tos.
This commit is contained in:
parent
2007fe5f49
commit
f009fe1f63
|
@ -419,6 +419,8 @@ void PackTos::pack(OutputFile *fo)
|
||||||
const unsigned i_sym = ih.fh_sym;
|
const unsigned i_sym = ih.fh_sym;
|
||||||
const unsigned i_bss = ih.fh_bss;
|
const unsigned i_bss = ih.fh_bss;
|
||||||
|
|
||||||
|
symbols.reset();
|
||||||
|
|
||||||
// read file
|
// read file
|
||||||
const unsigned isize = file_size - i_sym;
|
const unsigned isize = file_size - i_sym;
|
||||||
ibuf.alloc(isize);
|
ibuf.alloc(isize);
|
||||||
|
|
18
src/p_tos.h
18
src/p_tos.h
|
@ -75,6 +75,24 @@ protected:
|
||||||
|
|
||||||
tos_header_t ih, oh;
|
tos_header_t ih, oh;
|
||||||
|
|
||||||
|
struct LinkerSymbols
|
||||||
|
{
|
||||||
|
enum { LOOP_UNKNOWN, LOOP_SUBQ_L, LOOP_SUBQ_W, LOOP_DBRA };
|
||||||
|
// before linker->relocate()
|
||||||
|
unsigned loop1_count; int loop1_mode;
|
||||||
|
unsigned loop2_count; int loop2_mode;
|
||||||
|
unsigned loop3_count; int loop3_mode;
|
||||||
|
// after linker->relocate()
|
||||||
|
unsigned copy_to_stack_len;
|
||||||
|
unsigned flush_cache_rts_offset;
|
||||||
|
unsigned clear_bss_size_p4;
|
||||||
|
unsigned clear_dirty_stack_len;
|
||||||
|
// FIXME: up11 etc.
|
||||||
|
|
||||||
|
void reset() { memset(this, 0, sizeof(*this)); }
|
||||||
|
};
|
||||||
|
LinkerSymbols symbols;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
unsigned patch_d_subq(void *l, int llen, int, unsigned, const char*);
|
unsigned patch_d_subq(void *l, int llen, int, unsigned, const char*);
|
||||||
unsigned patch_d_loop(void *l, int llen, int, unsigned, const char*, const char*);
|
unsigned patch_d_loop(void *l, int llen, int, unsigned, const char*, const char*);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user