Page MenuHomeFreeBSD

Fix PPC symbol resolution

Authored by on May 9 2018, 9:13 PM.



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

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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

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.

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 accepted this revision.May 9 2018, 9:35 PM
jhibbits added inline comments.
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

Thanks Leandro. This closes bug#227093

This revision was automatically updated to reflect the committed changes.