Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109366910
D33120.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D33120.diff
View Options
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -1321,7 +1321,7 @@
}
static int
-relocate_file(elf_file_t ef)
+relocate_file1(elf_file_t ef, bool ifuncs)
{
const Elf_Rel *rellim;
const Elf_Rel *rel;
@@ -1354,6 +1354,9 @@
/* Local relocs are already done */
if (ELF_ST_BIND(sym->st_info) == STB_LOCAL)
continue;
+ if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC ||
+ elf_is_ifunc_reloc(rel->r_info)) != ifuncs)
+ continue;
if (elf_reloc(&ef->lf, base, rel, ELF_RELOC_REL,
elf_obj_lookup)) {
symname = symbol_name(ef, rel->r_info);
@@ -1386,6 +1389,9 @@
/* Local relocs are already done */
if (ELF_ST_BIND(sym->st_info) == STB_LOCAL)
continue;
+ if ((ELF_ST_TYPE(sym->st_info) == STT_GNU_IFUNC ||
+ elf_is_ifunc_reloc(rela->r_info)) != ifuncs)
+ continue;
if (elf_reloc(&ef->lf, base, rela, ELF_RELOC_RELA,
elf_obj_lookup)) {
symname = symbol_name(ef, rela->r_info);
@@ -1406,6 +1412,17 @@
return (0);
}
+static int
+relocate_file(elf_file_t ef)
+{
+ int error;
+
+ error = relocate_file1(ef, false);
+ if (error == 0)
+ error = relocate_file1(ef, true);
+ return (error);
+}
+
static int
link_elf_lookup_symbol(linker_file_t lf, const char *name, c_linker_sym_t *sym)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 5, 3:30 AM (12 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16458198
Default Alt Text
D33120.diff (1 KB)
Attached To
Mode
D33120: link_elf_obj: Process global ifunc relocs after other global relocs
Attached
Detach File
Event Timeline
Log In to Comment