Hi Michael, A recent upload of tcc in Debian showed a self test failure [1] 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.
[1] https://buildd.debian.org/status/fetch.php?pkg=tcc&arch=armhf&ver=0.9.27%7Egit20140907.87d879a-1&stamp=1410110433 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). Best regards, Thomas
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
