Re: Is some special attribute or qualifier required tomake C function tables to use the right linker stubs?

David Fernandez <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <[email protected]>
On 02/05/14 12:43, Jan Waclawek wrote:
>> 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".
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.

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.

Regards
David F.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.