This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] elf: Apply attribute_relro to pointers in elf/dl-minimal.c


* Florian Weimer:

> Would it be acceptable to switch from -fpic to -fPIC to fix this
> (if it addresses the issue)?
>
> diff --git a/sysdeps/alpha/Makefile b/sysdeps/alpha/Makefile
> index da52c1d4d1..baf5d480e5 100644
> --- a/sysdeps/alpha/Makefile
> +++ b/sysdeps/alpha/Makefile
> @@ -57,10 +57,6 @@ endif
>  # "current" rounding mode, and it's easiest to set this with all of them.
>  sysdep-CFLAGS += -mieee -mfp-rounding-mode=d
>  
> -# libc.so requires about 16k for the small data area, which is well
> -# below the 64k maximum.
> -pic-ccflag = -fpic
> -
>  #  Software floating-point emulation.
>  
>  ifeq ($(subdir),soft-fp)

alpha builds again with this patch.

I also tried to remove the direct __ehdr_start reference in rtld.c:

  /* Starting from binutils-2.23, the linker will define the magic symbol
     __ehdr_start to point to our own ELF header if it is visible in a
     segment that also includes the phdrs.  If that's not available, we use
     the old method that assumes the beginning of the file is part of the
     lowest-addressed PT_LOAD segment.  */
#ifdef HAVE_EHDR_START
  extern const ElfW(Ehdr) __ehdr_start __attribute__ ((visibility ("hidden")));
  rtld_ehdr = &__ehdr_start;
#else
  rtld_ehdr = (void *) GL(dl_rtld_map).l_map_start;
#endif

It looks like something that could be problematic to represent due to
section ordering.  But getting rid of that (either by reverting to the
old mechanism or introducing a level of indirection) is not sufficient
to address the build failure.

I'd prefer to use -fPIC for now.  If someone finds a way to make -fpic
work, than we can of course consider making that change.


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