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

@ -820,22 +820,22 @@ constexpr unsigned R_386_GOT32X = 43;
constexpr unsigned R_X86_64_GNU_VTINHERIT = 250;
constexpr unsigned R_X86_64_GNU_VTENTRY = 251;
// Arm
constexpr unsigned R_ARM_NONE = 0;
constexpr unsigned R_ARM_PC24 = 1;
constexpr unsigned R_ARM_ABS32 = 2;
constexpr unsigned R_ARM_REL32 = 3;
constexpr unsigned R_ARM_CALL = 28;
constexpr unsigned R_ARM_JUMP24 = 29;
constexpr unsigned R_ARM_TARGET1 = 38;
constexpr unsigned R_ARM_V4BX = 40;
constexpr unsigned R_ARM_PREL31 = 42;
constexpr unsigned R_ARM_MOVW_ABS_NC = 43;
constexpr unsigned R_ARM_MOVT_ABS = 44;
constexpr unsigned R_ARM_MOVW_PREL_NC = 45;
constexpr unsigned R_ARM_MOVT_PREL = 46;
constexpr unsigned R_ARM_ALU_PC_G0_NC = 57;
constexpr unsigned R_ARM_ALU_PC_G1_NC = 59;
constexpr unsigned R_ARM_LDR_PC_G2 = 63;
constexpr unsigned R_ARM_NONE = 0;
constexpr unsigned R_ARM_PC24 = 1;
constexpr unsigned R_ARM_ABS32 = 2;
constexpr unsigned R_ARM_REL32 = 3;
constexpr unsigned R_ARM_CALL = 28;
constexpr unsigned R_ARM_JUMP24 = 29;
constexpr unsigned R_ARM_TARGET1 = 38;
constexpr unsigned R_ARM_V4BX = 40;
constexpr unsigned R_ARM_PREL31 = 42;
constexpr unsigned R_ARM_MOVW_ABS_NC = 43;
constexpr unsigned R_ARM_MOVT_ABS = 44;
constexpr unsigned R_ARM_MOVW_PREL_NC = 45;
constexpr unsigned R_ARM_MOVT_PREL = 46;
constexpr unsigned R_ARM_ALU_PC_G0_NC = 57;
constexpr unsigned R_ARM_ALU_PC_G1_NC = 59;
constexpr unsigned R_ARM_LDR_PC_G2 = 63;
// Arm thumb
constexpr unsigned R_ARM_THM_CALL = 10;
constexpr unsigned R_ARM_THM_JUMP24 = 30;

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

@ -1009,17 +1009,17 @@ class mock_wiiu_compression : public compression_interface
{
public:
std::unique_ptr<char[]>
inflate( const char* data,
inflate( const char* data,
const endianness_convertor* convertor,
Elf_Xword compressed_size,
Elf_Xword& uncompressed_size ) const override
Elf_Xword compressed_size,
Elf_Xword& uncompressed_size ) const override
{
uncompressed_size = 2 * compressed_size;
return std::unique_ptr<char[]>(
new ( std::nothrow ) char[uncompressed_size + 1] );
}
std::unique_ptr<char[]> deflate( const char* data,
std::unique_ptr<char[]> deflate( const char* data,
const endianness_convertor* convertor,
Elf_Xword decompressed_size,
Elf_Xword& compressed_size ) const override
@ -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

@ -91,7 +91,7 @@ bool write_obj_i386( bool is64bit )
symbol_section_accessor symbol_writer( writer, sym_sec );
Elf_Word nSymIndex = symbol_writer.add_symbol(
nStrIndex, 0, 0, STB_LOCAL, STT_NOTYPE, 0, data_sec->get_index() );
nStrIndex, 0, 0, STB_LOCAL, STT_NOTYPE, 0, data_sec->get_index() );
// Another way to add symbol
symbol_writer.add_symbol( str_writer, "_start", 0x00000000, 0, STB_WEAK,
@ -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;