From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 711FF385B835 for ; Thu, 9 Apr 2020 18:27:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 711FF385B835 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mittosystems.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jozef.l@mittosystems.com Received: by mail-wm1-x330.google.com with SMTP id z6so769692wml.2 for ; Thu, 09 Apr 2020 11:27:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mittosystems.com; s=google; h=date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=Ij4WiCHL5r9+amA4GVXLh6W0xyIjkv4pH0M8N7YAolk=; b=NOkamWzTT0jimPyPhE2QUK86FB4dCmBl5kS1lCVPcFqof2pwL9+ztpMAoorBnlC1Kv Nu6wBBHVkZMO8uxR+0/L3O7lOowS17L4KieJltsPOrjXZ3I3iTkC1QZnihpBYZp18Q6Q 1FO6nRiMBUK4M5HfEyfn8W2xEBTDLHnsCyXPGyWmF0MiGMqXvO3tzb2a6z9OSNBmbi8e ltxJmEk8DhZu4uu5OkGVHAHW210V5wbnWuUjRCuiOZedFxNbaJcHjL0yOjH0nfjc6IYl cLYXiyrzOJVg4sOuleBvKT4If0haQiueHiG5Q4nllKh09VJEm2KPW0VX4D6qKgRtW9O8 7PjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=Ij4WiCHL5r9+amA4GVXLh6W0xyIjkv4pH0M8N7YAolk=; b=rIgoQCVKmYixE1mGcWgYfOEun1IlRKxEO5qNrCEPQMHJIpiK4mDAPEsmbcHEpHCSGw 6S9PmWcPTtojSahxr8MYjC0OkF+6XFKspUVRAWWw+405OO3MSLVnq+TDKma8JHyHgp7W r+zKUENyxIjKILWCOB/bCHzIZfv/MWsPCsOWIvDWkayvlFmqTiLdD5ARW5W3N8kIywuV 5fs3drGQOZl7wZTeNsCAFjbxsd/WNgKg+PLMD98so3M7wrKipDOuRvo1Y6v3aWLVm7eO WtQyNtWA8MP4+7C0xXjzB+RfIqCh0xrxmrLtfC7HCnYCmlFAA99saE0BOl/M9vAr23Su 7SgA== X-Gm-Message-State: AGi0PuZ92S3Y2NKzPSgZZUTMVpNWcOHro3tor/HJqyjiHrU896ROSCrZ rVzxjwoSLsJzdukG3KEhkhLpK7hxh+A= X-Google-Smtp-Source: APiQypKdYbMMVOprlVmOA1HXh/YRDfDXwYaJPH+/4K9TgALwz7cU6DTQr01cbfHF/e8gS/eqqz4F1Q== X-Received: by 2002:a1c:6885:: with SMTP id d127mr1150508wmc.33.1586456855285; Thu, 09 Apr 2020 11:27:35 -0700 (PDT) Received: from jozef-kubuntu ([2a01:4b00:87fd:900:48a7:dad8:7945:326f]) by smtp.gmail.com with ESMTPSA id f12sm4580866wmh.4.2020.04.09.11.27.34 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Apr 2020 11:27:35 -0700 (PDT) Date: Thu, 9 Apr 2020 19:27:31 +0100 From: Jozef Lawrynowicz To: "binutils@sourceware.org" Subject: What size-dependent parts of bfd/elfcode.h are undesirable? Message-ID: <20200409192731.44c1f67c@jozef-kubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2020 18:27:37 -0000 There is a comment at the top of bfd/elfcode.h: > (2) The code in this file is compiled twice, once in 32-bit mode and > once in 64-bit mode. More of it should be made size-independent > and moved into elf.c. > If I am adding a new ELF type which has 32 and 64-bit versions and has similar requirements to relocation entries, is it ok to copy much of the implementation required to support Elf_External_Rel for my new type? i.e. swap_{in,out} functions, size-independent mappings of external types (Elf_External_Rel -> Elf{32,64_External_Rel}) and field accessors (ELF_R_INFO -> Elf{32,64}_R_INFO). Is there a new recommended way to do something like this, or is the comment referring to some other parts of the size-dependent implementation? Thanks, Jozef