1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-22 21:23:07 +03:00
Earle F. Philhower, III 97c926ea91 Move all PSTRs to own section, allow string dedup (#6565)
* Move all PSTRs to own section, allow string dedup

GNU ld can deduplicate strings, and does so for most normal char *s
automatically.  However, for PSTRs we were using a unique section per
string *and* the section was not flagges as containing dedupable
0-terminated strings.

Modify the PSTR macro to emit assembly, which lets us set the section
flags required (SM) for the variables, and use inline assembly to get
the asm-block defined address.

Should result in smaller compiled binaries if any strings are
duplicated.

* Give each PSTR its own segment

* Allow disposing of unused strings before merging

Add the "a" section flag to allow the linker to throw away unneeded
strings.  Without this flag, the linker will not discard unreferenced
strings and ROMs will increase in size, possibly dramatically.
2019-10-01 01:27:10 +02:00
..