public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
@ 2012-12-21 12:54 hjl.tools at gmail dot com
  2012-12-21 12:56 ` [Bug dynamic-link/14979] " jakub at redhat dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: hjl.tools at gmail dot com @ 2012-12-21 12:54 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14979

             Bug #: 14979
           Summary: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
           Product: glibc
           Version: 2.18
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
        AssignedTo: unassigned@sourceware.org
        ReportedBy: hjl.tools@gmail.com
    Classification: Unclassified


i386 psABI specifies that R_386_GLOB_DAT and R_386_JUMP_SLOT
should use the symbol value without addend.  But i386/dl-machine.h
has

351         case R_386_GLOB_DAT:
352         case R_386_JMP_SLOT:
353           *reloc_addr = value;
354           break;


508       switch (ELF32_R_TYPE (reloc->r_info))
509         {
510         case R_386_GLOB_DAT:
511         case R_386_JMP_SLOT:
512         case R_386_32:
513           *reloc_addr = value + reloc->r_addend;
514           break;


The second one is wrong.  We shouldn't add addend.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug dynamic-link/14979] Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
  2012-12-21 12:54 [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling hjl.tools at gmail dot com
@ 2012-12-21 12:56 ` jakub at redhat dot com
  2012-12-21 13:08 ` hjl.tools at gmail dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at redhat dot com @ 2012-12-21 12:56 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14979

Jakub Jelinek <jakub at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com

--- Comment #1 from Jakub Jelinek <jakub at redhat dot com> 2012-12-21 12:56:34 UTC ---
I'd say it is way too late to do changes like that.
And, if you even consider those, make sure you won't break e.g. prelink (not
sure about x86_64, but on i386 you'd definitely break prelink fatally with such
a change).

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug dynamic-link/14979] Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
  2012-12-21 12:54 [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling hjl.tools at gmail dot com
  2012-12-21 12:56 ` [Bug dynamic-link/14979] " jakub at redhat dot com
@ 2012-12-21 13:08 ` hjl.tools at gmail dot com
  2012-12-21 13:10 ` jakub at redhat dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl.tools at gmail dot com @ 2012-12-21 13:08 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14979

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2012-12-21 13:08:16 UTC ---
(In reply to comment #1)
> I'd say it is way too late to do changes like that.
> And, if you even consider those, make sure you won't break e.g. prelink (not
> sure about x86_64, but on i386 you'd definitely break prelink fatally with such
> a change).

How can I look at relocations generated by prelink for both i386
and x86-64?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug dynamic-link/14979] Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
  2012-12-21 12:54 [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling hjl.tools at gmail dot com
  2012-12-21 12:56 ` [Bug dynamic-link/14979] " jakub at redhat dot com
  2012-12-21 13:08 ` hjl.tools at gmail dot com
@ 2012-12-21 13:10 ` jakub at redhat dot com
  2012-12-21 13:40 ` hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at redhat dot com @ 2012-12-21 13:10 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14979

--- Comment #3 from Jakub Jelinek <jakub at redhat dot com> 2012-12-21 13:09:56 UTC ---
Run prelink testsuite for any change you are considering on the glibc side?
on i386, in particular, to avoid changing REL relocations into RELA, prelink
forces uses of R_386_GLOB_DAT if possible.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug dynamic-link/14979] Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
  2012-12-21 12:54 [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2012-12-21 13:10 ` jakub at redhat dot com
@ 2012-12-21 13:40 ` hjl.tools at gmail dot com
  2012-12-21 13:45 ` jakub at redhat dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl.tools at gmail dot com @ 2012-12-21 13:40 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14979

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2012-12-21 13:39:46 UTC ---
(In reply to comment #1)
> I'd say it is way too late to do changes like that.
> And, if you even consider those, make sure you won't break e.g. prelink (not
> sure about x86_64, but on i386 you'd definitely break prelink fatally with such
> a change).

I did a quick check.  All files under /lib and /bin on 32-bit Fedora 17
have 0 addend for both R_386_GLOB_DAT and R_386_JMP_SLOT.  I looked
at prelink source, R_386_GLOB_DAT, R_X86_64_GLOB_DAT and R_X86_64_JMP_SLOT
have zero r_addend.  I am not sure about R_386_JMP_SLOT.  I will modify
prelink to check addend for both 386 and x86-64.  I will run it on both
32bit and 64bit Fedora 17 to see prelink ever generates none-zero addend
for GLOB_DAT and JMP_SLOT.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug dynamic-link/14979] Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
  2012-12-21 12:54 [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2012-12-21 13:40 ` hjl.tools at gmail dot com
@ 2012-12-21 13:45 ` jakub at redhat dot com
  2012-12-21 13:51 ` hjl.tools at gmail dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at redhat dot com @ 2012-12-21 13:45 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14979

--- Comment #5 from Jakub Jelinek <jakub at redhat dot com> 2012-12-21 13:45:06 UTC ---
BTW, for i386, I wonder why you think psABI applies here at all.  Because
according to psABI, i386 is REL architecture, thus never has any addend.
It is just a prelink extension that it handles also RELA.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug dynamic-link/14979] Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
  2012-12-21 12:54 [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2012-12-21 13:45 ` jakub at redhat dot com
@ 2012-12-21 13:51 ` hjl.tools at gmail dot com
  2012-12-21 17:24 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl.tools at gmail dot com @ 2012-12-21 13:51 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14979

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> 2012-12-21 13:50:39 UTC ---
i386 psABI does have addend for relocation, which is in place.
REL vs RELA doesn't change how relocations are applied.  The
only difference is where addend is stored.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug dynamic-link/14979] Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
  2012-12-21 12:54 [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2012-12-21 13:51 ` hjl.tools at gmail dot com
@ 2012-12-21 17:24 ` hjl.tools at gmail dot com
  2012-12-21 20:37 ` bugdal at aerifal dot cx
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl.tools at gmail dot com @ 2012-12-21 17:24 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14979

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> 2012-12-21 17:23:48 UTC ---
I checked 32-bit and 64-bit Fedora 17.  I didn't
find any addend for GLOB_DAT and JUMP_SLOT with
prelink.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug dynamic-link/14979] Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
  2012-12-21 12:54 [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling hjl.tools at gmail dot com
                   ` (6 preceding siblings ...)
  2012-12-21 17:24 ` hjl.tools at gmail dot com
@ 2012-12-21 20:37 ` bugdal at aerifal dot cx
  2012-12-22  0:24 ` hjl.tools at gmail dot com
  2014-06-14  5:30 ` fweimer at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: bugdal at aerifal dot cx @ 2012-12-21 20:37 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14979

Rich Felker <bugdal at aerifal dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugdal at aerifal dot cx

--- Comment #8 from Rich Felker <bugdal at aerifal dot cx> 2012-12-21 20:37:45 UTC ---
I think this bug report is correct. Treating RELA differently from REL is
conceptually wrong. The REL version of the code is already ignoring the addend
(the original data at the relocation address), and since i386 normally does not
use RELA, it doesn't matter what the RELA code does (it can't break anything if
it's not in use), but as long as the code is there it should be consistent.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug dynamic-link/14979] Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
  2012-12-21 12:54 [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling hjl.tools at gmail dot com
                   ` (7 preceding siblings ...)
  2012-12-21 20:37 ` bugdal at aerifal dot cx
@ 2012-12-22  0:24 ` hjl.tools at gmail dot com
  2014-06-14  5:30 ` fweimer at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: hjl.tools at gmail dot com @ 2012-12-22  0:24 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=14979

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> 2012-12-22 00:24:36 UTC ---
prelink does use addend for GLOB_DAT/JMP_SLOT.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug dynamic-link/14979] Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling
  2012-12-21 12:54 [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling hjl.tools at gmail dot com
                   ` (8 preceding siblings ...)
  2012-12-22  0:24 ` hjl.tools at gmail dot com
@ 2014-06-14  5:30 ` fweimer at redhat dot com
  9 siblings, 0 replies; 11+ messages in thread
From: fweimer at redhat dot com @ 2014-06-14  5:30 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=14979

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2014-06-14  5:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-21 12:54 [Bug dynamic-link/14979] New: Incorrect R_386_GLOB_DAT/R_386_JUMP_SLOT handling hjl.tools at gmail dot com
2012-12-21 12:56 ` [Bug dynamic-link/14979] " jakub at redhat dot com
2012-12-21 13:08 ` hjl.tools at gmail dot com
2012-12-21 13:10 ` jakub at redhat dot com
2012-12-21 13:40 ` hjl.tools at gmail dot com
2012-12-21 13:45 ` jakub at redhat dot com
2012-12-21 13:51 ` hjl.tools at gmail dot com
2012-12-21 17:24 ` hjl.tools at gmail dot com
2012-12-21 20:37 ` bugdal at aerifal dot cx
2012-12-22  0:24 ` hjl.tools at gmail dot com
2014-06-14  5:30 ` fweimer at redhat dot com

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