aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2025-01-15 18:11:47 +0800
committerH.J. Lu <hjl.tools@gmail.com>2025-01-15 20:26:23 +0800
commit64e281da5f2f466f51bebffc2e16d6f608d8d9e0 (patch)
tree0975e4c330b79f4d8c82a0eef02e704376a90203
parent2c4b3fd06d1adc143173831227aa808dbe13295d (diff)
downloadbinutils-64e281da5f2f466f51bebffc2e16d6f608d8d9e0.zip
binutils-64e281da5f2f466f51bebffc2e16d6f608d8d9e0.tar.gz
binutils-64e281da5f2f466f51bebffc2e16d6f608d8d9e0.tar.bz2
ld: Correct ldelf_place_orphan
Remove the extra for loop and if statement in ldelf_place_orphan. * ldelf.c (ldelf_place_orphan): Remove the extra for loop and if statement. Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
-rw-r--r--ld/ldelf.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/ld/ldelf.c b/ld/ldelf.c
index a66d1d2..dfe8032 100644
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -2275,19 +2275,17 @@ ldelf_place_orphan (asection *s, const char *secname, int constraint)
{
struct orphan_save *ho, *horig;
- for (ho = hold; ho < hold + sizeof (hold) / sizeof (hold[0]); ++ho)
for (ho = hold, horig = orig_hold;
ho < hold + ARRAY_SIZE (hold);
++ho, ++horig)
{
*ho = *horig;
if (ho->name != NULL)
- if (ho->name != NULL)
- {
- ho->os = lang_output_section_find (ho->name);
- if (ho->os != NULL && ho->os->flags == 0)
- ho->os->flags = ho->flags;
- }
+ {
+ ho->os = lang_output_section_find (ho->name);
+ if (ho->os != NULL && ho->os->flags == 0)
+ ho->os->flags = ho->flags;
+ }
}
orphan_init_done = true;
}