Removed
Link Here
|
1 |
From 10b4dbbf281397e2827820c715c39559c7f7a29d Mon Sep 17 00:00:00 2001 |
2 |
From: Alan Modra <amodra@gmail.com> |
3 |
Date: Tue, 20 Jul 2021 18:46:57 +0930 |
4 |
Subject: [PATCH] PR28106, build of 2.37 fails on FreeBSD and Clang |
5 |
|
6 |
https://en.cppreference.com/w/cpp/types/NULL says NULL might be |
7 |
defined as nullptr. |
8 |
https://en.cppreference.com/w/cpp/language/reinterpret_cast says |
9 |
reinterpret_cast can't be used on nullptr. |
10 |
|
11 |
PR gold/28106 |
12 |
PR gold/27815 |
13 |
* gc.h (gc_process_relocs): Use static_cast in Section_id constructor. |
14 |
|
15 |
(cherry picked from commit b97bd976233ee4d43c2fe18f6356e62779cbe82d) |
16 |
--- |
17 |
gold/ChangeLog | 6 ++++++ |
18 |
gold/gc.h | 4 ++-- |
19 |
2 files changed, 8 insertions(+), 2 deletions(-) |
20 |
|
21 |
diff --git gold/gc.h gold/gc.h |
22 |
index 6ebd81f3fd0..4a1368f5abe 100644 |
23 |
--- gold/gc.h |
24 |
+++ gold/gc.h |
25 |
@@ -247,7 +247,7 @@ gc_process_relocs( |
26 |
if (is_ordinary) |
27 |
(*secvec).push_back(Section_id(src_obj, dst_indx)); |
28 |
else |
29 |
- (*secvec).push_back(Section_id(reinterpret_cast<Relobj*>(NULL), 0)); |
30 |
+ (*secvec).push_back(Section_id(static_cast<Relobj*>(NULL), 0)); |
31 |
// If the target of the relocation is an STT_SECTION symbol, |
32 |
// make a note of that by storing -1 in the symbol vector. |
33 |
if (lsym.get_st_type() == elfcpp::STT_SECTION) |
34 |
@@ -329,7 +329,7 @@ gc_process_relocs( |
35 |
if (is_ordinary && dst_obj != NULL) |
36 |
(*secvec).push_back(Section_id(dst_obj, dst_indx)); |
37 |
else |
38 |
- (*secvec).push_back(Section_id(reinterpret_cast<Relobj*>(NULL), 0)); |
39 |
+ (*secvec).push_back(Section_id(static_cast<Relobj*>(NULL), 0)); |
40 |
(*symvec).push_back(gsym); |
41 |
(*addendvec).push_back(std::make_pair( |
42 |
static_cast<long long>(symvalue), |
43 |
-- |
44 |
2.32.0 |
45 |
|