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] S/390 Some comment fixes


Hi,

the attached patch fixes a bunch of comments which say that the PLT
slot parameter points to the symbol table. In fact it points to the
relocation in the .rela.plt section.  I stumbled over that several
times now so its about time to fix it.

Will commit together with the other cleanup patches.

Bye,

-Andreas-

2012-03-27  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* elf64-s390.c: Fix several comments regarding PLT entry
	description.
	* elf32-s390.c: Likewise.

---
 bfd/elf32-s390.c |   20 ++++++++++----------
 bfd/elf64-s390.c |   20 ++++++++++----------
 2 files changed, 20 insertions(+), 20 deletions(-)

Index: bfd/elf64-s390.c
===================================================================
--- bfd/elf64-s390.c.orig
+++ bfd/elf64-s390.c
@@ -540,18 +540,18 @@ elf_s390_is_local_label_name (abfd, name
    RET1: BASR 1,0         # 2 bytes  Return from GOT 1st time
          LGF  1,12(1)     # 6 bytes  Load offset in symbl table in r1
          BRCL 15,-x       # 6 bytes  Jump to start of PLT
-         .long ?          # 4 bytes  offset into symbol table
+         .long ?          # 4 bytes  offset into .rela.plt
 
    Total = 32 bytes per PLT entry
    Fixup at offset 2: relative address to GOT entry
    Fixup at offset 22: relative branch to PLT0
-   Fixup at offset 28: 32 bit offset into symbol table
+   Fixup at offset 28: 32 bit offset into .rela.plt
 
-   A 32 bit offset into the symbol table is enough. It allows for symbol
-   tables up to a size of 2 gigabyte. A single dynamic object (the main
-   program, any shared library) is limited to 4GB in size and I want to see
-   the program that manages to have a symbol table of more than 2 GB with a
-   total size of at max 4 GB.  */
+   A 32 bit offset into the symbol table is enough. It allows for
+   .rela.plt sections up to a size of 2 gigabyte.  A single dynamic
+   object (the main program, any shared library) is limited to 4GB in
+   size.  Having a .rela.plt of 2GB would already make the .plt
+   section bigger than 8GB.  */
 
 static const bfd_byte elf_s390x_plt_entry[PLT_ENTRY_SIZE] =
   {
@@ -565,8 +565,8 @@ static const bfd_byte elf_s390x_plt_entr
   };
 
 /* The first PLT entry pushes the offset into the symbol table
-   from R1 onto the stack at 8(15) and the loader object info
-   at 12(15), loads the loader address in R1 and jumps to it.  */
+   from R1 onto the stack at 56(15) and the loader object info
+   at 48(15), loads the loader address in R1 and jumps to it.  */
 
 /* The first entry in the PLT:
 
@@ -3065,7 +3065,7 @@ elf_s390_finish_dynamic_symbol (bfd *out
       bfd_put_32 (output_bfd, - (PLT_FIRST_ENTRY_SIZE +
 				 (PLT_ENTRY_SIZE * plt_index) + 22)/2,
 		  htab->elf.splt->contents + h->plt.offset + 24);
-      /* Fixup offset into symbol table */
+      /* Fixup offset into .rela.plt section.  */
       bfd_put_32 (output_bfd, plt_index * sizeof (Elf64_External_Rela),
 		  htab->elf.splt->contents + h->plt.offset + 28);
 
Index: bfd/elf32-s390.c
===================================================================
--- bfd/elf32-s390.c.orig
+++ bfd/elf32-s390.c
@@ -509,7 +509,7 @@ elf_s390_is_local_label_name (abfd, name
    The GOT holds the address in the PLT to be executed.
    The loader then gets:
    24(15) =  Pointer to the structure describing the object.
-   28(15) =  Offset in symbol table
+   28(15) =  Offset into rela.plt
 
    The loader  must  then find the module where the function is
    and insert the address in the GOT.
@@ -527,7 +527,7 @@ RET1: BASR 1,0         # 2 bytes  Return
       BRC  15,-x       # 4 bytes  Jump to start of PLT
       .word 0          # 2 bytes filler
       .long ?          # 4 bytes  offset in GOT
-      .long ?          # 4 bytes  offset into symbol table
+      .long ?          # 4 bytes  offset into rela.plt
 
   This was the general case. There are two additional, optimizes PLT
   definitions. One for GOT offsets < 4096 and one for GOT offsets < 32768.
@@ -537,10 +537,10 @@ PLT1: L    1,<offset>(12) # 4 bytes  Loa
       BCR  15,1           # 2 bytes  Jump to address
       .word 0,0,0         # 6 bytes  filler
 RET1: BASR 1,0            # 2 bytes  Return from GOT 1st time
-      L    1,14(1)        # 4 bytes  Load offset in symbol table in r1
+      L    1,14(1)        # 4 bytes  Load offset in rela.plt in r1
       BRC  15,-x          # 4 bytes  Jump to start of PLT
       .word 0,0,0         # 6 bytes  filler
-      .long ?             # 4 bytes  offset into symbol table
+      .long ?             # 4 bytes  offset into rela.plt
 
   Second the one for GOT offsets < 32768:
 
@@ -549,10 +549,10 @@ PLT1: LHI  1,<offset>     # 4 bytes  Loa
       BCR  15,1           # 2 bytes  Jump to address
       .word 0             # 2 bytes  filler
 RET1: BASR 1,0            # 2 bytes  Return from GOT 1st time
-      L    1,14(1)        # 4 bytes  Load offset in symbol table in r1
+      L    1,14(1)        # 4 bytes  Load offset in rela.plt in r1
       BRC  15,-x          # 4 bytes  Jump to start of PLT
       .word 0,0,0         # 6 bytes  filler
-      .long ?             # 4 bytes  offset into symbol table
+      .long ?             # 4 bytes  offset into rela.plt
 
 Total = 32 bytes per PLT entry
 
@@ -567,7 +567,7 @@ RET1: BASR 1,0         # 2 bytes  Return
       BRC  15,-x       # 4 bytes  Jump to start of PLT
       .word 0          # 2 bytes  filler
       .long ?          # 4 bytes  address of GOT entry
-      .long ?          # 4 bytes  offset into symbol table  */
+      .long ?          # 4 bytes  offset into rela.plt  */
 
 static const bfd_byte elf_s390_plt_entry[PLT_ENTRY_SIZE] =
   {
@@ -629,14 +629,14 @@ static const bfd_byte elf_s390_plt_pic16
     0x00, 0x00
   };
 
-/* The first PLT entry pushes the offset into the symbol table
+/* The first PLT entry pushes the offset into the rela.plt
    from R1 onto the stack at 8(15) and the loader object info
    at 12(15), loads the loader address in R1 and jumps to it.  */
 
 /* The first entry in the PLT for PIC code:
 
 PLT0:
-   ST   1,28(15)  # R1 has offset into symbol table
+   ST   1,28(15)  # R1 has offset into rela.plt
    L    1,4(12)   # Get loader ino(object struct address)
    ST   1,24(15)  # Store address
    L    1,8(12)   # Entry address of loader in R1
@@ -645,7 +645,7 @@ PLT0:
    The first entry in the PLT for static code:
 
 PLT0:
-   ST   1,28(15)      # R1 has offset into symbol table
+   ST   1,28(15)      # R1 has offset into rela.plt
    BASR 1,0
    L    1,18(0,1)     # Get address of GOT
    MVC  24(4,15),4(1) # Move loader ino to stack


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