Marcin KoÅcielnicki wrote: > Fair enough. Here's what I'm going to implement in gold: > > - any PLT relocation: call > - PC32DBL on a larl: non-call > - PC32DBL otherwise: call > - any other relocation: non-call > > Does that sound right?
Hmm, I'm wondering about the PC32DBL choices. There are now a large number of other non-call instructions that use PC32DBL, including lrl, strl, crl, cgrl, cgfrl, ... However, these all access *data* at the pointed-to location, so it is quite unlikely they would ever be used with a function symbol. So, assuming that you also check that the target of the relocation is a function symbol, treating only larl as non-call might be OK. Maybe a more conservative approach might be to make the decision the other way round: for PC32DBL check for *branch* instructions, and treat only those are calls. There's just a few branch instruction using PC32DBL: brasl (call) brcl (conditional or unconditional sibcall) brcth (???) where the last one is extremely unlikely (but theorically possible) to be used as conditional sibcall combined with a register decrement; I don't think this can ever happen with current compilers however. For full completeness, there are also PC16DBL relocations that *could* target called functions, but only when compiling with the -msmall-exec flag to assume total executable size is less than 64 KB. These are used by the following instructions: bras brc brct brctg brxh brxhg brxle brxlg crj cgrj clrj clgrj cij cgij clij clgij Note that those are *all* branch instructions, so it might make sense to add any PC16DBL targetting a function symbol to the list of calls, just in case. (But since basically nobody ever uses -msmall-exec, it doesn't really matter much either.) Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain ulrich.weig...@de.ibm.com