Print this page
ld should reject kernel modules as input

@@ -1089,11 +1089,11 @@
  * If the specified object has a dynamic section, and that section
  * contains a DT_FLAGS_1 entry, then return the value of that entry.
  * Otherwise, return 0.
  */
 GElf_Xword
-_gelf_getdyndtflags_1(Elf *elf)
+_gelf_getdynval(Elf *elf, GElf_Sxword tag)
 {
         Elf_Scn *scn = NULL;
         Elf_Data *data;
         GElf_Shdr shdr;
         GElf_Dyn dyn;

@@ -1106,14 +1106,20 @@
                         continue;
                 if (data = elf_getdata(scn, NULL)) {
                         n = shdr.sh_size / shdr.sh_entsize;
                         for (i = 0; i < n; i++) {
                                 (void) gelf_getdyn(data, i, &dyn);
-                                if (dyn.d_tag == DT_FLAGS_1) {
+                                if (dyn.d_tag == tag) {
                                         return (dyn.d_un.d_val);
                                 }
                         }
                 }
                 break;
         }
         return (0);
 }
+
+GElf_Xword
+_gelf_getdyndtflags_1(Elf *elf)
+{
+        return (_gelf_getdynval(elf, DT_FLAGS_1));
+}