From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by sourceware.org (Postfix) with ESMTPS id CD49D385B835 for ; Wed, 8 Apr 2020 15:33:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CD49D385B835 Received: by mail-wr1-x442.google.com with SMTP id k1so8338251wrm.3 for ; Wed, 08 Apr 2020 08:33:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HKUolsDoi+IM8+Vrj6lgdMCr5tfLl3y19nJXXBi7K3o=; b=AuAOAPq/VHBMFgab72P0+3JrctUYRhaH1Xd8PHPLfFMRbg1Is85NbQ0Z90nHyfTo2J RqGtA7xFEoiXBOtmmStfdnidbObz360AIjd7A8J5q6ALNPc9rmQ7eSEG2hbOtrE0YNtN duziHFJ4n40BXaeX0/VHazeyL/P3A/cXZgBldDMGnnuCKZAzOXMp4hBTxfbwsAtLVvpA 2N/JN62o+i+BkyoJwFdR0aE6m9az2K1+9BIXCZZXSCvD3SEj9uo5QwxrgD2/+Qg7kaBh TOG6Zcsg55YniXcNYffpcgNVHrNp8iNtyu9yOXfJvBZcbjsnpu436LJHpFFpZwSAZBWw Yqug== X-Gm-Message-State: AGi0PuZU1g9fh5mg3VlxezV/0T9VOb5+DcGzVtnnHAW9RIdG7Om2G+bW HB5AXh/dTfa7aUGvocgxVgY= X-Google-Smtp-Source: APiQypLcEU4NW3EtfY1vtgWHoC7aLVAeIZQ9KmcdaFJeZAZN5hEH1EKPu1C2i76nIWh/kSzk9xQjBg== X-Received: by 2002:adf:aacf:: with SMTP id i15mr8717601wrc.31.1586359997910; Wed, 08 Apr 2020 08:33:17 -0700 (PDT) Received: from [10.0.0.1] (138.sub226.ddfr.nl. [217.27.226.138]) by smtp.gmail.com with ESMTPSA id d7sm35629208wrr.77.2020.04.08.08.33.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Apr 2020 08:33:17 -0700 (PDT) Subject: Re: [PATCH 2/2] coff-go32: support extended relocations To: binutils@sourceware.org Cc: dj@delorie.com, juan.guerrero@gmx.de References: <20200408152104.891-1-jwjagersma@gmail.com> <20200408152104.891-3-jwjagersma@gmail.com> From: "J.W. Jagersma" Message-ID: <312e942a-4279-d7e2-764b-694e3590e1d6@gmail.com> Date: Wed, 8 Apr 2020 17:33:16 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200408152104.891-3-jwjagersma@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-15.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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: Wed, 08 Apr 2020 15:33:20 -0000 On 2020-04-08 17:21, J.W. Jagersma wrote: > This patch extends the relocation and line number counters for > coff-go32 and coff-go32-exe to 32 bits. As I understand it works the > same as for PE-COFF: > > If the number of relocations in an object file exceeds 65534, the > NRELOC field is set to 65535 and the actual number of relocations is > stored in the VADDR field of the first relocation entry. > > Executable files have no relocations, and thus the NRELOC field is > repurposed to extend NLNNO to 32-bits. > > bfd/ > 2020-04-08 Juan Manuel Guerrero > Jan W. Jagersma > > * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL) > (coff_swap_scnhdr_in, coff_swap_scnhdr_out): Define. > (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out) > (_bfd_go32_mkobject): New functions. > * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL) > (coff_swap_scnhdr_in, coff_swap_scnhdr_out): Define. > (go32exe_mkobject): Call _bfd_go32_mkobject. > * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define. > (coff_set_alignment_hook): Define function for COFF_GO32_EXE > and COFF_GO32. > (coff_write_relocs): Enable extended reloc counter code if > COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32. > (coff_write_object_contents): Likewise. Pad section headers > for COFF_GO32 and COFF_GO32EXE. > cofflink.c (_bfd_coff_final_link): Test for obj_go32. > coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_in): Allow > overriding these functions with macros of the same name. > libcoff-in.h: (struct coff_tdata): New field go32. > (obj_go32): Define. > --- I'm sorry, I did not thoroughly proofread the changelog before sending. Please use the following: * coff-go32.c (COFF_GO32, IMAGE_SCN_LNK_NRELOC_OVFL) (coff_swap_scnhdr_in, coff_swap_scnhdr_out): Define. (_bfd_go32_swap_scnhdr_in, _bfd_go32_swap_scnhdr_out) (_bfd_go32_mkobject): New functions. * coff-stgo32.c (IMAGE_SCN_LNK_NRELOC_OVFL) (coff_swap_scnhdr_in, coff_swap_scnhdr_out): Define. (go32exe_mkobject): Call _bfd_go32_mkobject. * coffcode.h (COFF_WITH_EXTENDED_RELOC_COUNTER): Define. (coff_set_alignment_hook): Define function for COFF_GO32_EXE and COFF_GO32. (coff_write_relocs): Enable extended reloc counter code if COFF_WITH_EXTENDED_RELOC_COUNTER is defined. Test for obj_go32. (coff_write_object_contents): Likewise. Pad section headers for COFF_GO32 and COFF_GO32EXE. * cofflink.c (_bfd_coff_final_link): Test for obj_go32. * coffswap.h: (coff_swap_scnhdr_in, coff_swap_scnhdr_in): Allow overriding these functions with macros of the same name. * libcoff-in.h: (struct coff_tdata): New field go32. (obj_go32): Define. * libcoff.h: Regenerate.