ld: Why does ppc64 have --no-toc-optimize instead of reusing --no-relax?

Michael Matz matz@suse.de
Tue Jun 9 14:54:52 GMT 2020


Hello,

On Mon, 8 Jun 2020, H.J. Lu via Binutils wrote:

> On Sun, Jun 7, 2020 at 9:52 PM Fangrui Song <i@maskray.me> wrote:
> >
> > Also an x86 question to HJ: should TLS relaxation be disabled by --no-relax?
> 
> Good question.  Any reason to do it?  X86 linker also performs other
> relaxations.

I think it's helpful to not mix terminology here.  Relaxation done by the 
linker involves shrinking or enlarging code so that other code in the same 
section (and hence references to it) needs to be moved, until a fixed 
point is reached if that moving cause further shrinking or enlarging.

Mere code editing and replacement is not relaxation in that sense, and 
hence should not be affected by --relax or --no-relax.  (That also answers 
the initial question: ppc TOC optimization simply is no relaxation)

The linker has -O for optimization, so that could perhaps be used to 
conditionalize all code-editing, if not done already; including TOC 
optimization.


Ciao,
Michael.


More information about the Binutils mailing list