Functions marked as __exit must never be called from main line code or
from code marked as __init. For a module, __exit code is entered
directly from rmmod during module removal. When the code is built into
the kernel, the entire __exit section is discarded and therefore must
never be referenced from anywhere else. Unfortunately the linker does
not flag references to discarded sections as an error.
On ix86 the reference is resolved to an offset from the start of the
non-existent .text.exit section, as if the section started at 0. So on
ix86 you get a resolved reference to the bottom end of memory, if that
reference is ever used, oops.
On IA64 the linker may flag an error, but only if the distance between
the reference and the low value assigned to the discarded symbol cannot
fit into the instruction. An external reference in an instruction is
normally a 21 bit offset, the kernel starts at 0xe000000004400000 so
discarded symbols usually cause an error on IA64, but it is not
guaranteed.
pagebuf_terminate is called from the __init code so pagebuf_terminate
must not be marked as __exit. Changing pagebuf_terminate also meant
changing all the functions called by pagebuf_terminate that were marked
as __exit.
Date: Wed Oct 10 20:32:47 PDT 2001
Workarea: sherman.melbourne.sgi.com:/build/kaos/2.4.x-xfs
The following file(s) were checked into:
bonnie.engr.sgi.com:/isms/slinx/2.4.x-xfs
Modid: 2.4.x-xfs:slinx:104332a
linux/fs/pagebuf/page_buf.c - 1.100
linux/fs/pagebuf/page_buf_locking.c - 1.14
linux/fs/pagebuf/avl.c - 1.5
|