[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/16345] ld emits errors on .eh_frame from partial linking
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/16345] ld emits errors on .eh_frame from partial linking |
Date: |
Fri, 20 Dec 2013 13:42:00 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=16345
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Both .init and .fini sections are special. This
patch warns about using "ld -r" on them:
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 9a2fe89..098f423 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1114,7 +1114,20 @@ gld${EMULATION_NAME}_after_open (void)
}
if (link_info.relocatable)
- return;
+ {
+ bfd *abfd;
+
+ for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next)
+ {
+ if (bfd_get_section_by_name (abfd, ".init"))
+ einfo ("%P: warning: -r on %B with .init section may lead"
+ " to incorrect output.\n", abfd);
+ if (bfd_get_section_by_name (abfd, ".fini"))
+ einfo ("%P: warning: -r on %B with .fini section may lead"
+ " to incorrect output.\n", abfd);
+ }
+ return;
+ }
if (link_info.eh_frame_hdr
&& !link_info.traditional_format)
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/16345] New: ld emits errors on .eh_frame from partial linking, stilor at att dot net, 2013/12/18
- [Bug ld/16345] ld emits errors on .eh_frame from partial linking, hjl.tools at gmail dot com, 2013/12/18
- [Bug ld/16345] ld emits errors on .eh_frame from partial linking, hjl.tools at gmail dot com, 2013/12/20
- [Bug ld/16345] ld emits errors on .eh_frame from partial linking,
hjl.tools at gmail dot com <=
- [Bug ld/16345] ld emits errors on .eh_frame from partial linking, stilor at att dot net, 2013/12/20
- [Bug ld/16345] ld emits errors on .eh_frame from partial linking, hjl.tools at gmail dot com, 2013/12/20
- [Bug ld/16345] ld emits errors on .eh_frame from partial linking, stilor at att dot net, 2013/12/20
- [Bug ld/16345] ld emits errors on .eh_frame from partial linking, hjl.tools at gmail dot com, 2013/12/20
- [Bug ld/16345] ld emits errors on .eh_frame from partial linking, stilor at att dot net, 2013/12/21
- [Bug ld/16345] ld emits errors on .eh_frame from partial linking, hjl.tools at gmail dot com, 2013/12/21