From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17312 invoked by alias); 8 Nov 2005 09:42:08 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 17266 invoked by uid 22791); 8 Nov 2005 09:41:59 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C5E448.A3190EC0" Subject: RE: inconsistent module relocation in elfutils Date: Tue, 08 Nov 2005 09:42:00 -0000 Message-ID: <9FBCE015AF479F46B3B410499F3AE05B08979B@pdsmsx405> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Topic: inconsistent module relocation in elfutils Thread-Index: AcXhf5g7ccrQrv3/QEqA2BBF3Z4nCQCxsRBg From: "Mao, Bibo" To: "Roland McGrath" , "Frank Ch. Eigler" Cc: X-OriginalArrivalTime: 08 Nov 2005 09:41:47.0843 (UTC) FILETIME=[A34CE130:01C5E448] X-Scanned-By: MIMEDefang 2.52 on 10.7.209.17 X-SW-Source: 2005-q4/txt/msg00157.txt.bz2 This is a multi-part message in MIME format. ------_=_NextPart_001_01C5E448.A3190EC0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-length: 1757 >-----Original Message----- >From: systemtap-owner@sourceware.org [mailto:systemtap-owner@sourceware.or= g] >On Behalf Of Roland McGrath >Sent: 2005=C4=EA11=D4=C25=C8=D5 4:37 >To: Frank Ch. Eigler >Cc: systemtap@sources.redhat.com >Subject: Re: inconsistent module relocation in elfutils > >> Specifically, with some kernel versions (e.g. 2.6.13-1.1532_FC4) I >> find that the GElf_Shdr sh_addr fields of .text-like sections are >> correctly relocated, and for other kernel versions (2.6.9-22.EL), that >> field is left at zero. Can you suggest an explanation or workaround? > >You should not have any particular expectations about section headers in >ET_REL modules. The fact that you see an sh_addr you can use there is more >an artifact of the implementation than something you should be relying on. >When using the style of module callback now in use (-k), the only sections >whose addresses are noted are those needed to relocate the debug info. > >> One can put a breakpoint at tapsets.cxx:1673 and look at variable "*shdr= ". > >I don't think that code is the right way to do that. Instead use >dwfl_module_relocate_address and dwfl_module_relocation_info to get the >section name. In IA64 platform, we test elfutils-0.116 by test case ./dwflmodtest -k comm= and, we find that there will be "Unsupported relocation type". In IA64 plat= form, it use default default_reloc_simple_type function, and this function = return ELF_T_NUM value. It will be regarded as unknown relocated type. So I think in IA64 platform there should be some function like i386_reloc_s= imple_type, x86_64_reloc_simple_type. Here in the attachment it defines rel= ocation type for IA64. This patch only defines little endian type, also it = need define big endian type. ------_=_NextPart_001_01C5E448.A3190EC0 Content-Type: application/octet-stream; name="patch_elfutils_ia64_relocate_type" Content-Transfer-Encoding: base64 Content-Description: patch_elfutils_ia64_relocate_type Content-Disposition: attachment; filename="patch_elfutils_ia64_relocate_type" Content-length: 3144 ZGlmZiAtdXJOIGVsZnV0aWxzLTAuMTE1Lm9yZy9saWJlYmwvaWE2NF9pbml0 LmMgZWxmdXRpbHMtMC4xMTUvbGliZWJsL2lhNjRfaW5pdC5jCi0tLSBlbGZ1 dGlscy0wLjExNS5vcmcvbGliZWJsL2lhNjRfaW5pdC5jCTIwMDUtMTEtMDEg MDM6MTA6NDEuMDAwMDAwMDAwICswODAwCisrKyBlbGZ1dGlscy0wLjExNS9s aWJlYmwvaWE2NF9pbml0LmMJMjAwNS0xMS0wMSAwMzoxMTo1Ny4wMDAwMDAw MDAgKzA4MDAKQEAgLTM0LDYgKzM0LDcgQEAKICAgZWgtPm5hbWUgPSAiSW50 ZWwgSUEtNjQiOwogICBlaC0+cmVsb2NfdHlwZV9uYW1lID0gaWE2NF9yZWxv Y190eXBlX25hbWU7CiAgIGVoLT5yZWxvY190eXBlX2NoZWNrID0gaWE2NF9y ZWxvY190eXBlX2NoZWNrOworICBlaC0+cmVsb2Nfc2ltcGxlX3R5cGUgPSBp YTY0X3Jlb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