diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-06-18 11:53:55 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-10-07 10:26:08 -0700 |
commit | 1bd888d0b705fa5ab7b443724288f7ba12939533 (patch) | |
tree | 166dd3a513e03da33dfad8b580b8f415db93b91d /sysdeps/generic | |
parent | 1836bb2ebf62bd9a3588f2ed2d851c8ae810097a (diff) | |
download | glibc-1bd888d0b705fa5ab7b443724288f7ba12939533.zip glibc-1bd888d0b705fa5ab7b443724288f7ba12939533.tar.gz glibc-1bd888d0b705fa5ab7b443724288f7ba12939533.tar.bz2 |
Initial support for GNU_PROPERTY_1_NEEDED
1. Add GNU_PROPERTY_1_NEEDED:
#define GNU_PROPERTY_1_NEEDED GNU_PROPERTY_UINT32_OR_LO
to indicate the needed properties by the object file.
2. Add GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS:
#define GNU_PROPERTY_1_NEEDED_INDIRECT_EXTERN_ACCESS (1U << 0)
to indicate that the object file requires canonical function pointers and
cannot be used with copy relocation.
3. Scan GNU_PROPERTY_1_NEEDED property and store it in l_1_needed.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/dl-prop.h | 9 | ||||
-rw-r--r-- | sysdeps/generic/link_map.h | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sysdeps/generic/dl-prop.h b/sysdeps/generic/dl-prop.h index eaee805..207aadb 100644 --- a/sysdeps/generic/dl-prop.h +++ b/sysdeps/generic/dl-prop.h @@ -47,7 +47,14 @@ static inline int __attribute__ ((always_inline)) _dl_process_gnu_property (struct link_map *l, int fd, uint32_t type, uint32_t datasz, void *data) { - return 0; + /* Continue until GNU_PROPERTY_1_NEEDED is found. */ + if (type == GNU_PROPERTY_1_NEEDED) + { + if (datasz == 4) + l->l_1_needed = *(unsigned int *) data; + return 0; + } + return 1; } #endif /* _DL_PROP_H */ diff --git a/sysdeps/generic/link_map.h b/sysdeps/generic/link_map.h index a056184..9f482b8 100644 --- a/sysdeps/generic/link_map.h +++ b/sysdeps/generic/link_map.h @@ -1 +1,2 @@ -/* No architecture specific definitions. */ +/* GNU_PROPERTY_1_NEEDED of this object. */ +unsigned int l_1_needed; |