README
1The goals:
21) calls from inside libcrypto to other libcrypto functions should
3 be via identifiers that are of hidden visibility and -- to avoid
4 confusion or conflicts -- are in the reserved namespace. By
5 doing this these calls are protected from being overridden by
6 applications and on many platforms can avoid creation or use of
7 GOT or PLT entries. I've chosen a prefix of "_lcry_" for this.
8 Note that these symbols aren't in the dynamic symbol table of the
9 libcrypto.so shared library...but they are visible in the static
10 library.
11
122) calls from libssl to symbols in libcrypto should be via identifiers
13 which won't be accidentally overridden by the application, libc,
14 other random crypto libraries that are pulled in, etc. I've
15 chosen a prefix of "_libre_" for this.
16
17These will not be declared directly; instead, the gcc "asm labels"
18extension will be used rename the function. In order to actually
19set up the desired asm labels, we use these in the internal .h
20files:
21
22 LCRYPTO_USED(x) Symbols used both internally and externally
23 In builds of libcrypto, this makes gcc convert use of x to
24 use _libre_x instead. In other builds that use these headers,
25 it makes gcc convert use of x to use _libre_x instead. Use
26 LCRYPTO_ALIAS(x) to create the external aliases.
27 ex: LCRYPTO_USED(SSL_get_verify_mode)
28
29 LCRYPTO_UNUSED(x) Symbols that are not used internally or by libssl
30 No renaming is done. In builds of libcrypto, the symbol
31 is marked as deprecated to detect unintentional use of such
32 a symbol, so that it can be marked as used going forward.
33 ex: LCRYPTO_UNUSED(SSL_CIPHER_get_name)
34
35Finally, to create the expected aliases, we use these in the .c files
36where the definitions are:
37 LCRYPTO_ALIAS(x)
38 This defines both x and _libre_x as strong aliases for _lcry_x.
39 Match uses of this with uses of LCRYPTO_USED()
40 ex: LCRYPTO_ALIAS(SSL_get_verify_mode)
41