diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index e0ea44626b7f..410d9964922d 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -796,7 +796,7 @@ MCSectionELF *ELFWriter::createRelocationSection(MCContext &Ctx, else EntrySize = is64Bit() ? sizeof(ELF::Elf64_Rel) : sizeof(ELF::Elf32_Rel); - unsigned Flags = 0; + unsigned Flags = ELF::SHF_INFO_LINK; if (Sec.getFlags() & ELF::SHF_GROUP) Flags = ELF::SHF_GROUP; diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/SystemZ/cfi-relo-pc64.s b/llvm/test/ExecutionEngine/RuntimeDyld/SystemZ/cfi-relo-pc64.s index 166d46edbd9e..29bc6ce9c6c4 100644 --- a/llvm/test/ExecutionEngine/RuntimeDyld/SystemZ/cfi-relo-pc64.s +++ b/llvm/test/ExecutionEngine/RuntimeDyld/SystemZ/cfi-relo-pc64.s @@ -18,6 +18,7 @@ f1: // CHECK: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-adjust-cfa-offset.s b/llvm/test/MC/ELF/cfi-adjust-cfa-offset.s index e34fc5da7399..1ea60b10e2e5 100644 --- a/llvm/test/MC/ELF/cfi-adjust-cfa-offset.s +++ b/llvm/test/MC/ELF/cfi-adjust-cfa-offset.s @@ -55,6 +55,7 @@ f: // CHECK-NEXT: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-advance-loc2.s b/llvm/test/MC/ELF/cfi-advance-loc2.s index 9226200e63a9..2e9fa59cc888 100644 --- a/llvm/test/MC/ELF/cfi-advance-loc2.s +++ b/llvm/test/MC/ELF/cfi-advance-loc2.s @@ -36,6 +36,7 @@ f: // CHECK: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-def-cfa-offset.s b/llvm/test/MC/ELF/cfi-def-cfa-offset.s index 2d788c18a395..58edcd4aeed1 100644 --- a/llvm/test/MC/ELF/cfi-def-cfa-offset.s +++ b/llvm/test/MC/ELF/cfi-def-cfa-offset.s @@ -38,6 +38,7 @@ f: // CHECK: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-def-cfa-register.s b/llvm/test/MC/ELF/cfi-def-cfa-register.s index 53a77c3fc279..a9e0e6369505 100644 --- a/llvm/test/MC/ELF/cfi-def-cfa-register.s +++ b/llvm/test/MC/ELF/cfi-def-cfa-register.s @@ -37,6 +37,7 @@ f: // CHECK: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-def-cfa.s b/llvm/test/MC/ELF/cfi-def-cfa.s index 6003327da170..1f1006319f3d 100644 --- a/llvm/test/MC/ELF/cfi-def-cfa.s +++ b/llvm/test/MC/ELF/cfi-def-cfa.s @@ -33,6 +33,7 @@ f: // CHECK: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-escape.s b/llvm/test/MC/ELF/cfi-escape.s index daedc52eae23..84ab909d1db6 100644 --- a/llvm/test/MC/ELF/cfi-escape.s +++ b/llvm/test/MC/ELF/cfi-escape.s @@ -38,6 +38,7 @@ f: // CHECK-NEXT: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-offset.s b/llvm/test/MC/ELF/cfi-offset.s index efb8dbe84df8..f538d50c24d7 100644 --- a/llvm/test/MC/ELF/cfi-offset.s +++ b/llvm/test/MC/ELF/cfi-offset.s @@ -33,6 +33,7 @@ f: // CHECK: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-register.s b/llvm/test/MC/ELF/cfi-register.s index 20a3f44b0df6..fadb46e228b4 100644 --- a/llvm/test/MC/ELF/cfi-register.s +++ b/llvm/test/MC/ELF/cfi-register.s @@ -38,6 +38,7 @@ f: // CHECK-NEXT: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-rel-offset.s b/llvm/test/MC/ELF/cfi-rel-offset.s index 71d8d7c781d1..04549429ed22 100644 --- a/llvm/test/MC/ELF/cfi-rel-offset.s +++ b/llvm/test/MC/ELF/cfi-rel-offset.s @@ -48,6 +48,7 @@ f: // CHECK-NEXT: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-rel-offset2.s b/llvm/test/MC/ELF/cfi-rel-offset2.s index d5909112599f..4863b07b3770 100644 --- a/llvm/test/MC/ELF/cfi-rel-offset2.s +++ b/llvm/test/MC/ELF/cfi-rel-offset2.s @@ -33,6 +33,7 @@ f: // CHECK-NEXT: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-remember.s b/llvm/test/MC/ELF/cfi-remember.s index ffafe785b484..c7e9a5c92026 100644 --- a/llvm/test/MC/ELF/cfi-remember.s +++ b/llvm/test/MC/ELF/cfi-remember.s @@ -40,6 +40,7 @@ f: // CHECK-NEXT: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-restore.s b/llvm/test/MC/ELF/cfi-restore.s index bbf339f7fdd9..71ac1f0f12e9 100644 --- a/llvm/test/MC/ELF/cfi-restore.s +++ b/llvm/test/MC/ELF/cfi-restore.s @@ -34,6 +34,7 @@ f: // CHECK-NEXT: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-same-value.s b/llvm/test/MC/ELF/cfi-same-value.s index 80afaa0f8401..9ee4b3768ca3 100644 --- a/llvm/test/MC/ELF/cfi-same-value.s +++ b/llvm/test/MC/ELF/cfi-same-value.s @@ -38,6 +38,7 @@ f: // CHECK-NEXT: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-undefined.s b/llvm/test/MC/ELF/cfi-undefined.s index 32ae2b17a945..de7f29fd99e4 100644 --- a/llvm/test/MC/ELF/cfi-undefined.s +++ b/llvm/test/MC/ELF/cfi-undefined.s @@ -38,6 +38,7 @@ f: // CHECK-NEXT: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-window-save.s b/llvm/test/MC/ELF/cfi-window-save.s index 8c9db9406049..df70734d8004 100644 --- a/llvm/test/MC/ELF/cfi-window-save.s +++ b/llvm/test/MC/ELF/cfi-window-save.s @@ -40,6 +40,7 @@ f: // CHECK: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi-zero-addr-delta.s b/llvm/test/MC/ELF/cfi-zero-addr-delta.s index 094110515373..b53e75e946e8 100644 --- a/llvm/test/MC/ELF/cfi-zero-addr-delta.s +++ b/llvm/test/MC/ELF/cfi-zero-addr-delta.s @@ -41,6 +41,7 @@ f: // CHECK: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cfi.s b/llvm/test/MC/ELF/cfi.s index a30ee1bbbff3..d347cc6259ee 100644 --- a/llvm/test/MC/ELF/cfi.s +++ b/llvm/test/MC/ELF/cfi.s @@ -358,6 +358,7 @@ f37: // CHECK: Name: .rela.eh_frame // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/cgprofile.s b/llvm/test/MC/ELF/cgprofile.s index 26f60bcd8af0..f8469ddc6887 100644 --- a/llvm/test/MC/ELF/cgprofile.s +++ b/llvm/test/MC/ELF/cgprofile.s @@ -33,7 +33,8 @@ late3: # CHECK: Name: .rel.llvm.call-graph-profile (28) # CHECK-NEXT: Type: SHT_REL (0x9) -# CHECK-NEXT: Flags [ (0x0) +# CHECK-NEXT: Flags [ (0x40) +# CHECK-NEXT: SHF_INFO_LINK # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 # CHECK-NEXT: Offset: 0x140 diff --git a/llvm/test/MC/ELF/relocation-pc.s b/llvm/test/MC/ELF/relocation-pc.s index a74a438002b4..8202adb81936 100644 --- a/llvm/test/MC/ELF/relocation-pc.s +++ b/llvm/test/MC/ELF/relocation-pc.s @@ -11,6 +11,7 @@ // CHECK: Name: .rela.text // CHECK-NEXT: Type: SHT_RELA // CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/ELF/rename.s b/llvm/test/MC/ELF/rename.s index c5351a0be558..9a33681a5c86 100644 --- a/llvm/test/MC/ELF/rename.s +++ b/llvm/test/MC/ELF/rename.s @@ -19,7 +19,8 @@ defined3: // CHECK: Index: // CHECK: Name: .rela.text // CHECK-NEXT: Type: SHT_RELA (0x4) -// CHECK-NEXT: Flags [ (0x0) +// CHECK-NEXT: Flags [ +// CHECK-NEXT: SHF_INFO_LINK // CHECK-NEXT: ] // CHECK-NEXT: Address: 0x0 // CHECK-NEXT: Offset: diff --git a/llvm/test/MC/PowerPC/ppc64-initial-cfa.s b/llvm/test/MC/PowerPC/ppc64-initial-cfa.s index e7be1f51ac2c..627f1d469062 100644 --- a/llvm/test/MC/PowerPC/ppc64-initial-cfa.s +++ b/llvm/test/MC/PowerPC/ppc64-initial-cfa.s @@ -40,7 +40,8 @@ _proc: # STATIC: Section { # STATIC: Name: .rela.eh_frame # STATIC-NEXT: Type: SHT_RELA -# STATIC-NEXT: Flags [ (0x0) +# STATIC-NEXT: Flags [ +# STATIC-NEXT: SHF_INFO_LINK # STATIC-NEXT: ] # STATIC-NEXT: Address: # STATIC-NEXT: Offset: @@ -81,7 +82,8 @@ _proc: # PIC: Section { # PIC: Name: .rela.eh_frame # PIC-NEXT: Type: SHT_RELA -# PIC-NEXT: Flags [ (0x0) +# PIC-NEXT: Flags [ +# PIC-NEXT: SHF_INFO_LINK # PIC-NEXT: ] # PIC-NEXT: Address: # PIC-NEXT: Offset: