diff options
| author | Marcel Moolenaar <marcel@FreeBSD.org> | 2002-04-21 21:08:30 +0000 |
|---|---|---|
| committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2002-04-21 21:08:30 +0000 |
| commit | 8420105927433fa5327d76871e927d2c295aa976 (patch) | |
| tree | 745d9e23292cef4ba528d7c410f78377f0a1dde6 | |
| parent | 3bf762b7f61757c859d21eb99a0226e6d6c4cc63 (diff) | |
Notes
| -rw-r--r-- | sys/kern/link_elf.c | 19 | ||||
| -rw-r--r-- | sys/kern/link_elf_obj.c | 19 |
2 files changed, 38 insertions, 0 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index fe4aba357351..8eb7681f95ac 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -165,6 +165,10 @@ r_debug_state(struct r_debug *dummy_one __unused, #endif +#ifdef __ia64__ +Elf_Addr link_elf_get_gp(linker_file_t); +#endif + /* * The kernel symbol table starts here. */ @@ -1171,3 +1175,18 @@ link_elf_each_function_name(linker_file_t file, } return (0); } + +#ifdef __ia64__ +/* + * Each KLD has its own GP. The GP value for each load module is given by + * DT_PLTGOT on ia64. We need GP to construct function descriptors, but + * don't have direct access to the ELF file structure. The link_elf_get_gp() + * function returns the GP given a pointer to a generic linker file struct. + */ +Elf_Addr +link_elf_get_gp(linker_file_t lf) +{ + elf_file_t ef = (elf_file_t)lf; + return (Elf_Addr)ef->got; +} +#endif diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index fe4aba357351..8eb7681f95ac 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -165,6 +165,10 @@ r_debug_state(struct r_debug *dummy_one __unused, #endif +#ifdef __ia64__ +Elf_Addr link_elf_get_gp(linker_file_t); +#endif + /* * The kernel symbol table starts here. */ @@ -1171,3 +1175,18 @@ link_elf_each_function_name(linker_file_t file, } return (0); } + +#ifdef __ia64__ +/* + * Each KLD has its own GP. The GP value for each load module is given by + * DT_PLTGOT on ia64. We need GP to construct function descriptors, but + * don't have direct access to the ELF file structure. The link_elf_get_gp() + * function returns the GP given a pointer to a generic linker file struct. + */ +Elf_Addr +link_elf_get_gp(linker_file_t lf) +{ + elf_file_t ef = (elf_file_t)lf; + return (Elf_Addr)ef->got; +} +#endif |
