llvm.org GIT mirror llvm / 6bd5b27
MC, Object: Reserve a section type, SHT_LLVM_ODRTAB, for the ODR table. This is part of the ODR checker proposal: http://lists.llvm.org/pipermail/llvm-dev/2017-June/113820.html Per discussion on the gnu-gabi mailing list [1] the section type range 0x6fff4c00..0x6fff4cff is reserved for LLVM. [1] https://sourceware.org/ml/gnu-gabi/2017-q2/msg00030.html Differential Revision: https://reviews.llvm.org/D33978 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305407 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Collingbourne 3 years ago
7 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
682682 SHT_GROUP = 17, // Section group.
683683 SHT_SYMTAB_SHNDX = 18, // Indices for SHN_XINDEX entries.
684684 SHT_LOOS = 0x60000000, // Lowest operating system-specific type.
685 SHT_LLVM_ODRTAB = 0x6fff4c00, // LLVM ODR table.
685686 SHT_GNU_ATTRIBUTES = 0x6ffffff5, // Object attributes.
686687 SHT_GNU_HASH = 0x6ffffff6, // GNU-style hash table.
687688 SHT_GNU_verdef = 0x6ffffffd, // GNU version definitions.
602602 Type = ELF::SHT_NOTE;
603603 else if (TypeName == "unwind")
604604 Type = ELF::SHT_X86_64_UNWIND;
605 else if (TypeName == "llvm_odrtab")
606 Type = ELF::SHT_LLVM_ODRTAB;
605607 else if (TypeName.getAsInteger(0, Type))
606608 return TokError("unknown section type");
607609 }
146146 // Print hex value of the flag while we do not have
147147 // any standard symbolic representation of the flag.
148148 OS << "0x7000001e";
149 else if (Type == ELF::SHT_LLVM_ODRTAB)
150 OS << "llvm_odrtab";
149151 else
150152 report_fatal_error("unsupported type 0x" + Twine::utohexstr(Type) +
151153 " for section " + getSectionName());
191191 STRINGIFY_ENUM_CASE(ELF, SHT_PREINIT_ARRAY);
192192 STRINGIFY_ENUM_CASE(ELF, SHT_GROUP);
193193 STRINGIFY_ENUM_CASE(ELF, SHT_SYMTAB_SHNDX);
194 STRINGIFY_ENUM_CASE(ELF, SHT_LLVM_ODRTAB);
194195 STRINGIFY_ENUM_CASE(ELF, SHT_GNU_ATTRIBUTES);
195196 STRINGIFY_ENUM_CASE(ELF, SHT_GNU_HASH);
196197 STRINGIFY_ENUM_CASE(ELF, SHT_GNU_verdef);
371371 ECase(SHT_GROUP);
372372 ECase(SHT_SYMTAB_SHNDX);
373373 ECase(SHT_LOOS);
374 ECase(SHT_LLVM_ODRTAB);
374375 ECase(SHT_GNU_ATTRIBUTES);
375376 ECase(SHT_GNU_HASH);
376377 ECase(SHT_GNU_verdef);
266266 // CHECK-NEXT: SHF_TLS
267267 // CHECK-NEXT: SHF_WRITE
268268 // CHECK-NEXT: ]
269
270 // Test SHT_LLVM_ODRTAB
271
272 .section .odrtab,"e",@llvm_odrtab
273 // ASM: .section .odrtab,"e",@llvm_odrtab
274
275 // CHECK: Section {
276 // CHECK: Name: .odrtab
277 // CHECK-NEXT: Type: SHT_LLVM_ODRTAB
278 // CHECK-NEXT: Flags [
279 // CHECK-NEXT: SHF_EXCLUDE
280 // CHECK-NEXT: ]
26282628 return "GROUP";
26292629 case SHT_SYMTAB_SHNDX:
26302630 return "SYMTAB SECTION INDICES";
2631 case SHT_LLVM_ODRTAB:
2632 return "LLVM_ODRTAB";
26312633 // FIXME: Parse processor specific GNU attributes
26322634 case SHT_GNU_ATTRIBUTES:
26332635 return "ATTRIBUTES";