Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-05

Problems using a new ld-version

8 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joost van der Sluis

Hi all,

On Fedora 11 there are some issues with the ld-version. First of all it's impossible to cycle the compiler using the --build-id flag, because it generates different id's for each run, so that ppc3 and ppcx64 will always differ. I'm trying to fix this.

But another issue is that it always complains while compiling:

/usr/bin/ld: warning: link.res contains output sections; did you forget -T?

What does it mean? Does fpc something special with output sections in link.res? And where's -T for?

The ld version is 2.19.51.0.2-17.fc11 20090204

Joost.

Reply by email

Jonas Maebe
to Joost van der Sluis
Joost van der Sluis wrote
But another issue is that it always complains while compiling: /usr/bin/ld: warning: link.res contains output sections; did you forget -T?

This is a new warning that was added to ld.

What does it mean? Does fpc something special with output sections in link.res?

FPC puts a linker script in link.res, and this linker script specifies (a.o.) output sections.

And where's -T for?

It's to specify a linker script to ld. If you put a linker script in link.res, then it gets "appended" to the internal default ld linker script. If you specify it with -T, then it completely overrides the default linker script. As far as I know, ld has always behaved this way. The warning was added because you seldom want to append your own linker script to the default one.

However, I don't know whether it's intentional or not that FPC does not override ld's default internal linker script, so I'm not changing this.

Jonas

Reply by email

Joost van der Sluis
to Jonas Maebe

Op dinsdag 19-05-2009 om 14:42 uur [tijdzone +0200], schreef Jonas Maebe:

Show quoted text 21 lines
On 19 May 2009, at 14:04, Joost van der Sluis wrote: > But another issue is that it always complains while compiling: > > /usr/bin/ld: warning: link.res contains output sections; did you > forget -T? This is a new warning that was added to ld. > And where's -T for? It's to specify a linker script to ld. If you put a linker script in link.res, then it gets "appended" to the internal default ld linker script. If you specify it with -T, then it completely overrides the default linker script. As far as I know, ld has always behaved this way. The warning was added because you seldom want to append your own linker script to the default one. However, I don't know whether it's intentional or not that FPC does not override ld's default internal linker script, so I'm not changing this.

Is there anyone who knows if some parts of the default linker script are used? Peter or Florian maybe?

I think we'll get lot of questions about this when more distributions are using this version of ld.

Joost.

Reply by email

Marco van de Voort
to Joost van der Sluis

In our previous episode, Joost van der Sluis said:

Show quoted text 9 lines
> way. The warning was added because you seldom want to append your own > linker script to the default one. > > However, I don't know whether it's intentional or not that FPC does > not override ld's default internal linker script, so I'm not changing > this. Is there anyone who knows if some parts of the default linker script are used? Peter or Florian maybe?

Afaik Linux and FreeBSD use own linker scripts and should use -T, due to the resource support.

Reply by email

Peter Vreman
Show quoted text 14 lines
In our previous episode, Joost van der Sluis said: > > way. The warning was added because you seldom want to append your own > > linker script to the default one. > > > > However, I don't know whether it's intentional or not that FPC does > > not override ld's default internal linker script, so I'm not changing > > this. > > Is there anyone who knows if some parts of the default linker script are > used? Peter or Florian maybe? Afaik Linux and FreeBSD use own linker scripts and should use -T, due to the resource support.

The linker scripts without the full SECTIONS details are only used to reduce the length and complexity of the commandline.

Peter

Reply by email

Jonas Maebe
to Peter Vreman
Peter Vreman wrote
The linker scripts without the full SECTIONS details are only used to reduce the length and complexity of the commandline.

This is about the linker scripts /with/ SECTIONS details. That's what the warning is about: there are SECTIONS details in a file not specified via -T, and therefore these details are appended to ld's internal linker script, rather than that they replace it. But I don't know whether this is intentional or not.

Jonas

Reply by email

Peter Vreman
Show quoted text 9 lines
> The linker scripts without the full SECTIONS details are only used > to reduce the length and > complexity of the commandline. This is about the linker scripts /with/ SECTIONS details. That's what the warning is about: there are SECTIONS details in a file not specified via -T, and therefore these details are appended to ld's internal linker script, rather than that they replace it. But I don't know whether this is intentional or not.

The link.res files with SECTIONS can replace the internal script. The -T can be used.

Peter

Reply by email

Jonas Maebe
to Peter Vreman
Peter Vreman wrote 12 lines
>> The linker scripts without the full SECTIONS details are only used >> to reduce the length and >> complexity of the commandline. > > This is about the linker scripts /with/ SECTIONS details. That's what > the warning is about: there are SECTIONS details in a file not > specified via -T, and therefore these details are appended to ld's > internal linker script, rather than that they replace it. But I don't > know whether this is intentional or not. The link.res files with SECTIONS can replace the internal script. The -T can be used.

There's one problem with this: that also overrides the default library search paths (the SEARCH_DIR statements in the default linker scripts). So things will break on Linux systems where not all libraries are in the default library directories defined in FPC (for i386: /lib, /usr/lib and /usr/X11R6/lib)

Jonas

Reply by email