https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7f9c78bc3a0eaa7bc5f04a585bdaf672c6578e9a commit 7f9c78bc3a0eaa7bc5f04a585bdaf672c6578e9a Author: Carlos Eduardo Seo <carlos.seo@arm.com> Date: Tue Jul 5 22:09:03 2022 +0000 TODO(pldd): cheri: elf: fix pldd to compile for purecap abi Adjust types in the E(*) structs to support capabilities. TODO: purecap pldd should refuse to deal with lp64 and ELF32 processes. the code for the 32bit case should be disabled. TODO: a correct fix requires support for all abis that can run on the same system (purecap, lp64 and ELF32 too). Diff: --- elf/pldd-xx.c | 58 +++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/elf/pldd-xx.c b/elf/pldd-xx.c index 30513b423f..cddec459d7 100644 --- a/elf/pldd-xx.c +++ b/elf/pldd-xx.c @@ -24,6 +24,7 @@ #include <dl-r_debug.h> +#ifndef __CHERI_PURE_CAPABILITY__ struct E(link_map) { EW(Addr) l_addr; @@ -35,6 +36,48 @@ struct E(link_map) Lmid_t l_ns; EW(Addr) l_libname; }; + +struct E(libname_list) +{ + EW(Addr) name; + EW(Addr) next; +}; + +struct E(r_debug) +{ + int r_version; +# if CLASS == 64 + int pad; +# endif + EW(Addr) r_map; +}; +#else +struct E(link_map) +{ + uintptr_t l_addr; + uintptr_t l_name; + uintptr_t l_ld; + uintptr_t l_next; + uintptr_t l_prev; + uintptr_t l_real; + Lmid_t l_ns; + uintptr_t l_libname; +}; + +struct E(libname_list) +{ + uintptr_t name; + uintptr_t next; +}; + +struct E(r_debug) +{ + int r_version; + int pad; + uintptr_t r_map; +}; +#endif + #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct link_map, l_addr) == offsetof (struct E(link_map), l_addr), "l_addr"); @@ -44,27 +87,12 @@ _Static_assert (offsetof (struct link_map, l_next) == offsetof (struct E(link_map), l_next), "l_next"); #endif - -struct E(libname_list) -{ - EW(Addr) name; - EW(Addr) next; -}; #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct libname_list, name) == offsetof (struct E(libname_list), name), "name"); _Static_assert (offsetof (struct libname_list, next) == offsetof (struct E(libname_list), next), "next"); #endif - -struct E(r_debug) -{ - int r_version; -#if CLASS == 64 - int pad; -#endif - EW(Addr) r_map; -}; #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct r_debug, r_version) == offsetof (struct E(r_debug), r_version), "r_version");
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=96320bbc9042c4aa04bf3955e5399683933e539b commit 96320bbc9042c4aa04bf3955e5399683933e539b Author: Carlos Eduardo Seo <carlos.seo@arm.com> Date: Tue Jul 5 22:09:03 2022 +0000 TODO(pldd): cheri: elf: fix pldd to compile for purecap abi Adjust types in the E(*) structs to support capabilities. TODO: purecap pldd should refuse to deal with lp64 and ELF32 processes. the code for the 32bit case should be disabled. TODO: a correct fix requires support for all abis that can run on the same system (purecap, lp64 and ELF32 too). Diff: --- elf/pldd-xx.c | 58 +++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/elf/pldd-xx.c b/elf/pldd-xx.c index 30513b423f..cddec459d7 100644 --- a/elf/pldd-xx.c +++ b/elf/pldd-xx.c @@ -24,6 +24,7 @@ #include <dl-r_debug.h> +#ifndef __CHERI_PURE_CAPABILITY__ struct E(link_map) { EW(Addr) l_addr; @@ -35,6 +36,48 @@ struct E(link_map) Lmid_t l_ns; EW(Addr) l_libname; }; + +struct E(libname_list) +{ + EW(Addr) name; + EW(Addr) next; +}; + +struct E(r_debug) +{ + int r_version; +# if CLASS == 64 + int pad; +# endif + EW(Addr) r_map; +}; +#else +struct E(link_map) +{ + uintptr_t l_addr; + uintptr_t l_name; + uintptr_t l_ld; + uintptr_t l_next; + uintptr_t l_prev; + uintptr_t l_real; + Lmid_t l_ns; + uintptr_t l_libname; +}; + +struct E(libname_list) +{ + uintptr_t name; + uintptr_t next; +}; + +struct E(r_debug) +{ + int r_version; + int pad; + uintptr_t r_map; +}; +#endif + #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct link_map, l_addr) == offsetof (struct E(link_map), l_addr), "l_addr"); @@ -44,27 +87,12 @@ _Static_assert (offsetof (struct link_map, l_next) == offsetof (struct E(link_map), l_next), "l_next"); #endif - -struct E(libname_list) -{ - EW(Addr) name; - EW(Addr) next; -}; #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct libname_list, name) == offsetof (struct E(libname_list), name), "name"); _Static_assert (offsetof (struct libname_list, next) == offsetof (struct E(libname_list), next), "next"); #endif - -struct E(r_debug) -{ - int r_version; -#if CLASS == 64 - int pad; -#endif - EW(Addr) r_map; -}; #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct r_debug, r_version) == offsetof (struct E(r_debug), r_version), "r_version");
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=352adc1281d307089c30c2736b6ec501439478ca commit 352adc1281d307089c30c2736b6ec501439478ca Author: Carlos Eduardo Seo <carlos.seo@arm.com> Date: Tue Jul 5 22:09:03 2022 +0000 TODO(pldd): cheri: elf: fix pldd to compile for purecap abi Adjust types in the E(*) structs to support capabilities. TODO: purecap pldd should refuse to deal with lp64 and ELF32 processes. the code for the 32bit case should be disabled. TODO: a correct fix requires support for all abis that can run on the same system (purecap, lp64 and ELF32 too). Diff: --- elf/pldd-xx.c | 58 +++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/elf/pldd-xx.c b/elf/pldd-xx.c index 30513b423f..cddec459d7 100644 --- a/elf/pldd-xx.c +++ b/elf/pldd-xx.c @@ -24,6 +24,7 @@ #include <dl-r_debug.h> +#ifndef __CHERI_PURE_CAPABILITY__ struct E(link_map) { EW(Addr) l_addr; @@ -35,6 +36,48 @@ struct E(link_map) Lmid_t l_ns; EW(Addr) l_libname; }; + +struct E(libname_list) +{ + EW(Addr) name; + EW(Addr) next; +}; + +struct E(r_debug) +{ + int r_version; +# if CLASS == 64 + int pad; +# endif + EW(Addr) r_map; +}; +#else +struct E(link_map) +{ + uintptr_t l_addr; + uintptr_t l_name; + uintptr_t l_ld; + uintptr_t l_next; + uintptr_t l_prev; + uintptr_t l_real; + Lmid_t l_ns; + uintptr_t l_libname; +}; + +struct E(libname_list) +{ + uintptr_t name; + uintptr_t next; +}; + +struct E(r_debug) +{ + int r_version; + int pad; + uintptr_t r_map; +}; +#endif + #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct link_map, l_addr) == offsetof (struct E(link_map), l_addr), "l_addr"); @@ -44,27 +87,12 @@ _Static_assert (offsetof (struct link_map, l_next) == offsetof (struct E(link_map), l_next), "l_next"); #endif - -struct E(libname_list) -{ - EW(Addr) name; - EW(Addr) next; -}; #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct libname_list, name) == offsetof (struct E(libname_list), name), "name"); _Static_assert (offsetof (struct libname_list, next) == offsetof (struct E(libname_list), next), "next"); #endif - -struct E(r_debug) -{ - int r_version; -#if CLASS == 64 - int pad; -#endif - EW(Addr) r_map; -}; #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct r_debug, r_version) == offsetof (struct E(r_debug), r_version), "r_version");
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=025e8cb8d9af704636b523b29bca4eb17aad50d0 commit 025e8cb8d9af704636b523b29bca4eb17aad50d0 Author: Carlos Eduardo Seo <carlos.seo@arm.com> Date: Tue Jul 5 22:09:03 2022 +0000 TODO(pldd): cheri: elf: fix pldd to compile for purecap abi Adjust types in the E(*) structs to support capabilities. TODO: purecap pldd should refuse to deal with lp64 and ELF32 processes. the code for the 32bit case should be disabled. TODO: a correct fix requires support for all abis that can run on the same system (purecap, lp64 and ELF32 too). Diff: --- elf/pldd-xx.c | 58 +++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/elf/pldd-xx.c b/elf/pldd-xx.c index 30513b423f..cddec459d7 100644 --- a/elf/pldd-xx.c +++ b/elf/pldd-xx.c @@ -24,6 +24,7 @@ #include <dl-r_debug.h> +#ifndef __CHERI_PURE_CAPABILITY__ struct E(link_map) { EW(Addr) l_addr; @@ -35,6 +36,48 @@ struct E(link_map) Lmid_t l_ns; EW(Addr) l_libname; }; + +struct E(libname_list) +{ + EW(Addr) name; + EW(Addr) next; +}; + +struct E(r_debug) +{ + int r_version; +# if CLASS == 64 + int pad; +# endif + EW(Addr) r_map; +}; +#else +struct E(link_map) +{ + uintptr_t l_addr; + uintptr_t l_name; + uintptr_t l_ld; + uintptr_t l_next; + uintptr_t l_prev; + uintptr_t l_real; + Lmid_t l_ns; + uintptr_t l_libname; +}; + +struct E(libname_list) +{ + uintptr_t name; + uintptr_t next; +}; + +struct E(r_debug) +{ + int r_version; + int pad; + uintptr_t r_map; +}; +#endif + #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct link_map, l_addr) == offsetof (struct E(link_map), l_addr), "l_addr"); @@ -44,27 +87,12 @@ _Static_assert (offsetof (struct link_map, l_next) == offsetof (struct E(link_map), l_next), "l_next"); #endif - -struct E(libname_list) -{ - EW(Addr) name; - EW(Addr) next; -}; #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct libname_list, name) == offsetof (struct E(libname_list), name), "name"); _Static_assert (offsetof (struct libname_list, next) == offsetof (struct E(libname_list), next), "next"); #endif - -struct E(r_debug) -{ - int r_version; -#if CLASS == 64 - int pad; -#endif - EW(Addr) r_map; -}; #if CLASS == __ELF_NATIVE_CLASS _Static_assert (offsetof (struct r_debug, r_version) == offsetof (struct E(r_debug), r_version), "r_version");