Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Userspace runtime loader support for sub-library c18n #2267

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions contrib/elftoolchain/common/elfdefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ _ELF_DEFINE_DT(DT_SUNW_CAP, 0x60000010UL, \
"address of hardware capabilities section") \
_ELF_DEFINE_DT(DT_SUNW_ASLR, 0x60000023UL, \
"Address Space Layout Randomization flag") \
_ELF_DEFINE_DT(DT_C18NSTRTAB, 0x64331380UL, \
"address of compartment string table") \
_ELF_DEFINE_DT(DT_C18NSTRTABSZ, 0x64331381UL, \
"size of the compartment string table") \
_ELF_DEFINE_DT(DT_HIOS, 0x6FFFF000UL, \
"end of OS-specific types") \
_ELF_DEFINE_DT(DT_VALRNGLO, 0x6FFFFD00UL, \
Expand Down Expand Up @@ -965,6 +969,10 @@ _ELF_DEFINE_PT(PT_PHDR, 6, \
_ELF_DEFINE_PT(PT_TLS, 7, "thread local storage") \
_ELF_DEFINE_PT(PT_LOOS, 0x60000000UL, \
"start of OS-specific range") \
_ELF_DEFINE_PT(PT_COMPARTMENT, 0x64331380UL, \
"Sub-object compartment") \
_ELF_DEFINE_PT(PT_CHERI_BOUNDS, 0x64348450UL, \
"CHERI PCC bounds") \
_ELF_DEFINE_PT(PT_SUNW_UNWIND, 0x6464E550UL, \
"Solaris/amd64 stack unwind tables") \
_ELF_DEFINE_PT(PT_GNU_EH_FRAME, 0x6474E550UL, \
Expand Down
6 changes: 6 additions & 0 deletions contrib/elftoolchain/elfdump/elfdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ d_tags(uint64_t tag)
case DT_FLAGS: return "DT_FLAGS";
case DT_PREINIT_ARRAY: return "DT_PREINIT_ARRAY"; /* XXX DT_ENCODING */
case DT_PREINIT_ARRAYSZ:return "DT_PREINIT_ARRAYSZ";
case DT_C18NSTRTAB: return "DT_C18NSTRTAB";
case DT_C18NSTRTABSZ: return "DT_C18NSTRTABSZ";
/* 0x6000000D - 0x6ffff000 operating system-specific semantics */
case 0x6ffffdf5: return "DT_GNU_PRELINKED";
case 0x6ffffdf6: return "DT_GNU_CONFLICTSZ";
Expand Down Expand Up @@ -351,6 +353,8 @@ elf_phdr_type_str(unsigned int type)
case PT_SHLIB: return "PT_SHLIB";
case PT_PHDR: return "PT_PHDR";
case PT_TLS: return "PT_TLS";
case PT_COMPARTMENT: return "PT_COMPARTMENT";
case PT_CHERI_BOUNDS: return "PT_CHERI_BOUNDS";
case PT_GNU_EH_FRAME: return "PT_GNU_EH_FRAME";
case PT_GNU_STACK: return "PT_GNU_STACK";
case PT_GNU_RELRO: return "PT_GNU_RELRO";
Expand Down Expand Up @@ -1666,6 +1670,7 @@ elf_print_dynamic(struct elfdump *ed)
case DT_VERNEED:
case DT_VERNEEDNUM:
case DT_VERSYM:
case DT_C18NSTRTABSZ:
if (ed->flags & SOLARIS_FMT)
PRT("%#jx\n", (uintmax_t)dyn.d_un.d_val);
else
Expand All @@ -1682,6 +1687,7 @@ elf_print_dynamic(struct elfdump *ed)
case DT_REL:
case DT_JMPREL:
case DT_DEBUG:
case DT_C18NSTRTAB:
if (ed->flags & SOLARIS_FMT)
PRT("%#jx\n", (uintmax_t)dyn.d_un.d_ptr);
else
Expand Down
6 changes: 6 additions & 0 deletions contrib/elftoolchain/readelf/readelf.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,8 @@ phdr_type(unsigned int mach, unsigned int ptype)
case PT_SHLIB: return "SHLIB";
case PT_PHDR: return "PHDR";
case PT_TLS: return "TLS";
case PT_COMPARTMENT: return "COMPARTMENT";
case PT_CHERI_BOUNDS: return "CHERI_BOUNDS";
case PT_GNU_EH_FRAME: return "GNU_EH_FRAME";
case PT_GNU_STACK: return "GNU_STACK";
case PT_GNU_RELRO: return "GNU_RELRO";
Expand Down Expand Up @@ -885,6 +887,8 @@ dt_type(unsigned int mach, unsigned int dtype)
case DT_SUNW_FILTER: return "SUNW_FILTER";
case DT_SUNW_CAP: return "SUNW_CAP";
case DT_SUNW_ASLR: return "SUNW_ASLR";
case DT_C18NSTRTAB: return "C18NSTRTAB";
case DT_C18NSTRTABSZ: return "C18NSTRTABSZ";
case DT_CHECKSUM: return "CHECKSUM";
case DT_PLTPADSZ: return "PLTPADSZ";
case DT_MOVEENT: return "MOVEENT";
Expand Down Expand Up @@ -3030,6 +3034,7 @@ dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab)
case DT_GNU_HASH:
case DT_GNU_LIBLIST:
case DT_GNU_CONFLICT:
case DT_C18NSTRTAB:
printf(" 0x%jx\n", (uintmax_t) dyn->d_un.d_val);
break;
case DT_PLTRELSZ:
Expand All @@ -3044,6 +3049,7 @@ dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab)
case DT_FINI_ARRAYSZ:
case DT_GNU_CONFLICTSZ:
case DT_GNU_LIBLISTSZ:
case DT_C18NSTRTABSZ:
printf(" %ju (bytes)\n", (uintmax_t) dyn->d_un.d_val);
break;
case DT_RELACOUNT:
Expand Down
Loading
Loading