Bug 1422463 - patch: overrides canonicalize function
Summary: patch: overrides canonicalize function
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: patch
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: Fedora26GlibcInterpositionTracker
TreeView+ depends on / blocked
 
Reported: 2017-02-15 11:50 UTC by Florian Weimer
Modified: 2017-02-22 10:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-22 10:12:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch-canonicalize.patch (2.37 KB, patch)
2017-02-22 09:08 UTC, Tim Waugh
no flags Details | Diff

Description Florian Weimer 2017-02-15 11:50:12 UTC
The “patch” program overrides the “canonicalize” function provided by glibc.  The function should be renamed, to avoid future problems if other libraries in the same process images try to use this function.

Note: The ELF symbol interposition is not visible on all architectures, I only see it on arhmfp.

Comment 1 Tim Waugh 2017-02-21 16:23:47 UTC
This is a replacement function only used when the autoconf test detects that it is not already provided.

Perhaps it isn't provided on armhfp, which is why you only see the symbol there? In that case, there won't be any conflicts...

Comment 2 Florian Weimer 2017-02-21 22:20:08 UTC
(In reply to Tim Waugh from comment #1)
> This is a replacement function only used when the autoconf test detects that
> it is not already provided.

That's for canonicalize_file_name, I think.

> Perhaps it isn't provided on armhfp, which is why you only see the symbol
> there? In that case, there won't be any conflicts...

I think we are dealing with an *object* (STT_OBJECT) called “canonicalize” (which comes from a global variable in the C code).  I don't know why the static linker behaves differently on some architectures.  My best guess is that some architectures provide richer relocation types which avoid preemption in this case.

Comment 3 Tim Waugh 2017-02-22 09:08:10 UTC
Created attachment 1256384 [details]
patch-canonicalize.patch

Ah, I see. My copy of ISO C99 must be too old as it doesn't mention this function, but it is mentioned here:
https://www.gnu.org/software/libc/manual/html_node/FP-Bit-Twiddling.html#index-canonicalize

Attached is a patch which renames this global variable.

Comment 4 Tim Waugh 2017-02-22 10:12:09 UTC
This was applied upstream.


Note You need to log in before you can comment on or make changes to this bug.