Skip to content
TLS access example code snippets
Makefile C C++
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
COPYING
Makefile
README.md
main-ld.c
main.c
nontls.c
tls-gd.c
tls-ie.c
tls-le.c
x.c
x.h
xy.c
xy.h

README.md

TLS Examples

These are a collection of source files and a makefile to build different code patterns to generate TLS access methods.

  • Global Dynamic
  • Local Dynamic
  • Initial Exec
  • Local Exec

These examples were created in conjunction with my TLS documentation.

Building

Build Status

To build just use:

# this will build using or1k-smh-linux-gnu-
make

To build with a different cross toolchain to:

# this will build using the system default toolchain
make CROSS_COMPILE=

Testing

The tls example build will also generate executable binaries which can be run and should return 0 if they work correctly. This can be used as a crude test suite for TLS handling. Using a more complete test suite like that found in glibc is recommended, but this can get you off the ground.

$ make check
$ cat test-results.out

Running tls-gd-dynamic...
ok
Running tls-ld-dynamic...
ok
Running nontls-dynamic...
ok
Running tls-le-static...
ok
Running tls-ie-static...
ok
Running nontls-static...
ok

Cleaning up

Like most makefiles we also provide a way to cleanup with clean.

make clean
You can’t perform that action at this time.