Multiple relocation in ELF
Ian Lance Taylor
iant@google.com
Tue Jul 25 14:50:00 GMT 2006
More information about the Binutils mailing list
Tue Jul 25 14:50:00 GMT 2006
- Previous message (by thread): Multiple relocation in ELF
- Next message (by thread): Multiple relocation in ELF
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Paul Brook <paul@codesourcery.com> writes: > > Note that you can always do a jump table using a PC relative > > relocation against a single symbol, plus an addend. > > Not always. You may want to put the table itself in .rodata (to reduce code > size for better constant pool placement), and have the values in the table be > relative to the branch instruction. Especially with hot/cold partitioning > there's no guarantee that both the jump and the target will be in the same > section. eg: I agree that that case won't work, but I stand by my statement. You do have to make the values in the table be relative to the start of the table. That is a restriction, but it is unlikely to be a serious one. You have to put the address of the table into a register either way, and then you have to load the branch offset either way. The question then is whether you want to jump to the sum of two registers (which generally means an addition followed by a jump to register indirect), or jump to a PC relative address plus a register. Most modern processors generally do not have an instruction which jumps to a PC relative address plus a register (if you need a separate addition, then you might as well use the other approach). (I agree that in the specific case of such a processor, it would be desirable to define a relocation pair which can compute the different of two arbitrary symbols. Such a relocation pair is conceptually no different than, e.g., R_MIPS_HI16/R_MIPS_LO16.) Ian
- Previous message (by thread): Multiple relocation in ELF
- Next message (by thread): Multiple relocation in ELF
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list