tccelf.c: Avoid two trivial instances of undefined behaviour.
This commit is contained in:
parent
951c23f257
commit
c52128c581
1 changed files with 4 additions and 2 deletions
4
tccelf.c
4
tccelf.c
|
@ -812,7 +812,8 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s)
|
||||||
{
|
{
|
||||||
tcc_error("R_AARCH64_(JUMP|CALL)26 relocation failed (val=%lx, addr=%lx)", addr, val);
|
tcc_error("R_AARCH64_(JUMP|CALL)26 relocation failed (val=%lx, addr=%lx)", addr, val);
|
||||||
}
|
}
|
||||||
*(uint32_t *)ptr = 0x14000000 | (type == R_AARCH64_CALL26) << 31 |
|
*(uint32_t *)ptr = 0x14000000 |
|
||||||
|
(uint32_t)(type == R_AARCH64_CALL26) << 31 |
|
||||||
((val - addr) >> 2 & 0x3ffffff);
|
((val - addr) >> 2 & 0x3ffffff);
|
||||||
break;
|
break;
|
||||||
case R_AARCH64_ADR_GOT_PAGE: {
|
case R_AARCH64_ADR_GOT_PAGE: {
|
||||||
|
@ -2435,6 +2436,7 @@ static void tcc_output_elf(TCCState *s1, FILE *f, int phnum, ElfW(Phdr) *phdr,
|
||||||
offset++;
|
offset++;
|
||||||
}
|
}
|
||||||
size = s->sh_size;
|
size = s->sh_size;
|
||||||
|
if (size)
|
||||||
fwrite(s->data, 1, size, f);
|
fwrite(s->data, 1, size, f);
|
||||||
offset += size;
|
offset += size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue