rtld: dl_iterate_phdr change
authorJohn Marino <draco@marino.st>
Sat, 30 Nov 2013 09:55:19 +0000 (10:55 +0100)
committerJohn Marino <draco@marino.st>
Sat, 30 Nov 2013 11:55:32 +0000 (12:55 +0100)
The dynamic linker needs to include itself when iterating over loaded
ELF objects in dl_iterate_phdr(3).

Taken by:
FreeBSD SVN 257811 (07 NOV 2013)

libexec/rtld-elf/rtld.c

index 968a526..581aaff 100644 (file)
@@ -3332,6 +3332,11 @@ dl_iterate_phdr(__dl_iterate_hdr_callback callback, void *param)
                break;
 
     }
+    if (error == 0) {
+       rtld_fill_dl_phdr_info(&obj_rtld, &phdr_info);
+       error = callback(&phdr_info, sizeof(phdr_info), param);
+    }
+
     lock_release(rtld_bind_lock, &bind_lockstate);
     lock_release(rtld_phdr_lock, &phdr_lockstate);