Page MenuHomeFreeBSD

Fix PPC symbol resolution
ClosedPublic

Authored by leandro.lupori_gmail.com on May 9 2018, 9:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 23 2024, 6:30 AM
Unknown Object (File)
Jan 17 2024, 1:24 AM
Unknown Object (File)
Dec 20 2023, 12:52 AM
Unknown Object (File)
Dec 12 2023, 4:41 AM
Unknown Object (File)
Nov 17 2023, 12:20 PM
Unknown Object (File)
Nov 12 2023, 2:07 PM
Unknown Object (File)
Nov 9 2023, 9:26 PM
Unknown Object (File)
Nov 9 2023, 7:57 PM

Details

Summary

There were 2 issues that were preventing correct symbol resolution
on PowerPC/pseries:

1- memory corruption at chrp_attach() - this caused the inital

part of the symbol table to become zeroed, which would cause
the kernel linker to fail to parse it.
(this was probably zeroing out other memory parts as well)

2- DDB symbol resolution wasn't working because symtab contained

not relocated addresses but it was given relocated offsets.
Although relocating the symbol table fixed this, it broke the
linker, that already handled this case.
Thus, the fix for this consists in adding a new DDB macro:
DB_STOFFS(offs) that converts a (potentially) relocated offset
into one that can be compared with symbol table values.

Fixes bug 227093.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Overall looks good, just one question which could reduce the diff down significantly.

sys/ddb/db_main.c
115 ↗(On Diff #42336)

Is there any reason not to just adjust 'off' instead? It's not used anywhere after here now, anyway, and they're the same type.

sys/ddb/db_main.c
115 ↗(On Diff #42336)

'off' is used at line 148.
I thought it was safer to use the original 'off' value there.
Maybe it is ok to use the adjusted 'off' value there, I'm just not sure...

jhibbits added inline comments.
sys/ddb/db_main.c
115 ↗(On Diff #42336)

You're right, I missed that when I first read through. What you have is best, then.

This revision is now accepted and ready to land.May 9 2018, 9:35 PM
This revision was automatically updated to reflect the committed changes.