I am using Android NDKr8 and by extension gcc to compile some library code that is shared across multiple platforms including some embedded ones. This code uses segments to put a bunch of elements into a contiguous memory space. The compile is generating a "error: variable\_name causes a section type conflict". 

We use a macro to declare the segment attribute:

```
# define DB_SEGMENT __attribute__ ((__section__ ("DBSegment")))

```

The above variable\_name is declared as follows:

```
dbStruct const variable_name[] DB_SEGMENT = {
    {conststringvalue0, sizeof(conststringvalue0)},
    …more like this
};

```

dbStruct is

```
typedef struct dbStruct
{
    const char * const  address;
    const UINT16        stringSize;
} dbStruct;

```

conststringvalue0 is declared like so:

```
const char conststringvalue0[] DB_SEGMENT = "some string value";

```

This same code compiles in Xcode using its default compiler with only a small modification in the declaration of the DB\_SEGMENT macro. This is deeper C than I am used to so any help would be appreciated. Google has some references to the error but the fix for it is not clear. Is there a better strategy for setting up a specific contiguous memory section?

In response to a comment, here is the only difference fromthe correctly compiling version on XCode:

```
#define DB_SEGMENT __attribute__ ((section ("DBSegment,DBSection")))

```