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

Cary Coutant ccoutant@gmail.com
Mon Nov 2 18:04:54 GMT 2020


> +    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".

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.

-cary


More information about the Binutils mailing list