Re: C++ objects with virtual tables in eeprom

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



jon.busenkell@xxxxxxx writes:

> The EEPROM is not directly write addressable, executing and reading are
> directly addressable. Either using gcc or other compiler's I can place
> the object(variable) where I want it. But then all the compilers that I
> have tried, use some sort of direct addressing to write the vtable's
> address into the object. My thought was that if the compiler generated a
> call to an out-of-line function like: 
> void setVtableAddress( object* dest, vtable* value )
> {
> 	*((uint32_t*)dest) = value;
> }
>
> Then in could right an overload for the function that would do the
> correct operation, and place this function as the first module to link.
> There-by replacing the compiler's library function. 
>
> While I realize this adds a performance overhead, I suggested to the
> vendor that this could be controlled by a command line switch. There
> response was how about doing it with a pragma.
>
> Just to summarize; getting object into the locations I want them in
> memory, and writing to them is not a problem, because I can control all
> that. My only problem is with the code that the compiler generates to
> set the vtable's address in the object.

I see.  Yeah, g++ doesn't have anything to help you here today.  I
think this is a special case of an old general bug:
http://gcc.gnu.org/PR4131 .  Your suggestion of an overridable
function is interesting, but I personally would prefer to see a fix
for the general case.

The new constexpr keyword in C++0x may help, but g++ does not yet
implement it.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux