]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenFw/Elf32Convert.c
BaseTools: Clean up source files
[mirror_edk2.git] / BaseTools / Source / C / GenFw / Elf32Convert.c
index ac0e2b13771bbcefc4285b8483965d2330a7fb04..af5ff9396ecf7c06656b057ee3f4f23e5d179621 100644 (file)
@@ -130,7 +130,7 @@ InitializeElf32 (
   //\r
   // Initialize data pointer and structures.\r
   //\r
-  mEhdr = (Elf_Ehdr*) FileBuffer;  \r
+  mEhdr = (Elf_Ehdr*) FileBuffer;\r
 \r
   //\r
   // Check the ELF32 specific header information.\r
@@ -142,12 +142,12 @@ InitializeElf32 (
   if (mEhdr->e_ident[EI_DATA] != ELFDATA2LSB) {\r
     Error (NULL, 0, 3000, "Unsupported", "ELF EI_DATA not ELFDATA2LSB");\r
     return FALSE;\r
-  }  \r
+  }\r
   if ((mEhdr->e_type != ET_EXEC) && (mEhdr->e_type != ET_DYN)) {\r
     Error (NULL, 0, 3000, "Unsupported", "ELF e_type not ET_EXEC or ET_DYN");\r
     return FALSE;\r
   }\r
-  if (!((mEhdr->e_machine == EM_386) || (mEhdr->e_machine == EM_ARM))) { \r
+  if (!((mEhdr->e_machine == EM_386) || (mEhdr->e_machine == EM_ARM))) {\r
     Error (NULL, 0, 3000, "Unsupported", "ELF e_machine not EM_386 or EM_ARM");\r
     return FALSE;\r
   }\r
@@ -155,13 +155,13 @@ InitializeElf32 (
     Error (NULL, 0, 3000, "Unsupported", "ELF e_version (%u) not EV_CURRENT (%d)", (unsigned) mEhdr->e_version, EV_CURRENT);\r
     return FALSE;\r
   }\r
-  \r
+\r
   //\r
   // Update section header pointers\r
   //\r
   mShdrBase  = (Elf_Shdr *)((UINT8 *)mEhdr + mEhdr->e_shoff);\r
   mPhdrBase = (Elf_Phdr *)((UINT8 *)mEhdr + mEhdr->e_phoff);\r
-  \r
+\r
   //\r
   // Create COFF Section offset buffer and zero.\r
   //\r
@@ -707,20 +707,20 @@ WriteSections32 (
     if ((RelShdr->sh_type != SHT_REL) && (RelShdr->sh_type != SHT_RELA)) {\r
       continue;\r
     }\r
-    \r
+\r
     //\r
     // Relocation section found.  Now extract section information that the relocations\r
     // apply to in the ELF data and the new COFF data.\r
     //\r
     SecShdr = GetShdrByIndex(RelShdr->sh_info);\r
     SecOffset = mCoffSectionsOffset[RelShdr->sh_info];\r
-    \r
+\r
     //\r
     // Only process relocations for the current filter type.\r
     //\r
     if (RelShdr->sh_type == SHT_REL && (*Filter)(SecShdr)) {\r
       UINT32 RelOffset;\r
-      \r
+\r
       //\r
       // Determine the symbol table referenced by the relocation data.\r
       //\r
@@ -735,18 +735,18 @@ WriteSections32 (
         // Set pointer to relocation entry\r
         //\r
         Elf_Rel *Rel = (Elf_Rel *)((UINT8*)mEhdr + RelShdr->sh_offset + RelOffset);\r
-        \r
+\r
         //\r
         // Set pointer to symbol table entry associated with the relocation entry.\r
         //\r
         Elf_Sym *Sym = (Elf_Sym *)(Symtab + ELF_R_SYM(Rel->r_info) * SymtabShdr->sh_entsize);\r
-        \r
+\r
         Elf_Shdr *SymShdr;\r
         UINT8 *Targ;\r
         UINT16 Address;\r
 \r
         //\r
-        // Check section header index found in symbol table and get the section \r
+        // Check section header index found in symbol table and get the section\r
         // header location.\r
         //\r
         if (Sym->st_shndx == SHN_UNDEF\r
@@ -768,7 +768,7 @@ WriteSections32 (
         //\r
         // Convert the relocation data to a pointer into the coff file.\r
         //\r
-        // Note: \r
+        // Note:\r
         //   r_offset is the virtual address of the storage unit to be relocated.\r
         //   sh_addr is the virtual address for the base of the section.\r
         //\r
@@ -814,9 +814,9 @@ WriteSections32 (
           case R_ARM_THM_JUMP19:\r
           case R_ARM_CALL:\r
           case R_ARM_JMP24:\r
-          case R_ARM_THM_JUMP24:  \r
-          case R_ARM_PREL31:  \r
-          case R_ARM_MOVW_PREL_NC:  \r
+          case R_ARM_THM_JUMP24:\r
+          case R_ARM_PREL31:\r
+          case R_ARM_MOVW_PREL_NC:\r
           case R_ARM_MOVT_PREL:\r
           case R_ARM_THM_MOVW_PREL_NC:\r
           case R_ARM_THM_MOVT_PREL:\r
@@ -909,7 +909,7 @@ WriteRelocations32 (
         for (RelIdx = 0; RelIdx < RelShdr->sh_size; RelIdx += RelShdr->sh_entsize) {\r
           Rel = (Elf_Rel *)((UINT8*)mEhdr + RelShdr->sh_offset + RelIdx);\r
 \r
-          if (mEhdr->e_machine == EM_386) { \r
+          if (mEhdr->e_machine == EM_386) {\r
             switch (ELF_R_TYPE(Rel->r_info)) {\r
             case R_386_NONE:\r
             case R_386_PC32:\r
@@ -941,9 +941,9 @@ WriteRelocations32 (
             case R_ARM_THM_JUMP19:\r
             case R_ARM_CALL:\r
             case R_ARM_JMP24:\r
-            case R_ARM_THM_JUMP24:  \r
-            case R_ARM_PREL31:  \r
-            case R_ARM_MOVW_PREL_NC:  \r
+            case R_ARM_THM_JUMP24:\r
+            case R_ARM_PREL31:\r
+            case R_ARM_MOVW_PREL_NC:\r
             case R_ARM_MOVT_PREL:\r
             case R_ARM_THM_MOVW_PREL_NC:\r
             case R_ARM_THM_MOVT_PREL:\r
@@ -1090,7 +1090,7 @@ WriteRelocations32 (
           case  R_ARM_RABS32:\r
             CoffAddFixup (Rel->r_offset, EFI_IMAGE_REL_BASED_HIGHLOW);\r
             break;\r
-          \r
+\r
           default:\r
             Error (NULL, 0, 3000, "Invalid", "%s bad ARM dynamic relocations, unkown type %d.", mInImageName, ELF32_R_TYPE (Rel->r_info));\r
             break;\r
@@ -1163,7 +1163,7 @@ SetImageSize32 (
   )\r
 {\r
   EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;\r
-  \r
+\r
   //\r
   // Set image size\r
   //\r