Bug 1422463

Summary: patch: overrides canonicalize function
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: patchAssignee: Tim Waugh <twaugh>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-22 10:12:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1422434    
Attachments:
Description Flags
patch-canonicalize.patch none

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.