This is the mail archive of the 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]

Re: [PATCH] LD: PROVIDE_HIDDEN export class problem

On Mon, Apr 29, 2013 at 11:30:12PM +0100, Maciej W. Rozycki wrote:
>  While testing the __ehdr_start fix (PR ld/15365) I have realised we have 
> a problem with the PROVIDE_HIDDEN linker script command or 
> bfd_elf_record_link_assignment that implements this command's export class 
> handling.  The issue is the symbol named is always assigned the hidden 
> export class even if it was actually created by other means and the 
> PROVIDE part of the command wasn't used.

Is that really a problem?  The ELF gABI says that in both references
and definitions, a visibility attribute must be propagated.  I reckon
a PROVIDEd symbol counts as a definition, so I think it quite
reasonable that the symbol becomes hidden.  The bug in
bfd_elf_record_link_assignment that I was referring to in is just that
the attributes are not merged properly.  Fixed as follows and

	* elflink.c (bfd_elf_record_link_assignment): Dont make

Index: bfd/elflink.c
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.489
diff -u -p -r1.489 elflink.c
--- bfd/elflink.c	24 Apr 2013 13:24:30 -0000	1.489
+++ bfd/elflink.c	25 Apr 2013 23:53:58 -0000
@@ -573,7 +573,8 @@ bfd_elf_record_link_assignment (bfd *out
   if (hidden)
       bed = get_elf_backend_data (output_bfd);
-      h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
+      if (ELF_ST_VISIBILITY (h->other) != STV_INTERNAL)
+	h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
       (*bed->elf_backend_hide_symbol) (info, h, TRUE);
Alan Modra
Australia Development Lab, IBM

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