https://sourceware.org/bugzilla/show_bug.cgi?id=18345
Bug ID: 18345 Summary: How to fix code emitted by FreePascal Compiler for ld ? Product: binutils Version: 2.25 Status: NEW Severity: minor Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: saulery at free dot fr Target Milestone: --- Created attachment 8279 --> https://sourceware.org/bugzilla/attachment.cgi?id=8279&action=edit linking file emitted by FPC Helelo Dear Maintainer, FreePascal Compiler emits each time an annoying error, which is a workaround of ld: $fpc msg2inc Free Pascal Compiler version 2.6.4+dfsg-4 [2014/10/14] for x86_64 Copyright (c) 1993-2014 by Florian Klaempfl and others Target OS: Linux for x86-64 Compiling msg2inc.pp msg2inc.pp(64,3) Note: Local variable "code" is assigned but never used Linking msg2inc /usr/bin/ld.bfd warning: link.res contains output sections; did you forget -T? 823 lines compiled, 0.3 sec 1 note(s) issued FPC FAQ give some explanations: There is a bug in GNU LD 2.19 and 2.19.1 that causes it to crash when processing FPC-generated linker scripts. This bug has been fixed in the mean time. At the same time, LD has been modified to emit a warning of the form /usr/bin/ld: warning: link.res contains output sections; did you forget -T? This warning is benign, and FPC intentionally does not pass -T to LD. The reason is that if -T is used, LD's internal linker script is ignored and only FPC's linker script is used. Such linker scripts also contain paths to libraries however, and if we would ignore the internal linker script then LD would no longer find libraries in distribution-specific directories. I looked at the file ld / ldlang.c (3275 to 3343 lines) and commentary puzzles me: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=ld/ldlang.c;hb=24b73f8e74857245c0a7ea07c2a360237abcdfc0#l3275 3316 /* If this was a script with output sections then 3317 tack any added statements on to the end of the 3318 list. This avoids having to reorder the output 3319 section statement list. Very likely the user 3320 forgot -T, and whatever we do here will not meet 3321 naive user expectations. */ Is it possible to easily modify the content generated of link.res to meet the format expected by ld? Ld does not reorder sections, but it may be possible to modify the code issued for it. Regards, Stéphane Aulery -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils