rtld-elf: Don't include duplicate semicolon in Obj_Entry
MD_OBJ_ENTRY is a list of members, possibly empty, to include in
Obj_Entry. By including the semicolon here, in the case that it's empty,
we end up with a duplicate semicolon. In the case that it's not empty,
whether there's a duplicate depends on each architecture's definition,
but they all in fact put a semicolon after every member, so there is
also a duplicate semicolon there. This is invalid C syntax, although
both GCC and Clang accept it, treating it only as a pedantic warning,
but there is no need for us to rely on that, and downstream it masked a
missing semicolon for an added field, but only on architectures where
MD_OBJ_ENTRY is empty, leading to conditional compilation failure for
something that should have been detected as an unconditional error.
Note that PCPU_MD_FIELDS, which this is based on, follows a different
style. There, every architecture defines at least one member, and there
is a semicolon after PCPU_MD_FIELDS in sys/sys/pcpu.h, but every
architecture makes sure to not put a semicolon after the final member in
its definition of the macro. This is not a pattern we can adhere to here
though given not all architectures add members.
Fixes: 06db20ffec ("rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_Entry")
This commit is contained in:
@@ -268,7 +268,7 @@ typedef struct Struct_Obj_Entry {
|
||||
bool unholdfree : 1; /* unmap upon last unhold */
|
||||
bool doomed : 1; /* Object cannot be referenced */
|
||||
|
||||
MD_OBJ_ENTRY;
|
||||
MD_OBJ_ENTRY
|
||||
|
||||
struct link_map linkmap; /* For GDB and dlinfo() */
|
||||
Objlist dldags; /* Object belongs to these dlopened DAGs (%) */
|
||||
|
||||
Reference in New Issue
Block a user