public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* got and plt section attributes
@ 2003-07-28 14:24 Alan Modra
  2003-07-28 14:42 ` Jakub Jelinek
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2003-07-28 14:24 UTC (permalink / raw)
  To: binutils; +Cc: H.J. Lu

This fixes warnings about "setting incorrect section attributes for
.got" when compiling gcc/config/rs6000/eabi-ci.asm.

	 * elf.c (special_sections): Set attributes for .got and .plt.

Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.193
diff -u -p -r1.193 elf.c
--- bfd/elf.c	26 Jul 2003 01:06:27 -0000	1.193
+++ bfd/elf.c	28 Jul 2003 14:10:11 -0000
@@ -2192,13 +2192,13 @@ static struct bfd_elf_special_section co
   { ".dynsym",		0,	NULL,	0,
     SHT_DYNSYM,		SHF_ALLOC },
   { ".got",		0,	NULL,	0,
-    SHT_PROGBITS,	0 },
+    SHT_PROGBITS,	SHF_ALLOC + SHF_WRITE },
   { ".hash",		0,	NULL,	0,
     SHT_HASH,		SHF_ALLOC },
   { ".interp",		0,	NULL,	0,
     SHT_PROGBITS,	0 },
   { ".plt",		0,	NULL,	0,
-    SHT_PROGBITS,	0 },
+    SHT_PROGBITS,	SHF_ALLOC + SHF_EXECINSTR },
   { ".shstrtab",	0,	NULL,	0,
     SHT_STRTAB,		0 },
   { ".strtab",		0,	NULL,	0,

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Re: got and plt section attributes
  2003-07-28 14:24 got and plt section attributes Alan Modra
@ 2003-07-28 14:42 ` Jakub Jelinek
  2003-07-28 15:01   ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2003-07-28 14:42 UTC (permalink / raw)
  To: binutils, H.J. Lu

On Mon, Jul 28, 2003 at 11:54:40PM +0930, Alan Modra wrote:
> This fixes warnings about "setting incorrect section attributes for
> .got" when compiling gcc/config/rs6000/eabi-ci.asm.
> 
> 	 * elf.c (special_sections): Set attributes for .got and .plt.
> 
> Index: bfd/elf.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/elf.c,v
> retrieving revision 1.193
> diff -u -p -r1.193 elf.c
> --- bfd/elf.c	26 Jul 2003 01:06:27 -0000	1.193
> +++ bfd/elf.c	28 Jul 2003 14:10:11 -0000
> @@ -2192,13 +2192,13 @@ static struct bfd_elf_special_section co
>    { ".dynsym",		0,	NULL,	0,
>      SHT_DYNSYM,		SHF_ALLOC },
>    { ".got",		0,	NULL,	0,
> -    SHT_PROGBITS,	0 },
> +    SHT_PROGBITS,	SHF_ALLOC + SHF_WRITE },
>    { ".hash",		0,	NULL,	0,
>      SHT_HASH,		SHF_ALLOC },
>    { ".interp",		0,	NULL,	0,
>      SHT_PROGBITS,	0 },
>    { ".plt",		0,	NULL,	0,
> -    SHT_PROGBITS,	0 },
> +    SHT_PROGBITS,	SHF_ALLOC + SHF_EXECINSTR },

.plt is SHF_ALLOC + SHF_WRITE + SHF_EXECINSTR on about half of ELF arches I
think (and SHT_NOBITS on ppc/ppc64).
Do we really expect half of the arches to define their own special_section
table with .plt section, or shouldn't backends inform ELF generic code
whether they use .got.plt or not?

	Jakub

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

* Re: got and plt section attributes
  2003-07-28 14:42 ` Jakub Jelinek
@ 2003-07-28 15:01   ` Alan Modra
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2003-07-28 15:01 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: binutils, H.J. Lu

On Mon, Jul 28, 2003 at 04:42:45PM +0200, Jakub Jelinek wrote:
> On Mon, Jul 28, 2003 at 11:54:40PM +0930, Alan Modra wrote:
> > -    SHT_PROGBITS,	0 },
> > +    SHT_PROGBITS,	SHF_ALLOC + SHF_EXECINSTR },
> 
> .plt is SHF_ALLOC + SHF_WRITE + SHF_EXECINSTR on about half of ELF arches I
> think (and SHT_NOBITS on ppc/ppc64).
> Do we really expect half of the arches to define their own special_section
> table with .plt section, or shouldn't backends inform ELF generic code
> whether they use .got.plt or not?

I'm not too worried really.  This table mostly is about getting section
attributes correct for the assembler, and people don't tend to put
things in .plt by hand.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* RE: got and plt section attributes
@ 2003-07-28 14:32 Lu, Hongjiu
  0 siblings, 0 replies; 4+ messages in thread
From: Lu, Hongjiu @ 2003-07-28 14:32 UTC (permalink / raw)
  To: Alan Modra, binutils

Looks OK to me.

H.J. Lu
Intel Corporation


> -----Original Message-----
> From: Alan Modra [mailto:amodra@bigpond.net.au]
> Sent: Monday, July 28, 2003 7:25 AM
> To: binutils@sources.redhat.com
> Cc: Lu, Hongjiu
> Subject: got and plt section attributes
> 
> This fixes warnings about "setting incorrect section attributes for
> .got" when compiling gcc/config/rs6000/eabi-ci.asm.
> 
> 	 * elf.c (special_sections): Set attributes for .got and .plt.
> 
> Index: bfd/elf.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/elf.c,v
> retrieving revision 1.193
> diff -u -p -r1.193 elf.c
> --- bfd/elf.c	26 Jul 2003 01:06:27 -0000	1.193
> +++ bfd/elf.c	28 Jul 2003 14:10:11 -0000
> @@ -2192,13 +2192,13 @@ static struct bfd_elf_special_section co
>    { ".dynsym",		0,	NULL,	0,
>      SHT_DYNSYM,		SHF_ALLOC },
>    { ".got",		0,	NULL,	0,
> -    SHT_PROGBITS,	0 },
> +    SHT_PROGBITS,	SHF_ALLOC + SHF_WRITE },
>    { ".hash",		0,	NULL,	0,
>      SHT_HASH,		SHF_ALLOC },
>    { ".interp",		0,	NULL,	0,
>      SHT_PROGBITS,	0 },
>    { ".plt",		0,	NULL,	0,
> -    SHT_PROGBITS,	0 },
> +    SHT_PROGBITS,	SHF_ALLOC + SHF_EXECINSTR },
>    { ".shstrtab",	0,	NULL,	0,
>      SHT_STRTAB,		0 },
>    { ".strtab",		0,	NULL,	0,
> 
> --
> Alan Modra
> IBM OzLabs - Linux Technology Centre

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

end of thread, other threads:[~2003-07-28 15:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-28 14:24 got and plt section attributes Alan Modra
2003-07-28 14:42 ` Jakub Jelinek
2003-07-28 15:01   ` Alan Modra
2003-07-28 14:32 Lu, Hongjiu

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).