www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2016/03/03/15:57:30

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
Message-ID: <56D8A5F0.3060901@gmx.de>
Date: Thu, 03 Mar 2016 22:00:32 +0100
From: "Juan Manuel Guerrero (juan DOT guerrero AT gmx DOT de) [via djgpp-workers AT delorie DOT com]" <djgpp-workers AT delorie DOT com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.13) Gecko/20101206 SUSE/3.1.7 Thunderbird/3.1.7
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: [winter-gcc AT bfw-online DOT de: DJGPP COFF relocation in absolute
sections]
References: <56D62004 DOT 9040101 AT gmx DOT de> <201603020114 DOT u221EWsu015460 AT envy DOT delorie DOT com> <20160302134725 DOT GA21050 AT bfw-online DOT de>
In-Reply-To: <20160302134725.GA21050@bfw-online.de>
X-Provags-ID: V03:K0:89zJ0WUPl71xly+eJaze9jiYysqh1W2qZJntGTwEP40VpwN9K4G
+CQvUnNvR2f42GEJkZ/WMVxR6EhGepeo2Z4xnSHiqeVTcbb8NXfaCmimOWNVa+hGmkZYuz3
b01z8bCFoE3tyPLcTIOqsOKcYLo1k8gyt8DAhPom8YPByF4wCpZABEOAwx6I4+iBxMzfNgx
14sAcwv1/hUf59W/JWhxA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:SYIBaHrGLO4=:13d2axNmweZY/cBcyYSeIS
xP4FpM4MQMmk8dMaOJI2s7ZSWLCrAcYAiBcjP6NxQbwz5ZzfWebcZ1Ndz8kqfU29p/LZal6zw
L80KKVedR78E8yqnzQTC5Mrm0as1g8AvOBq9ueAEikoCr/sN1s+5SgPcs7Et1jWuhnxRbwzNE
uECXA8pgYJSjBtJxrpxQvdTUnDfIBekPbMTx4CLpzrNgxQ7AQ8lf6M2pCkVsG9PBi3Mf7hI8b
RSZ4/fgt6KzA6XIVEgIp7DFbfYtjEUC/lzzINP1DWHvCc2tycxW+Yyr9Z+xQmgYAevAr4ogbK
RBJ1HxEaB7wVpFZksGJIxWcmV0B8w/zMUtpF+aGcfRtI6ruuRFJq9Fd/HBjPrhBUubf40Ff9x
BZvm2csJha4LkBNKw1TbBj6uH3ddiyO05e76R40ZpUZJMwLmhS/wO3FX92NrJFywPl7UVLh4q
p057H2hUeRAt4bl9YFzNYA2KhSGuhw0CMgdc9sKUPMjdSup/Ln0av6zICVUqu0wWbojuK26oe
ndTMXn56kvhNk+83wqAb0yEKGS6ElJIMGu2jD4na81r6iYJxfDXUGg8UnvfvL6rhcw0W97aTQ
ssZ3q78youcjdQsy7jkM3zXviXgnZ+lHFFYEYlhdUT6JLeLIl2PaZHx7/GNucprZ46SQUdwhB
Jn+baqBN3Vqd8q4qzwRbygRVbhTPqp6P4BoKdcT4NFCkeUaVqe0KmO/jvpssxN8dAbaPsGznE
BgIxCeYKyBcnMddT/dMlFPzScDAparjowqLQz+e2MPgke1YCiZbMRHpK/veHp+8aOV1jM1v++
w8duOev
Reply-To: djgpp-workers AT delorie DOT com

Am 02.03.2016 14:47, schrieb Leon Winter:
> Hi,
>
>>> In the end the question is does the DJGPP port also need that symbols in absolute
>>> sections shall not be relocated or not?
>
>> I couldn't think of a good reason why we'd use absolute symbols
>> anyway, as they're usually used for hardware or OS hooks, and that
>> won't work for DJGPP as we relocate address "0" anyway.  ABS sections
>> would only be useful for constants but we don't use them for that I
>> think.
>
>>> Is DJGPP/COFF in this sense different to
>>> SCO/COFF?
>
> The outcome of the changes in binutils suggest that.
>
> Looking at the code at hand in binutils and my debugging session it appears to
> be that in my SCO scenario an absolute section also has
>     sec->output_section->vma == 0
> which might not be true in DJGPP.
>
> Attached patch works for me on SCO. Does it work for you, too?
>
> Best regards,
> Leon


After a little bit of testing during the last couple of days I thing that the
patch proposed by you seems to work for the DJGPP port too.  At a first glance
I thought you were trying to reintroduce the change objected by me in:

diff -aprNU5 binutils-2.25.orig/bfd/cofflink.c binutils-2.25/bfd/cofflink.c
--- binutils-2.25.orig/bfd/cofflink.c	2015-06-04 12:57:58 +0000
+++ binutils-2.25/bfd/cofflink.c	2015-06-04 13:22:24 +0000
@@ -2977,13 +2977,18 @@ _bfd_coff_generic_relocate_section (bfd
  	    }
  	  else
  	    {
  	      sec = sections[symndx];

+	      /* This does not work for the DJGPP port of binutils-2.25.
+	         This issue has already fixed in the master branch and
+	         will be removed in the next DJGPP port.  */
+#ifndef __DJGPP__
  	      /* If the output section has been discarded then ignore this reloc.  */
  	      if (sec->output_section->vma == 0)
  		continue;
+#endif

                val = (sec->output_section->vma
  		     + sec->output_offset
  		     + sym->n_value);
  	      if (! obj_pe (input_bfd))

But your patch seems to be a little bit different so it is ok for me.
It seems neither to break the binary nor to corrupt the debug sections
as the changes introduced with binutils-2.25 have done.
Please note that I have applied your patch to binutils 2.26 and not to
the current master branch or whatever.  I do not have a git system
available and I do nort want to check out the repository, so I hape that
there will be no surprises when your patch get applied to the next version.
I hope that we do not fix the SCO port at the cost of breaking the DJGPP
port again.

Regards,
Juan M.Guerrero

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019