Bug 479041 - Executables without RW sections do not trigger debuginfo reading
commit8e1d13bd11f0064b39896450e15e9d924866c478
authorPaul Floyd <pjfloyd@wanadoo.fr>
Thu, 28 Dec 2023 09:27:18 +0000 (28 10:27 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Thu, 28 Dec 2023 09:27:18 +0000 (28 10:27 +0100)
tree74e865e267b94d37f884dc61fa70579e3f6eec5a
parentfe7cc3726ff4c39fe0337603f7723bf643d92084
Bug 479041 - Executables without RW sections do not trigger debuginfo reading

The main change is to not assume that there is always 1 and only 1 RW segment.
Now the rw segment count is obtained from the macho segments.

I've had to make several changes to remove asserts that checked
that there is always 1 or more rw segments. I don't think that this
really affects 'normal' C and C++ compiled binaries. There is one
exp-bbv testcase (x86/million) that is written in assembler and
was failing until I removed all of the asserts.

There's still a bit more work to do.
1. Handle fat binaries - are these still a thing (with "apple silicon")?
2. Use a dynamically sized buffer for the segments rather than just 4k.
coregrind/m_debuginfo/debuginfo.c
coregrind/m_debuginfo/priv_readmacho.h
coregrind/m_debuginfo/readelf.c
coregrind/m_debuginfo/readmacho.c
coregrind/m_debuginfo/storage.c
tests/filter_stderr_basic.in