public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [gold patch] Incremental 20/22: Fix problem caused by realignment of data segment
@ 2011-05-02 23:16 Cary Coutant
  2011-06-08  0:38 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Cary Coutant @ 2011-05-02 23:16 UTC (permalink / raw)
  To: Ian Lance Taylor, Binutils

[-- Attachment #1: Type: text/plain, Size: 827 bytes --]

This patch fixes a problem with the TLS segment caused by realignment
of the data segment during the initial incremental-full link. When we
do a subsequent incremental-update, the initial attempt to assign
addresses to the data segment doesn't match the fixed layout, and we
end up with out-of-sync addresses. I avoid this issue simply by
keeping the original layout for --incremental-full. Part of the
problem was also some old code under a FIXME that ought to have been
removed in one of the earlier patches, but I didn't notice that when I
was rearranging all my git commits.

OK?

-cary


2011-05-02 Cary Coutant  <ccoutant@google.com>

	* layout.cc (Layout::set_segment_offsets): Don't adjust layout
	for incremental links.
	* output.cc (Output_segment::set_section_list_addresses): Remove
	FIXME and test for TLS or BSS.

[-- Attachment #2: incr-patch-20.txt --]
[-- Type: text/plain, Size: 1455 bytes --]

Suppress realignment of data segment for incremental links, and
fix handling of TLS and BSS sections during incremental update.


2011-05-02 Cary Coutant  <ccoutant@google.com>

	* layout.cc (Layout::set_segment_offsets): Don't adjust layout
	for incremental links.
	* output.cc (Output_segment::set_section_list_addresses): Remove
	FIXME and test for TLS or BSS.


diff --git a/gold/layout.cc b/gold/layout.cc
index 67ed8c3..537651a 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -2945,7 +2945,7 @@ Layout::set_segment_offsets(const Target* target, Output_segment* load_seg,
 	  if (!are_addresses_set
 	      && !has_relro
 	      && aligned_addr != addr
-	      && !parameters->incremental_update())
+	      && !parameters->incremental())
 	    {
 	      uint64_t first_off = (common_pagesize
 				    - (aligned_addr
diff --git a/gold/output.cc b/gold/output.cc
index 832428e..8e81b07 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -4036,10 +4036,7 @@ Output_segment::set_section_list_addresses(Layout* layout, bool reset,
                 }
             }
 
-	  // FIXME: Need to handle TLS and .bss with incremental update.
-	  if (!parameters->incremental_update()
-	      || (*p)->is_section_flag_set(elfcpp::SHF_TLS)
-	      || (*p)->is_section_type(elfcpp::SHT_NOBITS))
+	  if (!parameters->incremental_update())
 	    {
 	      off = align_address(off, align);
 	      (*p)->set_address_and_file_offset(addr + (off - startoff), off);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [gold patch] Incremental 20/22: Fix problem caused by realignment of data segment
  2011-05-02 23:16 [gold patch] Incremental 20/22: Fix problem caused by realignment of data segment Cary Coutant
@ 2011-06-08  0:38 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2011-06-08  0:38 UTC (permalink / raw)
  To: Cary Coutant; +Cc: Binutils

Cary Coutant <ccoutant@google.com> writes:

> 2011-05-02 Cary Coutant  <ccoutant@google.com>
>
> 	* layout.cc (Layout::set_segment_offsets): Don't adjust layout
> 	for incremental links.
> 	* output.cc (Output_segment::set_section_list_addresses): Remove
> 	FIXME and test for TLS or BSS.

This is OK.

Thanks.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-08  0:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-02 23:16 [gold patch] Incremental 20/22: Fix problem caused by realignment of data segment Cary Coutant
2011-06-08  0:38 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).