Find the answer to your Linux question:
Results 1 to 4 of 4
Hello, I've got a application that examines a running process. I want to locate a symbol in that running process. Using /proc I know where a library is loaded in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    kf
    kf is offline
    Just Joined!
    Join Date
    Aug 2005
    Posts
    4

    Symbol value difference between 2.4 and 2.6 kernel in elf format library files


    Hello,

    I've got a application that examines a running process. I want to locate a symbol in that running process. Using /proc I know where a library is loaded in memory. If I open that library and look in the symbol table then I can get the information about the symbol, including its value. On the Linux 2.4 system, that value was an offset which I can add to my library load address to get the location of that symbol in my target process.
    When I take the app to the Linux 2.6 kernel, the symbol value seems to be an absolute value. That is it points to the location of the symbol in the target process, without needing the library load address.

    The problem is in being able to tell if I've got an offset or an absolute address.

    Also, the absolute address in Linux 2.6 must mean that the my library is loaded at a specific address. If it can't be loaded at that specific address, what happens then ?

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035

    Re: Symbol value difference between 2.4 and 2.6 kernel in elf format library files

    Quote Originally Posted by kf
    The problem is in being able to tell if I've got an offset or an absolute address.
    You could test for the kernel version, and then adapt how you reference the address (i.e. offset vs. absolute) based on that value.

  3. #3
    kf
    kf is offline
    Just Joined!
    Join Date
    Aug 2005
    Posts
    4
    I think I've found the solution. I need to reference the segments and their load addresses in the program section headers. Anyway, thanks for the help.

  4. #4
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    that should work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •