[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Is some special attribute or qualifier required tomak
Re: [avr-gcc-list] Is some special attribute or qualifier required tomake C function tables to use the right linker stubs?
Fri, 02 May 2014 13:16:55 +0100
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
On 02/05/14 12:43, Jan Waclawek wrote:
Sorry, I meant if gcc will create the right relocation for the function
pointer value, so that the linker puts a stub in trampolines, or if I
have to use some special attribute to make it do so for some pointers.
Will avr-gcc use the right relocation when picking one function from the
array and calling it?
No, the relocation happened earlier, when the function pointer is getting
allocated during linking (i.e when the *value* of the function pointer is
getting determined). All the function pointers are 16-bit, but they will
get a stub allocated in the "trampolines". If you use linker relaxation,
only those functions allocated above the >64kW boundary will get a stub,
others are used "directly".
You've already answer this below, so the answer is that gcc wiill always
create a 16-bit relocation and the linker will create a stub always for
function pointers going into data objetcs, or only for the ones above
128Kb (64Kwords) if linker relaxation is selected.
Thanks for the help.