Project

General

Profile

Actions

Bug #1626

closed

Bug #1450: Illumos should be buildable with GCC4

libld may accidentally return success while failing

Added by Rich Lowe almost 10 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2011-10-11
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

In two places in the linker we accidentally return succes while trying to fail.

In both ar_extract_bysym and ar_extract_all we return S_ERROR if ar_member_path fails, both of these functions return Boolean which in the linker is an enum of two values (TRUE and FALSE, 0 and 1), with FALSE being failure. Unfortunately S_ERROR is a word-sized ~0, which when liberally interpreted is true, and signifies success.

GCC4 type checks this and complains that ~0 is not a member of the Boolean enum.

Actions

Also available in: Atom PDF