Patent Document ID: 10133560
Application ID: 15273527

Base Claim:
1. A method for optimizing source code, the method comprising: optimizing, at a compiler, the source code from files of a computer program at link-time; receiving, at a linker, a customized linker script, wherein the customized linker script is provided by an embedded application developer and overrides a default linker script existing within the linker, the customized liker script defining output sections for files of an executable version of the files of the computer program; adding, by the compiler, to intermediate representation files having global or local symbols, metadata comprising default section assignment information for the symbols; recording, by the linker, for symbols in machine code files, an origin path and an output section; sending, from the linker to the compiler, detailed global scope and use information, then; parsing, by the compiler, based on a request and the detailed global scope and use information from the linker, the intermediate representation files; recording, by the compiler, the symbols and related symbol information comprising the default section assignment information and dependency information of the intermediate representation files, then; assigning output sections to the symbols based on both the default section assignment information and instructions from the customized linker script; and linking optimized code of the files of the computer program based on the assigned output sections.

---

Claim 7:
7. The method of claim 1 , wherein the method further comprises: restoring symbols to global scope.