This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
If you have only one procesor stack (i.e. single-threaded execution), you can handle
hmm.. what's about doing it gc-like. Instead of a stack there simply is a 'pool' of trampolines from which trampolines are allocated and a pointer to the trampoline is pushed on the stack.
When the last trampoline from the pool is allocated, a 'garbage collector' is running over it and looking for pointers to trampolines between the stack pointer and the stack start address. Every trampoline which isn't possibly referenced is added to a free-list from which new trampolines are allocated.
Instead of adding the trampoline pool to libgcc (as suggested earlier inYou don't need a linkonce section for this. The function that needs a trampoline
this thread) I would suggest that gcc generates a trampoline pool in a
linkonce section every time a source file is compiled which requires
trampolines. That way there wouldn't be any trampoline pool in an
executeable which doesn't need one
This is messy; say you have two libraries that are compiled with -ftrampoline-pool-size=32 ;and a compiler option such as -ftrampoline-pool-size=32 could be used the specify the size of the trampoline pool on the command line.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |