You copied the Doc URL to your clipboard.

Protecting code in images and objects with fromelf

If you are delivering images and objects to third parties, then you might want to protect the code they contain. To help you to protect this code, fromelf provides the --strip option and the --privacy option. These options remove or obscure the symbol names in the object or image. The option you choose depends on the how much information you want to remove. The effect of these options is different for object files and images.

Note

You must use --elf with these options. Because you have to use --elf, you must also use --output.

Protecting code in image files

For image files:

Table 1. Effect of fromelf --privacy and --strip options on images files
Option [a]Local symbolsSection namesMapping symbolsBuild attributes
fromelf --elf --privacy

Removes the whole symbol table.

Removes the .comment section name. This is marked as [Anonymous Section] in the fromelf --text output.

Gives section names a default value. For example, changes code section names to '.text'.

fromelf --elf --strip=symbols

Removes whole symbol table.

Section names remain the same.

fromelf --elf --strip=localsymbolsRemovedPresentRemovedPresent

[a] The --cpu option omitted for brevity.


Protecting code in object files

For object files:

Table 2. Effect of fromelf --privacy and --strip options on object files
Option [a]Local symbolsSection namesMapping symbolsBuild attributes
fromelf --elf --privacy

Removes those local symbols that can be removed without loss of functionality.

Symbols that cannot be removed, such as the targets for relocations, are kept. For these symbols, the names are removed. These are marked as [Anonymous Symbol] in the fromelf --text output.

Gives section names a default value. For example, changes code section names to '.text'

PresentPresent
fromelf --elf --strip=symbols

Removes those local symbols that can be removed without loss of functionality.

Symbols that cannot be removed, such as the targets for relocations, are kept. For these symbols, the names are removed. These are marked as [Anonymous Symbol] in the fromelf --text output.

Section names remain the same

PresentPresent
fromelf --elf --strip=localsymbols

Removes those local symbols that can be removed without loss of functionality.

Symbols that cannot be removed, such as the targets for relocations, are kept. For these symbols, the names are removed. These are marked as [Anonymous Symbol] in the fromelf --text output.

Section names remain the same

PresentPresent

[a] The --cpu option omitted for brevity.


Example

To produce a new ELF executable image with the complete symbol table removed and various section names changed, enter:

fromelf --cpu=8-A.64 --elf --privacy --output=outfile.axf infile.axf
Was this page helpful? Yes No