It's additive... flat-out...
Start with your gun's damage = X
You find a relic with +10% damage and put it on = X + (X*.1)
You find a class mod with +10% damage... but you think it might work better with a different relic, so you take that off first... = X
... then put on the class mod = X + (X*.1)
...then realize the other relic won't work with your build, so you put the damage relic back on = X + (X*.1) + (X*.1)
In the actual coding, X is most likely something like "gun_base_damage" and is being referenced by each individual instance where X is needed to fill a variable. Since the X variable doesn't actually change, and the bonuses do not reference eachother, each bonus is added independently.
To do otherwise would require an absurd amount of coding because you would be checking for variables that aren't neccesarily present all of the time... variable variables, if you will.