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)
Sun, Nov 10, 10:00 AM
Unknown Object (File)
Sun, Nov 10, 6:53 AM
Unknown Object (File)
Sun, Nov 10, 5:58 AM
Unknown Object (File)
Sun, Nov 10, 4:07 AM
Unknown Object (File)
Sun, Nov 10, 12:07 AM
Unknown Object (File)
Sat, Nov 9, 11:43 PM
Unknown Object (File)
Oct 22 2024, 1:12 PM
Unknown Object (File)
Oct 3 2024, 8:38 AM

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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16502
Build 16416: arc lint + arc unit

Event Timeline

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

sys/ddb/db_main.c
115

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

'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

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.