File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1388,6 +1388,7 @@ struct phdr_data {
1388
1388
off_t offset ;
1389
1389
u64 addr ;
1390
1390
u64 len ;
1391
+ struct list_head node ;
1391
1392
};
1392
1393
1393
1394
struct kcore_copy_info {
@@ -1399,6 +1400,7 @@ struct kcore_copy_info {
1399
1400
u64 last_module_symbol ;
1400
1401
struct phdr_data kernel_map ;
1401
1402
struct phdr_data modules_map ;
1403
+ struct list_head phdrs ;
1402
1404
};
1403
1405
1404
1406
static int kcore_copy__process_kallsyms (void * arg , const char * name , char type ,
@@ -1510,6 +1512,11 @@ static int kcore_copy__read_maps(struct kcore_copy_info *kci, Elf *elf)
1510
1512
if (elf_read_maps (elf , true, kcore_copy__read_map , kci ) < 0 )
1511
1513
return -1 ;
1512
1514
1515
+ if (kci -> kernel_map .len )
1516
+ list_add_tail (& kci -> kernel_map .node , & kci -> phdrs );
1517
+ if (kci -> modules_map .len )
1518
+ list_add_tail (& kci -> modules_map .node , & kci -> phdrs );
1519
+
1513
1520
return 0 ;
1514
1521
}
1515
1522
@@ -1678,6 +1685,8 @@ int kcore_copy(const char *from_dir, const char *to_dir)
1678
1685
char kcore_filename [PATH_MAX ];
1679
1686
char extract_filename [PATH_MAX ];
1680
1687
1688
+ INIT_LIST_HEAD (& kci .phdrs );
1689
+
1681
1690
if (kcore_copy__copy_file (from_dir , to_dir , "kallsyms" ))
1682
1691
return -1 ;
1683
1692
You can’t perform that action at this time.
0 commit comments