elf/dl-load.c: Use __strdup.
commitcc00cecef5cca965191cd8f75aec85d6b4bb399a
authorCarlos O'Donell <carlos@redhat.com>
Tue, 28 Oct 2014 23:37:07 +0000 (28 19:37 -0400)
committerCarlos O'Donell <carlos@redhat.com>
Tue, 28 Oct 2014 23:46:15 +0000 (28 19:46 -0400)
tree2d2b8d5479307a5f65b575e227434c856d569dc6
parent51e623f2419c9f33423fa8e36ed9a9ff0d05e17e
elf/dl-load.c: Use __strdup.

During a refactoring pass several repeated blocks of code in dl-load.c
were turned into a call to a local function named local_strdup.  There
is no need for local_strdup, and the routines should instead call
__strdup.  This change does just that.  We call the internal symbol
__strdup because calling strdup is unsafe.  The user might be
using a standard that doesn't include strdup and may have defined this
symbol in their application. During a static link we might reference
the user defined symbol and crash if it doesn't implement a standards
conforming strdup. The resulting code is simpler to understand, and
makes it easier to debug.

No regressions on x86_64.

2014-10-28  Carlos O'Donell  <carlos@redhat.com>

* dl-load.c (local_strdup): Remove.
(expand_dynamic_string_token): Use __strdup.
(decompose_rpath): Likewise.
(_dl_map_object): Likewise.
ChangeLog
elf/dl-load.c