rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_Entry

Add a macro the architectures can use to add per-arch fields to
Struct_Obj_Entry.

Reviewed by:	kib
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45116
This commit is contained in:
Andrew Turner 2024-05-07 16:49:53 +01:00
parent a7b222db12
commit 06db20ffec
8 changed files with 16 additions and 0 deletions

View File

@ -37,6 +37,8 @@
struct Struct_Obj_Entry;
#define MD_OBJ_ENTRY
/* Return the address of the .dynamic section in the dynamic linker. */
#define rtld_dynamic(obj) \
({ \

View File

@ -35,6 +35,8 @@
struct Struct_Obj_Entry;
#define MD_OBJ_ENTRY
/* Return the address of the .dynamic section in the dynamic linker. */
Elf_Dyn *rtld_dynamic_addr(void);
#define rtld_dynamic(obj) rtld_dynamic_addr()

View File

@ -36,6 +36,8 @@
struct Struct_Obj_Entry;
#define MD_OBJ_ENTRY
/* Return the address of the .dynamic section in the dynamic linker. */
#define rtld_dynamic(obj) (&_DYNAMIC)

View File

@ -35,6 +35,8 @@
struct Struct_Obj_Entry;
#define MD_OBJ_ENTRY
/* Return the address of the .dynamic section in the dynamic linker. */
#define rtld_dynamic(obj) \
((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC))

View File

@ -35,6 +35,8 @@
struct Struct_Obj_Entry;
#define MD_OBJ_ENTRY
/* Return the address of the .dynamic section in the dynamic linker. */
#define rtld_dynamic(obj) (&_DYNAMIC)

View File

@ -35,6 +35,8 @@
struct Struct_Obj_Entry;
#define MD_OBJ_ENTRY
/* Return the address of the .dynamic section in the dynamic linker. */
#define rtld_dynamic(obj) (&_DYNAMIC)

View File

@ -42,6 +42,8 @@
struct Struct_Obj_Entry;
#define MD_OBJ_ENTRY
uint64_t set_gp(struct Struct_Obj_Entry *obj);
/* Return the address of the .dynamic section in the dynamic linker. */

View File

@ -277,6 +277,8 @@ typedef struct Struct_Obj_Entry {
bool unholdfree : 1; /* unmap upon last unhold */
bool doomed : 1; /* Object cannot be referenced */
MD_OBJ_ENTRY;
struct link_map linkmap; /* For GDB and dlinfo() */
Objlist dldags; /* Object belongs to these dlopened DAGs (%) */
Objlist dagmembers; /* DAG has these members (%) */