This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: PR ld/3666: Comdat/linkonce doesn't merge symbol visibility


We shouldn't ignore symbol visibility for symbols from discarded
section. I will add a testcase later.


H.J.
---
bfd/

2006-12-06  H.J. Lu <hjl@gnu.org>

	PR ld/3666
	* elflink.c (elf_link_add_object_symbols): Keep symbol
	visibility for symbols from discarded section.
	
--- binutils/bfd/elflink.c.merge	2006-12-06 06:43:24.000000000 -0800
+++ binutils/bfd/elflink.c	2006-12-06 07:10:18.000000000 -0800
@@ -3702,12 +3702,10 @@ elf_link_add_object_symbols (bfd *abfd, 
 	    sec = bfd_abs_section_ptr;
 	  else if (sec->kept_section)
 	    {
-	      /* Symbols from discarded section are undefined, and have
-		 default visibility.  */
+	      /* Symbols from discarded section are undefined.  We keep
+		 its visibility.  */
 	      sec = bfd_und_section_ptr;
 	      isym->st_shndx = SHN_UNDEF;
-	      isym->st_other = (STV_DEFAULT
-				| (isym->st_other & ~ ELF_ST_VISIBILITY (-1)));
 	    }
 	  else if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
 	    value -= sec->vma;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]