This is in continuance to my previous question.
hash of libgmp.so changes automatically
I have developed a library and linked it to my process. It is required that my library should have same hash (from installation time), every time I link it with my process. My process always checks library's hash before doing anything else. My process is a daemon process and it gets started and stopped with script in initrd. I am always killing my process through "kill -9 myproc" command which send SIGKILL to process and forcefully terminates the process.
but it happens that sometimes my shared library file's hash gets changed when I stop and restart my process. It happens at random times and recently it is happening more frequently, due which my process does not start because of hash comparison condition that I coded in it.
I have taken dumps of both shared libraries i.e. right after installation and the changed version. I have used "objdump -d libmy.so" to take dumps. Here is a 'diff' screen shot of both dumps (yellow is original file and red is changed version):
I dont know much about elf file contents but it looks like that original file only had offsets and changed file has full address of instructions and functions. As a result, changed version of library is 2kb bigger than that of original.
Why is this happening? Does it has anything to do with SIGKILL signal which forces process to shutdown? If not, what can be the reason?
Any help would be appreciated.