[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] Fallout from commit 01c041923474750a236da02561f0f88354458
[Tinycc-devel] Fallout from commit 01c041923474750a236da02561f0f8835445848b
Tue, 09 Sep 2014 22:17:47 +0800
KMail/4.14 (Linux/3.14-2-amd64; KDE/4.14.0; x86_64; ; )
A recent upload of tcc in Debian showed a self test failure  due to a
failed R_ARM_PC24 relocation. The two bits with the smallest weight are 0 so
it's a problem of out of range branch.
The biggest change in this code was your commits to get rid of
runtime_plt_and_got so I took a closer look at it. A few things surprised me
so I wanted to ask you some questions.
1) You added the support for R_ARM_GLOB_DAT and R_ARM_JUMP_SLOT relocations
but the computation you added ignore the possible addend at *ptr by doing a
simple assignment. Is that normal? Did I miss something?
2) When creating a GOT and PLT entry for a R_ARM_PC24, R_ARM_CALL or
R_ARM_JUMP24 you add the offset of the PLT entry to the place being relocated.
I'm not sure I got it right but it seems to me that the relocation will be
processed again in relocate_section and seems the symbol referenced is still
the target function (and not the PLT entry created) as the index in the r_info
field of the relocation has remained unchanged. Also this put some relocation
computation in build_got_entries. Why not change the initial relocation to
make it resolve to the PLT entry.
3) I don't see any test for the type of output when deciding what type of
relocation to add. So even when the output is in memory reloc_type will be
JUMP_SLOT which will lead to a PLT entry being created. This seems to
contradict the comment near the end of put_got_entry. The comment seems wrong
as I don't see how a branch could be relocated without a PLT entry.
4) the jump table that was removed in subsequent patch was only available when
outputing to memory. But now a PLT and GOT entry is created no matter what
type of output (see 3) above).
Description: This is a digitally signed message part.
|[Prev in Thread]
||[Next in Thread]|
- [Tinycc-devel] Fallout from commit 01c041923474750a236da02561f0f8835445848b,
Thomas Preud'homme <=