Einzelnen Beitrag anzeigen

Benutzerbild von implementation
implementation

Registriert seit: 5. Mai 2008
940 Beiträge
 
FreePascal / Lazarus
 
#29

AW: Wozu Relocation?

  Alt 30. Mär 2014, 10:23
Unter Linux kommt man um PIC quasi nicht herum, während du unter Windows quasi um Relocation nicht herum kommst.
Ich bekam gerade beim Kompilieren von kde-base/kdelibs auf Gentoo GNU/Linux folgende Fehlermeldung:
Zitat:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/kdecore.dir/kernel/kstandarddirs.o: warning: relocation against `KStandardDirs::realFilePath(QString const&)' in readonly section `.text'.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/kdecore.dir/localization/klocalizedstring.o: relocation R_X86_64_PC32 against symbol `KLocalizedString::KLocalizedString(char const*, char const*, char const*)' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
Ich will jetzt nicht die Problemlösung diskutieren, aber die Meldung weist für mich darauf hin, dass auch hier Relocation möglich ist (und die GNU Build Chain dies sogar als Standardfall annimmt).

Und die Wikipedia sagt sogar:
Zitat:
The ELF executable format and SO shared library format used by most Unix-like systems allows several types of relocation to be defined.
Und so sieht die Tabelle wohl aus.

Geändert von implementation (30. Mär 2014 um 10:29 Uhr)
  Mit Zitat antworten Zitat