This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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] Fix tst-array* on x86_64


On Tue, Dec 10, 2002 at 03:25:38PM -0800, Roland McGrath wrote:
> > Why are the labels around wrong?  I would imagine that padding is added
> > and that if two .preinit_array sections have to be concatenated there is
> > garbage between them.  But still, the lables should be rights.
> 
> This padding is added by the compiler, inside the section.  
> The labels are created by the linker.  i.e.: 
> 
> .globl preinit_array
> 	.section	.preinit_array,"a",@progbits
> 	.align 16
> 	.type	preinit_array, @object
> 	.size	preinit_array, 24
> preinit_array:
> 	.quad ...
> 
> This doesn't explain exactly what I saw, which was the linker symbols and
> the sections not starting at the same address.  But even if they matched,
> the leading or trailing zeros bite.

Does

  /* Ensure the __preinit_array_start label is properly aligned.  We
     could instead move the label definition inside the section, but
     the linker would then create the section even if it turns out to
     be empty, which isn't pretty.  */
  ${RELOCATING+. = ALIGN(${ALIGNMENT});}
  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
  .preinit_array   ${RELOCATING-0} : { *(.preinit_array) }
  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}

explain what you saw?


H.J.


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