[PATCH] gold: Add -z noreloc-overflow option

H.J. Lu hjl.tools@gmail.com
Mon Nov 2 18:53:07 GMT 2020


On Mon, Nov 2, 2020 at 10:05 AM Cary Coutant <ccoutant@gmail.com> wrote:
>
> > +    case elfcpp::R_X86_64_32S:
> > +      // -z noreloc-overflow
> > +      if (parameters->options().noreloc_overflow())
> > +       return;
> > +      // Fall through.
> > +
> >      default:
> >        // This prevents us from issuing more than one error per reloc
> >        // section.  But we can still wind up issuing more than one
>
> This will issue the wrong error message in the normal (check overflow)
> case, won't it? You'll get "requires unsupported dynamic reloc"
> instead of "requires R_X86_64_32S reloc which may overflow at
> runtime".

Since R_X86_64_32S is handled by the default label, the error
message without -z noreloc-overflow is unchanged.

> Also, shouldn't -z noreloc-overflow turn off link-time overflow
> checking? All this patch does is disable the warning about a possible
> overflow at runtime. If that's all you want, I think the option is
> misnamed.
>

This patch disables overflow checks for R_X86_64_32S and
R_X86_64_32 as the tests show.

-- 
H.J.


More information about the Binutils mailing list