[MLton] experimental release 20051109

Florian Weimer fw@deneb.enyo.de
Tue, 15 Nov 2005 15:08:29 +0100

* Matthew Fluet:

>> I'm not sure how to fix this, maybe using a special section for the
>> profiling label addresses is the proper approach.
> Could you say more about how a special section would address the problem? 
> We need the profiling labels in the text section, since we want to map PC 
> addresses back to profiling labels.

I had an idea along the following lines:

#define ProfilingLabel(l) \
  __asm__ volatile (".section labels\n\t" \
                    ".long " #l ", 1f\n\t" \

As a result, label/address pairs accumulate in the "labels" section.
I couldn't find I good way to derive the size of that section, though.
Using debugging information, or some postprocessor on the generated
assembler code might be preferable.