From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6484 invoked by alias); 21 Feb 2020 00:16:28 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 6160 invoked by uid 89); 21 Feb 2020 00:16:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-pf1-f169.google.com Received: from mail-pf1-f169.google.com (HELO mail-pf1-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Feb 2020 00:15:52 +0000 Received: by mail-pf1-f169.google.com with SMTP id n7so268292pfn.0 for ; Thu, 20 Feb 2020 16:15:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=zqt01jGcEq0NDnmJ8gjKCHSbaWmC5PGg8ZIl8r0bI64=; b=rqN1sdhwOh3RVWGIXjg8q1coi5tAtP/3YwquglXojbDHnTUoqf7ZM3yVhSPrYph5G1 xu6JyLq5+zlGnPmdhpQpR8Z0K9eizF/8+xvxogP+AemFZbfZg19DOOJpV+LnCTvRSWUv Ha74iLGwfPlrc6r0LEVu13ODsl3Q4PTJLFNAlTZFdC0DraRzJ4KDI9zDPpRY9pYDlc5K wX99YrmvPyl7YZs8TZp+K8JNSuR5CCQ5z5+jWzOuPclKrn0vne9pHQe6NodSRnKvL5gj BaMdeA9niGCS/ExDSP6ljSNMeE3sg2yKGuXvqHp6jkAneOvtzFjisBmys1IAY1bqvXZO pknA== Return-Path: Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:d8df:d29:a36c:e2a]) by smtp.gmail.com with ESMTPSA id a69sm686087pfa.129.2020.02.20.16.15.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 16:15:49 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 05EA5804C6; Fri, 21 Feb 2020 10:45:45 +1030 (ACDT) Date: Fri, 21 Feb 2020 00:16:00 -0000 From: Alan Modra To: binutils@sourceware.org Subject: pdp11 reloc processing Message-ID: <20200221001545.GZ5570@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00503.txt.bz2 This allows pdp11 to handle 32-bit fixups that can be applied by gas, and improves the error message emitted when the required reloc isn't available. * config/tc-pdp11.c (md_apply_fix): Handle BFD_RELOC_32. (tc_gen_reloc): Only give a BAD_CASE assertion on pcrel relocs. diff --git a/gas/config/tc-pdp11.c b/gas/config/tc-pdp11.c index 7b3f663d12..d38a3cd6d2 100644 --- a/gas/config/tc-pdp11.c +++ b/gas/config/tc-pdp11.c @@ -257,6 +257,10 @@ md_apply_fix (fixS *fixP, mask = 0xffff; shift = 0; break; + case BFD_RELOC_32: + mask = 0xffffffff; + shift = 0; + break; case BFD_RELOC_PDP11_DISP_8_PCREL: mask = 0x00ff; shift = 1; @@ -1419,22 +1423,22 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, /* This is taken account for in md_apply_fix(). */ reloc->addend = -symbol_get_bfdsym (fixp->fx_addsy)->section->vma; - switch (fixp->fx_r_type) + code = fixp->fx_r_type; + if (fixp->fx_pcrel) { - case BFD_RELOC_16: - if (fixp->fx_pcrel) - code = BFD_RELOC_16_PCREL; - else - code = BFD_RELOC_16; - break; + switch (code) + { + case BFD_RELOC_16: + code = BFD_RELOC_16_PCREL; + break; - case BFD_RELOC_16_PCREL: - code = BFD_RELOC_16_PCREL; - break; + case BFD_RELOC_16_PCREL: + break; - default: - BAD_CASE (fixp->fx_r_type); - return NULL; + default: + BAD_CASE (code); + return NULL; + } } reloc->howto = bfd_reloc_type_lookup (stdoutput, code); -- Alan Modra Australia Development Lab, IBM