Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157667197
D45182.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D45182.diff
View Options
diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c
--- a/libexec/rtld-elf/powerpc/reloc.c
+++ b/libexec/rtld-elf/powerpc/reloc.c
@@ -57,6 +57,17 @@
void _rtld_bind_secureplt_start(void);
+bool
+arch_digest_dynamic(struct Struct_Obj_Entry *obj, const Elf_Dyn *dynp)
+{
+ if (dynp->d_tag == DT_PPC_GOT) {
+ obj->gotptr = (Elf_Addr *)(obj->relocbase + dynp->d_un.d_ptr);
+ return (true);
+ }
+
+ return (false);
+}
+
/*
* Process the R_PPC_COPY relocations
*/
diff --git a/libexec/rtld-elf/powerpc/rtld_machdep.h b/libexec/rtld-elf/powerpc/rtld_machdep.h
--- a/libexec/rtld-elf/powerpc/rtld_machdep.h
+++ b/libexec/rtld-elf/powerpc/rtld_machdep.h
@@ -35,13 +35,13 @@
struct Struct_Obj_Entry;
-#define MD_OBJ_ENTRY
+#define MD_OBJ_ENTRY \
+ Elf_Addr *gotptr; /* GOT pointer (secure-plt only) */
/* Return the address of the .dynamic section in the dynamic linker. */
#define rtld_dynamic(obj) (&_DYNAMIC)
-/* No arch-specific dynamic tags */
-#define arch_digest_dynamic(obj, dynp) false
+bool arch_digest_dynamic(struct Struct_Obj_Entry *, const Elf_Dyn *);
/* No architecture specific notes */
#define arch_digest_note(obj, note) false
diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c
--- a/libexec/rtld-elf/powerpc64/reloc.c
+++ b/libexec/rtld-elf/powerpc64/reloc.c
@@ -52,6 +52,17 @@
};
#endif
+bool
+arch_digest_dynamic(struct Struct_Obj_Entry *obj, const Elf_Dyn *dynp)
+{
+ if (dynp->d_tag == DT_PPC64_GLINK) {
+ obj->glink = (Elf_Addr)(obj->relocbase + dynp->d_un.d_ptr);
+ return (true);
+ }
+
+ return (false);
+}
+
/*
* Process the R_PPC_COPY relocations
*/
diff --git a/libexec/rtld-elf/powerpc64/rtld_machdep.h b/libexec/rtld-elf/powerpc64/rtld_machdep.h
--- a/libexec/rtld-elf/powerpc64/rtld_machdep.h
+++ b/libexec/rtld-elf/powerpc64/rtld_machdep.h
@@ -35,13 +35,13 @@
struct Struct_Obj_Entry;
-#define MD_OBJ_ENTRY
+#define MD_OBJ_ENTRY \
+ Elf_Addr glink; /* GLINK PLT call stub section */
/* Return the address of the .dynamic section in the dynamic linker. */
#define rtld_dynamic(obj) (&_DYNAMIC)
-/* No arch-specific dynamic tags */
-#define arch_digest_dynamic(obj, dynp) false
+bool arch_digest_dynamic(struct Struct_Obj_Entry *, const Elf_Dyn *);
/* No architecture specific notes */
#define arch_digest_note(obj, note) false
diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h
--- a/libexec/rtld-elf/rtld.h
+++ b/libexec/rtld-elf/rtld.h
@@ -183,13 +183,6 @@
const Elf_Sym *symtab; /* Symbol table */
const char *strtab; /* String table */
unsigned long strsize; /* Size in bytes of string table */
-#ifdef __powerpc__
-#ifdef __powerpc64__
- Elf_Addr glink; /* GLINK PLT call stub section */
-#else
- Elf_Addr *gotptr; /* GOT pointer (secure-plt only) */
-#endif
-#endif
const Elf_Verneed *verneed; /* Required versions. */
Elf_Word verneednum; /* Number of entries in verneed table */
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -1520,18 +1520,6 @@
obj->static_tls = true;
break;
-#ifdef __powerpc__
-#ifdef __powerpc64__
- case DT_PPC64_GLINK:
- obj->glink = (Elf_Addr)(obj->relocbase + dynp->d_un.d_ptr);
- break;
-#else
- case DT_PPC_GOT:
- obj->gotptr = (Elf_Addr *)(obj->relocbase + dynp->d_un.d_ptr);
- break;
-#endif
-#endif
-
case DT_FLAGS_1:
if (dynp->d_un.d_val & DF_1_NOOPEN)
obj->z_noopen = true;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 24, 9:29 PM (11 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33487589
Default Alt Text
D45182.diff (3 KB)
Attached To
Mode
D45182: rtld: Move powerpc specific code to powerpc files
Attached
Detach File
Event Timeline
Log In to Comment