Re: CR_FIND_KSYM help?

From: Paul H. Hargrove (PHHargrove_at_lbl_dot_gov)
Date: Tue May 16 2006 - 15:50:18 PDT

  • Next message: Liu: "Can BLCR supports MIPS?"
    John M. Choi wrote:
    >So I've traced the problem, which is I guess not really a problem. The
    >function 'rw_verify_area' is *not* exported (I'm guessing by the absence
    >of EXPORT_SYMBOL in the kernel source?) so everything is actually working
    >correctly. It looks like you (the developers) get around this by looking
    >it up in System.map using CR_FIND_KSYM. However, I can't figure out (yet)
    >what 'type' is in CR_FIND_KSYM([kernel function],[type]), type =
    >{DATA,CODE}, and what purpose blcr_imports/imports.c has.
    >
    >Would someone please help with what I should do to get this to work? I
    >know I need to add CR_FIND_KSYM([rw_verify_area],[type]) to configure.ac,
    >but I don't know what 'type' to use, and what to do to
    >blcr_imports/imports.c. (Or if there's anything else I need to do.) Any
    >help would be much appreciated...
    >
    >  
    You are on the right track.  Since you say rw_verify_area is a function,
    CODE is the proper type:
        CR_FIND_KSYM([rw_verify_area],[CODE])
    
    The imports goop is to provide a module that exports all the required
    symbols that were not exported by the kernel.
    Assuming that a valid prototype is available in some header, you'll want
    to add the following to blcr_imports/import.c:
    
    #if CR_KCODE_rw_verify_area
      #include <linux/some_header_that_declares_rw_verify_area>
      CR_IMPORT_KCODE(rw_verify_area)
    #endif
    
    Note that if you get all this to work, PLEASE send us the patches so
    they can be added to the next release (or even posted to the website
    before that).
    
    -Paul
    
    
    >John
    >
    >_____________________________________________
    >John Choi, Caltech 136-93, Pasadena, CA 91125
    >Tel: 626-395-4829 Fax: 626-405-0928
    >
    >On Tue, 16 May 2006, John M. Choi wrote:
    >
    >  
    >>Hi,
    >>I'm trying to install blcr-0.4.2 against linux-2.4.32. However, blcr uses
    >>locks_verify_area in 2 files:
    >>
    >>  cr_module/cr_io.c
    >>  vmadump/vmadump.c
    >>
    >>The first time I tried to install this, the module blcr_vmadump complained of
    >>unresolved symbol locks_verify_area. I believe that the function no longer
    >>exists in linux version > 2.4.29 except in arch/mips from looking at
    >>patch-2.4.30 from kernel.org. The new function seems to be rw_verify_area.
    >>So, I copied the function calls in
    >>
    >>  linux-2.4.32/fs/read_write.c:sys_read/sys_write
    >>  (as per the comments in cr_io.c)
    >>
    >>and changed the references in blcr. I then recompiled, but now the vmadump
    >>module complains:
    >>  unresolved symbol rw_verify_area.
    >>
    >>So, just to make sure, I recompiled the kernel, and made sure that
    >>System.map and bzImage was self-consistent, copied the freshly compiled
    >>versions to /boot, re-ran lilo and rebooted. I then 'make distclean', and
    >>re-configure and re-make blcr, but I still get the unresolved symbol
    >>error.
    >>
    >>If I do 'grep rw_verify_area /boot/System.map', I get
    >>  c014d5f0 T rw_verify_area
    >>but if I look in /proc/ksyms, the symbol does not exist. However, this
    >>symbol does exist in linux-2.4.32/vmlinux, which is used to create
    >>bzImage. (I'm confused about what's going on here.)
    >>
    >>I realize, that most of the people reading this are probably much more
    >>familiar with kernel internals than I (I'm basically guessing here), but
    >>I've tried to err on the side of verbosity in what I've tried for
    >>clarity's sake.
    >>
    >>Would anyone please be willing to offer any hints? It would be much
    >>appreciated.
    >>
    >>Thanks,
    >>John
    >>
    >>_____________________________________________
    >>John Choi, Caltech 136-93, Pasadena, CA 91125
    >>Tel: 626-395-4829 Fax: 626-405-0928
    >>
    >>    
    
    
    -- 
    Paul H. Hargrove                          PHHargrove_at_lbl_dot_gov
    Future Technologies Group                 
    HPC Research Department                   Tel: +1-510-495-2352
    Lawrence Berkeley National Laboratory     Fax: +1-510-486-6900
    

  • Next message: Liu: "Can BLCR supports MIPS?"