+ ;; Make sure that the symbol has an appropriate package. In
+ ;; particular, catch the so-easy-to-make error of typing something
+ ;; like SB-KERNEL:%BYTE-BLT in cold sources when what you really
+ ;; need is SB!KERNEL:%BYTE-BLT.
+ (let ((package-name (package-name package)))
+ (cond ((find package-name '("COMMON-LISP" "KEYWORD") :test #'string=)
+ ;; That's OK then.
+ (values))
+ ((string= package-name "SB!" :end1 3 :end2 3)
+ ;; That looks OK, too. (All the target-code packages
+ ;; have names like that.)
+ (values))
+ (t
+ ;; looks bad: maybe COMMON-LISP-USER? maybe an extension
+ ;; package in the xc host? something we can't think of
+ ;; a valid reason to dump, anyway...
+ (bug "internal error: PACKAGE-NAME=~S looks too much like a typo."
+ package-name))))
+