1.5.9 How to ensure re-implemented mutex functions are called

If your re-implemented _mutex_*() functions are within an object that is contained within a library file, the linker does not automatically include the object.

This can result in the _mutex_*() functions being excluded from the image you have built.

To ensure that your _mutex_*() functions are called, you can either:

  • Place your mutex functions in a non-library object file. This helps to ensure that they are resolved at link time.

  • Place your mutex functions in a library object file, and arrange a non-weak reference to something in the object.

  • Place your mutex functions in a library object file, and have the linker explicitly extract the specific object from the library on the command line by writing libraryname.a(objectfilename.o) when you invoke the linker.

Non-ConfidentialPDF file icon PDF versionARM DUI0475M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.