Browse Prior Art Database

Method for Linker Automatic Code And Data Distribution

IP.com Disclosure Number: IPCOM000240491D
Publication Date: 2015-Feb-03
Document File: 3 page(s) / 178K

Publishing Venue

The IP.com Prior Art Database

Abstract

The compiler build tools used for programming embedded devices having limited memory and restrictions need to support low level device memory management for loading program binary. This is achieved by manually defining memory mappings through the linker script file. Since manual mapping is relatively complex and error prone, some tool chains support automatic distribution. This paper describes a method to achieve automatic code and data distribution, driven through linker script file that does not involve modifications to existing compiler build tools. The method can be applied to any tool chain with minimal effort.

This text was extracted from a Microsoft Word document.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 42% of the total text.

Method for Linker Automatic Code And Data Distribution

Abstract — The compiler build tools used for programming embedded devices having limited memory and restrictions need to support low level device memory management for loading program binary. This is achieved by manually defining memory mappings through the linker script file. Since manual mapping is relatively complex and error prone, some tool chains support automatic distribution. This paper describes a method to achieve automatic code and data distribution, driven through linker script file that does not involve modifications to existing compiler build tools.  The method can be applied to any tool chain with minimal effort.

Keywords—linker, loader, memory, automatic, lcf

                                                                                                                                                                I.      Introduction

The industry strength compiler tool-chains, over time, have become very sophisticated supporting many advanced features. However these are usually not architected for smaller microcontroller devices, which have become more relevant in the IOT era. The small devices having limited memory and restrictions have a need of fine grain device memory handling and section placement. Supporting these features through automatic code and data distribution in these existing production tool chains will need redesigning the tool-chain costing many man hours. Even when supported, pushing these changes to open source tool-chains like GNU has its own challenges and maintaining such large patches without syncing with community release is next to impossible. For these reasons, many tool-chains have left it to user to handle these manually through the linker script file.

In such environment, we propose an alternate method that provides a clean, quick and easily maintainable option to support automatic code and data distribution, leveraging the advanced features already available in the existing tool-chain.

The method involves invoking the tools in two phases.  In phase 1, generate intermediate absolute executable image with command-line options to place each data/code symbol into its own section assuming infinite device memory. Generate a new LCF representing the automatic code and data distribution achieved by reading the phase1 executable and original user lcf file and distributing, packing many new sections to different memory segments honoring memory blocks, boundaries and priorities provided in LCF. In phase 2, link with generated new LCF, phase 1 object files and libraries to achieve auto code and data distribution.

                                                                                                                                                                  II.    Motivation

There is often a need to create separate memory segments on small microcontroller devices to

·         place safety routines at specific absolute memory address in Flash

·         reserve some address block at specific absolute memory address in Flash for  boot loader purposes

·         handle hardware restrictions such as no burst memory access across blocks of on chip SRAM

But this causes the memory fragmentation and linker should be able to distribute the objects into multiple memory segments effici...