[PATCH] D30256: [ELF] - Implemented -z noreloc-overflow.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 09:04:47 PST 2017


George Rimar <grimar at accesssoftek.com> writes:

>>> I took a quick look at BFD linker's source code and I think that is right.
>>> The GNU linker doesn't say anything about text relocations unless "-z text"
>>> or "-warn-shared-textrel" is given.
>>>
>>> So, It think what we should do is this:
>>>
>>>  - Add "-z textrel" and treat text relocations as an error only when that
>>> option is given, and
>>>  - emit DT_TEXTREL if an output has text relocations.
>>>
>>> We don't need to add -warn-shared-textrel at the moment. (We may want it
>>> later, but you want to focus on one thing at a time.)
>>
>>I would ask that we keep the default being an error. This is in line
>>with lld normally being stricter and most of the time a text relocation
>>will be there because of an user error.
>>
>>Cheers,
>>Rafael
>
> In that case all we would need is implement one of options bfd already has:
>
>  -z notext                 Don't treat DT_TEXTREL in shared object as error
>  -z textoff                 Don't treat DT_TEXTREL in shared object as error

Correct. We might still want to have "-z text" for completeness, but that
would not be required.

Cheers,
Rafael


More information about the llvm-commits mailing list