| Summary: | Reading debug info of binaries with zero-size PT_LOAD segment | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | H.J. Lu <hjl.tools> |
| Component: | general | Assignee: | Paul Floyd <pjfloyd> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | CC: | dilyan.palauzov, pjfloyd, sam |
| Priority: | NOR | ||
| Version First Reported In: | 3.14 SVN | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Bug Depends on: | 395682 | ||
| Bug Blocks: | |||
| Attachments: | A test program | ||
|
Description
H.J. Lu
2018-07-13 14:51:45 UTC
This is not straightforward. The segment loading code ignores zero sized segments. But the precondition for loading debuginfo is that an RX and one or two RW segments have been loaded. What I think that I need to do is add some dummy handler for zero-sized RW segments that just trigger the debuginfo loading. (In reply to Paul Floyd from comment #1) > What I think that I need to do is add some dummy handler for zero-sized RW > segments that just trigger the debuginfo loading. I can reproduce the problem on FreeBSD. Using ld.lld I get paulf> readelf -lW test Elf file type is EXEC (Executable file) Entry point 0x20128a There are 4 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000040 0x0000000000200040 0x0000000000200040 0x000118 0x000118 R 0x8 LOAD 0x000000 0x0000000000200000 0x0000000000200000 0x0001d4 0x0001d4 R 0x1000 LOAD 0x0001e0 0x00000000002011e0 0x00000000002011e0 0x0000da 0x0000da R E 0x1000 GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0 Section to Segment mapping: Segment Sections... 00 01 .rodata .eh_frame 02 .text 03 So this doesn't even have a zero sized RW segment. That's even worse. It now works on FreeBSD with the change in 491394 (vgModuleLocal_addDiCfSI): Assertion 'di->fsm.have_rx_map &&
di->fsm.rw_map_count' failed
I just checked this on Fedora 39 and it looks good. *** This bug has been marked as a duplicate of bug 491394 *** |