You copied the Doc URL to your clipboard.

Arm Compiler armlink User Guide : --library_security=protection

--library_security=protection

Selects a protected library for branch protection.

Default

The default is --library_security=auto.

Syntax

--library_security=protection

Parameters

protection specifies the level of protection in the library.

v8.3a
Selects the v8.3a library, which provides branch protection using Branch Target Identification and Pointer Authentication on function returns.
none
Selects the standard C library that does not provide protection using Branch Target Identification and Pointer Authentication.
auto
The linker automatically selects either the standard C library or the v8.3a library. If at least one of the input objects has been compiled for Arm®v8.3-A or later, and has return address signing with pointer authentication, then the linker selects the v8.3a library. Otherwise, the library selects the standard C library that does not have branch protection.

Note

The presence of BTI instructions in the compiled objects do not affect automatic library selection.

Usage

Use --library_security to override the automatic selection of protected libraries for branch protection. Branch protection protects your code from Return Oriented Programming (ROP) and Jump Oriented Programming (JOP) attacks.

Branch protection using pointer authentication and branch target identification are only available in AArch64.

Examples

This uses the v8.3a library with branch protection using Branch Target Identification and Pointer Authentication:

armlink --cpu=8.3-A.64 --library_security=v8.3a foo.o 

This uses the standard C library without any branch protection using Branch Target Identification and Pointer Authentication:

armlink --cpu=8.3-A.64 --library_security=none foo.o 
Was this page helpful? Yes No