From: Tristan Gingold <gingold@adacore.com>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>,
binutils@sourceware.org, Andreas Schwab <schwab@linux-m68k.org>,
Maxim Kuvyrkov <maxim@codesourcery.com>
Subject: Re: Fix CRIS bug exposed by "MIPS/BFD: Don't make debug section relocs dynamic"
Date: Fri, 02 Dec 2011 08:12:00 -0000 [thread overview]
Message-ID: <F5E7FAF6-0A80-4FED-92CA-519E18C4C099@adacore.com> (raw)
In-Reply-To: <20183.23295.604024.307462@pilspetsen.it.uu.se>
On Dec 1, 2011, at 11:46 AM, Mikael Pettersson wrote:
> Hans-Peter Nilsson writes:
>>> From: "Maciej W. Rozycki" <macro@codesourcery.com>
>>> Date: Mon, 31 Oct 2011 13:21:52 +0100
>>
>>> 2011-10-31 Maciej W. Rozycki <macro@codesourcery.com>
>>>
>>> PR ld/10144
>>> * lib/ld-lib.exp (run_ld_link_tests): Handle sources from other
>>> directories.
>>> (run_ld_link_exec_tests): Likewise.
>>> (run_cc_link_tests): Likewise.
>>> * ld-elf/comm-data1.sd: New test.
>>> * ld-elf/comm-data1.s: Source for the new test.
>>> * ld-elf/comm-data2.sd: New test.
>>> * ld-elf/comm-data2.rd: Likewise.
>>> * ld-elf/comm-data2.xd: Likewise.
>>> * ld-elf/comm-data2.s: Source for the new tests.
>>> * ld-elf/comm-data.exp: Run the new tests.
>>> * ld-mips-elf/comm-data.exp: Likewise.
>>
>> This new test caused the following failure to appear for
>> cris-axis-linux-gnu:
>>
>> Running /tmp/hpautotest-binutils/bsrc/src/ld/testsuite/ld-elf/comm-data.exp ...
>> FAIL: Common symbol override test
>>
>> ...but it turned out to be a target bug, so...thanks, I guess. :)
>>
>> I see this test fails for m68k-linux too, if someone feels pity
>> (no listed maintainer).
>>
>> No regressions tested cris-elf cris-linux.
>> Can I put this on the 2.22 branch too?
Yes.
>>
>> bfd:
>> * elf32-cris.c (cris_elf_check_relocs) <plt accounting for
>> R_CRIS_8, R_CRIS_16, and R_CRIS_32>: Move early break for
>> non-SEC_ALLOC sections before GOT and PLT accounting.
>>
>> Index: elf32-cris.c
>> ===================================================================
>> RCS file: /cvs/src/src/bfd/elf32-cris.c,v
>> retrieving revision 1.117
>> diff -p -u -r1.117 elf32-cris.c
>> --- elf32-cris.c 19 Oct 2011 07:17:13 -0000 1.117
>> +++ elf32-cris.c 1 Dec 2011 02:47:49 -0000
>> @@ -3583,6 +3583,12 @@ cris_elf_check_relocs (bfd *abfd,
>> sec,
>> cris_elf_howto_table[r_type].name);
>> }
>> +
>> + /* We don't need to handle relocs into sections not going into
>> + the "real" output. */
>> + if ((sec->flags & SEC_ALLOC) == 0)
>> + break;
>> +
>> if (h != NULL)
>> {
>> h->non_got_ref = 1;
>> @@ -3612,11 +3618,6 @@ cris_elf_check_relocs (bfd *abfd,
>> if (! info->shared)
>> break;
>>
>> - /* We don't need to handle relocs into sections not going into
>> - the "real" output. */
>> - if ((sec->flags & SEC_ALLOC) == 0)
>> - break;
>> -
>> /* We may need to create a reloc section in the dynobj and made room
>> for this reloc. */
>> if (sreloc == NULL)
>>
>> brgds, H-P
>
> I've implemented a similar change for elf32-m68k.c which fixes
> ld-elf/comm-data.exp for m68k-linux, with no testsuite regressions
> on head or the 2.22 release.
>
> As for m68k maintainers, I looked around in recent ChangeLogs,
> and both Andreas Schwab and Maxim Kuvyrkov seem likely candidates
> so I've added them to the Cc: list.
>
> Ok for head and 2.22 branch?
>
> (If approved I'll need for someone else to do the commits.)
>
> /Mikael
>
>
> bfd/
>
> 2011-12-01 Mikael Pettersson <mikpe@it.uu.se>
>
> * elf32-m68k.c (elf_m68k_check_relocs) <R_68K_8, R68K_16, R_68K_32>: For
> non-SEC_ALLOC sections break before GOT and PLT accounting.
>
> --- binutils-2.22.51/bfd/elf32-m68k.c.~1~ 2011-10-19 09:17:14.000000000 +0200
> +++ binutils-2.22.51/bfd/elf32-m68k.c 2011-12-01 10:41:31.000000000 +0100
> @@ -2816,6 +2816,11 @@ elf_m68k_check_relocs (abfd, info, sec,
> case R_68K_8:
> case R_68K_16:
> case R_68K_32:
> + /* We don't need to handle relocs into sections not going into
> + the "real" output. */
> + if ((sec->flags & SEC_ALLOC) == 0)
> + break;
> +
> if (h != NULL)
> {
> /* Make sure a plt entry is created for this symbol if it
> @@ -2829,8 +2834,7 @@ elf_m68k_check_relocs (abfd, info, sec,
>
> /* If we are creating a shared library, we need to copy the
> reloc into the shared library. */
> - if (info->shared
> - && (sec->flags & SEC_ALLOC) != 0)
> + if (info->shared)
> {
> /* When creating a shared object, we must copy these
> reloc types into the output file. We create a reloc
next prev parent reply other threads:[~2011-12-02 8:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-14 23:31 [PATCH][PR ld/10144] MIPS/BFD: Don't make debug section relocs dynamic Maciej W. Rozycki
2010-09-18 8:40 ` Richard Sandiford
2010-11-04 15:09 ` Maciej W. Rozycki
2010-11-04 17:28 ` Richard Sandiford
2010-11-04 17:48 ` Maciej W. Rozycki
2010-11-10 17:16 ` Richard Sandiford
2010-11-10 17:58 ` Maciej W. Rozycki
2010-11-11 0:27 ` Matthias Klose
2010-11-11 1:44 ` Maciej W. Rozycki
2010-11-11 10:11 ` Richard Sandiford
2010-11-12 17:39 ` Maciej W. Rozycki
2010-11-15 8:32 ` Alan Modra
2010-12-07 20:27 ` Maciej W. Rozycki
2010-12-09 21:20 ` Richard Sandiford
2010-12-10 14:32 ` Maciej W. Rozycki
2010-12-11 10:21 ` Richard Sandiford
2010-12-13 16:51 ` Maciej W. Rozycki
2011-10-31 12:22 ` Maciej W. Rozycki
2011-11-24 20:59 ` Richard Sandiford
2011-11-29 12:43 ` Maciej W. Rozycki
2011-12-01 2:52 ` Fix CRIS bug exposed by "MIPS/BFD: Don't make debug section relocs dynamic" Hans-Peter Nilsson
2011-12-01 8:14 ` Tristan Gingold
2011-12-01 10:46 ` Mikael Pettersson
2011-12-01 15:52 ` nick clifton
2011-12-02 8:12 ` Tristan Gingold [this message]
2011-12-02 12:12 ` Hans-Peter Nilsson
2011-12-02 12:50 ` Tristan Gingold
2011-12-02 13:39 ` Hans-Peter Nilsson
2012-02-15 23:03 ` [PATCH] de-Linuxification Thomas Schwinge
2012-02-20 1:53 ` Alan Modra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F5E7FAF6-0A80-4FED-92CA-519E18C4C099@adacore.com \
--to=gingold@adacore.com \
--cc=binutils@sourceware.org \
--cc=hans-peter.nilsson@axis.com \
--cc=maxim@codesourcery.com \
--cc=mikpe@it.uu.se \
--cc=schwab@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).