-
Notifications
You must be signed in to change notification settings - Fork 18k
debug/dwarf: invalid string values due to incorrect strp offsets #4107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Milestone
Comments
So it turns out that this due to a well hidden bug in debug/elf - the object in question contains a rela.debug_info section, which contains the offsets into the string table. However, the relocation for the given section is not processed, resulting in all strp offsets referring to the first entry in the string table. The root cause is an off-by-one error caused by debug/elf discarding the first symbol in the symbol table. As a result, the relocation code actually checks the following symbol and if it does not have a type of STT_SECTION then the relocation is skipped. Unfortunately, all of the objects used for the existing relocation tests have symbols of type STT_SECTION that follow the symbol that requires relocation, hence they relocate correctly. There are two obvious fixes - stop skipping over the first symbol in the symbol table or adjust the index when performing relocation. I suspect the first of these is more "correct" since any data that contains an index into the symbol table will potentially encounter the same issue. Furthermore, code that uses debug/elf or debug/dwarf should not need to know that they must adjust for this. Owner changed to @4a6f656c. |
Issue #4378 has been merged into this issue. |
This issue was closed by revision 7668984. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Attachments:
The text was updated successfully, but these errors were encountered: