-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
patches
not detecting libcrypto as livepatchable
libcrypto.so.1.1 required to read around 200 symbols in order for `patch` to detect it as a livepatchable library. Hence we bump the number of symbols to read from 64 to 8000. This value of 8000 is found by analyzing all libraries found in /usr/lib64 and its subfolders for how many symbols it would need to be read in order to decide if the library is livepatchable. Workarround #159 Signed-off-by: Giuliano Belinassi <[email protected]>
- Loading branch information
1 parent
5598a87
commit a208967
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Look for the number of symbols and how many symbols will need to be read to | ||
# decide if a library is livepatchable or not in /usr/lib64 to collect | ||
# statistics. | ||
|
||
get_first_function_symbol() | ||
{ | ||
local realfile=$(readlink -f $1) | ||
local symbol=$(readelf -D -sW $realfile | grep -E "FUNC[ ]*GLOBAL[ ]*DEFAULT[ ]*[0-9]+" | head -n 1 | awk '{ print substr($1, 1, length($1)-1) }') | ||
local num_symbols=$(readelf -D -sW $realfile | tail -n 1 | awk '{ print substr($1, 1, length($1)-1) }') | ||
|
||
echo "Analyzing $realfile" | ||
echo "$realfile, $symbol", $num_symbols >> output.csv | ||
} | ||
|
||
rm -f output.csv | ||
for so in $(find "/usr/lib64/" -name "*.so"); do | ||
get_first_function_symbol $so | ||
done | ||
|
||
sort -u output.csv -o output.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters