doc: describe dropping unused tables from static builds
Adds a short README section: compile with -ffunction-sections -fdata-sections and link with -Wl,--gc-sections, so a static build drops the precomputed tables and code a program never calls. A verification-only program should use secp256k1_context_static, because a context from secp256k1_context_create keeps the signing table linked in.
Addresses the last open item of #1065 (the other items are checked). real-or-random agreed to a docs PR in the thread.
Size of text in bytes, static library built with the default modules and CFLAGS="-g -O2", plus the section flags in the last column:
| program | no flags | sections + gc |
|---|---|---|
| signing only (ECDSA + Schnorr) | 1340145 | 131364 |
verifying only, context_static |
1340313 | 1128701 |
verifying only, context_create |
1340281 | 1234429 |
Measured with size and nm on the linked binaries (Debian trixie, aarch64, GCC 14.2, GNU ld 2.44); Autotools and CMake give identical sizes.