Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
symbols: skip load .init.* sections if module was successfully initia…
…lized There might be address overlap of one modules .init.text symbols and another modules .text symbols. As a result, gdb fails to translate the address to symbol name correctly: crash> sym -m virtio_blk | grep MODULE ffffffffc00a4000 MODULE START: virtio_blk ffffffffc00a86ec MODULE END: virtio_blk crash> gdb info address floppy_module_init Symbol "floppy_module_init" is a function at address 0xffffffffc00a4131. Since the .init.* sections of a module had been freed by kernel if the module was initialized successfully, there is no need to load the .init.* sections data from "*.ko.debug" in gdb to create such an overlap. lm->mod_init_module_ptr is used as a flag of whether module is freed. Without the patch: crash> mod -S crash> struct blk_mq_ops 0xffffffffc00a7160 struct blk_mq_ops { queue_rq = 0xffffffffc00a45b0 <floppy_module_init+1151>, <-- translated from module floppy map_queue = 0xffffffff813015c0 <blk_mq_map_queue>, ...snip... complete = 0xffffffffc00a4370 <floppy_module_init+575>, init_request = 0xffffffffc00a4260 <floppy_module_init+303>, ...snip... } With the patch: crash> mod -S crash> struct blk_mq_ops 0xffffffffc00a7160 struct blk_mq_ops { queue_rq = 0xffffffffc00a45b0 <virtio_queue_rq>, <-- translated from module virtio_blk map_queue = 0xffffffff813015c0 <blk_mq_map_queue>, ...snip... complete = 0xffffffffc00a4370 <virtblk_request_done>, init_request = 0xffffffffc00a4260 <virtblk_init_request>, ...snip... } Signed-off-by: Tao Liu <[email protected]>
- Loading branch information