[llvm] r227422 - [ELFYAML] Provide default value 0 for YAML relocation addendum field

Simon Atanasyan simon at atanasyan.com
Wed Jan 28 22:56:25 PST 2015


Author: atanasyan
Date: Thu Jan 29 00:56:24 2015
New Revision: 227422

URL: http://llvm.org/viewvc/llvm-project?rev=227422&view=rev
Log:
[ELFYAML] Provide default value 0 for YAML relocation addendum field

Follow up to r227318.

Modified:
    llvm/trunk/lib/Object/ELFYAML.cpp
    llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml
    llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml
    llvm/trunk/test/Object/obj2yaml.test

Modified: llvm/trunk/lib/Object/ELFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELFYAML.cpp?rev=227422&r1=227421&r2=227422&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ELFYAML.cpp (original)
+++ llvm/trunk/lib/Object/ELFYAML.cpp Thu Jan 29 00:56:24 2015
@@ -592,7 +592,7 @@ void MappingTraits<ELFYAML::Relocation>:
   } else
     IO.mapRequired("Type", Rel.Type);
 
-  IO.mapOptional("Addend", Rel.Addend);
+  IO.mapOptional("Addend", Rel.Addend, (int64_t)0);
 }
 
 void MappingTraits<ELFYAML::Object>::mapping(IO &IO, ELFYAML::Object &Object) {

Modified: llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml?rev=227422&r1=227421&r2=227422&view=diff
==============================================================================
--- llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml (original)
+++ llvm/trunk/test/Object/AArch64/yaml2obj-elf-aarch64-rel.yaml Thu Jan 29 00:56:24 2015
@@ -10,11 +10,9 @@
 # CHECK-NEXT:      - Offset:          0x0000000000000000
 # CHECK-NEXT:        Symbol:          main
 # CHECK-NEXT:        Type:            R_AARCH64_ABS64
-# CHECK-NEXT:        Addend:          0
 # CHECK-NEXT:      - Offset:          0x0000000000000008
 # CHECK-NEXT:        Symbol:          main
 # CHECK-NEXT:        Type:            R_AARCH64_TLSGD_ADR_PREL21
-# CHECK-NEXT:        Addend:          0
 
 FileHeader:
   Class:           ELFCLASS64

Modified: llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml?rev=227422&r1=227421&r2=227422&view=diff
==============================================================================
--- llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml (original)
+++ llvm/trunk/test/Object/Mips/elf-mips64-rel.yaml Thu Jan 29 00:56:24 2015
@@ -29,21 +29,17 @@
 # YAML-NEXT:   - Offset:      0x0000000000000020
 # YAML-NEXT:     Symbol:      .rodata
 # YAML-NEXT:     Type:        R_MIPS_GOT_PAGE
-# YAML-NEXT:     Addend:      0
 # YAML-NEXT:   - Offset:      0x0000000000000024
 # YAML-NEXT:     Symbol:      .rodata
 # YAML-NEXT:     Type:        R_MIPS_GOT_OFST
-# YAML-NEXT:     Addend:      0
 # YAML-NEXT:   - Offset:      0x0000000000000028
 # YAML-NEXT:     Symbol:      printf
 # YAML-NEXT:     Type:        R_MIPS_CALL16
-# YAML-NEXT:     Addend:      0
 # YAML-NEXT:   - Offset:      0x0000000000000030
 # YAML-NEXT:     Symbol:      printf
 # YAML-NEXT:     Type:        R_MIPS_GPREL16
 # YAML-NEXT:     Type2:       R_MIPS_LO16
 # YAML-NEXT:     SpecSym:     RSS_GP0
-# YAML-NEXT:     Addend:      0
 
 ---
 FileHeader:

Modified: llvm/trunk/test/Object/obj2yaml.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/obj2yaml.test?rev=227422&r1=227421&r2=227422&view=diff
==============================================================================
--- llvm/trunk/test/Object/obj2yaml.test (original)
+++ llvm/trunk/test/Object/obj2yaml.test Thu Jan 29 00:56:24 2015
@@ -210,27 +210,21 @@ ELF-MIPSEL-NEXT:     Relocations:
 ELF-MIPSEL-NEXT:       - Offset:          0x0000000000000000
 ELF-MIPSEL-NEXT:         Symbol:          _gp_disp
 ELF-MIPSEL-NEXT:         Type:            R_MIPS_HI16
-ELF-MIPSEL-NEXT:         Addend:          0
 ELF-MIPSEL-NEXT:       - Offset:          0x0000000000000004
 ELF-MIPSEL-NEXT:         Symbol:          _gp_disp
 ELF-MIPSEL-NEXT:         Type:            R_MIPS_LO16
-ELF-MIPSEL-NEXT:         Addend:          0
 ELF-MIPSEL-NEXT:       - Offset:          0x0000000000000018
 ELF-MIPSEL-NEXT:         Symbol:          '$.str'
 ELF-MIPSEL-NEXT:         Type:            R_MIPS_GOT16
-ELF-MIPSEL-NEXT:         Addend:          0
 ELF-MIPSEL-NEXT:       - Offset:          0x000000000000001C
 ELF-MIPSEL-NEXT:         Symbol:          '$.str'
 ELF-MIPSEL-NEXT:         Type:            R_MIPS_LO16
-ELF-MIPSEL-NEXT:         Addend:          0
 ELF-MIPSEL-NEXT:       - Offset:          0x0000000000000020
 ELF-MIPSEL-NEXT:         Symbol:          puts
 ELF-MIPSEL-NEXT:         Type:            R_MIPS_CALL16
-ELF-MIPSEL-NEXT:         Addend:          0
 ELF-MIPSEL-NEXT:       - Offset:          0x000000000000002C
 ELF-MIPSEL-NEXT:         Symbol:          SomeOtherFunction
 ELF-MIPSEL-NEXT:         Type:            R_MIPS_CALL16
-ELF-MIPSEL-NEXT:         Addend:          0
 ELF-MIPSEL-NEXT:   - Name:            .data
 ELF-MIPSEL-NEXT:     Type:            SHT_PROGBITS
 ELF-MIPSEL-NEXT:     Flags:           [ SHF_WRITE, SHF_ALLOC ]
@@ -328,7 +322,6 @@ ELF-MIPS64EL-NEXT:     Relocations:
 ELF-MIPS64EL-NEXT:       - Offset:          0
 ELF-MIPS64EL-NEXT:         Symbol:          zed
 ELF-MIPS64EL-NEXT:         Type:            R_MIPS_64
-ELF-MIPS64EL-NEXT:         Addend:          0
 ELF-MIPS64EL-NEXT:   - Name:            .bss
 ELF-MIPS64EL-NEXT:     Type:            SHT_NOBITS
 ELF-MIPS64EL-NEXT:     Flags:           [ SHF_WRITE, SHF_ALLOC ]
@@ -398,7 +391,6 @@ ELF-X86-64-NEXT:     Relocations:
 ELF-X86-64-NEXT:       - Offset:          0x000000000000000D
 ELF-X86-64-NEXT:         Symbol:          .rodata.str1.1
 ELF-X86-64-NEXT:         Type:            R_X86_64_32S
-ELF-X86-64-NEXT:         Addend:          0
 ELF-X86-64-NEXT:       - Offset:          0x0000000000000012
 ELF-X86-64-NEXT:         Symbol:          puts
 ELF-X86-64-NEXT:         Type:            R_X86_64_PC32





More information about the llvm-commits mailing list