Friday, 6 September 2013

Store variables in EFL section and iterate them later

Store variables in EFL section and iterate them later

I'm trying to store a few variables in the binary's section (like
__attribute((__section__("counters"))) ) and iterate over them, but I
can't find how to get the starting direction of that section.
Reading GCC's documentation I found that (automagically?) two variables
are created, in my case __start_counters and __stop_counters, but
iterating over that memory segment doesn't seem to contain the data I'm
looking for.
My question is: How can I store a few variables in a section and then get
those variables?

No comments:

Post a Comment