Just formatting

This commit is contained in:
Serge Lamikhov-Center 2024-06-15 10:58:36 +03:00
parent bb572fb848
commit 41f4012d49
5 changed files with 29 additions and 29 deletions

View File

@ -284,8 +284,8 @@ template <class T> class section_impl : public section
( *translator )[( *convertor )( header.sh_offset )];
Elf_Xword size = get_size();
if ( nullptr == data && SHT_NULL != get_type() &&
SHT_NOBITS != get_type() &&
sh_offset <= get_stream_size() && size <= (get_stream_size() - sh_offset)) {
SHT_NOBITS != get_type() && sh_offset <= get_stream_size() &&
size <= ( get_stream_size() - sh_offset ) ) {
data.reset( new ( std::nothrow ) char[size_t( size ) + 1] );
if ( ( 0 != size ) && ( nullptr != data ) ) {

View File

@ -68,8 +68,8 @@ int main( int argc, char** argv )
std::ifstream proc_maps( std::string( "/proc/" ) + argv[1] + "/maps" );
if ( !proc_maps ) {
std::cout << "Can't open "
<< std::string( "/proc/" ) + argv[1] + "/maps"
<< " file" << std::endl;
<< std::string( "/proc/" ) + argv[1] + "/maps" << " file"
<< std::endl;
return 2;
}

View File

@ -1198,7 +1198,7 @@ TEST( ELFIOTest, test_segment_resize_bug )
* 09 .tdata .init_array .fini_array .data.rel.ro .got
*/
auto checkElf = [](auto &reader) {
auto checkElf = [](auto &reader) {
const auto &segments = reader.segments;
ASSERT_EQ( segments.size(), 10 );
checkSegment(segments[0], PT_LOAD, 0x400000, 0x400000, 0x518, 0x518, PF_R, 0x1000);
@ -1213,9 +1213,9 @@ TEST( ELFIOTest, test_segment_resize_bug )
checkSegment(segments[9], PT_GNU_RELRO, 0x4bd0c0, 0x4bd0c0, 0x2f40, 0x2f40, PF_R, 0x1);
};
checkElf(reader);
checkElf( reader );
ASSERT_EQ( reader.save("elf_examples/x86_64_static.save"), true );
ASSERT_EQ( reader.save( "elf_examples/x86_64_static.save" ), true );
ASSERT_EQ( reader.load( "elf_examples/x86_64_static.save" ), true );
// Comment out the assertion. The question is - how the original segment size was calculated

View File

@ -679,7 +679,7 @@ TEST( ELFIOTest, rearrange_local_symbols )
symbols.add_symbol( str_writer, name.c_str(), value, size, bind, type,
other, section_index );
ASSERT_EQ( symbols.get_symbols_num(), sym_num + 9);
ASSERT_EQ( symbols.get_symbols_num(), sym_num + 9 );
symbols.arrange_local_symbols( [&]( Elf_Xword first, Elf_Xword ) -> void {
static int counter = 0;