public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Tristan Gingold <gingold@adacore.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: binutils <binutils@sourceware.org>
Subject: Re: [Patch] ld: check for address space overflow
Date: Tue, 14 Mar 2017 08:15:00 -0000	[thread overview]
Message-ID: <F639AA22-1566-43A8-96DD-C3013A5E5B5B@adacore.com> (raw)
In-Reply-To: <CAMe9rOqwDo3nzhLY4jDYabfYGAj9dFx3kUBkf2D0en3tu7r6HA@mail.gmail.com>

[...]

> This works:
> 
> diff --git a/ld/ldlang.c b/ld/ldlang.c
> index a0638ea..8c1d829 100644
> --- a/ld/ldlang.c
> +++ b/ld/ldlang.c
> @@ -4783,13 +4783,13 @@ lang_check_section_addresses (void)
>   for (s = link_info.output_bfd->sections; s != NULL; s = s->next)
>     {
>       s_end = (s->vma + s->size) & addr_mask;
> -      if (s_end != 0 && s_end < s->vma)
> +      if (s_end != 0 && s_end < (s->vma & addr_mask))
>   einfo (_("%X%P: section %s VMA wraps around address space\n"),
>          s->name);
>       else
>   {
>     s_end = (s->lma + s->size) & addr_mask;
> -    if (s_end != 0 && s_end < s->lma)
> +    if (s_end != 0 && s_end < (s->lma & addr_mask))
>       einfo (_("%X%P: section %s LMA wraps around address space\n"),
>         s->name);
>   }

Yes, that makes sense.
Do you plan to commit it ?

  reply	other threads:[~2017-03-14  8:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10 14:29 Tristan Gingold
2017-03-11  1:14 ` Alan Modra
2017-03-13  9:47   ` Tristan Gingold
2017-03-13 17:52     ` H.J. Lu
2017-03-13 19:06 ` H.J. Lu
2017-03-13 19:27   ` H.J. Lu
2017-03-14  8:15     ` Tristan Gingold [this message]
2017-03-14 10:20       ` Alan Modra
2017-03-14 10:50         ` Tristan Gingold
2017-03-14 12:17           ` Alan Modra
2017-03-14 13:56             ` Tristan Gingold
2017-03-15  1:11               ` Alan Modra
2017-03-15  9:26                 ` Tristan Gingold
2017-03-14 16:13       ` H.J. Lu

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=F639AA22-1566-43A8-96DD-C3013A5E5B5B@adacore.com \
    --to=gingold@adacore.com \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.com \
    /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).