Make the entry point padding code logic looks nicer

This commit is contained in:
Homer Hsing 2012-09-14 13:40:08 +08:00 committed by Damien Lespiau
parent 73ab2f6a68
commit f02a1ed427

View File

@ -300,7 +300,8 @@ int main(int argc, char **argv)
entry->inst_offset = inst_offset;
entry1 = entry->next;
if (entry1 && entry1->islabel && is_entry_point(entry1->string)) {
while (((inst_offset+1) & 0x3) != 0) {
// insert empty instructions until (inst_offset+1) % 4 == 0
while (((inst_offset+1) % 4) != 0) {
tmp_entry = calloc(sizeof(*tmp_entry), 1);
entry->next = tmp_entry;
tmp_entry->next = entry1;