I built a custom esp8266 lwip library variant based on the v2 Lower Memory (no features) version so I could implement the LWIP_HOOK_IP4_INPUT function.
However, when I build my sketch with the new library, I get a .text1' will not fit in region iram1_0_seg' error.
Between the builds using the two lwip variants, the map file shows two different core.a libraries being used for some reason.
The bad build uses /tmp/arduino/cores/b694a3edb968e8b3b6f5c53838d22f44/core.a and the good build uses /tmp/arduino/sketches/96E307F36729D6C219729E15DDE2A6C3/core/core.a
The bad build puts all of the text in iram. The good build does not.
Where might I look to figure out why two different core.a files are being used?
I think that the two different core file locations is a red-herring.
The issue is clear from the map files being generated. In the lwip variant where LWIP_HOOK_IP4_INPUT function is implemented, many more functions from the lwip library are being put into .text1
The only thing that I did was add an empty hook function like this...
It is otherwise identical to the no features low memory v4 variant. Why would adding this hook require so much more stuff to be moved into text from flash?