+ /* Mach-O doesn't like labels in this section */
+ ASSERT_AND_RET(get_entity_ld_ident(entity),
+ "entity in destructors should have ld_ident=''", 1);
+ }
+ thread_locals = get_segment_type(IR_SEGMENT_THREAD_LOCAL);
+ for (i = get_compound_n_members(thread_locals)-1; i >= 0; --i) {
+ const ir_entity *entity = get_compound_member(thread_locals, i);
+ /* this is odd and should not be allowed I think */
+ ASSERT_AND_RET(!is_method_entity(entity),
+ "method in THREAD_LOCAL segment", 1);
+ ASSERT_AND_RET(! (get_entity_linkage(entity) & IR_LINKAGE_CONSTANT),
+ "thread locals must not be constant", 1);