Add decompress section function for readelf.
Update Makefile.
Update readelf.1
Depends on this libelf patch
Details
Details
- Reviewers
emaste markj - Group Reviewers
manpages - Commits
- rS367209: readelf: Add -z decompression support
Compared results with/without -z flags.
Confirmed -h prints -z usage info.
Compared results for:
readelf -x [section] -z file readelf -p [section] -z file
with GNU's readelf.
diff elftoolchain_output gnu_output
shows no difference.
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
contrib/elftoolchain/readelf/readelf.c | ||
---|---|---|
6953 | Since buf pointer keeps moving I added a pointer to newly allocated decompressed buffer. |
contrib/elftoolchain/readelf/readelf.c | ||
---|---|---|
6841 | we can use bool and return true / false | |
6843–6847 | FreeBSD style(9) wants doesn't use this style; should be /* * Decompress a data section if needed (using ZLIB). * Returns 0 if sucessful, 1 otherwise. */ static int decompress_section(struct section *s, unsigned char *compressed_data_buffer, uint64_t compressed_size, unsigned char **ret_buf, uint64_t *ret_sz) { | |
6851–6853 | these should be indented by 1/2 tabs | |
6892–6894 | {} are not required for single-statement bodies. They are permitted but need to be consistent throughout and they're not used elsewhere |
contrib/elftoolchain/readelf/readelf.c | ||
---|---|---|
7038 | Fixed by setting new_buf to NULL every loop. |