Bug 13633 - stripped libm drops ifunc identifiers
Summary: stripped libm drops ifunc identifiers
Status: RESOLVED DUPLICATE of bug 13618
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: Andreas Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-30 20:41 UTC by Paulo César Pereira de Andrade
Modified: 2014-06-27 10:00 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
pr13633.c (477 bytes, text/x-csrc)
2012-01-31 00:35 UTC, Paulo César Pereira de Andrade
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paulo César Pereira de Andrade 2012-01-30 20:41:37 UTC
Both, eu-strip and binutils strip drop some identifiers from newer libm with sse4.1 optimizations.

  Before strip:
000000000001a980 <floor>:
   1a980:       e8 1b a7 fe ff          callq  50a0 <__get_cpu_features@plt>
   1a985:       48 89 c2                mov    %rax,%rdx
   1a988:       48 8d 05 11 00 00 00    lea    0x11(%rip),%rax        # 1a9a0 <__floor_sse41>
   1a98f:       f7 42 10 00 00 08 00    testl  $0x80000,0x10(%rdx)
   1a996:       75 07                   jne    1a99f <floor+0x1f>
   1a998:       48 8d 05 b1 77 02 00    lea    0x277b1(%rip),%rax        # 42150 <__floor_c>
   1a99f:       c3                      retq   

000000000001a9a0 <__floor_sse41>:
   1a9a0:       66 0f 3a 0b c0 01       roundsd $0x1,%xmm0,%xmm0
   1a9a6:       c3                      retq   

  After strip:
000000000001a980 <floor>:
   1a980:       e8 1b a7 fe ff          callq  50a0 <__get_cpu_features@plt>
   1a985:       48 89 c2                mov    %rax,%rdx
   1a988:       48 8d 05 11 00 00 00    lea    0x11(%rip),%rax        # 1a9a0 <floor+0x20>
   1a98f:       f7 42 10 00 00 08 00    testl  $0x80000,0x10(%rdx)
   1a996:       75 07                   jne    1a99f <floor+0x1f>
   1a998:       48 8d 05 b1 77 02 00    lea    0x277b1(%rip),%rax        # 42150 <__signbitl+0x6950>
   1a99f:       c3                      retq   
   1a9a0:       66 0f 3a 0b c0 01       roundsd $0x1,%xmm0,%xmm0
   1a9a6:       c3                      retq   

  Most times this happens to work, but will break on special conditions if libm is loaded as a
dependency of a dynamic module, for example, apache mod_php (using LD_PRELOAD on these special
cases also "corrects" the problem).
Comment 1 Paul Pluzhnikov 2012-01-30 21:54:46 UTC
(In reply to comment #0)

> Most times this happens to work, but will break on special conditions if libm
> is loaded as a dependency of a dynamic module

Sorry, I am not following.

Will break in what way?
Can you provide a minimal test case demonstrating breakage?

(I suspect this is just a dup of issue 13618, which actually has nothing
to do with strip.)
Comment 2 Paulo César Pereira de Andrade 2012-01-31 00:32:52 UTC
(In reply to comment #1)
> (In reply to comment #0)
> 
> > Most times this happens to work, but will break on special conditions if libm
> > is loaded as a dependency of a dynamic module
> 
> Sorry, I am not following.
> 
> Will break in what way?
> Can you provide a minimal test case demonstrating breakage?
> 
> (I suspect this is just a dup of issue 13618, which actually has nothing
> to do with strip.)

  You are right. I opened the bug report due to a related
Mandriva bugzilla saying that a rebuilt glibc not stripping
libm would correct the problem.
Comment 3 Paulo César Pereira de Andrade 2012-01-31 00:35:16 UTC
Created attachment 6185 [details]
pr13633.c

Not as simple as the test case in #13618, this
should mimic what happens in httpd + mod_php.

Free free to close the report as a dupe.
Comment 4 Paulo César Pereira de Andrade 2012-01-31 03:29:31 UTC
I did a backport of http://sourceware.org/git/?p=glibc.git;a=commit;h=6ee65ed6ddbf04402fad0bec6aa9c73b9d982ae4
to the mandriva glibc package and confirm that
the "apache + mod_php" test case now works
correctly.
Comment 5 Paul Pluzhnikov 2012-01-31 03:49:05 UTC

*** This bug has been marked as a duplicate of bug 13618 ***