On 11/9/18 9:58 PM, Daniel Engel wrote:
> Is the linker aware of section hierarchy, such that using a common section 
> prefix (e.g. ".text.m0fp.*") would gather the appropriate sections together 
> from multiple object files?

The linker script is not written like that.  But we could reasonably replace
the current ".text.*" with "SORT(.text.*)" with no ill effects (since the
current ordering is not guaranteed, no one should be depending on it).

> Adding such rules to the default linker script wouldn't be ideal, as everyone 
> using a custom script might then have library breakage unless they knew to 
> add equivalent rules.

*shrug* But what other solution?  At least the failure isn't silent -- the
branches will be out of range and the link will fail.  Anyone using their own
linker script must be willing to adjust to compiler changes over time, and in
this case the fix is trivial.

> If the consensus is to split the library, it might help to add a set of 
> intermediate branches (trampolines?) in the libm portion.  This would add 
> execution cycles, but not require as many extra bytes.

I don't think it's a good idea to put sin() into libgcc.  That really does
belong over in newlib.  Trampolines do sound like a reasonable solution.


r~

Reply via email to